Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 413
  • Last Modified:

"Twebbrowser" problem when using "navigate"

Hi

My application uses Twebbrowser to display HTML-files
in an explorerwindow. The application openens a new window for every link. Here is an example:

        flag := navOpenInNewWindow;
        browser.Navigate(link,flag);

This works great... but:

Problem:
When running the application on win2000 or XP the
window is created behind my applicationwindow. In most situations you can´t se that explorer is opened....

Is there any way that I can force the new window on top?

0
Martin_Andersen
Asked:
Martin_Andersen
1 Solution
 
God_AresCommented:
this is a double post...

well basicly, isn't i cauzed because your main window formstyle is set on fsStayOnTop instead on fsNormal?
0
 
Martin_AndersenAuthor Commented:
No..
Mainwindow´s formstyle is: fsNormal

In win98 or winNT the window allways popup in front
of my application but not under win2000.
0
 
God_AresCommented:
strange i'm using w2000 but no problems
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
ginsonicCommented:
listening
0
 
FarderlornCommented:
What about this:

enumerate all ExplorerWindows (class: IEFrame) and put their handles in a stringlist.

then do your code to open the new one

  flag := navOpenInNewWindow;
  browser.Navigate(link,flag);

now enumerate the Windows again and check wich window is NOT in the list. This is your new one. Take the handle and use SetForegroundWindow(handle) to bring it on top of all windows.

...just from the top of my head
 - Farderlorn
0
 
azagCommented:
Have you tried placing an application.processmessages before opening the browser window?

There is a trick with XP in that if menus are running, modal dialogs can sometimes not be brought to the front.

Rob
0
 
pnh73Commented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Accept Answer from Farderlorn

Please leave any comments here within the next seven days.
 
PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!
 
Paul (pnh73)
EE Cleanup Volunteer
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now