09-08-2008, 06:28 AM
If don't want to use global variables, can send variables to the hook function with SendMessage.
Macro
Toolbar
Function ToolbarHookProc2
Macro
;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
Function ToolbarHookProc2
;/
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
,