托盘图标
<h2>1 属性和相关方法</h2>
<h4>1.1 设置托盘图标</h4>
<ul>
<li>通过config.xml设置对应的托盘。
<pre><code class="language-xml"><?xml version="1.0" encoding="utf-8"?>
<ConfigTable>
<Config Name="TrayMenu">TrayMenu.xml</Config>
</ConfigTable></code></pre></li>
</ul>
<h4>1.2 修改托盘图标</h4>
<ul>
<li>通过C++程序代码调用方法如下:
<pre><code class="language-c">void CDialog::ModifyTrayIcon(const String& strTips, HICON hIcon);</code></pre></li>
</ul>
<h4>1.3 闪烁托盘图标</h4>
<ul>
<li>
<p>通过C++程序代码调用方法如下:</p>
<pre><code class="language-c">void FlashTrayIcon(BOOL bFlash);</code></pre>
</li>
<li>参考下面的示例代码
<pre><code class="language-c">void CDemoTrayIconLayout::OnBtnClickedFlashIcon(UINT uNotifyCode, int nID, CView* pView)
{
CTextView* pChildView = dynamic_cast<CTextView*>(pView->GetChildById(ID_TEXTVIEW));
if(pChildView)
{
String strFlash = SkinUI::GetString(_T("IDS_FLASH_TRAY_ICON"));
String strStopFlash = SkinUI::GetString(_T("IDS_STOP_FLASH_TRAY_ICON"));
if(pChildView->GetText() == strFlash)
{
GetOwner()->FlashTrayIcon(TRUE);
pChildView->SetText(strStopFlash);
pView->Redraw();
}
else if(pChildView->GetText() == strStopFlash)
{
GetOwner()->FlashTrayIcon(FALSE);
pChildView->SetText(strFlash);
pView->Redraw();
}
else
{
assert(false);
}
}
}</code></pre></li>
</ul>