Browse Source

* RegisterClass returns a BOOL in windows 3.0 and earlier, and an ATOM in 3.1+

git-svn-id: trunk@31729 -
nickysn 10 years ago
parent
commit
fc6837799e
2 changed files with 14 additions and 2 deletions
  1. 9 0
      rtl/win16/win31.pp
  2. 5 2
      rtl/win16/winprocsh.inc

+ 9 - 0
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.

+ 5 - 2
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';