Code #1
CopyCode The Code is as follows: Private void form1_sizechanged (Object sender, eventargs e) // minimizes the hidden form.
{
If (this. windowstate = formwindowstate. Minimized) // The form state is minimized.
{
Stoprecttimer. Enabled = false;
This. Visible = false;
This. policyicon1.visible = true; // The System Tray Icon is displayed.
This. policyicon1.text = This. Text; // you can specify the text displayed on the icon.
This. showintaskbar = false; // hide the form in the task tag.
Reghotkey ();
Open otoolstripmenuitem. Text = "open (& O )";
}
}
obviously, if you open the lyrics, how can we minimize the size of the form without changing it? I thought of "minimizing" the reload, but how can I reload it? Here is a scheme to overload wndproc: copy Code : const int wm_syscommand = 0x112;
const int SC _close = 0xf060;
const int SC _minimize = 0xf020;
const int SC _maximize = 0xf030;
protected override void wndproc (ref message m)
{< br> If (M. MSG = wm_syscommand)
{< br> If (M. wparam. toint32 () = SC _minimize)
{< br> This. visible = false;
return;
}< BR >}< br> base. wndproc (ref m);
}