ByVal?

N

Newbie

Can someone please explain what each of this actually does?

Private Declare Function FindWindowA& Lib "User32" _
(ByVal lpClassName$, ByVal lpWindowName$)
Private Declare Function SetWindowLongA& Lib "User32" _
(ByVal hWnd&, ByVal nIndex&, ByVal dwNewLong&)
Private Declare Function OpenClipboard& Lib "User32" (ByVal hWnd&)
Private Declare Function EmptyClipboard& Lib "User32" ()
Private Declare Function CloseClipboard& Lib "User32" ()
Private Declare Sub keybd_event Lib "User32" (ByVal bVk As Byte _
, ByVal bScan As Byte, ByVal dwFlags&, ByVal dwExtraInfo&)

Thanks in advance
 
K

keepITcool

These are so called API declarations to register certain functions in
operaring system libraries. For syntax and explanations see:
www.AllApi.Net

The difference re ByVal / ByRef:
if you pass a parameter ByRef the pointer (reference to memoery
address) to the original variable is passed.

ByVal: a New variable is created. the Value of the orignal variable
is then assigned to that new variable...

This not only relates to API declarations, but is the same for VBA.
(where passsing it ByREF is the default)

Search VBA hlep for ByRef and you should have a nice read.



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Newbie wrote :
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top