Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile EXE
#Dim All
%Unicode=1
#Include "Win32API.inc"
Global hDlg As Dword
%IDC_Label = 500
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Label, hDlg, %IDC_Label, "Click me!", 20,10,120,20, %WS_Border
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Local R As Rect, pt As Point
Select Case Cb.Msg
Case %WM_LButtonDown
GetWindowRect(GetDlgItem(hDlg,%IDC_Label),R)
GetCursorPos(pt)
If PtInRect(R,pt) Then ? "clicked on label"
End Select
End Function
'gbs_01024
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm