Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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
alex100 is currently offline  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
mirek is currently offline  mirek
Messages: 13975
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
Previous Topic: NotNull doesn't work on an EditString with a convert
Next Topic: Set Button's size programmatically (with maintaining the left-top position)
Goto Forum:
  


Current Time: Fri Apr 19 10:39:27 CEST 2024

Total time taken to generate the page: 0.03205 seconds