RelaseDC is delcare like this.
VB Code:
Public Declare Function ReleaseDC Lib "user32" (ByVal hwnd As Long, ByVal hdc As Long) As Long
As you can see you need a handle to the window that the device context is to be released. I guess since you use 0 as your handle to get the device context you can use that as your first parameter. I am not positive because anytime I got a device context I always had a window handle, but in your case you don't.
VB Code:
'So you can write you code like this. ReleaseDC 0, hdc





Reply With Quote