Newsgroups : Borland : borland.public.delphi.nativeapi.win32 : 2006 Jul : Application.OnMessage receive the same message 3 times

www.cryer.info
Managed Newsgroup Archive

Application.OnMessage receive the same message 3 times

Subject:Application.OnMessage receive the same message 3 times
Posted by:"Daniel" (dani..@borland.com)
Date:Thu, 6 Jul 2006 19:38:44

Hi,

   I redirect Application.OnMessage to MyOnMessage, inside it I code to
treate my registered message, WM_RefreshPaintBox.

    When I send WM_RefreshPaintBox by
           PostMessage(HWND_BROADCAST, WM_RefreshPaintBox,
msg.wParam,msg.lParam );

    MyOnMessage( ) receive WM_RefreshPaintBox for 3 times.

procedure TMyFrame.MyOnMessage(var Msg: TMsg; var Handled: Boolean);
begin
  if (Msg.message= WM_RefreshPaintBox) then
  begin
    Handled:=true;
    pbEzf.Refresh;
  end;
end;

    How can I remove WM_RefreshPaintBox from message queue after it was
first treated?


Thanks,

Daniel

Replies:

www.cryer.info
Managed Newsgroup Archive