API functions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • vdraceil
    New Member
    • Jul 2007
    • 236

    API functions

    Hi experts,does anyone know what is hWnd?i see this in most of API function arguments.Can anyone explain clearly about API functions in general??
  • shuvo2k6
    New Member
    • Jan 2008
    • 68

    #2
    Hi.
    hWnd is a handle type data, that is used for handling or working with a window which is showing control. Handle type data is 32 bits in size. API functions are Visual C or VC++ functions. In VC, a notation is used called Hungarian Notation for declaring variables. In syntax that is written hWnd, I mean Window handle.

    Here is an API Function:
    Private Declare Function MessageBox Lib "user32" Alias "MessageBox A" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

    In this API Function is called for messagebox, here hwnd holds the handle of a window that is previously made and used for this operation.

    API functions are functions like C/C++. There are two types of APIs. Win16 API & Win32 API. Win32 APIs are stored in 'USER32.DLL', 'GDI32.DLL' & 'KRNL32.DLL' files of Windows OS. In previously mentioned API function, 'USER.DLL' is used.
    Last edited by Killer42; Jan 27 '08, 10:09 AM.

    Comment

    • vdraceil
      New Member
      • Jul 2007
      • 236

      #3
      Originally posted by shuvo2k6
      Hi.
      hWnd is a handle type data, that is used for handling or working with a window which is showing control. Handle type data is 32 bits in size. API functions are Visual C or VC++ functions. In VC, a notation is used called Hungarian Notation for declaring variables. In syntax that is written hWnd, I mean Window handle.

      Here is an API Function:
      Private Declare Function MessageBox Lib "user32" Alias "MessageBox A" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

      In this API Function is called for messagebox, here hwnd holds the handle of a window that is previously made and used for this operation.

      API functions are functions like C/C++. There are two types of APIs. Win16 API & Win32 API. Win32 APIs are stored in 'USER32.DLL', 'GDI32.DLL' & 'KRNL32.DLL' files of Windows OS. In previously mentioned API function, 'USER.DLL' is used.
      Thanks.That was a good explanation.
      I use API Viewer to copy API functions.I'd love to write on my own without any reference.To do that i must understand it completely..
      Actually i could not completely understand the syntax of API functions.
      It seems odd.Can u help me understan it pls??

      Comment

      • shuvo2k6
        New Member
        • Jan 2008
        • 68

        #4
        Originally posted by vdraceil
        Thanks.That was a good explanation.
        I use API Viewer to copy API functions.I'd love to write on my own without any reference.To do that i must understand it completely..
        Actually i could not completely understand the syntax of API functions.
        It seems odd.Can u help me understan it pls??
        Hi,
        What you understand by this following code:

        Private Declare Function MessageBox Lib "user32" Alias "MessageBox A" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

        Please reply, then I can understand what is your need, OK. You must remember that APIs are vendor generated funtions.
        Get Better.

        Again,
        shuvo2k6
        Last edited by Killer42; Feb 4 '08, 01:52 AM. Reason: Correct some "textisms"; "u", "wht"

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Keep in mind, while it will be helpful to understand API functions and know what is available, that doesn't mean you have to be familiar with every one and throw away the reference. There are a heck of a lot of them.

          Comment

          • shuvo2k6
            New Member
            • Jan 2008
            • 68

            #6
            Hi,
            I upload a MS Word2003 Document (Win32 API in VB6.doc) at the link http://www.MegaShare.com/352250 , it contains a tutorial on Windows API Programming in VB6. I think, it may be helpful for you. You can go to that link & download it, if you wish.

            If it makes any help for you, Plz reply me.
            Get Better.

            Again,
            shuvo2k6

            Comment

            • vdraceil
              New Member
              • Jul 2007
              • 236

              #7
              Originally posted by shuvo2k6
              Hi,
              What you understand by this following code:

              Private Declare Function MessageBox Lib "user32" Alias "MessageBox A" (ByVal hwnd As Long, ByVal lpText As String, ByVal lpCaption As String, ByVal wType As Long) As Long

              Please reply, then I can understand what is your need, OK. You must remember that APIs are vendor generated funtions.
              Get Better.

              Again,
              shuvo2k6
              Hi shuvo2k6, thanks for replying. From the code you gave, all I understand is we are declaring an already existing messagebox function of user32.dll library and we are going to use this function somewhere in our form coding. I dont understand those parameters.
              Last edited by Killer42; Feb 10 '08, 10:33 AM.

              Comment

              Working...