Keep window from being minimized

Jimmythegreat

Member
Joined
Jul 19, 2006
Messages
17
Programming Experience
3-5
Simple question here, I hope.

How can I keep a form from being minimized to taskbar?

Also, how can I keep my form from being the the 'Alt+Tab' list.


Thanks
JimmyTheGreat
 
Last edited:
Setting ShowInTaskBar=False prevents it being shown in task bar and task manager, and prevents to being minimized to task bar (it will minimize though :)). Setting FormBorderStyle to one of the ToolWindow options also hides it from Alt-Tab list.
 
Thanks for the fast answer, however......

I have ShowInTaskBar=False, but when a user presses 'WindowsKey + D' it minimizes to the Taskbar as invisible.

Not being in the 'Alt+Tab' list isn't for this program. I needed it for other programs in the past, thanks for that info.

Thanks
JimmyTheGreat
 
With this code you can prevent application scope minimize:
VB.NET:
Const WM_SYSCOMMAND As Int32 = &H112
Const SC_MINIMIZE As Int32 = &HF020I
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
    If m.Msg = WM_SYSCOMMAND Then
        If m.WParam.ToInt32 = SC_MINIMIZE Then
            Return
        End If
    End If
    MyBase.WndProc(m)
End Sub
I don't know how to prevent system commands Win-M or Win-D.
 
That code works perfectly!

I didn't need to prevent the 'WindowsKey + D' just stop it from minimizing my form.

Thanks a bunch!
JimmyTheGreat
 
Back
Top