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 ?
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 ?
Comment