Jump to content
  • Advertisement
Sign in to follow this  
lonewolff

Get parent window of an application

This topic is 1005 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi guys,

Is it possible to retrieve the parent window of a application without knowing the window handle?

The reason I want to do this, is to get the HWND of the parent window to use in a function, without passing it via function parameter and not setting HWND to a global.

Hoping there is something like GetModuleHandle(NULL), which retrieves the HINSTANCE without having to pass around the HINSTANCE from the main function - if you get my drift.

Thanks in advance smile.png

Share this post


Link to post
Share on other sites
Advertisement

A win32 application can have as many top level windows as it wants, there's no requirement for there to be a 'parent' window.  The best you could maybe do is enumerate all top level windows (perhaps something in here might be of help: https://social.msdn.microsoft.com/Forums/en-US/c19a695d-a7d1-42b7-851e-12e98f427b39/can-i-get-all-the-windows-a-process-has?forum=vcgeneral) and filter them by some criteria.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!