Picture1.hdc is returning a different value than GetDC(Picture1.hwnd)
Look at the source code I've provided. This doesn't make any sense! I need help!
Expand|Select|Wrap|Line Numbers
- Option Explicit
- Private Declare Function GetDC Lib "user32" (ByVal hwnd As Long) As Long
- Private Declare Function GetPixel Lib "gdi32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long) As Long
- Private Sub Form_Load()
- Dim lngHDC As Long
- MsgBox "Picture1.hdc value = " & Picture1.hdc
- lngHDC = GetDC(Form1.Picture1.hwnd)
- MsgBox "GetDC value = " & lngHDC
- 'Get the color
- MsgBox GetPixel(lngHDC, 1, 1)
- End Sub