Joe WB
2011-09-17 18:36:30 UTC
Thank You
Question:
Is there c++ code that can do what this vbs script does ....pls cite online resource?
which is open notepad and type some text -like can i just write a simple c++ program that could open a windows program and type text into it without the c++ program having a user interface of its own and can that c++ program activate itself when i press a hotkey because of code i incorporated into the program...pls don't tell me to get hotkey software...i'd like to learn to do it my self with c++...here is the vbs script code:Option Explicit
Dim wshShell
Dim intCount
'Open notepad
Set wshShell= CreateObject("WScript.Shell")
wshShell.Run "notepad"
'Wait a second before we do anything
WScript.sleep 1000
intCount=0
'Send the keys to notepad application
Do While intCount <= 10
wshShell.SendKeys "Line No: "
wshShell.SendKeys intCount
wshShell.SendKeys "{ENTER}"
intCount = intCount + 1
Loop
'Quit
WScript.Quit
Answer:
Yes you could write a c++ program to do that.
Yes it can be activated by a hot key but only if you write it as a windows service or some other terminate and stay resident (TSR) type application.