Keypress when minimized

Ontani

Centurion
Joined
Mar 3, 2004
Messages
121
Location
Belgium
This is probably asked before, but i can't find any answers.

is there a way to capture the keypressed when my application is minimized.

Visual Basic:
    Protected Overrides Sub OnKeyDown(ByVal e As System.Windows.Forms.KeyEventArgs)
        If e.KeyValue = Keys.Shift and e.KeyValue = Keys.M Then
            MsgBox("Test")
        End If
    End Sub

i used this

this works when my application is focused, but when in taskbar or not active it handles the function that other apps have assigned to the keys.

Greetz
 
i got the minimize thingy working but i got a serious problem.
the game gets send to my taskbar.
but when i click on it again it goes back fullscreen (like it should)
but it doesn't reload all of its graphics for some reason the whole game looks realy screwed. i can see tru walls and such. does someone has an idea to fix this?

Greetz
 
I caught key strokes with that function when i was making a little app for Mu online. It does work.

You need a loop like this

Do
If GetAsyncKeyState(YourKey)=KeyUp then
Do your stuff
end if
Loop


Probably in a separate thread. You will also need the proper constants (in Win32Api.txt). I think they start with VK_ (Virtual keys).
 
Back
Top