Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- The Guide to Clip-4-Win version 3.0 - <b>getdc()</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GetDC()
Get access to a window for drawing purposes
------------------------------------------------------------------------------

Syntax
GetDC( <hWnd> )   -->   hDC

Arguments
<hWnd> is the handle of the window where drawing is to take
place.

Returns
If successful, this function returns a handle to a device
context for the window's client area (the part an application
can draw on).  This handle will be a non-zero numeric.
Otherwise, zero (0) is returned.

Description
Drawing in Windows is done using GDI (graphics device
interface) functions, which require a handle to a device
context.  This function returns a suitable handle for drawing
on the display.  For printing, see the CreateDC() and
GetPrintDC() functions.

Example
// Draw a frame
hDC = GetDC( hWnd )
FrameRect( hDC, 100, 100, 200, 200, hBlueBrush )
ReleaseDC( hWnd, hDC )


See Also: CreateDC() DeleteDC() GetPrintDC() ReleaseDC()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson