📄 ntray.htm
字号:
<p><font face="Arial"><strong>Parameters</strong></font></p>
<p><font face="Arial"><em>hIcon</em> handle to the icon to set</font></p>
<p><font face="Arial"><em>lpIconName</em> a Windows Icon resource string of the icon to
use</font></p>
<p><font face="Arial"><em>nIDResource</em> a Windows Icon resource ID of the icon to use</font></p>
<p><font color="#000000" face="Arial" size="3"><em>phIcons</em>: pointer to an array of
icon handles to use to do the icon animation.</font></p>
<p><font color="#000000" face="Arial" size="3"><em>nNumIcons</em>: The number of icons
phIcons points to.</font></p>
<p><font color="#000000" face="Arial" size="3"><em>dwDelay</em>: interval in milliseconds
between icon animation frames.</font></p>
<p><font face="Arial"><strong>Remarks</strong></font></p>
<p><font face="Arial">Sets the icon associated with the tray icon</font></p>
<p> </p>
<p><a name="SetStandardIcon"></a><big><strong><font face="Arial">CTrayNotifyIcon::SetStandardIcon</font></strong></big></p>
<p><strong><font face="Arial">BOOL CTrayNotifyIcon::SetStandardIcon(LPCTSTR lpIconName);</font></strong></p>
<p><strong><font face="Arial">BOOL CTrayNotifyIcon::SetStandardIcon(UINT nIDResource);</font></strong></p>
<p><font face="Arial"><strong>Parameters</strong></font></p>
<p><font face="Arial"><em>lpIconName</em> a Windows Icon resource string of the icon to
use</font></p>
<p><font face="Arial"><em>nIDResource</em> a Windows Icon resource ID of the icon to use</font></p>
<p><font face="Arial"><strong>Remarks</strong></font></p>
<p><font face="Arial">Sets the icon associated with the tray icon using the standard icon
identifiers. </font></p>
<p><font face="Arial">To use one of the Windows predefined icons, <i>the lpIconName</i>
parameter to one of the following values: </font></p>
<table cellSpacing="4" cols="2">
<TBODY>
<tr vAlign="top">
<th align="left" width="164"><font face="Arial">Value</font></th>
<th align="left" width="301"><font face="Arial">Description</font></th>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_APPLICATION</font></td>
<td width="301"><font face="Arial">Default application icon.</font></td>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_ASTERISK</font></td>
<td width="301"><font face="Arial">Same as IDI_INFORMATION.</font></td>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_ERROR</font></td>
<td width="301"><font face="Arial">Hand-shaped icon.</font></td>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_EXCLAMATION</font></td>
<td width="301"><font face="Arial">Same as IDI_WARNING.</font></td>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_HAND</font></td>
<td width="301"><font face="Arial">Same as IDI_ERROR. </font></td>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_INFORMATION</font></td>
<td width="301"><font face="Arial">Asterisk icon.</font></td>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_QUESTION</font></td>
<td width="301"><font face="Arial">Question mark icon.</font></td>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_WARNING</font></td>
<td width="301"><font face="Arial">Exclamation point icon.</font></td>
</tr>
<tr vAlign="top">
<td width="164"><font face="Arial">IDI_WINLOGO</font></td>
<td width="301"><font face="Arial">Windows logo icon.</font></td>
</tr>
</TBODY>
</table>
<p> </p>
<p><a name="GetIcon"></a><big><strong><font face="Arial">CTrayNotifyIcon::GetIcon</font></strong></big></p>
<p><strong><font face="Arial">HICON CTrayNotifyIcon::GetIcon() const;</font></strong></p>
<p><font face="Arial"><strong>Return Value</strong></font></p>
<p><font face="Arial">Icon handle of the icon currently being displayed</font></p>
<p> </p>
<p><a name="UsingAnimatedIcon"></a><big><strong><font face="Arial">CTrayNotifyIcon::UsingAnimatedIcon</font></strong></big></p>
<p><strong><font face="Arial">BOOL UsingAnimatedIcon() const;</font></strong></p>
<p><strong><font face="Arial">Return Value</font></strong></p>
<p><font face="Arial">TRUE if an animated icon is being show, FALSE if an ordinary static
icon is being used.</font></p>
<p> </p>
<p><a name="SetNotificationWnd"></a><font face="Arial"><big><strong>CTrayNotifyIcon::SetNotificationWnd</strong></big></font></p>
<p><strong><font face="Arial">BOOL CTrayNotifyIcon::SetNotificationWnd(CWnd* pNotifyWnd);</font></strong></p>
<p><strong><font face="Arial">Return Value</font></strong></p>
<p><font face="Arial">TRUE if the notification window was successfully set otherwise FALSE</font></p>
<p><font face="Arial"><strong>Parameters</strong></font></p>
<p><font face="Arial"><em>pNotifyIcon</em> The window which is to be the notification
window associated with this tray icon</font></p>
<p> </p>
<p><a name="GetNotificationWnd"></a><big><font face="Arial"><strong>CTrayNotifyIcon::GetNotificationWnd</strong></font></big></p>
<p><font face="Arial"><strong>CWnd* GetNotificationWnd() const;</strong></font></p>
<p><font face="Arial"><strong>Return Value</strong></font></p>
<p><font face="Arial">The window which is the notification window associated with this
tray icon</font></p>
<p> </p>
<p><a name="HideIcon"></a><big><font face="Arial"><strong>CTrayNotifyIcon::HideIcon</strong></font></big></p>
<p><font face="Arial"><strong>void CTrayNotifyIcon::HideIcon();</strong></font></p>
<p><font face="Arial"><strong>Remarks</strong></font></p>
<p><font face="Arial">Temporarily hides the tray notify icon</font></p>
<p> </p>
<p><a name="ShowIcon"></a><strong><big><font face="Arial">CTrayNotifyIcon::ShowIcon</font></big></strong></p>
<p><strong><font face="Arial">void CTrayNotifyIcon::ShowIcon();</font></strong></p>
<p><font face="Arial"><strong>Remarks</strong></font></p>
<p><font face="Arial">Shows the icon if it had previously been hidden</font></p>
<p> </p>
<p><a name="RemoveIcon"></a><big><strong><font face="Arial">CTrayNotifyIcon::RemoveIcon</font></strong></big></p>
<p><strong><font face="Arial">void CTrayNotifyIcon::RemoveIcon();</font></strong></p>
<p><font face="Arial"><strong>Remarks</strong></font></p>
<p><font face="Arial">Removes the tray icon entirely and resets the class member
variables. This is the corollary function of </font><font face="Arial"><a href="#Create">CTrayNotifyIcon::Create</a></font></p>
<p> </p>
<p><a name="MoveToExtremeRight"></a><big><font face="Arial"><strong>CTrayNotifyIcon::MoveToExtremeRight</strong></font></big></p>
<p><font face="Arial"><strong>void MoveToExtremeRight();</strong></font></p>
<p><font face="Arial"><strong>Remarks</strong></font></p>
<p><font face="Arial">Moves the tray icon to the extreme right of the tray notification
area. This is achieved by first hiding the icon followed by re showing it.</font></p>
<p> </p>
<p><a name="OnTrayNotification"></a><big><strong><font face="Arial">CTrayNotifyIcon::OnTrayNotification</font></strong></big></p>
<p><font face="Arial"><strong>virtual LRESULT </strong><big>CTrayNotifyIcon::</big><strong>OnTrayNotification(WPARAM
uID, LPARAM lEvent);</strong></font></p>
<p><strong><font face="Arial">Return Value</font></strong></p>
<p><font face="Arial">Standard result to return from the message handler</font></p>
<p><strong><font face="Arial">Parameters</font></strong></p>
<p><font face="Arial">uID the value you specified in the call to <a href="#Create">CTrayNotifyIcon::Create</a></font></p>
<p><font face="Arial">lEvent is a mouse event (such as WM_LBUTTONDOWN).</font></p>
<p><font face="Arial"><strong>Remarks</strong></font></p>
<p><font color="#000000" face="Arial" size="3">When your handler gets control, WPARAM is
the ID you specified when you created the CTrayNotifyIcon. LPARAM is the mouse event (for
example,WM_LBUTTONDOWN). You can do whatever you like when you get the notification.
NOTTEST does nothing and delegates all the work to the default implementation in
CTrayNotifyIcon This virtual (so you can override it) function implements the default UI
behaviour as outlined in the "Windows Interface Guidelines for Software".</font></p>
<p> </p>
<p><a name="IsShowing"></a><big><font face="Arial"><strong>CTrayNotifyIcon::IsShowing</strong></font></big></p>
<p><font face="Arial"><strong>BOOL CTrayNotifyIcon::IsShowing() const;</strong></font></p>
<p><font face="Arial"><strong>Return Value</strong></font></p>
<p><font face="Arial">TRUE if the tray icon is currently been shown else FALSE</font></p>
<p> </p>
<p><a name="IsHidden"></a><big><strong><font face="Arial">CTrayNotifyIcon::IsHidden</font></strong></big></p>
<p><font face="Arial"><strong>BOOL CTrayNotifyIcon::IsHidden();</strong></font></p>
<p><font face="Arial"><strong>Return Value</strong></font></p>
<p><font face="Arial">TRUE if the tray icon is currently hidden else FALSE</font></p>
<p> </p>
<p> </p>
<p> </p>
<p><font face="Arial"><a name="Contact"></a><font color="#000000" size="4"><strong>CONTACTING
THE AUTHOR</strong></font></font></p>
<p><font color="#000000" face="Arial" size="3">PJ Naughter<br>
Email: <a href="mailto:pjn@indigo..ie">pjn@indigo.ie</a><br>
Web: <a href="http://indigo.ie/~pjn">http://indigo.ie/~pjn</a><br>
22 July 1998</font></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -