Dobrý den, poradí mi někdo s potvrzením vyskakovací okna? ZDE: http://imageshack.com/a/img841/7452/o58h... Potřeboval bych potvrdit "Opustit tuto stránku".
<DllImport("user32.dll", CharSet:=CharSet.Auto, EntryPoint:="FindWindow")> _
Private Shared Function FindWindow(ByVal lpClassName As String, ByVal lpWindowName As String) As IntPtr
End Function
<DllImport("user32.dll", SetLastError:=True, CharSet:=CharSet.Auto)> _
Private Shared Function FindWindowEx(ByVal parentHandle As IntPtr, ByVal childAfter As IntPtr, ByVal lclassName As String, ByVal windowTitle As String) As IntPtr
End Function
<DllImport("user32.dll", EntryPoint:="SendMessage")> _
Private Shared Function SendMessage(hwnd As IntPtr, wMsg As Integer, wParam As Integer, lParam As Integer) As IntPtr
End Function
Private Const BM_CLICK As Integer = &HF5
Private Const WM_ACTIVATE As Integer = &H6
Private Const WA_ACTIVE As Integer = 1
Dim hwnd = FindWindow("#32770", "Windows Internet Explorer")
If hwnd <> IntPtr.Zero Then ' dialog window found
Dim btn = FindWindowEx(hwnd, IntPtr.Zero, "Button", "Opustit tuto stránku")
If btn <> IntPtr.Zero Then ' button found
SendMessage(btn, WM_ACTIVATE, WA_ACTIVE, 0)
SendMessage(btn, BM_CLICK, 0, 0)
Else
MsgBox("Button not found!")
End If
Else
MsgBox("Window not found!")
End If
Ale text tlačitka to nepobírá. Děkuji předem za radu.
|