Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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.

 

   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

  • 2 weeks later...
Posted

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

Posted

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).

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...