Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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=-

Whatever thy hand findest to do, do it with all thy heart - Jesus

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