X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/968c333d05db5d5ecf3599f8e304c67e64f21159..3dd5a60c6c89a29781e099a9e204b09ffbb2e317:/unitwindowobject.pas diff --git a/unitwindowobject.pas b/unitwindowobject.pas index 1c0d32d..ec5d955 100644 --- a/unitwindowobject.pas +++ b/unitwindowobject.pas @@ -12,9 +12,9 @@ uses {$ifdef mswindows} windows,messages,wmessages, {$else} - lmessages, + lcoremessages, {$macro on} - {$define windows := lmessages} + {$define windows := lcoremessages} {$endif} sysutils, pgtypes; @@ -118,7 +118,7 @@ begin '', dwstyle, CW_USEDEFAULT, CW_USEDEFAULT,100, 100, hwnd(0), 0, HInstance, nil); //swriteln('about to check result of createwindowex'); if hWndMain = hwnd(0) then raise exception.create('CreateWindowEx failed'); - //swriteln('about to store reference to self in extra windo memory'); + //swriteln('about to store reference to self in extra window memory'); setwindowlongptr(hwndmain,0,taddrint(self)); //swriteln('finished twindowobject.create , hwndmain='+inttohex(taddrint(hwndmain),16)); end; @@ -141,6 +141,7 @@ begin windows.postmessage(hwndmain,msg,wparam,lparam); end; +{$ifdef mswindows} function twindowobjectbase.ProcessMessage : Boolean; var MsgRec : TMsg; @@ -157,13 +158,16 @@ procedure twindowobjectbase.processmessages; begin while processmessage do; end; +{$endif} procedure twindowobjectbase.messageloop; var MsgRec : TMsg; begin while GetMessage(MsgRec, hwnd(0), 0, 0) do begin + {$ifdef mswindows} TranslateMessage(MsgRec); + {$endif} DispatchMessage(MsgRec); if exitloopflag then exit; {if not peekmessage(msgrec,0,0,0,PM_NOREMOVE) then onidle}