How can I prevent "Show Desktop" or "Windows Key+M" from minimizing my program?
hi,
i don't want my program to be on "TopMost" but i also don't want it to minimize. Never.
even if i disable the minimize feature, the program can still be minimized by clicking on the "show desktop" icon or pressing Windows Key+M. I'd like to prevent that. Can someone tell me a possible way to do it?
and btw, the show desktop doesn't trigger the "resize" or "changesize" events.
Thanks,
Re: How can I prevent "Show Desktop" or "Windows Key+M" from minimizing my program?
Well to prevent minimising by Win+M you can do this:
Code:
protected override void WndProc (ref Message m)
{
const int WM_SIZE = 5;
if (m.Msg == WM_SIZE)
{
this.WindowState = FormWindowState.Normal;
}
base.WndProc(ref m);
}
That doesn't prevent complete hiding by Win+D (same as the Show Desktop icon). I'm still trying to figure out how you'd do that.
Re: How can I prevent "Show Desktop" or "Windows Key+M" from minimizing my program?
oh, i must've made a mistake in my original post. i use a thinkpad, which doesn't have the windows key, so i thought windows+m was actually equal to "show desktop". i already know how to prevent minimization. but i'm really trying to find a way to prevent "show desktop" from minimizing/hiding my application. no success so far.