Send Application to the back or Show Desktop

Hello everyone,
I have an application that might have several windows open at a time, that even though they are not full screen, they cover all the screen real estate, hiding the taskbar.
Now I need to allow the user to either show the task bar (like pressing the windows key on the keyboard), or send my application to the back.
The problem is that the PC is a POS with no keyboard, and in reality the users needs to access the web browser whenever they want.

What should I do about it? Note that after using the web browser they should continue using the application.

Thanks in advance for any ideas.

Here’s a Few Options…

Sub SetTaskBarOnTop()
  Declare Function FindWindow Lib "user32" Alias "FindWindowA" (ByVal lpClassName As CString, ByVal lpWindowName As CString) As Integer
  Const SWP_NOMOVE = 2
  Const SWP_NOSIZE = 1
  Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
  Const HWND_TOPMOST = -1
  Const HWND_NOTOPMOST = -2
  
  //Used to set window Order and Position
  Declare Function SetWindowPos Lib "user32" Alias "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
  
  //Make window topmost
  Dim trayHandle as Integer = FindWindow("Shell_TrayWnd", nil)
  
  Call SetWindowPos(trayHandle, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)
End Sub

[code]Sub ShowDesktop()
Declare Sub keybd_event Lib “user32.dll” (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Integer, ByVal dwExtraInfo As Integer)

Const VK_STARTKEY = &H5B
Const VK_M = 77
Const KEYEVENTF_KEYUP = &H2

'WinKey down
keybd_event VK_STARTKEY, 0, 0, 0
'M key down
keybd_event VK_M, 0, 0, 0
'M key up
keybd_event VK_M, 0, KEYEVENTF_KEYUP, 0
'WinKey up
keybd_event VK_STARTKEY, 0, KEYEVENTF_KEYUP, 0
End Sub
[/code]

[code]Sub MakeTopMost(win as Window)
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2

//Used to set window Order and Position
Declare Function SetWindowPos Lib “user32” Alias “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

//Make window topmost
Call SetWindowPos(win.Handle, HWND_TOPMOST, 0, 0, 0, 0, FLAGS)

End Sub

Sub SetNotTopMost(win as Window)
Const SWP_NOMOVE = 2
Const SWP_NOSIZE = 1
Const FLAGS = SWP_NOMOVE Or SWP_NOSIZE
Const HWND_TOPMOST = -1
Const HWND_NOTOPMOST = -2

//Used to set window Order and Position
Declare Function SetWindowPos Lib “user32” Alias “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

//Stop window from being topmost
Call SetWindowPos(win.Handle, HWND_NOTOPMOST, 0, 0, 0, 0,FLAGS)

End Sub
[/code]

[code]Sub SendFocusToWindow(Win as Window)

//Will draw attention to the window. If the window is behind another, it’s taskbar icon will flash
Declare Function SetForegroundWindow Lib “user32” (ByVal hWnd As Integer) As Integer

Call SetForegroundWindow(Win.Handle)

End Sub
[/code]

Using the ShowDesktop method you can also send a Windows-Host key press by using its keycode, just as virtual keys were used to minimize all the windows.

Thank you very much Matthew.
I will check them out tomorrow morning and will let you know.

Thank you again very much Matthew, I went with the SetTaskBarOnTop Sub, which worked perfectly for what I want!