7/6/2023 0 Comments Restart explorer exe![]() Private Declare Function UnhookWindowsHookEx Lib "user32" (ByVal hHook As Integer) As Integer Private Const WM_SYSKEYUP As Integer = &H105 Private Const WM_SYSKEYDOWN As Integer = &H104 Private Const WM_KEYDOWN As Short = &H100S Private Const WM_KEYUP As Integer = &H101 I found this code to disable the windows key on DaniWeb reproduced below However, your user could still hit the Windows key to bring up the Start Menu, or use Alt-Tab to navigate to another program. This will just hide the Start Menu "Orb" and the Taskbar (including the system tray). TaskBarAndStartShowHide(SW_SHOW) ' Don't leave without re-enabling the Start Menu! End Sub End Class Object, ByVal e As ) Handles MyBase.FormClosing Object, ByVal e As System.EventArgs) Handles Button1.ClickĮnd Sub Private Sub Form1_FormClosing( ByVal sender As System. ![]() If ShowHide = SW_TOGGLE Then action = IIf(IsWindowVisible(TaskBarHwnd), SW_HIDE, SW_SHOW)īRet = False ' bret is actually already false End Try Return bRetĮnd Function Private Sub Button1_Click( ByVal sender As System. ' Determine whether we are hiding or showing the items Dim action As Integer = ShowHide Note Start Orb is no longer sub-window of task bar Dim TaskBarHwnd As Integer = FindWindow( " Shell_traywnd", " ")ĭim StartOrbHwnd As Integer = FindWindow( " Button", " Start") ''' Set to SW_TOGGLE (-1) to determine what to do first ''' True if no errors otherwise false Private Function TaskBarAndStartShowHide( ByVal ShowHide As Integer) As Boolean Dim bRet As Boolean = False Try ' Get the window handles that we need. ''' ''' Shows or Hides both the Taskbar and Start Orb Private Shared Function IsWindowVisible( ByVal hWnd As IntPtr) As Boolean End Function Private Const SW_HIDE As Integer = 0 Private Const SW_SHOW As Integer = 1 Private Const SW_TOGGLE As Integer = -1 Private Shared Function ShowWindow( ByVal hwnd As Integer, ByVal command As Integer) As Integer End Function Private Shared Function SetWindowPos( ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, ByVal y As Integer, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer End Function Private Shared Function FindWindow( ByVal className As String, ByVal windowText As String) As Integer End Function ![]()
0 Comments
Leave a Reply. |