• Welcome to Valhalla Legends Archive.
 

Minimizing Forms

Started by Mangix, October 06, 2005, 11:42 PM

Previous topic - Next topic

Mangix

does a form have an Event that fires exactly when the form gets minimized? i've looked at each event and i dont think im finding what im looking for.

MyndFyre

No.  You can intercept it, however, by overriding WndProc and handling WM_SYSCOMMAND -- specifically, the SC_MINIMIZE command contained in wParam.

Example code: .NETskinEx's /Controls/NCForm implements this in the form of the protected virtual function OnMinimized.
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Mangix

#2
mmk

also your NetSkinEx program is very neat :)

edit:ok it doesnt work. it compiles fine but when i run it, it crashes on start. here's the message.

QuoteApplication has generated an exception that could not be handled.

Process id=0x938 (2360), Thread id=0xc94 (3220).

Click OK to terminate the application.
Click CANCEL to debug the application.

my code is this. protected override void WndProc(ref Message m)
{
switch (m.Msg)
{
case 274:
if (m.Msg == 0xF020)
{
this.Visible = false;
}
break;
}
}
i took a look at WinUser.h and WM_SYSCOMMAND is 274