I've often used functions by just copying working code I saw someone else use. But then occasionally I find something in MSDN and that makes me wonder why the code worked in the first place.
The MSDN discussion on GetCursorPos says that the argument is a "Pointer to a POINT structure that receives the screen coordinates of the cursor."
So why does this work in PowerBASIC
Instead of this.
The Win32API.inc gives a declaration that looks the same for the argument as is given on MSDN.
The MSDN discussion on GetCursorPos says that the argument is a "Pointer to a POINT structure that receives the screen coordinates of the cursor."
So why does this work in PowerBASIC
Code:
Dim P as Point GetCursorPos P
Code:
Dim P as Point GetCursorPos VarPtr(P)
Code:
DECLARE FUNCTION GetCursorPos LIB "USER32.DLL" ALIAS "GetCursorPos" (lpPoint AS POINTAPI) AS LONG
Comment