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 ![Go to next message Go to next message](theme/default/images/down.png) |
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 ![Go to previous message Go to previous message](theme/default/images/up.png) |
![](https://www.ultimatepp.org/forums/images/custom_avatars/3.png) |
mirek
Messages: 14003 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: Sun Sep 01 07:25:04 CEST 2024
Total time taken to generate the page: 0.01172 seconds
|