The return value specifies whether the device context is released. If the device context is released, the return value is 1

My comment:

Once you obtain a device context (retrieved by GetDC, or GetWindowDC functions), you may write to the window. At the end of this process the device context must be released using ReleaseDC. Otherwise you will have a memory leak.

GDI Black Book: remember, use the ReleaseDC function only for a display device context that was retrieved from the GDI device-context cache. After you"re done with the memory device context, you must free it by using the DeleteDC function.

Finally:
- use ReleaseDC for forms (the hwnd used as the first parameter)
- use DeleteDC for memory device contexts (e.g. CreateCompatibleDC function)