initial commit
[rofl0r-KOL.git] / main_ttrayicon.htm
blob9ad2b4b6ffafb868010c347af14f78ff61625db6
1 <html>
2 <head>
3 <title>KOL Help: TTrayIcon object (main frame)</title>
4 <base target="_top">
5 </head>
7 <body bgcolor="#FFFFEF" text="#000000" link="#008080" vlink="#008000" alink="#808000">
8 <p><font face="Courier" color="#800080"><b>TTrayIcon( unit <a href=kol_pas.htm>KOL.pas</a> )
9 <font face="Wingdings">ï</font> <a href=tobj.htm>TObj</a>
10 <font face="Wingdings">ï</font> <a href=_tobj.htm>_TObj</a>
11 </b></font></p>
12 <p><b>
13 TTrayIcon = object( <a href=tobj.htm target="_top">TObj</a> )
14 </b></p>
15 Object to place (and change) a single icon onto taskbar tray.
16 <h3 align="center"><font color="#FF8080">TTrayIcon properties</font></h3>
17 <a name="icon"></a>
18 <p>
19 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Icon</b></font>: HIcon;</font>
20 <br>
21 Icon to be shown on taskbar tray. If not set, value of <a href=#active target="main">Active</a>
22 property has no effect. It is also possible to assign a value
23 to Icon property after assigning True to <a href=#active target="main">Active</a> to install
24 icon first time or to replace icon with another one (e.g. to
25 get animation effect).
26 <br>&nbsp;&nbsp;&nbsp;
27 Previously allocated icon (if any) is not deleted using
28 DeleteObject. This is normal for icons, loaded from resource
29 (e.g., by LoadIcon API call). But if icon was created (e.g.) by
30 CreateIconIndirect, your code is responsible for destroying
31 of it).
32 </p>
33 <a name="active"></a>
34 <p>
35 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Active</b></font>: <b>Boolean</b>;</font>
36 <br>
37 Set it to True to show assigned <a href=#icon target="main">Icon</a> on taskbar tray. Default
38 is False. Has no effect if <a href=#icon target="main">Icon</a> property is not assigned.
39 TrayIcon is deactivated automatically when <a href=kol_pas.htm#applet target="_top">Applet</a> is finishing
40 (but only if <a href=kol_pas.htm#applet target="_top">Applet</a> window is used as a &quot;parent&quot; for tray
41 icon object).
42 </p>
43 <a name="tooltip"></a>
44 <p>
45 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Tooltip</b></font>: <b>String</b>;</font>
46 <br>
47 Tooltip string, showing automatically when mouse is moving
48 over installed icon. Though &quot;huge string&quot; type is used, only
49 first 63 characters are considered. Also note, that only in
50 most recent versions of Windows multiline tooltips are supported.
51 </p>
52 <a name="autorecreate"></a>
53 <p>
54 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>AutoRecreate</b></font>: <b>Boolean</b>;</font>
55 <br>
56 If set to TRUE, auto-recreating of tray icon is proveded in case,
57 when Explorer is restarted for some (unpredictable) reasons. Otherwise,
58 your tray icon is disappeared forever, and if this is the single way
59 to communicate with your application, the user nomore can achieve it.
60 </p>
61 <a name="noautodeactivate"></a>
62 <p>
63 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>NoAutoDeactivate</b></font>: <b>Boolean</b>;</font>
64 <br>
65 If set to true, tray icon is not removed from tray automatically on
66 WM_CLOSE message receive by owner control. Set <a href=#active target="main">Active</a> := FALSE in
67 your code for such case before accepting closing the form.
68 </p>
69 <a name="wnd"></a>
70 <p>
71 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>Wnd</b></font>: HWnd;</font>
72 <br>
73 A window to use as a base window for tray icon messages. Overrides
74 parent Control handle is assigned. Note, that if Wnd property used,
75 message handling is not done automatically, and you should do this in
76 your code, or at least for one tray icon object, call <a href=#attachproc2wnd target="main">AttachProc2Wnd</a>.
77 </p>
78 <h4 align="center"><font color="black">Properties, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
79 <h3 align="center"><font color="#FF8080">TTrayIcon methods</font></h3>
80 <a name="destroy"></a>
81 <p>
82 <font face="Courier" color="#800080"><b>destructor</b> <font color="#808000"><b>Destroy</b></font>; <b>virtual</b>;</font>
83 &nbsp;&nbsp;&nbsp;<font face="Webdings" size=7>&#78;</font>&nbsp;&nbsp;&nbsp;
84 <br>
85 Destructor. Use <a href=#free target="main">Free</a> method instead (as usual).
86 </p>
87 <a name="attachproc2wnd"></a>
88 <p>
89 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>AttachProc2Wnd</b></font>;</font>
90 <br>
91 Call this method for a tray icon object in case if <a href=#wnd target="main">Wnd</a> used rather then
92 control. It is enough to call this method once for each <a href=#wnd target="main">Wnd</a> used, even
93 if several other tray icons are also based on the same <a href=#wnd target="main">Wnd</a>. See also
94 <a href=#detachproc2wnd target="main">DetachProc2Wnd</a> method.
95 </p>
96 <a name="detachproc2wnd"></a>
97 <p>
98 <font face="Courier" color="#800080"><b>procedure</b> <font color="#808000"><b>DetachProc2Wnd</b></font>;</font>
99 <br>
100 Call this method to detach window procedure attached via <a href=#attachproc2wnd target="main">AttachProc2Wnd</a>.
101 Do it once for a <a href=#wnd target="main">Wnd</a>, used as a base to handle tray icon messages.
102 Caution! If you do not call this method before destroying <a href=#wnd target="main">Wnd</a>, the
103 application will not functioning normally.
104 </p>
105 <h4 align="center"><font color="black">Methods, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
106 <h3 align="center"><font color="#FF8080">TTrayIcon events</font></h3>
107 <a name="onmouse"></a>
109 <font face="Courier" color="#800080"><b>property</b> <font color="#808000"><b>OnMouse</b></font>: <a href=kol_pas.htm#tontrayiconmouse target="_top">TOnTrayIconMouse</a>;</font>
110 <br>
111 Is called then mouse message is taking place concerning installed
112 icon. Only type of message can be obtained (e.g. WM_MOUSEMOVE,
113 WM_LBUTTONDOWN etc.)
114 </p>
115 <h4 align="center"><font color="black">Events, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
116 <h3 align="center"><font color="#FF8080">TTrayIcon fields</font></h3>
117 <h4 align="center"><font color="black">Fields, inherited from <a href="tobj.htm" target="_top">TObj</a></font></h4>
118 <a name=tasks></a><h3 align="center"><font color="#FF8080">TTrayIcon tasks</font></h3>
119 When You create invisible application, which should be represented by
120 only the tray icon, prepare a handle for the window, resposible for
121 messages handling. Remember, that window handle is created automatically
122 only when a window is showing first time. If window's property Visible is
123 set to False, You should to call CreateWindow manually.
124 &lt;br&gt;
125 There is a known bug exist with similar invisible tray-iconized applications.
126 When a menu is activated in response to tray mouse event, if there was
127 not active window, belonging to the application, the menu is not disappeared
128 when mouse is clicked anywhere else. This bug is occure in Windows9x/ME.
129 To avoid it, activate first your form window. This last window shoud have
130 status visible (but, certainly, there are no needs to place it on visible
131 part of screen - change its position, so it will not be visible for user,
132 if You wish).
133 &lt;br&gt;
134 Also, to make your application &quot;invisible&quot; but until special event is occure,
135 use <a href=kol_pas.htm#applet target="_top">Applet</a> separate from the main form, and make for both Visible := False.
136 This allows for You to make your form visible any time You wish, and without
137 making application button visible if You do not wish.
138 <hr>
139 <p align="center">[&nbsp;<a href=index.htm>Index</a>&nbsp;]</p>
140 <p align="center"><font face="Comic Sans MS"><small>This help is generated 22-Sep-2005 by KOL Help generator, (C) 2000-2001 by Vladimir Kladov<br>Modified (C) 2003 by Alexander Bartov</small></font></p>
141 </body>
142 </html>