AddMinimizeWatch Method
This method enables minimize "watching" of the window (form) passed in. When the user presses the minimize button on the "watched" form, the window will zoom to the system tray instead!
Syntax
csSysTray[(index)].AddMinimizeWatch hWnd
The AddMinimizeWatch method syntax has these parts:
Part | Description |
csSysTray | The SysTray control you are working with, or a control array of SysTray controls. |
hWnd | A handle to the form you want to be watched. (ex: Form1.hWnd) |
Examples
Example 1 (Starting a Minimize Watch on a form)
csSysTray1.AddMinimizeWatch Form1.hWnd
Remarks
You probably want to set the ShowInTaskBar property of the forms you are watching to False at design time. See also the RemoveMinimizeWatch method.
Also, the Microsoft Windows operating environment identifies each form and control in
an application by assigning it a handle, or hWnd. The hWnd property is used with Windows
API calls. Many Windows operating environment functions require the hWnd of the active
window as an argument.
Note Because the value of this property can change while a program is
running, never store the hWnd value in a variable.