[REBOL] Re: External library interface
From: ptretter:charter at: 2-Jul-2003 19:20
Well for example here is the GetWindowText function from Microsoft WINAPI as
I have used it (commented):
getwindowtext: make routine! [
{The GetWindowText function copies the text of the specified
window's title bar (if it has one) into a buffer.}
hWnd [integer!] "[in] Handle to the window or control
containing the text."
lpString [string!] "[out] Pointer to the buffer that will
receive the text."
nMaxCount [integer!] "[in] Specifies the maximum number of characters
to copy to the buffer, including the NULL character."
return: [integer!] {If the function succeeds, the return
value is the length, in characters, of the copied string,
not including the terminating NULL character.}
] winlib "GetWindowTextA"
str: make string! "" ; needed to hold windows title and passed to the
getwindowtext routine.
loop 200 [append str "^@"]
getwindowtext-ret: handle-to-a-window getwindow-next-ret str 200