WINAPI, what is a device context and when do i have to release, delete or ignore it?

53 Views Asked by At

I know how to use them for extremely simple tasks like retrieve it by the BeginPaint function and release it with EndPaint once i've done the painting, i'm able to select objects into them, but i want to understand them more. Could you please explain the rules i should follow when i work with them and explain why? For example when i select a brush into a device context, should i delete it? When i retrieve a handle to a device context, does the OS releases it at the end of the program without problems or i should manually do it?

0

There are 0 best solutions below