Re: How to bring ActiveX to top?
- From: tony@xxxxxxxxxxxxxxxxxxx (Tony Mountifield)
- Date: Fri, 16 Dec 2005 17:24:15 +0000 (UTC)
In article <439fd714.426397275@xxxxxxxxxxxxxxxxxxxx>,
J French <erewhon@xxxxxxxxxx> wrote:
> On Tue, 13 Dec 2005 18:00:12 +0000 (UTC), tony@xxxxxxxxxxxxxxxxxxx
> (Tony Mountifield) wrote:
>
> >I have an application that runs as an ActiveX control within a browser
> >window.
> >
> >It's possible that the user will have opened other windows on top of the
> >window in question, or perhaps minimised it. At a certain point in the
> >program I need to bring the browser window containing the control to the
> >top, in order to get the user's attention. How can I do this?
> >
> >I've tried both Show and SetWindowPos on the ActiveForm with HWND_TOP or
> >HWND_TOPMOST, but it doesn't work - I suspect it's only affecting the
> >control within the context of the broswer, and that I actually need to
> >tell the browser itself to be on top.
> >
> >Any ideas would be gratefully received!
>
> You need to find the Parent Window of the AX control
> - well the HWND of the Form that it is on
> - that may be a bit tricky - you may need to resort to FindWindow
Actually, I discovered that if I work my way up the handles using GetParent(),
I arrive at the browser handle which has a parent of 0.
Using the browser handle works, once I found the right thing to do with it.
> Also under XP a non active window is not supposed to force itself to
> the top, but someone has found a sneaky trick for getting round that.
>
> { Force Window to front
> Credit to: Karl E. Peterson }
> Function ForceForegroundWindow( Const hWnd :DWORD):Boolean;
Thanks for that. It didn't work quite as I wanted, but searchin Google
based on it led me to http://www.swissdelphicenter.ch/torry/showcode.php?id=261
and I found that a combination of "way 2" and "way 3" worked very well
when given the broswer handle I mentioned above.
Cheers
Tony
--
Tony Mountifield
Work: tony@xxxxxxxxxxxxx - http://www.softins.co.uk
Play: tony@xxxxxxxxxxxxxxx - http://tony.mountifield.org
.
- References:
- How to bring ActiveX to top?
- From: Tony Mountifield
- Re: How to bring ActiveX to top?
- From: J French
- How to bring ActiveX to top?
- Prev by Date: Re: Change mainmenu
- Next by Date: International characters
- Previous by thread: Re: How to bring ActiveX to top?
- Next by thread: How to clone a record?
- Index(es):
Relevant Pages
|