From 3745aa61ef489e4b143b5c753a006d0613a0297f Mon Sep 17 00:00:00 2001 From: beware Date: Sat, 13 Nov 2010 14:46:48 +0000 Subject: [PATCH] reversing unnecessary changes to windowproc, and add translatemessage git-svn-id: file:///svnroot/lcore/trunk@90 b1de8a11-f9be-4011-bde0-cc7ace90066a --- wcore.pas | 25 ++++++++----------------- 1 file changed, 8 insertions(+), 17 deletions(-) diff --git a/wcore.pas b/wcore.pas index 928486f..8b402b5 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; { @@ -272,22 +267,17 @@ function MyWindowProc( var MsgRec : TMessage; a:integer; - handled:boolean; begin Result := 0; // This means we handled the message - handled := false; - {MsgRec.hwnd := ahWnd;} MsgRec.wParam := awParam; MsgRec.lParam := alParam; - if (ahwnd = hwndwcore) then begin - dotasks; - case auMsg of + dotasks; + case auMsg of {$ifndef threadtimer} WM_TIMER: begin - handled := true; if msgrec.wparam = timerid_wcore then begin a := wcore_timehandler; killtimer(hwndwcore,timerid_wcore); @@ -299,15 +289,14 @@ begin {WINMSG_TASK:dotasks;} WM_CLOSE: begin - handled := true; + {} end; WM_DESTROY: begin - handled := true; + {} end; - end; + else + Result := DefWindowProc(ahWnd, auMsg, awParam, alParam) end; - - if not handled then Result := DefWindowProc(ahWnd, auMsg, awParam, alParam) end; @@ -375,6 +364,7 @@ begin Result := FALSE; if PeekMessage(Msg, 0, 0, 0, PM_REMOVE) then begin Result := TRUE; + TranslateMessage(MsgRec); DispatchMessage(Msg); end; end; @@ -386,3 +376,4 @@ end; end. + -- 2.30.2