From: beware Date: Sat, 13 Nov 2010 15:05:06 +0000 (+0000) Subject: init wcore stuff in lcoreinit, eliminating dependency on messageloop X-Git-Url: http://www.lcore.org/git/lcore.git/commitdiff_plain/9d2bca1f897628eaed87c733670f82ddb96b8c01?hp=d8999eeb3210dd13358a5c76fcc9722df1ef8d2e init wcore stuff in lcoreinit, eliminating dependency on messageloop git-svn-id: file:///svnroot/lcore/trunk@92 b1de8a11-f9be-4011-bde0-cc7ace90066a --- diff --git a/lcorewsaasyncselect.pas b/lcorewsaasyncselect.pas index 622c92e..cde709b 100755 --- a/lcorewsaasyncselect.pas +++ b/lcorewsaasyncselect.pas @@ -226,6 +226,7 @@ begin WSAStartup(2, GInitData); absoloutemaxs := maxlongint; + wcoreinit; inited := true; end; diff --git a/wcore.pas b/wcore.pas index 1c063ad..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);