|
なんとか自己解決できました。 「[ctrl][G]とキーストロークを合成して別アプリケーションに送信」 次のコードになりました。
---------------------------- Option Explicit
Private Declare Sub keybd_event Lib "user32" (ByVal bVk As Byte, _ ByVal bScan As Byte, _ ByVal dwFlags As Long, _ ByVal dwExtraInfo As Long) Private Const KEYEVENTF_KEYUP = &H2 Private Const KEYEVENTF_KEYCTRL = &HA2
Private Sub Command1_Click() 'Wait 5 secs Timer1.Interval = 5000 Timer1.Enabled = True Me.Visible = False End Sub
Private Sub Timer1_Timer() Timer1.Enabled = False Timer1.Interval = 0 Call keybd_event(KEYEVENTF_KEYCTRL, 0, 0, 0) Call keybd_event(Asc("G"), 0, 0, 0) Call keybd_event(Asc("G"), 0, KEYEVENTF_KEYUP, 0) Call keybd_event(KEYEVENTF_KEYCTRL, 0, KEYEVENTF_KEYUP, 0) Me.Visible = True Call MsgBox("Ctrl-G Sent") End Sub
|