Control Event


For our purposes, Control refers to the identifiable parts of a specific application window. Controls may include such things as a button, an edit box, a toolbar, a window title bar or others. The control may be part of the main application window or be part of a child window (a window within a window).



Macro Express Explorer > Macro > Add Macro - Or click on New Macro Icon


With Control Activation selected, the macro plays back when the control gains focus or the window with the control gains focus. In the example above the control name is listed. The program .exe is displayed followed by the window component that must be active in order for the macro to play back.





Launch Utility

The first step is to select the control that will activate the macro. Below is an image of the Capture Window Control window that appears when launching the control utility.


To select a Window Control place the mouse cursor on the crosshair image, hold down the left mouse button and drag the mouse over the control. When dragging the crosshairs over title bars, buttons, edit boxes, forms, toolbars, etc., the outline of the controls are highlighted. Once the control needed is highlighted, release the left mouse button. Click on the Save button to return to the Create New Macro window. The control details are saved in the edit box.




Save the Control Using the Contents of the Control

This option makes the capture of a control more specific and captures the text found in the control. So for example, if capturing an edit box with the word Test in it, during playback the macro looks for the edit box and verifies that it contains the word Test. If the edit box text is changed to something else, such as Reset or left blank, then the control (C1) that was captured will not match the actual control in the window - edit box.



Note: Not every button, menu item or component on a program is actually a Control. Sometimes the only control in a given program is the window or dialog that pops up when the program starts. We have also noticed that many of Microsoft's programs seem to have fewer controls than programs from other manufacturers. How the controls work will depend upon the way the program in use is designed.



Hide Macro Express

Hide Macro Express does what it implies. The program hides or gets out of the way after pressing the Launch Get Control Utility. This makes it easier to locate the application containing the control to capture.







Launch the Macro When

After selecting the control, decide when to activate the macro. Choose either when the control gains focus or when the window that contains the control gains focus.


The Control Gains Focus

This option requires that the control be part of the active window and the control gain focus. For example the mouse cursor could be in an edit box, giving focus to this control. Or a button may be highlighted and have control.


The Control's Window Gains Focus

With this option the macro starts when the window containing the selected control gains focus.



Control Details

This edit box lists the details of the selected control using the Launch Utility. The information should match what was listed in the Capture Window Control window.







Macro Nickname

Optionally assign a name to the macro to later help more readily determine what the macro does.



Build as a Popup Menu

Select this option and click on the OK button to open the Menu Builder and create a popup menu.