The difference between GetDC and GetWindowDC

来源:互联网 发布:生死时速打字游戏mac 编辑:程序博客网 时间:2024/04/28 08:16
GetDC
The GetDC function retrieves a handle of a display device context (DC) for the client area of the specified window. The display device context can be used in subsequent GDI functions to draw in the client area of the window.
This function retrieves a common, class, or private device context depending on the class style specified for the specified window. For common device contexts, GetDC assigns default attributes to the device context each time it is retrieved. For class and private device contexts, GetDC leaves the previously assigned attributes unchanged.
HDC GetDC(
    HWND hWnd                 // handle of window 
   );         
Parameters
hWnd
Identifies the window whose device context is to be retrieved.
 
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 
   );         
Parameters
hWnd
Identifies the window with a device context that is to be retrieved.
 
原创粉丝点击