'Delaration for the getPixel API function
Private Declare Function GetPixel Lib "gdi32" _
(ByVal hdc As Long, ByVal X As Long, ByVal Y As Long) As Long
Dim pixVal As Long
pixVal = GetPixel(Form1.hdc, 100, 100)
The value pixVal gets set to is -1, when it should be some positive number. What are possible problems with this code? It seems like it should certainly work to me.