-{ Copyright (C) 2005 Bas Steendijk and Peter Green\r
- For conditions of distribution and use, see copyright notice in zlib_license.txt\r
- which is included in the package\r
- ----------------------------------------------------------------------------- }\r
-\r
unit wcore;\r
\r
{\r
procedure disconnecttasks(aobj:tobject);\r
procedure exitmessageloop;\r
procedure processmessages;\r
+procedure wcoreinit;\r
\r
var\r
onshutdown:procedure(s:ansistring);\r
lpszMenuName : nil;\r
lpszClassName : 'wcoreClass');\r
\r
-procedure messageloop;\r
-var\r
- MsgRec : TMsg;\r
+procedure wcoreinit;\r
begin\r
-\r
if Windows.RegisterClass(MyWindowClass) = 0 then halt;\r
//writeln('about to create wcore handle, hinstance=',hinstance);\r
hwndwcore := CreateWindowEx(WS_EX_TOOLWINDOW,\r
{$endif}\r
\r
\r
+end;\r
+\r
+procedure messageloop;\r
+var\r
+ MsgRec : TMsg;\r
+\r
+begin\r
+\r
while GetMessage(MsgRec, 0, 0, 0) do begin\r
TranslateMessage(MsgRec);\r
DispatchMessage(MsgRec);\r
\r
function ProcessMessage : Boolean;\r
var\r
- Msg : TMsg;\r
+ MsgRec : TMsg;\r
begin\r
Result := FALSE;\r
- if PeekMessage(Msg, hwndwcore, 0, 0, PM_REMOVE) then begin\r
+ if PeekMessage(MsgRec, 0, 0, 0, PM_REMOVE) then begin\r
Result := TRUE;\r
- DispatchMessage(Msg);\r
+ TranslateMessage(MsgRec);\r
+ DispatchMessage(MsgRec);\r
end;\r
end;\r
\r
\r
\r
end.\r
+\r