0
votes

This is a teaching a man how to fish, rather than giving him a fish question. (Meaning, yes this question is technically about HDC's, but it's more about how I can learn about HDC's, rather than a specific question about them.) Finally being dragged screaming and kicking into some windows programming, after lots of unix experience.

Is there a way I can see everything I can do with a Windows HDC object? (Handle to device context, for graphics) On a website or in Visual Studio 2013? Other than manually looking through windef.h, WinUser.h, and who knows what else.

If HDC's were object oriented classes, I could type "HDC." in VS and see what member functions come up. But Windows GDI is old school functions with object orientation through parameters, so there's CreateCompatibleDC(HDC), GetClientRect(HDC, &ref), SelectObject(HDC, ...), etc.

If I was instead working with the standard c++ library, and interested in vectors, I could go here: http://www.cplusplus.com/reference/vector/vector/ I haven't found a similar MSDN site for HDC's or other windows objects.

I know I can go the reverse way -- saying I want to do operation X, and look up how to do it... But I'm looking to know how I can find operations I don't even know exist.

1
I would either find a book on the version of the SDK you are working with, or try searching the Microsoft Developer Network web site, e.g. with: social.msdn.microsoft.com/Search/en-US?query=windows gdi hdc - Dronz
Start with msdn. GDI is listed way down at the bottom, under "Deprecated or legacy APIs". - user3386109
There is nothing "object oriented" in the windows API. An HDC is a handle (sort of like an opaque pointer) to a Device Context. - crashmstr
@crashmstr - GDI+ doesn't come to mind? - enhzflep

1 Answers

1
votes

Google, or any other halfway decent search engine (I do NOT include the msdn integrated search in that category), is quite effective at locating the corresponding documentation.

Once there, you'll notice that the immediate list is related to creating and destruction of device contexts, not all operations that use them, but it also takes you into the Windows GDI section of the docs where by simply going up two levels in the help tree (left side of page) you'll find such additional categories as "Region Functions" or "Painting and Drawing Functions".

Besides the function reference documentation, each section within MSDN comes with a "Using Technology Name" section that provides high-level information and example code.