Jump to content

Getting a HWND handle on browser controls?

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
8 replies to this topic

#1
bhpianist

bhpianist

    Newbie

  • Members
  • Pip
  • 3 posts
As you know, all child windows/controls (ie. edit boxes, buttons, etc.) are windows, therefore you can get a HWND handle on them.

What about browser controls? I used Window Hack as well as calling EnumChildWindows() myself, apparently the screen that displays the web page is just one big window. What about all the controls inside? (ie. buttons, text boxes, text areas, radio controls, etc.) Are they windows as well?

I pretty much need to get a handle on a browser control in any browser, whether it be Internet Explorer, Mozilla Firefox, Google Chrome, etc. Any ideas?

#2
WingedPanther

WingedPanther

    A spammer's worst nightmare

  • Moderators
  • 16,831 posts
Different browsers are going to implement these in different ways. I would check out the Firefox GUI library to see how it handles everything.

Note: you are assuming a Windows environment/methodology.
Programming is a branch of mathematics.
My CodeCall Blog | My Personal Blog

#3
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,715 posts
I think you need to call EnumChildWindows() on that big window as well, as I would think it's just a container. So you'll have to call it twice--once to get the container, and a second time to get the children inside the container.
sudo rm -rf /

#4
shill

shill

    Newbie

  • Members
  • PipPip
  • 13 posts
If you look at the source code for Firefox, under the widgets/src/windows directory, you'll see that no controls are created using any variant of Win32 CreateWindow. I suspect these controls are being drawn and handled with a custom library which means they won't have hWnds. I'll have to look at the code further.

However, I did find that Firefox is compatible with something called the "Microsoft Active Accessibility API", but I can't post the link since I don't have enough posts yet. Search for "firefox accessibility api" on Google.

Quote

MSAA is designed to help Assistive Technology (AT) products interact with standard and custom user interface (UI) elements of an application (or the operating system), as well as to access, identify, and manipulate an application's UI elements.


#5
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,715 posts
Intriguing...if anyone finds out more on this, please post it here.
sudo rm -rf /

#6
carly

carly

    Learning Programmer

  • Members
  • PipPipPip
  • 34 posts

dargueta said:

I think you need to call EnumChildWindows() .

No, these are not windows at all.
You must use COM or ACC
For example, it's very classic to get them from IE with Win32 COM
(see on group news://nntp.aioe.org/comp.os.ms-windows.programmer.win32 for C++ code)

#7
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,715 posts
Nice. *bookmark*

EDIT: Which one's the article? I'm not digging through 297 messages to find it. :)
sudo rm -rf /

#8
sonika

sonika

    Newbie

  • Members
  • Pip
  • 1 posts
hi
Even i am looking for the answer of the same question .

What about browser controls?(buttons, text boxes, text areas, radio controls, etc.) How are they getting drawn in google chrome browser? Are they windows?

Do you have any update on this???

Any help will be highly appreciated.

Sonika

#9
dargueta

dargueta

    Writes binary right handed and hex left handed

  • Moderators
  • 4,715 posts
Google Chrome runs on several operating systems, so it depends on which one you're talking about.
sudo rm -rf /