postmessage快捷键问题。 ( 积分: 100 )

  • 主题发起人 主题发起人 youdu
  • 开始时间 开始时间
Y

youdu

Unregistered / Unconfirmed
GUEST, unregistred user!
我已经看过刘麻子的贴了,<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2753402<br><br>但是我向“我的电脑”(explorer.exe)发送VK_LEFT键(后退)却不成功,要是发送ORD('A')却可以!以下是我用的两段代码~<br>1。-----------------------------<br>var<br> &nbsp;hCabinetWClass : THandle;<br>begin<br>hCabinetWClass := FindWindow('CabinetWClass', nil);<br> PostMessage(hCabinetWClass, WM_KEYDOWN, VK_MENU , $002A0001);<br> &nbsp;PostMessage(hCabinetWClass, WM_KEYDOWN, VK_LEFT, &nbsp;$001E0001);<br> &nbsp;PostMessage(hCabinetWClass, WM_KEYUP, VK_LEFT, &nbsp;$C01E0001 );<br> &nbsp;PostMessage(hCabinetWClass, WM_KEYUP, VK_MENU, $C02A0001 );<br>2。---------------------------------------<br>var<br> &nbsp;hCabinetWClass : THandle;<br>begin<br>hCabinetWClass := FindWindow('CabinetWClass', nil);<br> PostMessage(hCabinetWClass, WM_SYSKEYDOWN, VK_LEFT,$201E0001);<br> &nbsp;PostMessage(hCabinetWClass, WM_SYSKEYUP, VK_LEFT, $C01E0001);<br><br>另外lParam参数要怎么写?VK_LEFT,VK_RIGHT的lParam是什么?<br>望指教,谢谢~
 
我已经看过刘麻子的贴了,<br>http://www.delphibbs.com/delphibbs/dispq.asp?lid=2753402<br><br>但是我向“我的电脑”(explorer.exe)发送VK_LEFT键(后退)却不成功,要是发送ORD('A')却可以!以下是我用的两段代码~<br>1。-----------------------------<br>var<br> &nbsp;hCabinetWClass : THandle;<br>begin<br>hCabinetWClass := FindWindow('CabinetWClass', nil);<br> PostMessage(hCabinetWClass, WM_KEYDOWN, VK_MENU , $002A0001);<br> &nbsp;PostMessage(hCabinetWClass, WM_KEYDOWN, VK_LEFT, &nbsp;$001E0001);<br> &nbsp;PostMessage(hCabinetWClass, WM_KEYUP, VK_LEFT, &nbsp;$C01E0001 );<br> &nbsp;PostMessage(hCabinetWClass, WM_KEYUP, VK_MENU, $C02A0001 );<br>2。---------------------------------------<br>var<br> &nbsp;hCabinetWClass : THandle;<br>begin<br>hCabinetWClass := FindWindow('CabinetWClass', nil);<br> PostMessage(hCabinetWClass, WM_SYSKEYDOWN, VK_LEFT,$201E0001);<br> &nbsp;PostMessage(hCabinetWClass, WM_SYSKEYUP, VK_LEFT, $C01E0001);<br><br>另外lParam参数要怎么写?VK_LEFT,VK_RIGHT的lParam是什么?<br>望指教,谢谢~
 
创建一个全局的IE的OLE对象<br>IEApp:=CreateOLEObject('InternetExplorer.Application') as IWebBrowser2;<br>IEApp.Visible:=True;<br><br>后退<br>IEApp.GoBack;<br><br>前进:<br>IEApp.GoForward;<br><br>停止:<br>IEApp.Stop;
 
问题已改,而且之前楼上也答得不对~
 
首先按左銉就不是向后退,在菜单区按左右銉都是没用的!
 
后退
顶部