Ontani Posted January 16, 2005 Posted January 16, 2005 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 Quote www.purevision.be :: www.devpoint.be
*Experts* mutant Posted January 16, 2005 *Experts* Posted January 16, 2005 May I ask why would you need to capture other application's key presses? Are you trying to setup a system wide hotkey or something? Quote
Ontani Posted January 16, 2005 Author Posted January 16, 2005 i want to minimize a fullscreen game when i press shift + M. Quote www.purevision.be :: www.devpoint.be
Ontani Posted January 30, 2005 Author Posted January 30, 2005 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 Quote www.purevision.be :: www.devpoint.be
Ontani Posted January 31, 2005 Author Posted January 31, 2005 nevermind got it to work. the restore resolution had to be set correctly Quote www.purevision.be :: www.devpoint.be
IcingDeath Posted February 3, 2005 Posted February 3, 2005 Ethical issues? Declare Function GetAsyncKeyState Lib "user32.dll" ( _ ByVal vKey As Long) As Integer Quote
Ontani Posted February 3, 2005 Author Posted February 3, 2005 doesn't work it the application isn't focused. i'm now working with a noftifyicon. http://www.ontani.net/ssa/home.php?page=downloads SoF² Minimizer is the one Quote www.purevision.be :: www.devpoint.be
IcingDeath Posted February 3, 2005 Posted February 3, 2005 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). Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.