Visual basic program upon close kills its child program that was started using ShellExecute
Posted on 2003-03-17
I have created a visual basic program that requires me to openup a URL
in a browser. And as soon as the browser is opened, my program should
I have used shellexecute() command for it. This shellexecute is being
invoked in a timer Sub. In order to make sure that the processor has
enough time to complete the shellexecute before it runs rest of the
code and closes the parent program, I have put in wait.
However, for some reason, when my visual basic program closes, IT
KILLS THE BROWSER WINDOW AS WELL!!!!
This is a very critical project for me and request an immediate
response from whosoever can help.
Thanks in advance for your help. Please email me at
P.S. The command used is as follows:
Dim hWndDeskTop As Long
Dim lRetval As Long
hWndDeskTop = GetDesktopWindow()
lRetval = ShellExecute(hWndDeskTop, "Open", gstrSSPath &
"\Homepage.htm", "", vbNullString, vbNormalFocus)