|
-
October 15th, 2001, 10:15 AM
#1
SendKeys cannot close DOS window.
Hello all,
I am looking for a way to use SendKeys to send the close window sequence (ALT+SPACE+C) to a DOS window under WinNT. Manually this can be done but programmatically, the DOS window seems to ignore the sequence. Doing the same on a Notepad application works fine, i.e. the sequence is correct and is sent correctly. If anyone has experienced such a phenomenon and may know of a solution or work-around, I would appreciate all the help you can offer.
Thanks,
Jacob.
-
October 16th, 2001, 05:31 AM
#2
Re: SendKeys cannot close DOS window.
private Sub Command1_Click()
Dim a
a = Shell("cmd.exe", vbNormalFocus)
AppActivate a
SendKeys "Exit", true
SendKeys "{ENTER}", true
End Sub
Special thanks to Lothar "the Great" Haensler, Tom Archer, Chris Eastwood, TCartwright, Bruno Paris, Dr_Michael
and all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
The Rater
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
-
October 16th, 2001, 09:24 AM
#3
Re: SendKeys cannot close DOS window.
this is if you want to close the DOS window after it says Finished.
Right-click on the executable that runs in dos mode in windows explorer and select properties
On the program tab select "Close on exit".
Now it will never keep the window open.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|