Function GetIE_Hand(DestString:String);<br>var<br> HWND_IE: HWnd; // 窗口句柄<br> WinText: array [0..255] of char;<br>begin<br> HWND_IE := GetWindow(HWND_IE, GW_HWNDFIRST);<br> // 获取第一个窗口的句柄<br> while HWND_IE <> 0 do<br> begin<br> // 获取窗口的名称<br> if GetWindowText(HWND_IE, @WinText, 255)>0 then<br> if ( WinText=DestString) then<br> begin<br> PostMessage (hWND_IE, WM_COMMAND, $A121, 0) //后退<br> PostMessage (hWND_IE, WM_COMMAND, $A122, 0) //前进<br> end; <br> // 获取下一个窗口的句柄<br> HWND_IE:=GetWindow(HWND_IE, GW_HWNDNEXT);<br> end;<br>end;<br>