- ©«¤l
- 23
- ¥DÃD
- 0
- ºëµØ
- 0
- ¿n¤À
- 73
- ÂI¦W
- 287
- §@·~¨t²Î
- XP
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 20
- µù¥U®É¶¡
- 2012-4-21
- ³Ì«áµn¿ý
- 2024-11-15
|
- Option Explicit
- #If Win64 = 1 Then
- Private Declare PtrSafe Function GetWindow Lib "user32" (ByVal HWND As Long, ByVal wCmd As Long) As Long
- Private Declare PtrSafe Function SetForegroundWindow Lib "user32" (ByVal HWND As Long) As Long
- #Else
- Private Declare Function GetWindow Lib "user32" (ByVal HWND As Long, ByVal wCmd As Long) As Long
- Private Declare Function SetForegroundWindow Lib "user32" (ByVal HWND As Long) As Long
- #End If
- Private Const GW_HWNDNEXT = 2
- Private Const GW_CHILD = 5
- Sub ex()
- Dim lHwndChild&
-
- With CreateObject("InternetExplorer.Application")
- .Visible = True
- .Navigate "https://dl.dropboxusercontent.com/u/40393708/test1.htm"
- Do While .Busy Or .ReadyState <> 4
- DoEvents
- If 3 = .ReadyState Then
- lHwndChild = GetWindow(.HWND, GW_CHILD)
- Do While lHwndChild
- SetForegroundWindow .HWND 'HWND is the HWND of the myIEWindow
- Application.SendKeys "~", True
- lHwndChild = GetWindow(lHwndChild, GW_HWNDNEXT)
- Loop
- End If
- Loop
- End With
-
- End Sub
½Æ»s¥N½X ¦^´_ 8# joey0415 |
|