# 附上我的code

Posted by 阿千 on August 27, 1999 at 12:45:39:

In Reply to: 又是 SendKeys 的问题 posted by 阿千 on August 26, 1999 at 16:28:57:

: 我sendkeys给photoimpact(一堆hotkey), 但似乎too fast
: 以至于来不及处理. 如何让vb等一会儿再sendkeys呢?
: SendKeys "%o", true
: SendKeys "p", true
: .
: .
: 难道要用for..next loop吗?
Private Sub Command1_Click()
Dim retVal As Double
Dim i As Integer
retVal = Shell("C:\Program Files\PhotoImpact\IEDIT.EXE", vbNormalFocus)
Me.SetFocus
AppActivate retVal, True
SendKeys "^o", True
SendKeys "c:\image\op\p7190027.jpg{ENTER}", True
Me.SetFocus
AppActivate retVal, True' 执行到此没有error,
'-------------------- 可是photoimpact 也
SendKeys "%o", True '没activate,也没下文
SendKeys "p", True
SendKeys "2", True '将图档改成小图
'--------------------
SendKeys "%o", True
SendKeys "d", True
SendKeys "{UP 5}", True
SendKeys "{ENTER}", True
'-----------------------
SendKeys "^s", True
SendKeys "c:\image\op\tinyCard\p7190027", True
SendKeys "%t", True
SendKeys "{DOWN 1}", True
SendKeys "{ENTER}", True
End Sub

Follow Ups: