CWindow::ReleaseDC

释放设备上下文。

int ReleaseDC(
   HDC hDC 
);

备注

在参见 Windows SDK的 ReleaseDC

示例

// The following example attaches a HWND to the CWindow object,
// calls CWindow::GetDC to retrieve the DC of the client
// area of the window wrapped by CWindow Object, and calls
// CWindow::ReleaseDC to release the DC. 

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

// Use the DC

myWindow.ReleaseDC(hDC);
hDC = NULL;

要求

Header: atlwin.h

请参见

参考

CWindow选件类

CWindow::GetDC

CWindow::GetDCEx

CWindow::GetWindowDC