【发布时间】:2014-01-09 23:59:47
【问题描述】:
所以我正在开发一个程序,该程序可以键入一个没有 api 的开放应用程序。所以我需要选择那个窗口,这样我的程序就会在里面输入。我正在使用此代码,但找不到该过程。
Dim windowHandle As IntPtr = FindWindow("LolClient", "League of Legends (TM) Client")
Private Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As IntPtr
SetForegroundWindow(windowHandle)
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait("{TAB}")
SendKeys.SendWait(ComboBox1.Text)
SendKeys.SendWait("{Enter}")
【问题讨论】:
-
您应该尝试查看 Process Class,在许多情况下它更容易使用。