Here's my problem:

I need to see whether IE is running first off. I use Get window to do this with "Microsoft Internet Explorer" as the caption.

Ok,

I basically have a Main IE window whose handle I get using Findwindow. Now I need to load URLs in this window only. If another IE window popups up it should be closed and URLs continue to be loaded in the main window.

If the main window happens to close it should start a fresh IE and use the handle of the new window as the new main browser window.

Here are all the problems:
I use the code in a timer (every 1 second).
Now if the main window closes and the new IE is ran, I immediately search for the IE window, but it doesn't always find it. Because of this it will load another and another.

The main problem is that I launch the program, I see it in the taskbar and then I immediately search for window handle using Findwindow and it can't find it.

By the way, I find the windows handle using a procedure with Findwindow and Findnext window since I need to search for "Microsoft Internet ...." in only a portion of the code. If I step through the code it works fine, but when I let it run it doesn't. The only thing I can think of is that the program does not wait for the "shell" command to execute since I check the windows right after this.

Please I need some help.
What am I doing wrong?
Is there some sort of API function to refresh all the windows in the list or something?

I'm kinda a beginer to API to some code would be nice.

ThanX in advance

[Edited by HardCopy on 05-04-2000 at 04:59 AM]

[Edited by HardCopy on 05-04-2000 at 06:09 AM]