X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/3745aa61ef489e4b143b5c753a006d0613a0297f..03b75b4c964d8b3ac97d4007f0e033549b01c92f:/wcore.pas diff --git a/wcore.pas b/wcore.pas old mode 100755 new mode 100644 index 8b402b5..e79fc10 --- 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;