Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Compiler PBWin 10
#Dim All
#Include "win32api.inc"
#Resource Bitmap test, "cowgirl.bmp"
Function PBMain () As Long
Local hDlg As Dword
Dialog New Pixels, %HWND_Desktop, "Flat Image Button", , , 300, 200, %WS_Popup Or %WS_SysMenu Or %WS_Caption To hDlg
Dialog Set Color hDlg, -1, %rgb_Black
Control Add Image, hDlg, 101, "test", 10, 10, 70, 30
Dialog Show Modal hDlg, Call WndProc
End Function
CallBack Function WndProc
Local pt As Point
Select Case Long Cb.Msg
Case %WM_LButtonUp
pt.x = : pt.y = Hi(Integer,Cb.LParam)
If ChildWindowFromPoint(Cb.Hndl,pt) = GetDlgItem(Cb.Hndl,101) Then Control Set Loc Cb.Hndl, 101, 10,10
Case %WM_LButtonDown
pt.x = Lo(Integer,Cb.LParam) : pt.y = Hi(Integer,Cb.LParam)
If ChildWindowFromPoint(Cb.Hndl,pt) = GetDlgItem(Cb.Hndl,101) Then Control Set Loc Cb.Hndl, 101, 11,11
End Select
End Function
'gbs_01225
'Date: 05-11-2013
http://www.garybeene.com/sw/gbsnippets.htm