Incorrect SetWindowLong declaration
Original Reporter info from Mantis: FPCCore
-
Reporter name: FPC core team
Original Reporter info from Mantis: FPCCore
- Reporter name: FPC core team
Description:
Function SetWindowLong of Win32 API is declared incorrectly, and when used with some constants:
SetWindowLong(WindowHandle, GWL_STYLE, WS_POPUP or WS_CLIPCHILDREN);
compiler gives a Warning: range check error while evaluating constants.
The program compiles and seems to be working, but MsWindows starts behaving funny at handling the window, on which this function was used, and may fail to switch video mode and experience other problems.
If I redefine SetWindowLong myself as
function SetWindowLong(hWnd:HWND; nIndex:longint; dwNewLong:cardinal):cardinal; stdcall; external 'user32' name 'SetWindowLongA';
the warning is gone and programs works properly.
Note that this is a very nasty bug, since it affects only WinXP, and only sporadically - most of the time program seems to be Ok.
Additional information:
Reporter: Anton Rzheshevski
EMail: chebmaster at mail dot ru
Mantis conversion info:
- Mantis ID: 5989
- OS: Win32
- Fixed in version: 2.0.2