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 #12972 is a reply to message #12850] Sat, 01 December 2007 17:57 Go to previous messageGo to previous message
amit is currently offline  amit
Messages: 17
Registered: November 2007
Promising Member
hi,
I want to have some additional processing on application exit.
The code given by lokki should work but few point to be cleared are:

by overriding WindowProc ((--------all we have to-------)) do is:

this is for minimize example ..

// implementation of WndProc
LRESULT MyWindow::WindowProc(UINT message, WPARAM wParam, LPARAM lParam)
{
	if (message == WM_SYSCOMMAND && wParam == SC_MINIMIZE)
	{
		My_Custom_Function(); // -------------------------------------------------------this does  not have to be a CallBack but any function can well do.
		return 0;  //-----------------------------------------------------add this line if you want to ignore the actual minimizing else remove it.
	}
	return TopWindow::WindowProc(message, wParam, lParam);
}



i am not able to get the Close thing ... wait i'll check the U++ source and let you know ...

ok got it for working out "custom closing" do so ..


there are two ways ...

first ...
virtual void Close()
{
  ... // custom code
  ...
  ...
  TopWindow::Close(); // call this if you want to actually close window after custom processing
}


or the second ...

my_window_app::my_window_app()
{
...
WhenClose = THISBACK(custom_action_function);  // WhenClose is a member of your baseclass already do not re-declare it ..
...
}


........

my_window_app::custom_action_function()
{
  ... // custom code
  ...
  ...
  Close(); // the TopWindow Close would be called as Close() is not re-defined in this case
}





and i think WhenMinimize CallBack is not there ... correct me if wrong.

[Updated on: Sat, 01 December 2007 17:59]

Report message to a moderator

 
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: Mon Jun 02 21:48:58 CEST 2025

Total time taken to generate the page: 0.02811 seconds