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 |
); |
If the function succeeds, the return value is the handle of a device context for the specified window.
If the function fails, the return value is NULL, indicating an error or an invalid hWnd parameter. To get extended error information, call GetLastError.
GetWindowDC is intended for special painting effects within a window’s nonclient area. Painting in nonclient areas of any window is not recommended.
The GetSystemMetrics function can be used to retrieve the dimensions of various parts of the nonclient area, such as the title bar, menu, and scroll bars.
After painting is complete, the ReleaseDC function must be called to release the device context. Not releasing the window device context has serious effects on painting requested by applications.
BeginPaint, GetDC, GetSystemMetrics, ReleaseDC
file: /Techref/os/win/api/win32/func/src/f42_14.htm, 2KB, , updated: 2000/4/7 11:19, local time: 2024/11/10 03:27,
3.144.23.143:LOG IN ©2024 PLEASE DON'T RIP! THIS SITE CLOSES OCT 28, 2024 SO LONG AND THANKS FOR ALL THE FISH!
|
©2024 These pages are served without commercial sponsorship. (No popup ads, etc...).Bandwidth abuse increases hosting cost forcing sponsorship or shutdown. This server aggressively defends against automated copying for any reason including offline viewing, duplication, etc... Please respect this requirement and DO NOT RIP THIS SITE. Questions? <A HREF="http://linistepper.com/techref/os/win/api/win32/func/src/f42_14.htm"> GetWindowDC</A> |
Did you find what you needed? |