Solved

"Twebbrowser" problem when using "navigate"

Posted on 2002-04-15
7
403 Views
Last Modified: 2010-04-04
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
Comment
Question by:Martin_Andersen
7 Comments
 
LVL 7

Expert Comment

by:God_Ares
ID: 6942308
this is a double post...

well basicly, isn't i cauzed because your main window formstyle is set on fsStayOnTop instead on fsNormal?
0
 

Author Comment

by:Martin_Andersen
ID: 6942325
No..
Mainwindow´s formstyle is: fsNormal

In win98 or winNT the window allways popup in front
of my application but not under win2000.
0
 
LVL 7

Expert Comment

by:God_Ares
ID: 6942356
strange i'm using w2000 but no problems
0
Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

 
LVL 9

Expert Comment

by:ginsonic
ID: 6942441
listening
0
 

Accepted Solution

by:
Farderlorn earned 150 total points
ID: 7026881
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
 

Expert Comment

by:azag
ID: 8548702
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
 
LVL 1

Expert Comment

by:pnh73
ID: 9003268
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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now