Home » U++ Library support » U++ Widgets - General questions or Mixed problems » How to catch a (registered) Message comming from other application
How to catch a (registered) Message comming from other application [message #40210] |
Wed, 03 July 2013 12:47 |
alex100
Messages: 118 Registered: November 2007
|
Experienced Member |
|
|
Hi
I am trying to communicate among applications using windows messages. I do the x=RegisterWindowMessage("XYZ") in both applications.
On one application I do
SendMessage(HWND_BROADCAST, x,(WPARAM)GetHWND(), 0);
and then I want to wait for the response. How to wait for an external windows Message?
I tried this but never takes place:
LRESULT CALLBACK SKTESTE::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PromptOK("Hit!");
if(message==x)
{
PromptOK("x message arriving");
return 1;
}
DefWindowProc(hWnd, message, wParam, lParam);
}
Thanks a lot
Alex
|
|
|
Re: How to catch a (registered) Message comming from other application [message #40389 is a reply to message #40210] |
Mon, 29 July 2013 19:41 |
|
mirek
Messages: 14038 Registered: November 2005
|
Ultimate Member |
|
|
alex100 wrote on Wed, 03 July 2013 06:47 | Hi
I am trying to communicate among applications using windows messages. I do the x=RegisterWindowMessage("XYZ") in both applications.
On one application I do
SendMessage(HWND_BROADCAST, x,(WPARAM)GetHWND(), 0);
and then I want to wait for the response. How to wait for an external windows Message?
I tried this but never takes place:
LRESULT CALLBACK SKTESTE::WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
PromptOK("Hit!");
if(message==x)
{
PromptOK("x message arriving");
return 1;
}
DefWindowProc(hWnd, message, wParam, lParam);
}
Thanks a lot
Alex
|
Calling DefWindowProc at the end is not right. In my apps, it looks like this (raw code):
LRESULT Ph::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
if(message == RC_message) {
int q = (int)lParam;
Query(q);
EditPh();
}
return TopWindow::WindowProc(message, wParam, lParam);
}
Mirek
|
|
|
Goto Forum:
Current Time: Fri Sep 20 06:19:05 CEST 2024
Total time taken to generate the page: 0.03514 seconds
|