Thread: ByVal?
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
keepITcool keepITcool is offline
external usenet poster
 
Posts: 2,253
Default ByVal?

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 :

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