Date: 02-16-2022
Return to Index
'Compilable Example: (Jose Includes)
created by gbSnippets
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Dim All
%Unicode=1
#Include "CommCtrl.inc"
#Include "Win32API.inc"
Global hDlg, hAbout As Dword
Function PBMain() As Long
Dialog New Pixels, 0, "Test Code",415,300,300,200, %WS_OverlappedWindow To hDlg
Control Add Toolbar, hDlg, 500,"", 0,0,0,0, %TbStyle_Tooltips
Toolbar Add Button hDlg, 500, 0, 200, %TbStyle_Button, "x"
Toolbar Add Button hDlg, 500, 0, 201, %TbStyle_Button, "y
Toolbar Add Button hDlg, 500, 0, 202, %TbStyle_Button, "z"
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
Select Case Cb.Msg
Case %WM_InitDialog
Dialog New Pixels, 0, "About gbSnippets", 125, 125, 300, 200, %WS_SysMenu Or %WS_Caption To hAbout
Control Add Toolbar, hAbout, 501,"", 0,0,0,0, %TbStyle_Tooltips
Toolbar Add Button hAbout, 501, 0, 200, %TbStyle_Button, "x"
Toolbar Add Button hAbout, 501, 0, 201, %TbStyle_Button, "y
Toolbar Add Button hAbout, 501, 0, 202, %TbStyle_Button, "z"
Dialog Show Modeless hAbout Call AboutProc
Case %WM_SetCursor
SetFocus hDlg
Case %WM_Notify
If Cb.NmCode = %TTN_GetDispInfo Then
Local P As TOOLTIPTEXT Ptr
P = Cb.LParam
Select Case Cb.NmId
Case 200 : @P.@lpszText = "x"
Case 201 : @P.@lpszText = "y"
Case 202 : @P.@lpszText = "z"
End Select
End If
End Select
End Function
CallBack Function AboutProc() As Long
Static LostFocus, iCount As Long
Select Case Cb.Msg
Case %WM_SetCursor
SetFocus hAbout
Case %WM_Notify
If Cb.NmCode = %TTN_GetDispInfo Then
Local P As TOOLTIPTEXT Ptr
P = Cb.LParam
Select Case Cb.NmId
Case 200 : @P.@lpszText = "x"
Case 201 : @P.@lpszText = "y"
Case 202 : @P.@lpszText = "z"
End Select
End If
End Select
End Function
'gbs_01042
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm