Posts: 1,271
Threads: 399
Joined: Mar 2003
i look for the best way to trigger 2 toolbars.
crm_trigger
Trigger !a"EMIS - CRM (Easy Marketing Information System), DB: Zentrale" "ThunderRT6FormDC"
int hwnd=val(_command)
int chwnd=child("" "SSActiveTabsWndClass" hwnd 0x1)
int oben_hwnd=child("" "SSPanelWndClass" hwnd 0x1)
int unten_hwnd=child("" "SSPanelWndClass" hwnd 0x1)
int cx cy cw ch; GetWinXY chwnd cx cy cw ch
int ox oy ow oh; GetWinXY oben_hwnd ox oy ow oh
int ux uy ucx ucy; GetWinXY unten_hwnd ux uy ucx ucy
int vhwnd = mac("crm_visitenkarten" hwnd)
MoveWindow vhwnd cx oy+oh cw cy-(oy+oh) 1
Posts: 1,271
Threads: 399
Joined: Mar 2003
crm_visitenkarten is a toolbar hosting a "ActiveX" "SHDocVw.WebBrowser" and has a trigger function.
Function _crm_visitenkarten
;/
function# hWnd message wParam lParam
def TB_HITTEST (WM_USER + 69)
int+ g_tb_move_htb g_tb_move_hfore
POINT+ g_tb_move_pos
POINT p
sel message
,case WM_CREATE
,,int h=CreateControl(0 "ActiveX" "SHDocVw.WebBrowser" 0 0 0 860 80 hWnd 1)
,,SHDocVw.WebBrowser b._getcontrol(h)
,,;b.Navigate("C:\Program Files\Microbender\Bilder\Gutsweine Zimmermann GmbH & Co. KG")
,,Shell32.ShellFolderView fv._create
,,;fv=b.Document
,,;fv.CurrentViewMode=1
,,;int hlv=child("" "SysListView32" hWnd)
,,;SetWinStyle hlv LVS_NOCOLUMNHEADER 1
,
,case WM_SETCURSOR
,,if(lParam=WM_LBUTTONDOWN<<16|HTCLIENT)
,,,if(wParam=hWnd)
,,,else if(GetDlgCtrlID(wParam)=9999)
,,,,GetCursorPos &p; ScreenToClient wParam &p
,,,,if(SendMessage(wParam TB_HITTEST 0 &p)>=0) ret ;;button
,,,else ret
,,,
,,,GetCursorPos &g_tb_move_pos
,,,g_tb_move_htb=hWnd
,,,g_tb_move_hfore=win
,,,act hWnd ;;for SetCapture
,,,SetCapture hWnd
,,
,,case [WM_LBUTTONUP,WM_CANCELMODE]
,,g_tb_move_htb=0
,,SetCapture 0
,,act g_tb_move_hfore; err
,,
,,case WM_MOUSEMOVE
,,if(g_tb_move_htb=hWnd)
,,,RECT r; GetWindowRect hWnd &r
,,,GetCursorPos &p
,,,mov r.left+p.x-g_tb_move_pos.x r.top+p.y-g_tb_move_pos.y hWnd
,,,g_tb_move_pos=p
,
,
,
,case WM_DESTROY
,
how do i work with the passed variables to the dialog macro ?
int vhwnd = mac("crm_visitenkarten" hwnd "" arg1 )
and sorry, but what is the code for passing more variables ?
Posts: 12,072
Threads: 140
Joined: Dec 2002
If don't want to use global variables, can send variables to the hook function with SendMessage.
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
,
|