From fc6837799e25481db7f6c0212d49def2a9be87fc Mon Sep 17 00:00:00 2001 From: nickysn Date: Thu, 17 Sep 2015 12:05:15 +0000 Subject: [PATCH] * RegisterClass returns a BOOL in windows 3.0 and earlier, and an ATOM in 3.1+ git-svn-id: trunk@31729 - --- rtl/win16/win31.pp | 9 +++++++++ rtl/win16/winprocsh.inc | 7 +++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/rtl/win16/win31.pp b/rtl/win16/win31.pp index 858963a3ef..459ee996fc 100644 --- a/rtl/win16/win31.pp +++ b/rtl/win16/win31.pp @@ -650,6 +650,15 @@ function SubtractRect(var rcDest: RECT; var rcSource1, rcSource2: RECT): BOOL; e function GetMessageExtraInfo: LPARAM; external 'USER'; function GetQueueStatus(flags: UINT): DWORD; external 'USER'; +{ Window class management } +{ in Windows 3.1+, RegisterClass returns an ATOM that unquely identifies the + class. In Windows 3.0 and earlier, the return value is BOOL. That's why we + redefine this function in the win31 unit. } +function RegisterClass(lpwc: LPWNDCLASS): ATOM; external 'USER'; +{$ifdef VAR_PARAMS_ARE_FAR} +function RegisterClass(var wc: WNDCLASS): ATOM; external 'USER'; +{$endif} + implementation end. diff --git a/rtl/win16/winprocsh.inc b/rtl/win16/winprocsh.inc index 786f113130..17e51193b0 100644 --- a/rtl/win16/winprocsh.inc +++ b/rtl/win16/winprocsh.inc @@ -792,9 +792,12 @@ procedure PostQuitMessage(nExitCode: SmallInt); external 'USER'; { Window class management } -function RegisterClass(lpwc: LPWNDCLASS): ATOM; external 'USER'; +{ in Windows 3.1+, RegisterClass returns an ATOM that unquely identifies the + class. In Windows 3.0 and earlier, the return value is BOOL. That's why we + redefine this function in the win31 unit. } +function RegisterClass(lpwc: LPWNDCLASS): BOOL; external 'USER'; {$ifdef VAR_PARAMS_ARE_FAR} -function RegisterClass(var wc: WNDCLASS): ATOM; external 'USER'; +function RegisterClass(var wc: WNDCLASS): BOOL; external 'USER'; {$endif} function UnregisterClass(lpszClassName: LPCSTR; hinst: HINST): BOOL; external 'USER';