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 » TopWindow&PopUp, TrayIcon » Custom actions on Minimize or Close button
Re: Custom actions on Minimize or Close button [message #12850 is a reply to message #1001] Wed, 21 November 2007 11:54 Go to previous messageGo to previous message
lokki is currently offline  lokki
Messages: 20
Registered: November 2005
Promising Member
Hello

I had similar problem and solved it just as you had written. For others, here it is:

class MyWindow: public WithMyCustomLayout<TopWindow> {
...
   Callback WhenMinimize; // callback for minimize

   // Overriding default WindowProc
   LRESULT WindowProc(UINT message, WPARAM wParam, LPARAM lParam);
...
};

// implementation of WndProc
LRESULT MyWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
	if (message == WM_SYSCOMMAND && wParam == SC_MINIMIZE)
	{
		WhenMinimize(); // callback
		return 0;
	}
	return TopWindow::WindowProc(message, wParam, lParam);
}

// in window constructor or any other suitable method, 
// assign custom function to callback
MyWindow::MyWindow()
{
...
   WhenMinimize = THISBACK(MyCustomFunction);
...
}
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: region defined windows or Rounded rectangle windows
Next Topic: Painting below your window, not bleeding into your window...
Goto Forum:
  


Current Time: Thu May 09 23:10:11 CEST 2024

Total time taken to generate the page: 0.02705 seconds