Share via


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