Dosbox,Visual Basic 2008

Can someone please write me a sample code how to send keys to Dosbox?
LVL 3
DgleichAsked:
Who is Participating?
 
DgleichAuthor Commented:
I figured it out myself here is the code for sending keys to dos...


Const KEYEVENTF_KEYUP = &H2
    Private Declare Sub keybd_event Lib "user32.dll" (ByVal bVk As Byte, ByVal bScan As Byte, ByVal dwFlags As Long, ByVal dwExtraInfo As Long)
 
keybd_event((Keys.Enter), 0, 0, 0)
            keybd_event((Keys.Enter), 0, KEYEVENTF_KEYUP, 0)

Open in new window

0
 
Jeffrey CoachmanMIS LiasonCommented:
I have never use DosBox, so I cannot say for certain.

But as long as the DosBox Application has the focus, Send keys should work with something like this:

    'DosBox Set Focus Code, or Shell command?
    DoEvents
    'Your SendKeys Code here  

If not, then you should contact the makers of DosBox and ask for help with this.

Let's see what some other experts have to say...
;-)

JeffCoachman
0
 
DgleichAuthor Commented:
SendKeys, not working....
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
Jeffrey CoachmanMIS LiasonCommented:
Can you post the code you are using?
0
 
DgleichAuthor Commented:
I am not using any code cuz I don't know where to start...
Send Keys is not working...
0
 
Jeffrey CoachmanMIS LiasonCommented:
OK,

Then let's start from the beginning...

What command do you use to run DosBox?


JeffCoachman
0
 
Jeffrey CoachmanMIS LiasonCommented:
OK,

Great, congratulations.

You can actually accept your own post as the "accepted solution"
;-)

JeffCoachman
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.