Obtaining window handle (hWnd)

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I've got an OCX  I want to be able to use in HTML, but one of the
methods requires the main window handle.  This is not the same as the
handle you get from window.self   Does anyone know how to extract
either the browser handle or a frame handle from withing HTML.  I can
utilize most any scripting language (VBScript, JavaScript, WShell,


Re: Obtaining window handle (hWnd)

Quoted text here. Click to load it

You cannot.

Can't the OCX get it?

Hywel     I do not eat quiche
http://hyweljenkins.co.uk /

Re: Obtaining window handle (hWnd)

On Wed, 15 Oct 2003 18:50:14 +0100, Hywel Jenkins

Quoted text here. Click to load it
I wish it could.

Re: Obtaining window handle (hWnd)

Quoted text here. Click to load it

Since you already are going to require an OCX, why not just make a
Wrapper OCX that creates the instance of the Original OCX, and find the
window handle with that?

Whitecrest Entertainment

Re: Obtaining window handle (hWnd)

<brewman> schreef in bericht
Quoted text here. Click to load it

'Extracting' a handle of a window or anything else is impossible in HTML.
You can how ever read the handles in use in real time using some freeware
there are plenty out there.
Window handles are (mostly) usefull for programmers only, and making use of
such a handle
requires a programming language such as Delphi, Pascal, C, C++, hell even
Visual Basic will do.
but VBScript, Javascript and such scripting languages can not control the
system at such a low-level.
Though you never know on a windows system...   :)

Are you sure your in the right group?

With regards,
SamuŽl van Laere
the Netherlands

Re: Obtaining window handle (hWnd)

Thanks for the help.  You've all basically confirmed what I thought,
but I was hoping someone out there had solved this problem.  

As to whether I am in the right group the answer is yes.  You've
answered the question I had even if it wasn't what I wanted to hear.

Some background on this problem.  I have been tasked to take an
existing product my company already owns and has licensed for use and
try and find a way to use it in a  browser based application.
Unfortunately it is a bit of a square peg/round hole problem and I'm
looking for a shim to make it work.  

As someone has mentioned one option would be to write an OCX wrapper,
but I've run into some issues doing this which are beyond the scope of
this particular forum.  If you know of an applet which will identify
the handle of  the window it's launched from I would greatly
appreciate being pointed in the right direction.


On Thu, 16 Oct 2003 01:31:17 GMT, "SamuŽl van Laere"

Quoted text here. Click to load it

Site Timeline