hello, I am having problems with the releaseDC function in my application.

According to microsoft:

Remarks

The application must call the ReleaseDC function for each call to the GetWindowDC function and for each call to the GetDC function that retrieves a common DC.
and in each sub I use it as follows:

VB Code:
  1. public sub whatever()
  2.  Dim hWndDesk As Long
  3.  Dim hDCDesk As Long
  4.   hWndDesk = GetDesktopWindow()
  5.   hDCDesk = GetWindowDC(hWndDesk)
  6.  
  7.  ' do whatever in the sub
  8.  
  9.   'right before the sub ends i release the DC that i got at the beginning of it
  10.  Call ReleaseDC(hWndDesk, hDCDesk)
  11. end sub

But that doesnt seem to work, i still get a memory leak. In the sub of the app. that im having my issue in, the only thing i do using the DC is use the getpixel function. So, does that mean everytime i use the getpixel function i should use the releasedc function after it? Thanks