From 9d2bca1f897628eaed87c733670f82ddb96b8c01 Mon Sep 17 00:00:00 2001 From: beware Date: Sat, 13 Nov 2010 15:05:06 +0000 Subject: [PATCH 1/1] init wcore stuff in lcoreinit, eliminating dependency on messageloop git-svn-id: file:///svnroot/lcore/trunk@92 b1de8a11-f9be-4011-bde0-cc7ace90066a --- lcorewsaasyncselect.pas | 1 + wcore.pas | 14 ++++++++++---- 2 files changed, 11 insertions(+), 4 deletions(-) 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); -- 2.30.2