According to the reference materials I have here, the parameter should be a LONG value (32-bits), but the return value should be INT (16-bit).
I guess that is an error in the WIN32API.INC file... I'll ask R&D to update it.
------------------
Lance
PowerBASIC Support
mailto:[email protected][email protected]</A>
Announcement
Collapse
No announcement yet.
Win32.Hlp & Win32Api.Inc
Collapse
X
-
Win32.Hlp & Win32Api.Inc
Win32.Hlp: SHORT GetKeyState(int nVirtKey);
Win32Api.Inc: DECLARE FUNCTION GetKeyState LIB "USER32.DLL" ALIAS "GetKeyState" (BYVAL nVirtKey AS LONG) AS LONG
Problem i s following.
Typical code for test a key is pressed or not, is
If GetKeyState(...) < 0 Then ...
Like this statement works with current declaration in Win32Api.Inc, better not to test (dangerous for health).
If to change declaration in Win32api.inc to
DECLARE FUNCTION GetKeyState LIB "USER32.DLL" ALIAS "GetKeyState" (BYVAL nVirtKey AS INTEGER) AS INTEGER
If GetKeyState(...) < 0 Then ... works as it should be.
I meat the same situations with some other functions.
So, my question is - why SHORT was necessary to convert to LONG ?Tags: None
Leave a comment: