X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/3745aa61ef489e4b143b5c753a006d0613a0297f..c1c7500bc32248d67b6cf7903a6db7b15e2cd1c9:/wcore.pas?ds=inline diff --git a/wcore.pas b/wcore.pas index 8b402b5..e79fc10 100755 --- a/wcore.pas +++ b/wcore.pas @@ -58,6 +58,7 @@ procedure addtask(ahandler:ttaskevent;aobj:tobject;awparam,alparam:longint); procedure disconnecttasks(aobj:tobject); procedure exitmessageloop; procedure processmessages; +procedure wcoreinit; var onshutdown:procedure(s:ansistring); @@ -312,11 +313,8 @@ var lpszMenuName : nil; lpszClassName : 'wcoreClass'); -procedure messageloop; -var - MsgRec : TMsg; +procedure wcoreinit; begin - if Windows.RegisterClass(MyWindowClass) = 0 then halt; //writeln('about to create wcore handle, hinstance=',hinstance); hwndwcore := CreateWindowEx(WS_EX_TOOLWINDOW, @@ -339,6 +337,14 @@ begin {$endif} +end; + +procedure messageloop; +var + MsgRec : TMsg; + +begin + while GetMessage(MsgRec, 0, 0, 0) do begin TranslateMessage(MsgRec); DispatchMessage(MsgRec); @@ -359,13 +365,13 @@ end; function ProcessMessage : Boolean; var - Msg : TMsg; + MsgRec : TMsg; begin Result := FALSE; - if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then begin + if PeekMessage(MsgRec, 0, 0, 0, PM_REMOVE) then begin Result := TRUE; TranslateMessage(MsgRec); - DispatchMessage(Msg); + DispatchMessage(MsgRec); end; end;