I have a vb.net application that, when a short cut is pressed, a window pops up. I also would like to make it completely invisible, unless the short cut is pressed. In the default class that houses my code for noticing the short cut and coordinating the events of the short cut, I have placed the following code:
Me.ShowInTaskbar = False
I have isolated this code as the issue. The issue is that my application does not work when it is not shown in the taskbar. This is only the default form – for the pop up window I have a separate class. How can I create a workaround for hiding the window in the taskbar and hiding it in general?
Thanks.
Btw, this is my hotkey code:
Public Const MOD_ALT As Integer = &H1
Public Const WM_HOTKEY As Integer = &H312
Public Declare Function RegisterHotKey Lib "user32" (ByVal hwnd As IntPtr, ByVal id As Integer, ByVal fsModifiers As Integer, ByVal vk As Integer) As Integer
Public Declare Function UnregisterHotKey Lib "user32" (ByVal hwnd As IntPtr, ByVal id As Integer) As Integer
Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = WM_HOTKEY Then
'Stuff do do when Alt-Q is pressed
End If
MyBase.WndProc(m)
End Sub
There should be a attribute like Me.object.Visible or form2.visible which you can set it to true and false. Just make sure it is also closed on exit of the main program.