Can I do this with a Window Handle?

Started by
1 comment, last by DividedByZero 10 years, 3 months ago

Hi Guys,

I am currently using a very restrictive API for my game, where I am making a DLL to (hopefully) expand upon it.

All I can really interface with my DLL is the handle to the window, Doubles, or Strings (this is by design for the API in use).

I can successfully write DLL's to do calculations, add XBOX controller support etc, but now I want to take it's graphics feature set a step further.

Having the Window Handle, it there any way I can use this window to display my own content such as Bitmaps or AVI files? Or is the HWND not enough for this sort of task.

I have no access to the API's Callback or anything like that. Only really the HWND.

Any advice on this would be awesome smile.png

Advertisement

The answer is maybe. You can use an HWND as an argument to GetDC() which will give you a device context to the client area of the window, which can be used to render to the client area. However, not every HWND has a client area, and even if there is a client area that doesn't mean that the window won't immediately wipe whatever you drew and draw something else over it as part of its rendering process.

Awesome, thanks man! I'll give that a try.

But Yes, I understand from your explanation that I may still not achieve what I want to do. But thanks :)

This topic is closed to new replies.

Advertisement