Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
One macro 2 toolbars
#3
If don't want to use global variables, can send variables to the hook function with SendMessage.

Macro
Code:
Copy      Help
;define type for variables
type XX86 a b
;set variables
XX86 x
x.a=8
x.b=6
;run toolbar
int htb=mac("Toolbar")
;pass x to the toolbar
SendMessage htb WM_APP+10 0 &x

Toolbar
Code:
Copy      Help
;/hook ToolbarHookProc2

Function ToolbarHookProc2
Code:
Copy      Help
;/
function# hWnd message wParam lParam

XX86* x=+GetProp(hWnd "var")

sel message
,;on WM_CREATE and WM_INITDIALOG x still unavailable; use WM_APP+10 for initialization
,case WM_APP+10
,;allocate x in dynamic memory, copy, and attach to hWnd
,x._new
,XX86* xx=+lParam; *x=*xx
,SetProp hWnd "var" x
,
,out x.a
,out x.b
,
,case WM_DESTROY
,x._delete
,


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)