I want to be able to send keys and text to a dos-window without doing a focus, but i have some difficulties doing that.
For example. I open an old dos-programm 'norton commander' in a dos-box like this:
When i want to send the 'dir' command to the dos-window *with* focus using the following code it works fine:
Code: Select all
SetFocus>D:\NC\NC.EXE
Send>dir
press enter
But when i want to send the 'dir' command *without* focus by using the following code:
Code: Select all
GetWindowHandle>D:\NC\NC.EXE,hWndParent
ObjectSendKeys>hWndParent,{"dir"},VK13
And when i run the same code again i see D:\ on the right top of the screen above. So it looks like it only accepts 'enter' (VK13)
I also tried ObjectSendText:
Code: Select all
GetWindowHandle>D:\NC\NC.EXE,hWndParent
ObjectSendText>hWndParent,{"dir"}
ObjectSendKeys>hWndParent,VK13
When i just open a dosbox (run-->cmd.exe) then
"ObjectSendKeys>hWndParent,{"dir"},VK13" works fine.
When i use the tool "view system windows" and searchfor 'NC' i get results for CabinetWClass and ConsoleWindowClas.
I hope someone can explain how to get the dir listing on the left of the window *without* using 'setfocus'
Thanks and best regards,
wil