Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Disableing taskbar

Status
Not open for further replies.

SoarinEagle

IS-IT--Management
Jul 27, 2002
3
US
Is it possible to diable accessing the taskbar while a program is running. I have the program running on top so no other programs can be used but the user can still access the taskbar.
 
You can do with it whatever you want. It depends on what you mean with disabling. If you want to capture all keyboard/mouse input, you'll could make a system wide hook. But an easier approach would be just to hide the Taskbar, which can be done like this:

[tt]
Option Explicit

Private Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As String, ByVal lpWindowName As String) As Long
Private Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long

Private Const SW_HIDE = 0
Private Const SW_NORMAL = 1

Private Sub Command1_Click()

Dim hWnd As Long

hWnd = FindWindow("Shell_TrayWnd", "")
Call ShowWindow(hWnd, SW_HIDE)

End Sub

Private Sub Command2_Click()

Dim hWnd As Long

hWnd = FindWindow("Shell_TrayWnd", "")
Call ShowWindow(hWnd, SW_NORMAL)

End Sub

Private Sub Form_Load()

Command1.Caption = "Hide"
Command2.Caption = "Show"

End Sub
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top