我需要一次写一行(用户迭代过程)到已经打开的命令提示符。
我想使用VB或VBA。我知道有AppActivate,但是你怎么写它?
命令提示符由另一个程序运行(我无法触摸)。
建议?
答案 0 :(得分:2)
您可以使用Windows API函数AttachConsole
(sample VB code)附加到已打开的控制台窗口。
Private Declare Function AttachConsole Lib "kernel32" (ByVal hConsoleHandle As Long) As Long
然后,您可以使用this sample写入STDOUT。