Date: 02-16-2022
Return to Index
created by gbSnippets
'Compilable Example: (Jose Includes)
#Compile Exe
#Dim All
%Unicode=1
#Include "Win32API.inc"
%IDC_LineA = 500 : %IDC_LineB = 501 : %IDC_LineC = 502
Global hDlg,hDC,hBrush as Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",300,300,200,200, %WS_OverlappedWindow To hDlg
Control Add Line, hDlg, %IDC_LineA,"", 50,10,100,20, %SS_Notify
Control Add Line, hDlg, %IDC_LineB,"", 50,40,100,20
Control Add Line, hDlg, %IDC_LineC,"", 50,70,100,20, %SS_Notify
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_CtlColorStatic 'wParam is hDC lParam is hControl
Select Case GetDlgCtrlID(Cb.lParam)
Case %IDC_LineA
Function = GetStockObject(%White_Brush) 'has SS_Notify
Case %IDC_LineB
Function = GetStockObject(%White_Brush) 'does NOT has SS_Notify
Case %IDC_LineC
hBrush = CreateSolidBrush(%RGB_DarkRed) 'has SS_Notify
Function = hBrush
End Select
Case %WM_Destroy
DeleteObject hBrush
End Select
End Function
'gbs_01153
'Date: 03-14-2012
http://www.garybeene.com/sw/gbsnippets.htm