Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg, hDesktopDC As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,150,25, %WS_OverlappedWindow To hDlg
Control Add Label, hDlg, 100,"<x,y,color>", 50,0,150,20
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc()
Local pt As PointAPI
Select Case Cb.Msg
Case %WM_InitDialog
Dialog Post Cb.Hndl, %WM_User+500, %Null, %Null
Case %WM_User+500
SetCapture hDlg
hDeskTopDC = GetDC(%Null)
Case %WM_MouseMove
If GetCapture = hDlg Then
GetCursorPos pt
Control Set Text hDlg, 100, Str$(pt.x) + Str$(pt.y) + Str$(GetPixel(hDesktopDC, pt.x,pt.y))
End If
Case %WM_LButtonUp
ReleaseCapture
ReleaseDC(%Null, hDeskTopDC)
End Select
End Function
'gbs_01026
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm