共用方式為


CWindow::GetWindowDC

擷取整個視窗的裝置內容。

HDC GetWindowDC() throw();

備註

請參閱在 Windows SDK的 GetWindowDC

範例

//The following example attaches an HWND to the CWindow object and 
//calls CWindow::GetWindowDC() to retrieve the DC of the entire window

CWindow myWindow;
myWindow.Attach(hWnd);
HDC hDC = myWindow.GetWindowDC();

需求

Header: atlwin.h

請參閱

參考

CWindow 類別

CWindow::GetDC

CWindow::GetDCEx

CWindow::ReleaseDC