Search code examples
winapimfcui-automation

How To Get Window handles In Mozilla Firefox


How to get handles of all the child windows in Mozilla firefox. Spy++ is showing only one class and window caption for all the windows. I tried using GetWindow and FindWindowEx but got nothing. I want to read URL from mozilla firefox.


Solution

  • Spy++ uses standard Windows API calls to inspect window hierarchies (EnumWindows, EnumChildWindows, etc.). If Spy++ doesn't show any native windows, then there aren't any native windows. Consequently, you cannot find any native windows either. Firefox uses what's called Windowless Controls.

    If you need to automate a GUI (which is likely the reason why you wish to find native windows), use the standard infrastructure available: UI Automation.