Monday 28 November 2011

in C programming

What are the differences among HANDLE, HWND, and HDC?

Under Windows, the symbolic names HANDLE, HWND, and HDC have different meanings, as presented in Table

Symbolic names and their meanings.
-----------------------------------------------------------------------------------------------------
Symbolic Name                                Meaning
-----------------------------------------------------------------------------------------------------
HANDLE                                         Generic symbolic name for a handle
HWND                                             Handle to a window
HDC                                                 Handle to a device context
-----------------------------------------------------------------------------------------------------

It is a Windows standard to make symbolic names uppercase. As FAQ XXI.3 explains, a handle under Windows is simply a numeric reference to an object. Windows keeps track of all objects through the use of handles. Because window objects and device context objects are used quite often under Windows, they have
their own handle identifier names (HWND for window and HDC for device context). Many other standard handle names exist under Windows, such as HBRUSH (handle to a brush), HCURSOR (handle to a cursor), and HICON (handle to an icon).

Cross Reference:

None.

No comments:

Post a Comment