Kisser Leon

这个kisser不太冷
posts - 100, comments - 102, trackbacks - 0, articles - 0

The difference between GetDC and GetWindowDC

Posted on 2007-04-21 12:54 kk 阅读(988) 评论(0)  编辑 收藏 引用 所属分类: IT

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.


只有注册用户登录后才能发表评论。
【推荐】超50万行VC++源码: 大型组态工控、电力仿真CAD与GIS源码库
网站导航: 博客园   IT新闻   BlogJava   知识库   博问   管理