By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,948 Members | 838 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,948 IT Pros & Developers. It's quick & easy.

API functions

vdraceil
100+
P: 236
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??
Jan 26 '08 #1
Share this Question
Share on Google+
6 Replies


P: 68
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 "MessageBoxA" (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.
Jan 27 '08 #2

vdraceil
100+
P: 236
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 "MessageBoxA" (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??
Feb 3 '08 #3

P: 68
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 "MessageBoxA" (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
Feb 3 '08 #4

Expert 5K+
P: 8,434
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.
Feb 4 '08 #5

P: 68
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
Feb 4 '08 #6

vdraceil
100+
P: 236
Hi,
What you understand by this following code:

Private Declare Function MessageBox Lib "user32" Alias "MessageBoxA" (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.
Feb 10 '08 #7

Post your reply

Sign in to post your reply or Sign up for a free account.