I can easily hide my form with the event KeyDown, but only by pressing ONE key, and I wanna hide it by pressing CTRL+SHIFT+O, for example. And the biggest problem is when I wanna restore it, because I have to go to the Task Manager, make the aplication has the focus and then press SHIFT. What can I do?
The first problem can be easily solved. The keydown event has a second parameter (the so called shift value). This second parameter captures the state of the modifier keys.
Example:
Private Sub WhateverCtrl_KeyDown (KeyCode As Integer, Shift As Integer)
Dim ShiftDown, AltDown, CtrlDown
ShiftDown = (Shift And vbShiftMask) > 0
AltDown = (Shift And vbAltMask) > 0
CtrlDown = (Shift And vbCtrlMask) > 0
if KeyCode = "O" And CtrlDown And ShiftDown then
msgbox "Ctrl + Shift + O"
end if
End Sub
The second one I would guess is not easily solved. As the focus is with another application, you have no control over that applications KeyPress ... events.
What you can do is use "Ctrl-Tab" (the normal Windows functionality) to get the focus back to your application and then use another key combination at the main form level to restore it.