Jump to content
  • Advertisement
Sign in to follow this  
EVE

HINSTANCE -> HWND

This topic is 2628 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

Hello.

Has loaded its own DLL into another process, so I have a variable: HINSTANCE.

I need to get the HWND (Window Handle).

How can I get it, knowing HINSTANCE?

Thank you and best regards.

Share this post


Link to post
Share on other sites
Advertisement
There's no direct relationship between one and the other. A given HINSTANCE can use multiple HWNDs and the API has no way of knowing which one you intend. The best way is to write a getter function that returns the HWND you want.

Share this post


Link to post
Share on other sites
Our EnumWindows. This StackOverflow answer is probably as close as you can get to an answer. As mhagain said, there is not a 1 to 1 relationship.

http://stackoverflow.com/questions/3269390/how-to-get-hwnd-of-window-opened-by-shellexecuteex-hprocess/3269432#3269432

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!