📄 15987.html
字号:
<html>
<head>
<title>其实很麻烦</title>
</head>
<body bgcolor="#FFFFFF" vlink="#808080">
<center>
<h1>其实很麻烦</h1>
</center>
<hr size=7 width=75%>
<hr size=7 width=75%><p>
Posted by <a href="mailto:cww5@mail.ncku.edu.tw">cww</a> on July 22, 1999 at 13:33:36:<p>
In Reply to: <a href="15978.html">Re: 很困难的问题! 如何输出文字到其他程式</a> posted by 龙幻 on July 22, 1999 at 11:41:03:<p>
part21的例子先按command2 后再按command1便可以知道<br>不过,如果程式不是我们呼叫起来的,我们还得<br>用FindWindow等API来找该程式的hWnd,再用SetWindowPos<br>或ShowWindow等API把Active Window设为该程式(或者可以<br>用AppActivate "Title名称" 来Activate Window,但这<br>样做,需取得Window的Caption,那可得用GetWindowText<br>的API)。如果是我们用Shell叫起来的程式,在Sendkeys<br>前也要确定该程式已确定叫起来了,否则Sendkeys就会<br>太早做,而没有在该程式送出字串。那时得用Part2的方式<br>Part1<p>private pid As Double<br>Private Sub Command1_Click()<br>AppActivate pid<br>SendKeys "haha"<br>End Sub<p>Private Sub Command2_Click()<br>pid = Shell("NotePad", vbNormalFocus)<br>End Sub<p>part2<p>Dim i As Integer<br>pid = Shell("C:\Program Files\Microsoft Office\Office\Word.EXE", vbNormalFocus)<br>Do While hProcess = 0 '等Word完全执行起来<br> hProcess = OpenProcess(PROCESS_QUERY_INFORMATION, 0, pid)<br> DoEvents<br>Loop<br>SendKeys "haha"<br>
<br>
<br><hr size=7 width=75%><p>
<a name="followups">Follow Ups:</a><br>
<ul><!--insert: 15987-->
<!--top: 16004--><li><a href="16004.html">对不起,还有一个问题</a> <b>龙幻</b> <i>16:07:14 7/22/99</i>
(<!--responses: 16004-->0)
<ul><!--insert: 16004-->
</ul><!--end: 16004-->
<!--top: 16003--><li><a href="16003.html">对不起,还有一个问题</a> <b>龙幻</b> <i>16:07:10 7/22/99</i>
(<!--responses: 16003-->1)
<ul><!--insert: 16003-->
<!--top: 16023--><li><a href="16023.html">不会吧</a> <b>cww</b> <i>08:13:22 7/23/99</i>
(<!--responses: 16023-->0)
<ul><!--insert: 16023-->
</ul><!--end: 16023-->
</ul><!--end: 16003-->
</ul><!--end: 15987-->
<br><hr size=7 width=75%><p>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -