Link to home
Start Free TrialLog in
Avatar of krypto2000
krypto2000

asked on

Send key sequence to ms-dos prompt

Hello,

I want to send a key-sequence, "abcdef" for example, to the dos command prompt with the sendMessage function.
I can get the handle, no problem, but after i didn't know what is the WM_COMMAND to send text.
I've tried with WM_SETTEXT but that change the caption of the console...

That's all ;-)

Ā 
Avatar of Ivanov_G
Ivanov_G
Flag of Bulgaria image

WM_KEYDOWN maybe...
Avatar of kretzschmar
would be my guess too

WM_KEYDOWN and WM_KEYUP combination
Avatar of geobul
geobul

SendMessage(handle, WM_CHAR, $41, 0); // sends 'A' to a command prompt window (handle)
A more readable version is:
SendMessage(h, WM_CHAR, Ord('A'), 0);
good point, geo ;-)
ASKER CERTIFIED SOLUTION
Avatar of geobul
geobul

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks meikl. Lots of attempts for automating third-party softwares administration/supervision tasks recently seem to have an effect ;-)
Avatar of krypto2000

ASKER

that's not realy hard but i have time not so much ;-)
thank you very much, the points is for you geobul !!