Re: Background Keystroke Commands...
- From: "Geoff" <NoSpam@xxxxxx>
- Date: Tue, 26 Jul 2005 01:12:17 +0000 (UTC)
"cwizzie" <cwizze@xxxxxxxxx> wrote in message
news:1122270511.993947.217570@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> I'm writing a program that staff shouldn't be able to close, but in
> the event that someone from the IT department needs to close the
> program I want them to be able to. If the tech can hit lets say
> "ctrl+0+j" it will bring up a box that says "are you sure you want to
> close? yes/no." Thats what I want to do.
>
>
> Thanks,
>
If your just checking for a few pressed keys then maybe you could use
GetAsyncKeyState
Option Explicit
Private Declare Function GetAsyncKeyState Lib "USER32" (ByVal vKey As Long)
As Integer
Private Sub Form_KeyDown(KeyCode As Integer, Shift As Integer)
If (GetAsyncKeyState(vbKey0) < 0) And _
(GetAsyncKeyState(vbKeyJ) < 0) And _
(GetAsyncKeyState(vbKeyControl) < 0) Then Unload Me
End Sub
Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
Cancel = (MsgBox("You sure", vbYesNo Or vbQuestion, "Confirm Close") =
vbNo)
End Sub
.
- References:
- Background Keystroke Commands...
- From: cwizzie
- Re: Background Keystroke Commands...
- From: Lee Weiner
- Re: Background Keystroke Commands...
- From: cwizzie
- Background Keystroke Commands...
- Prev by Date: Re: Background Keystroke Commands...
- Next by Date: Re: Background Keystroke Commands...
- Previous by thread: Re: Background Keystroke Commands...
- Next by thread: Re: Background Keystroke Commands...
- Index(es):
Relevant Pages
|