Jump to content
  • Advertisement
Sign in to follow this  
sprotz

How to get window handle from DLL and render to it ?

Recommended Posts

In c++, How to create a DLL that has a function that gets the Main window handle of the program that called it, and then render openGL graphics to that window ?  In Windows, preferably the easiest method ?

Share this post


Link to post
Share on other sites
Advertisement

Not necessarily in a DLL, but in Windows it is easy enough to find a target window's handle. With that handle you could create an OGL rendering context assuming the window is configured correctly.

If you are trying to create an overlay, it is possible to create your own window and set it as a child to the application's window, thn use your own window for the OGL rendering context.

You can do either of those in a DLL as well if you want, but doing so requires the app to load the library or requires some injection that requires security permissions.

Share this post


Link to post
Share on other sites

Any reason you don't have a method that takes a window handle?  Seems like it would be a bit less rude, and also a bit more functional if it could take a window handle instead of assuming it.

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
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!