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++ Callbacks and Timers » Execute(), LPARAM and WPARAM
Execute(), LPARAM and WPARAM [message #19125] Thu, 13 November 2008 18:50 Go to next message
amando1957 is currently offline  amando1957
Messages: 57
Registered: November 2007
Location: Wien/Vienna/Viden
Member
Hi to all,

I tried an event handler like this:
class midi_in : public Withmidi_inLayout<TopWindow>
{};

GUI_APP_MAIN
{
	midi_in inApp;
	// "lpGot" is just a dummy:
	LPARAM lpGot;
			
	for(;;)
		switch(inApp.Execute())
		{
		// for this I need the LPARAM and WPARAM:
		case MM_MIM_DATA:
			inApp.getMidiInData(lpGot);			
			break;
		case WM_KEYDOWN:
			PromptOK(t_("Want to quit proggy?"));
			return;
		}
	
	inApp.Run();
}

How can I read the LPARAM and WPARAM values now?
Are there any get-functions?

Martin
Re: Execute(), LPARAM and WPARAM [message #19132 is a reply to message #19125] Fri, 14 November 2008 11:36 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
amando1957 wrote on Thu, 13 November 2008 12:50

Hi to all,

I tried an event handler like this:
class midi_in : public Withmidi_inLayout<TopWindow>
{};

GUI_APP_MAIN
{
	midi_in inApp;
	// "lpGot" is just a dummy:
	LPARAM lpGot;
			
	for(;;)
		switch(inApp.Execute())
		{
		// for this I need the LPARAM and WPARAM:
		case MM_MIM_DATA:
			inApp.getMidiInData(lpGot);			
			break;
		case WM_KEYDOWN:
			PromptOK(t_("Want to quit proggy?"));
			return;
		}
	
	inApp.Run();
}

How can I read the LPARAM and WPARAM values now?
Are there any get-functions?

Martin


Not sure what "inApp.Execute" does and how it returns windows message.

However, to achieve what you need, override

	virtual LRESULT Ctrl::WindowProc(UINT message, WPARAM wParam, LPARAM lParam);


Mirek
Re: Execute(), LPARAM and WPARAM [message #19141 is a reply to message #19132] Fri, 14 November 2008 21:23 Go to previous messageGo to next message
amando1957 is currently offline  amando1957
Messages: 57
Registered: November 2007
Location: Wien/Vienna/Viden
Member

Made it like this now:
LRESULT midi_in::WindowProc(
	UINT message, WPARAM wParam, LPARAM lParam)
{
	switch(message)
	{
	case MM_MIM_DATA:
		getMidiInData(lParam);			
		break;
	case WM_KEYDOWN:
		if (wParam==27) 
			if (PromptYesNo("Want to quit proggy?"))
			{	Ctrl::ExitWin32();
			}
		return 0;
	}
	
	return Ctrl::WindowProc(message, wParam, lParam);
}

and that runs, given the call of the base function on bottom.
Thanks for the hint.

Martin
Re: focus = transparent window [message #19146 is a reply to message #19141] Sat, 15 November 2008 13:45 Go to previous messageGo to next message
amando1957 is currently offline  amando1957
Messages: 57
Registered: November 2007
Location: Wien/Vienna/Viden
Member
But makes a transparent window now:
The desktop is being copied each time it gets the focus, looks like:

http://members.aon.at/amando1957/screenshots/transparentWindow.jpg

Dealing with focus I have found these, but cannot make sense from them:
void TopWindow::ActiveFocus0(Ctrl& ctrl)
void TopWindow::Activate()

Not to guess, as its not a child:
void TopWindow::ChildGotFocus()


Made a seperate test case, but it did not repeat, there I got the expected grey window.

Martin
Re: focus = transparent window [message #19153 is a reply to message #19146] Sat, 15 November 2008 15:43 Go to previous messageGo to next message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
amando1957 wrote on Sat, 15 November 2008 07:45

But makes a transparent window now:
The desktop is being copied each time it gets the focus, looks like:

http://members.aon.at/amando1957/screenshots/transparentWindow.jpg

Dealing with focus I have found these, but cannot make sense from them:
void TopWindow::ActiveFocus0(Ctrl& ctrl)
void TopWindow::Activate()

Not to guess, as its not a child:
void TopWindow::ChildGotFocus()


Made a seperate test case, but it did not repeat, there I got the expected grey window.

Martin



IMO, event loop is not running.

Mirek
Re: focus = transparent window [message #19166 is a reply to message #19153] Sun, 16 November 2008 13:29 Go to previous message
amando1957 is currently offline  amando1957
Messages: 57
Registered: November 2007
Location: Wien/Vienna/Viden
Member
Quote:

IMO, event loop is not running.


I made it like this now:
GUI_APP_MAIN
{
	midi_in inApp;
	///// not this:
	// inApp.Run();
	///// but this:
	TopWindow().Run();
}


Now I have the grey window as desired, but the WM_KEYDOWN is not handled anymore.
I'll play around a little and find out former or later.
Thanks for the hints.

Martin
Previous Topic: callbacks and objects
Next Topic: How can I stop the timer?
Goto Forum:
  


Current Time: Thu Mar 28 14:23:20 CET 2024

Total time taken to generate the page: 0.01157 seconds