Rajat
September 14th, 2001, 10:09 AM
Hi,
I am trying launch the IE browser and call a certain asp page and then close the browser after a few seconds. I am successful in launching the browser and calling the asp page. But for some reason, I am not able to close the browser. I must be passing the wrong window handler? Any suggestions?
private Declare Function ShellExecute _
Lib "shell32.dll" Alias "ShellExecuteA" _
(byval hwnd as Long, byval lpOperation _
as string, byval lpFile as string, byval _
lpParameters as string, byval lpDirectory _
as string, byval nShowCmd as Long) as Long
private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, lParam as Any) as Long
private Const WM_CLOSE = &H10
private Sub Form_Load()
Dim r as Long
Dim lngResult as Long
r = ShellExecute(0, "Open", "C:\PROGRA~1\INTERN~1\IEXPLORE.EXE", "http://localhost/members/include/UserReport.asp?schedule=yes", 0, 1)
lngResult = SendMessage(hwnd, WM_CLOSE, 0, 0)
End Sub
Thanks,
Rajat
I am trying launch the IE browser and call a certain asp page and then close the browser after a few seconds. I am successful in launching the browser and calling the asp page. But for some reason, I am not able to close the browser. I must be passing the wrong window handler? Any suggestions?
private Declare Function ShellExecute _
Lib "shell32.dll" Alias "ShellExecuteA" _
(byval hwnd as Long, byval lpOperation _
as string, byval lpFile as string, byval _
lpParameters as string, byval lpDirectory _
as string, byval nShowCmd as Long) as Long
private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (byval hwnd as Long, byval wMsg as Long, byval wParam as Long, lParam as Any) as Long
private Const WM_CLOSE = &H10
private Sub Form_Load()
Dim r as Long
Dim lngResult as Long
r = ShellExecute(0, "Open", "C:\PROGRA~1\INTERN~1\IEXPLORE.EXE", "http://localhost/members/include/UserReport.asp?schedule=yes", 0, 1)
lngResult = SendMessage(hwnd, WM_CLOSE, 0, 0)
End Sub
Thanks,
Rajat