X-Git-Url: http://www.lcore.org/git/lcore.git/blobdiff_plain/87fed35010bb66b6183b06b01adb356dbefeefe6..4e72d8df4cde72eb1e62da6e0331af4b7f3e4c6a:/unitwindowobject.pas diff --git a/unitwindowobject.pas b/unitwindowobject.pas index cc7f1e1..414f975 100644 --- a/unitwindowobject.pas +++ b/unitwindowobject.pas @@ -9,7 +9,7 @@ interface uses classes, - {$ifdef win32} + {$ifdef mswindows} windows,messages,wmessages, {$else} lmessages, @@ -34,7 +34,7 @@ type function killtimer(id:taddrint):boolean; procedure postmessage(msg,wparam,lparam:taddrint); procedure messageloop; - {$ifdef win32} + {$ifdef mswindows} procedure processmessages; virtual; function processmessage:boolean; {$endif} @@ -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}