R
Rinaldo
Hi,
How to regonize when the user clicks the minimize button in a form with
events?
Rinaldo
How to regonize when the user clicks the minimize button in a form with
events?
Rinaldo
Nicholas Paldino said:Rinaldo,
You will have to handle the WM_SYSCOMMAND windows message on the form,
looking for where wParam is equal to SC_MINIMIZE. You can do this by
overriding the WndProc method on the Form.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Rinaldo said:Hi,
How to regonize when the user clicks the minimize button in a form with
events?
Rinaldo
Rinaldo said:Hi Nicholas,
I know that it can be done in C++, but where in C#? Intellisense does'nt
show up those commands?
Rinaldo
Nicholas Paldino said:Rinaldo,
You will have to handle the WM_SYSCOMMAND windows message on the form,
looking for where wParam is equal to SC_MINIMIZE. You can do this by
overriding the WndProc method on the Form.
--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)
Rinaldo said:Hi,
How to regonize when the user clicks the minimize button in a form with
events?
Rinaldo
Nicholas Paldino said:Rinaldo,
You will have to handle the WM_SYSCOMMAND windows message on the form,
looking for where wParam is equal to SC_MINIMIZE. You can do this by
overriding the WndProc method on the Form.
Liz said:protected override void WndProc(ref Message m)
{
const int WM_SYSCOMMAND = 0x112;
const int SC_MINIMIZE = 0xF020;
if (m.Msg == WM_SYSCOMMAND)
{
if (m.WParam == (IntPtr)SC_MINIMIZE)
{
MessageBox.Show("Minimize button was clicked");
}
}
base.WndProc(ref m);
}