|
|
Home » U++ Library support » TopWindow&PopUp, TrayIcon » Custom actions on Minimize or Close button
Custom actions on Minimize or Close button [message #999] |
Mon, 13 February 2006 12:35 ![Go to next message Go to next message](theme/default/images/down.png) |
hojtsy
Messages: 241 Registered: January 2006 Location: Budapest, Hungary
|
Experienced Member |
|
|
I would like to Hide() my window when the Minimize or Close button is pressed in the title bar, instead of minimizing or closing. Which methods should I overload for this?
|
|
|
|
|
|
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 message Go to previous message](theme/default/images/up.png) ![Go to next message Go to next message](theme/default/images/down.png) |
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
|
|
|
|
Goto Forum:
Current Time: Sun Sep 01 06:53:40 CEST 2024
Total time taken to generate the page: 0.03363 seconds
|
|
|