Opening a window behind an existing

Hi everybody,

i´d like to open a window with an html viewer behind / slightly beside my active window.

I have a main (working) window in which the user enters data, also a customerid. When he did this, i´d like to open a window with the customers website in the background (behind/ beside the active window). Setting my main window as floating window wont help, because in the moment, my user is clicking on that webwindow, it should become the foreground window, clicking again on my working window should let that working window become the first wirndow. So i need a “normal” window behaviour… So my Problem is: any action on my new Window (in this case the html window) forces this to get into foreground snd remains there.

Thanks for any idea…

Christian

Show the other window and then call Self.Show. That should bring the first window back to the foreground.

yeah, thats what I thought, too. But doesnt work

Put the mainwindow.show in the open event of the back window.

not Working…

Maybe its because the embedde htmlviewer in the backwindow and its loading??? I dont think so but its really not to understand. Both windows have nothing special - DocumentWindows…

got it. It IS the loading-process of the htmlviewer. Putting “mainwindow.show” into the DocumentComplete-Event of the htmlviewer evereything works pretty. This is something I can live with. My backwindow is just during the loading process in Front. Even if its not a solution but more a work around. That means - good ideas remain welcome…

Christian

Have you tried to put the mainwindow.show in the Activate event of the back window?
In this case it will be “always” in the back position, what may be it is a problem.

You may want to wait to load the website until the user actually activates by click on the back window to see it. This way your HTMLViewer will not force the window in front during loading time.

@Michel: The website in the background ist just a “helping hand”. My aim is still: loading it in the background so the user knows there is another source of information. Therefore I´d like to show it (in the background)

What system are you working on? On a Mac, you could open the second window as a child window of your main window with the use of MacOSLib. Then you could use:

nsw.AddChildWindow(childwindow.nsi, NSWindow.NSWindowOrderingMode.NSWindowBelow)

with nsw being an instance of your main window and nsi the same for the child window.

Or maybe the windows extension from MacOSLib would be enough, with an orderfrontregardless call to the main window after opening the child.

But that’s both for a Mac only. For Windows or Linux, I have no clue.

Hi Ulrich, thanks for your answer. Opening another window ist not the mail problem to me - keeping it in the background - always, even if there is a loading process - is whats making me crazy.

And yes - I need it for both - Mac and Windows