Monday, November 10, 2014

Difference between a GetDC() and GetWindowDC()



GetDC: The GetDC() function retrieves a handle to a display device context for the client area of a specified window or for the entire screen. You can use the returned handle in subsequent GDI functions to draw in the device context.
HDC GetDC(
  HWND hWnd   // handle to a window
);

GetWindowDC: The GetWindowDC() function retrieves the device context (DC) for the entire window, including title bar, menus, and scroll bars. A window device context permits painting anywhere in a window, because the origin of the device context is the upper-left corner of the window instead of the client area. GetWindowDC assigns default attributes to the window device context each time it retrieves the device context. Previous attributes are lost.
 
HDC GetWindowDC(
  HWND hWnd   // handle of window
);

String Table

A string table is a Windows resource that contains a list of IDs, values, and captions for all the strings of your application. For exa...