Date: 02-16-2022
Return to Index
created by gbSnippets
'%WM_NOTIFY
'These CB values are only valid when a %WM_Notify message is received
CB.Nmcode 'returns the specific notification message of the event which occurred.
CB.Nmhdr 'returns the address (a ) to the Nmhdr UDT, defined below.
CB.Nmhdr$ 'returns the contents of the Nmhdr UDT as a dynamic string.
CB.Nmhwnd 'returns the handle of the control which sent this message.
CB.NmID 'returns the Id number assigned to this Control.
'NMHDR Type declaration
Type Nmhdr hwndFrom as DWord
hWndFrom As DWord 'Handle of the control sending the message idfrom as Dword
IDFrom As DWord ' Identifier of the control sending the message code as Long
Code As Long ' Notification code
End Type
'The following list of notification messages require an extended version of the NM structure.
'However, all NM structures begin with an Nmhdr UDT, so the pointer returned here is always accurate.
%NM_CLICK NMMOUSE
%NM_RCLICK NMMOUSE
%NM_NCHITTEST NMMOUSE
%NM_KEYDOWN NMKEY
%NM_SETCURSOR NMMOUSE
%NM_CHAR NMCHAR
%NM_TOOLTIPSCREATED NMTOOLTIPSCREATE
'Compilable Example: (Jose Includes)
#Compiler PBWin 9, PBWin 10
#Compile EXE
#Include "Win32API.inc"
Global hDlg As Dword
Function PBMain()
Dialog New Pixels, 0, "Toolbar Test",,, 300,200, %WS_SysMenu, To hDlg
Control Add Button, hDlg, 400, "Button", 30,70,50,30
Control Add Toolbar, hDlg, 500,"", 0,0,0,0, %TbStyle_Flat Or %WS_Child Or %WS_TabStop Or _
%WS_Visible Or %WS_Border Or %CCS_Top
Toolbar Add Button hDlg, 500, 0, 201, %TbStyle_Button, "x"
Toolbar Add Button hDlg, 500, 0, 202, %TbStyle_Button, "y"
Dialog Show Modal hDlg Call DlgProc
End Function
CallBack Function DlgProc() As Long
If Cb.Msg = %WM_Command And Cb.Ctl = 201 Then ? "x"
If Cb.Msg = %WM_Command And Cb.Ctl = 202 Then ? "y"
End Function
'gbs_00818
'Date: 03-10-2012
http://www.garybeene.com/sw/gbsnippets.htm