#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 137
Default ByVal?

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
REPSOT?? Sub Worksheet_Change(ByVal Target As Range) Ed Davis[_2_] Excel Discussion (Misc queries) 14 October 13th 09 03:20 PM
ByVal Target Range Great Code but need Help Mark Excel Discussion (Misc queries) 31 July 27th 07 03:11 PM
what does (ByVal Target As Range) mean Zygoid[_7_] Excel Programming 6 January 31st 04 05:08 PM
Curious use of ByVal keyword in VBA event onedaywhen Excel Programming 1 September 8th 03 10:54 AM
Is ByVal always better if ByRef isn't necessary Jeff[_17_] Excel Programming 5 July 25th 03 09:25 AM


All times are GMT +1. The time now is 08:42 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"