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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Force KIOSK mode until application is exited

Status
Not open for further replies.

Celsoft

Programmer
Aug 27, 2008
17
IE

The code below toggles between kiosk mode and "not kiosk mode"

What is required to take the "toggle bit" out ??? i.e. force KIOSK mode until application is exited

I have managed to invoke the code at application startup, so it's working OK (user can't move or size the window) but ...

... if the user unlocks the TaskBar (at bottom of screen), the app window suddenly becomes Moveable/Sizeable, which is uwanted behaviour :(

Thanks for any gems of wisdom !




Public Function ToggleKioskModeAlike()
Dim NewStyle As Long
Access.RunCommand Access.AcCommand.acCmdAppMaximize
NewStyle = GetWindowLong(Application.hWndAccessApp, GWL_STYLE) Xor (WS_BORDER + WS_CAPTION)
SetWindowLong Application.hWndAccessApp, GWL_STYLE, NewStyle
SetWindowPos Application.hWndAccessApp, 0&, 0, 0, 0, 0, SWP_NOZORDER Or SWP_NOMOVE Or SWP_NOSIZE Or SWP_NOACTIVATE Or SWP_DRAWFRAME
Application.CommandBars("menu bar").Enabled = Not Application.CommandBars("menu bar").Enabled
End Function
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top