Simulates performing a left mouse button click of a Tool Bar button.
cClickToolbar(window-handle, position [, click-type])
(i) window-handle Windows handle to a Tool Bar common control.
(i) position Position of button to click.
(i) click-type (Optional)
1 = left mouse button
2 = middle mouse button
3 = right mouse button
4 = left mouse button double click
(i) @TRUE, if button pressed. @FALSE, if button was not pressed.
You can simulate a mouse button click on a Tool Bar button with this function. The Tool Bar button is selected by supplying its one based position as the second parameter. Since buttons can be hidden, a buttons position cannot always be determined by visual inspection. However, if a button has associated text, the position can be determined with the cgettbtext function.
The click-type parameter is optional and can be used to indicate the type of mouse button click to perform. Set this parameter to one (1) for a left button click, two (2) for a middle button click, three (3) for right button click and four (4) for a left button double click. If you do not supply this parameter as part of the function call, a single left mouse click is assumed.
The class name for the Tool Bar control is "ToolbarWindow32".
32-bit Extender
This function is designed for Windows 32-bit application controls. It cannot be used on Windows 64-bit controls.
64-bit Extender
This function is designed for Windows 64-bit application controls. It cannot be used on Windows on 32-bit controls.
AddExtender("wwctl44i.dll",0,"wwctl64i.dll")
; Find the Explorer tool bar handle hwndex = DllHwnd("Exploring ") hwnd = cWndbyclass(hwndex,"Worker") hwnd = cWndbyclass(hwnd,"ReBarWindow32") hwnd = cWndbyclass(hwnd,"ToolbarWindow32") buttontext = "Forward"
; Get any button text alltext = cGetTbText(hwnd)
;Get the index of the button select1=ItemLocate(buttontext, alltext, @TAB)
; Get any button text alltext = cGetTbText(hwnd)
;Get the index of the button select1=ItemLocate(buttontext, alltext, @TAB) If select1==0 Message("Tool Bar Button","%buttontext% Not Found") Else ; Click the Forward button If cClickToolbar(hwnd, select1,1) Message("Button click", "Succeeded") Else Message("Button click", "Failed") EndIf EndIf
cGetTBText, cWndByClass, cWndInfo, DLLhwnd,