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??
API functions
Collapse
X
-
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. -
Thanks.That was a good explanation.Originally posted by shuvo2k6Hi.
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.
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
-
Hi,Originally posted by vdraceilThanks.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??
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,
shuvo2k6Comment
-
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,
shuvo2k6Comment
-
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.Originally posted by shuvo2k6Hi,
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,
shuvo2k6Last edited by Killer42; Feb 10 '08, 10:33 AM.Comment
Comment