Obtaining window handle (hWnd)

B

brewman

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,
etc)

Thanks,
bk
 
H

Hywel Jenkins

brewman <> said:
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.

You cannot.
I can
utilize most any scripting language (VBScript, JavaScript, WShell,
etc)

Can't the OCX get it?
 
W

Whitecrest

[QUOTE="brewman said:
Can't the OCX get it?
I wish it could.[/QUOTE]

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?
 
S

Samuël van Laere

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,
etc)

Thanks,
bk

'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
utilitie,
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?
 
B

brewman

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.

thanks
BK
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top