nickamon
asked on
How to edit the windows event loop in a c++ builder application.
Hi,
I am writing an application that needs to intercept all messages sent from Windows to my application before the message is dispatched.
The old way I did it was to edit the GetMessage loop in my WinMain function. But now I am using Borland C++ Builder and I need to do the same thing. Any ideas on how? I want to do something like this:
while(GetMessage((LPMSG)&M sg,NULL,0, 0) > 0){
if(!checkSourceEvent((LPMS G)&Msg)){ <== ADDED CODE
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}
Thanks In Advance,
Nicholas Amon
I am writing an application that needs to intercept all messages sent from Windows to my application before the message is dispatched.
The old way I did it was to edit the GetMessage loop in my WinMain function. But now I am using Borland C++ Builder and I need to do the same thing. Any ideas on how? I want to do something like this:
while(GetMessage((LPMSG)&M
if(!checkSourceEvent((LPMS
TranslateMessage(&Msg);
DispatchMessage(&Msg);
}
}
Thanks In Advance,
Nicholas Amon
why wouldn't the same mechanism work in Borland C++ Builder if you are using Windows?
ASKER
The C++ Buidler does it for you automatically in their Application->Run method, but it doesn't allow you to edit that code. I could remove the line and put in my own event loop, but then the VCL will not initialize or deliver events properly.
Thanks,
Nicholas Amon
Thanks,
Nicholas Amon
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Alot Alf worked like a charm.