12-08-2021, 01:49 PM
sorry for the late reply didn't see your post. This can be done. Probably the easiest way is to use a hook on Toolbar2.So when toolbar2 starts or is running checks toolbar1 for changes and changes toolbar2.
for example
Toolbar Toolbar1
Trigger Cg
Toolbar Toolbar2
Trigger !v"" "CabinetWClass"
and
Function WndProc_Toolbar2Hook
for example
Toolbar Toolbar1
Trigger Cg
;/mov 936 79 /siz 45 256 /isiz 32 32
notepad :run "$system$\notepad.exe"
Snipping Tool :run "$system$\SnippingTool.exe"
Windows Media Player :run "$program files$\Windows Media Player\wmplayer.exe" "/prefetch:1" "" "$program files$\Windows Media Player"
Toolbar Toolbar2
Trigger !v"" "CabinetWClass"
and
Function WndProc_Toolbar2Hook
;/
function# hwnd message wParam lParam
;<help #IDH_EXTOOLBAR>Toolbar hook help</help>
;OutWinMsg message wParam lParam ;;uncomment to see received messages
sel message
,case WM_INITDIALOG
,str tb1.getmacro("Toolbar1" 0)
,str tb2.getmacro("Toolbar2" 0)
,str tb2t tb1t tb2tf tb1tf
,foreach tb1t tb1
,,if tb1t.beg(" /")=0
,,,tb2t.addline(tb1t 1)
,_s.getl(tb2 0)
,tb2t- F"{_s}[]"
,tb2t.setmacro("Toolbar2")
,SetTimer hwnd 1 30000 0;; timer 30 seconds
,case WM_TIMER
,sel wParam
,,case 1
,,tb1.getmacro("Toolbar1" 0)
,,tb2.getmacro("Toolbar2" 0)
,,foreach tb1t tb1
,,,if tb1t.beg(" /")=0
,,,,tb1tf.addline(tb1t 1)
,,foreach tb2t tb2
,,,if tb2t.beg(" /")=0
,,,,tb2tf.addline(tb2t 1)
,,if tb1tf<>tb2tf
,,,_s.getl(tb2 0)
,,,tb2tf=tb1tf
,,,tb2tf- F"{_s}[]"
,,,tb2tf.setmacro("Toolbar2")
,case WM_DESTROY
,KillTimer hwnd 1