X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/82d4e52fba54be50d719f6185ec381f2dc87fc6c..90c7057fc0ae5d85a6443e7633642ef43553ab28:/wcore.pas?ds=sidebyside diff --git a/wcore.pas b/wcore.pas index f88aa53..e79fc10 100755 --- a/wcore.pas +++ b/wcore.pas @@ -1,8 +1,3 @@ -{ Copyright (C) 2005 Bas Steendijk and Peter Green - For conditions of distribution and use, see copyright notice in zlib_license.txt - which is included in the package - ----------------------------------------------------------------------------- } - unit wcore; { @@ -63,9 +58,10 @@ procedure addtask(ahandler:ttaskevent;aobj:tobject;awparam,alparam:longint); procedure disconnecttasks(aobj:tobject); procedure exitmessageloop; procedure processmessages; +procedure wcoreinit; var - onshutdown:procedure(s:string); + onshutdown:procedure(s:ansistring); implementation @@ -317,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, @@ -344,6 +337,14 @@ begin {$endif} +end; + +procedure messageloop; +var + MsgRec : TMsg; + +begin + while GetMessage(MsgRec, 0, 0, 0) do begin TranslateMessage(MsgRec); DispatchMessage(MsgRec); @@ -364,12 +365,13 @@ end; function ProcessMessage : Boolean; var - Msg : TMsg; + MsgRec : TMsg; begin Result := FALSE; - if PeekMessage(Msg, hwndwcore, 0, 0, PM_REMOVE) then begin + if PeekMessage(MsgRec, 0, 0, 0, PM_REMOVE) then begin Result := TRUE; - DispatchMessage(Msg); + TranslateMessage(MsgRec); + DispatchMessage(MsgRec); end; end; @@ -380,3 +382,4 @@ end; end. +