Link to home
Start Free TrialLog in
Avatar of pamwestphal
pamwestphal

asked on

Removing the Taskbar

I am building a Kiosk application and I would like it to boot automatically to the application and not give the user the option to laucnch any other programs etc.  Does anyone know of a way to programatically remove the taskbar from the screen so that a user cannot click on it?
Avatar of Mystify
Mystify

you could set your form to "always on top" and then manually set the size of the form to the size of the screen (not maximizing it), thus covering the task bar...

if that is enough, then great, but it will not prevent keyboard shortcuts from launching it. But if there is no keyboard (assuming so in a kiosk) then this will work just fine.

Private Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Integer, ByVal hWndInsertAfter As Integer, ByVal x As Integer, y, ByVal cx As Integer, ByVal cy As Integer, ByVal wFlags As Integer) As Integer
Private Const HWND_TOPMOST As Integer = -1
Private Const HWND_NOTOPMOST As Integer  = -2
Private Const SWP_NOMOVE As Integer  = &H2
Private Const SWP_NOSIZE As Integer  = &H1
Private Const TOPMOST_FLAGS  As Integer = SWP_NOMOVE Or SWP_NOSIZE

Public Sub SetAlwaysOnTop(hwnd As Long, OnTop as Boolean)
    SetWindowPos hwnd, iif(OnTop,HWND_TOPMOST, HWND_NOTOPMOST), 0, 0, 0, 0, TOPMOST_FLAGS
End Sub


Then in your form load, call

Me.Bounds = Screen.PrimaryScreen.Bounds
SetAlwaysOnTop Me.Handle, True
Avatar of pamwestphal

ASKER

I am going to have a keyboard with this kiosk though because the user needs to type in a name etc.  Is there anyway to disable the keyboard shortcuts?
ASKER CERTIFIED SOLUTION
Avatar of Mystify
Mystify

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Mike Tomlinson
@Mystify...

The SPI_SCREENSAVERRUNNING trick only works on WinME and below.  It doesn't work on 2000/NT/XP systems.
figured it was something like that. I haven't spent a great deal of time.
I did find a VB6 project that DID work... but I wasn't able to successfully update it to get it to work.
It involved hooking the key proc.

check this thread out for info... I haven't tested it, I just found it by mistake while looking for something else for myself.
may help.

http://www.vbforums.com/showthread.php?t=267226
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial