LOTUSSCRIPT LANGUAGE
In a Declare statement, you can declare a C function as either a function or a sub. The syntax is:
Declare [Public | Private] {Function | Sub}
[Alias aliasName ]
( [ argList ] ) [ As returnType ]
GetActiveWindow takes no parameters and returns the handle (an integer) of the active window (the window with focus).
Declare Function GetActiveWindow Lib "User32" () As Long
SetWindowText returns nothing, so you can declare it as a sub. It has two input parameters: the window handle and a string. As long as they are valid LotusScript identifiers, you can use your own parameter names or copy the names used in the API documentation, as in the example below.
Declare Sub SetWindowText Lib "User32" Alias "SetWindowTextA" _
(ByVal hWnd As Long, ByVal lpString As String)
Note Be aware that you are actually calling a C function which needs to be supplied by you. This may cause your script to be platform-dependent.
See Also