08-21-2009, 10:12 AM
Hi Smita,
would you like to use Windows API in your script?
Try this - Paste the following code into your script or in a library file and call the function 'HandleDialog' where you want to handle the dialog
Let me know if there is any issue
would you like to use Windows API in your script?
Try this - Paste the following code into your script or in a library file and call the function 'HandleDialog' where you want to handle the dialog
Code:
Extern.Declare micHwnd, "FindWindowEx", "user32.dll", "FindWindowExA", micHwnd, micHwnd, micString, micString
Extern.Declare micLong, "PostMessage", "user32.dll", "PostMessageA", micHwnd, micLong, micLong, micLong
Extern.Declare micLong, "GetWindow", "user32.dll", "GetWindow", micLong, micLong
Const BM_CLICK = &HF5
Const WM_SETFOCUS = &H7
Public Function HandleDialog()
pHwnd = extern.FindWindowEx(0,0, vbNullString, "Microsoft Internet Explorer")
'pHwnd = extern.FindWindowEx(0,0, vbNullString, "Message from webpage")
extern.PostMessage pHwnd,WM_SETFOCUS,0,0
If pHwnd > 0 Then
btnHwnd = extern.FindWindowEx(pHwnd,0,"button" ,vbNullString)
extern.PostMessage btnHwnd,WM_SETFOCUS,0,0
wait(5)
extern.PostMessage btnHwnd,BM_CLICK,0,0
End If
End Function
Let me know if there is any issue