Bartske Posted August 16, 2005 Posted August 16, 2005 I'm trying to write a simple tool, that i hopefully can use to send single keystrokes to some (external) music-programs (called Renoise and Modplug-tracker). The command Sendkeys didn't help me. Although it succesfully seemed to send keys to external (text-based) programs like word, notepad, calculator etc, nothing happend when i set the focus to the Renoise window. I managed to send keys (like "z" or "x" ) to the program, but it did'nt respond. Does anyone know if there Is a way to simulate keystrokes that are executed exactly as if they had been typed in at the keyboard? Or Is there a plugin available,for visual basic that works better than sendkeys option? I would be very grateful if somebody could help me. :) Quote
Simcoder Posted August 16, 2005 Posted August 16, 2005 I've used sendkeys before and it worked fine for me. I've sent keystrokes to pc games, chat windows, winamp, internet explorer, etc. You just have to be sure to give focus to whatever window you want to send keys too. Here is some sample code that I've used before. 'Process ID of application that wants keystrokes Dim ProcID as Integer 'This activates the application AppActivate(ProcID) 'Process all data in queue SendKeys.Flush() 'This restores the form SendKeys.SendWait("%( R)") 'Send keystrokes to application SendKeys.SendWait(txtMessage.text) -=Simcoder=- Quote Whatever thy hand findest to do, do it with all thy heart - Jesus
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.