?
Solved

Dosbox,Visual Basic 2008

Posted on 2009-02-09
9
Medium Priority
?
582 Views
Last Modified: 2012-05-06
Can someone please write me a sample code how to send keys to Dosbox?
0
Comment
Question by:Dgleich
  • 4
  • 3
7 Comments
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 23678804
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
 
LVL 3

Author Comment

by:Dgleich
ID: 23679526
SendKeys, not working....
0
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 23679824
Can you post the code you are using?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:Dgleich
ID: 23679971
I am not using any code cuz I don't know where to start...
Send Keys is not working...
0
 
LVL 74

Assisted Solution

by:Jeffrey Coachman
Jeffrey Coachman earned 2000 total points
ID: 23681526
OK,

Then let's start from the beginning...

What command do you use to run DosBox?


JeffCoachman
0
 
LVL 3

Accepted Solution

by:
Dgleich earned 0 total points
ID: 23684011
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
 
LVL 74

Expert Comment

by:Jeffrey Coachman
ID: 23689789
OK,

Great, congratulations.

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

JeffCoachman
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When you upgrade from Windows 8 to 8.1 or to Windows 10 or if you are like me you are on the Insider Program you may find yourself with many 450MB recovery partitions.  With a traditional disk that may not be a problem but with relatively smaller SS…
Whether you've completed a degree in computer sciences or you're a self-taught programmer, writing your first lines of code in the real world is always a challenge. Here are some of the most common pitfalls for new programmers.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
Windows 8 comes with a dramatically different user interface known as Metro. Notably missing from the new interface is a Start button and Start Menu. Many users do not like it, much preferring the interface of earlier versions — Windows 7, Windows X…
Suggested Courses

621 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question