亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? systemtray.shtml

?? mfc資源大全包含MFC編程各個(gè)方面的源碼
?? SHTML
字號(hào):
<HTML>

<!-- Header information-->
<HEAD>
   <META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
   <META NAME="Author" CONTENT="Chris Maunder">
   <TITLE>Shell Programming - Adding Icons to the System Tray
</TITLE>
</HEAD>

<!-- Set background properties -->
<body background="../fancyhome/back.gif" bgcolor="#FFFFFF" link="#B50029" vlink="#8E2323" alink="#FF0000">

<!-- A word from our sponsors... -->
<table WIDTH="100%">
<tr WIDTH="100%"><td align=center><!--#exec cgi="/cgi/ads.cgi"--><td></tr>
</table>


<!-- Article Title -->
<CENTER><H3><FONT COLOR="#AOAO99">
Adding Icons to the System Tray
</FONT></H3></CENTER>
<CENTER><H3><HR></H3></CENTER>

<!-- Author and contact details -->
This article was contributed by <A HREF="mailto: Chris.Maunder@cbr.clw.csiro.au">Chris Maunder</A>.

<!-- Sample image and source code/demo project -->
<p>
<img src="systemtray.gif" width=157 height=31 border=0 alt="SystemTray image" align="bottom">
&nbsp;<A HREF="systemtray.zip">Download source files</A> (4Kb) or <A HREF="systemtray_demo.zip">Sample Project</a> (37Kb).
</p>

<br>

<!-- The article... -->

<p>
<A HREF="systemtray.shtml#Intro">Introduction</A><br>
<A HREF="systemtray.shtml#Construction">Construction</A><br>
<A HREF="systemtray.shtml#Operations">Operations</A><br>
<A HREF="systemtray.shtml#Default">Default message handling</A><br>
<A HREF="systemtray.shtml#Example">Example of use</A><br>
<A HREF="systemtray.shtml#TrackPopupMenu">NOTE on TrackPopupMenu</A><br>
</P>

<h4><A NAME="Intro">Introduction</a></h4>
<P>This is a conglomeration of ideas from the MSJ "Webster" application,
sniffing round the online docs, and from other implementations such
as PJ Naughter's "CTrayNotifyIcon" (<A HREF="http://indigo.ie/~pjn/ntray.html">
http://indigo.ie/~pjn/ntray.html</A>) especially the "CSystemTray::OnTrayNotification"
member function and the SetStandardIcon stuff.

<P>This class is a light wrapper around the windows system tray stuff. It
adds an icon to the system tray with the specified ToolTip text and 
callback notification value, which is sent back to the Parent window.

<p><b>The Old way:</b>
<P>The basic steps to using a tray icon via the windows API are:
<ol>
<li>Load up the <tt>NOTIFYICONDATA</tt> structure</li>
<li>Call <tt>Shell_NotifyIcon(NIM_ADD, &MyTrayNotifyStruct)</tt></li>
</ol>

<P>Changing the values of the fields in NOTIFYICONDATA and calling 
Shell_NotifyIcon allows you to change to icon or tool tip text or remove 
the icon itelf. All this messing around has been bundled in a class wrapper 
to make it easier and neater.

<p><b>The Better way</b>

<P>The simpler way to add an icon to the system tray is to create an
object of type CSystemTray either as a member variable or dynamically.
Two forms of the constructor allow the programmer to insert the icon
into the tray as the CSystemTray object is created, or by using the
member function <b>CSystemTray::Create</b>. eg.

<PRE><TT><FONT COLOR="#990000">	CSystemTray m_TrayIcon;   // Member variable of some class

	... 
	// in some member function maybe...
	m_TrayIcon.Create(pParentWnd, WM_MY_NOTIFY, "Click here", 
	                  hIcon, nTrayIconID);
</FONT></TT></PRE>

<p>This will insert an icon in the system tray. See the following section for details.

<a name="Construction"><H4>Construction</H4></a>

<PRE><TT><FONT COLOR="#990000">	CSystemTray();
	CSystemTray(CWnd* pWnd, UINT uCallbackMessage, LPCTSTR szToolTip, HICON icon, UINT uID);
	BOOL Create(CWnd* pWnd, UINT uCallbackMessage, LPCTSTR szToolTip, HICON icon, UINT uID);
</FONT></TT></PRE>

<P>Note that the destructor automatically removes the icon from the tray.</P>

<FONT COLOR="#990000">
<TABLE CELLSPACING=0 BORDER=0 WIDTH="100%">
<TR><td WIDTH="10%">&nbsp;</td>
<TD WIDTH="30%"><tt>pWnd</tt></TD>
<TD WIDTH="65%">Parent window where notification messages will be sent</TD>
</TR>
<TR>
<td WIDTH="5%">&nbsp;</td>
<TD WIDTH="30%"><tt>uCallbackMessage</tt></TD>
<TD WIDTH="65%">The notification messages that will be sent to the parent window</TD>
</TR>
<TR>
<td WIDTH="5%">&nbsp;</td>
<TD WIDTH="30%"><tt>szToolTip</tt></TD>
<TD WIDTH="65%">Tooltip for the tray icon</TD>
</TR>
<TR>
<td WIDTH="5%">&nbsp;</td>
<TD WIDTH="30%"><tt>icon</tt></TD>
<TD WIDTH="65%">Handle to the icon to be displayed</TD>
</TR>
<TR>
<td WIDTH="5%">&nbsp;</td>
<TD WIDTH="30%"><tt>uID</tt></TD>
<TD WIDTH="65%">Tray icon ID</TD>
</TR>
</TABLE>
</FONT>

<h4><A NAME="Operations">Operations</a></h4>

<PRE><TT><FONT COLOR="#990000">	LRESULT OnTrayNotification(WPARAM wID,
	                           LPARAM lEvent)      // Discussed below

	void    MoveToRight()                           // Moves the icon to the far right of the tray,
	                                                //   so it is immediately to the left of the clock
	void    RemoveIcon()                            // Removes the icon from the tray (icon can no
	                                                //   longer be manipulated)
	void    HideIcon()                              // Hides but does not totally remove the icon
	                                                //   from the tray.
	void    ShowIcon()                              // Redisplays a previously hidden icon

	BOOL    SetTooltipText(LPCTSTR pszTip)          // Set Tooltip text
	BOOL    SetTooltipText(UINT nID)                // Set tooltip from text resource ID
	CString GetTooltipText() const                  // Retrieve tool tip text

	BOOL    SetNotificationWnd(CWnd* pWnd)          // Self explanatory
	CWnd*   GetNotificationWnd() const

	HICON   GetIcon() const                         //  Get current tray icon
	BOOL    SetIcon(HICON hIcon)                    //  Change tray icon. Returns FALSE if unsuccessful
	BOOL    SetIcon(LPCTSTR lpszIconName)           //  Same, using name of the icon resource
	BOOL    SetIcon(UINT nIDResource)               //  Same, using icon resource ID

	BOOL    SetStandardIcon(LPCTSTR lpIconName)     //  Load icon from the current application.
	BOOL    SetStandardIcon(UINT nIDResource)         
</FONT></TT></PRE></p>

<p>SetStandardIcon can also take any of the following values:</p>
<p>
<PRE><TT>	<u>                                                                            </u>
	<u>nIDResource             Description                                         </u>
	IDI_APPLICATION         Default application icon. 
	IDI_ASTERISK            Asterisk (used in informative messages). 
	IDI_EXCLAMATION         Exclamation point (used in warning messages). 
	IDI_HAND                Hand-shaped icon (used in serious warning messages). 
	IDI_QUESTION            Question mark (used in prompting messages). 
	<u>IDI_WINLOGO             Windows logo                                        </u>                                                                         
</TT></PRE>


<h4><A NAME="Default">Default message handling</a></h4>

The parent window, on receiving a notification message, can redirect this
message back to the tray icon for handling be calling 
<strong>CSystemTray::OnTrayNotification(...)</strong>. The default implementation
tries to find a menu with the same resource ID as the tray icon. If it finds a 
menu and the event received was a right mouse button up, then the submenu is
displayed as a context menu. If a double click was received, then the message
ID of first item in the submenu is sent back to the parent window.

<h4><A NAME="Example">Example of use</a></h4>

A good place to declare the tray icon is in your CFrameWnd derived class.<br>
eg. 

<PRE><TT><FONT COLOR="#990000">	#define WM_ICON_NOTIFY  WM_USER+10
	
	CSystemTray m_TrayIcon
</FONT></TT></PRE>


Add a message map entry for the tray icon notification:


<PRE><TT><FONT COLOR="#990000">	BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
		...
		ON_MESSAGE(WM_ICON_NOTIFY, <strong>OnTrayNotification</strong>)
	END_MESSAGE_MAP()
</FONT></TT></PRE>


Create the icon (maybe in your OnCreate):

<PRE><TT><FONT COLOR="#990000">	if (!m_TrayIcon.Create(this, WM_ICON_NOTIFY, strToolTip, hIcon, IDR_POPUP_MENU))
		return -1;
</FONT></TT></PRE>


where IDR_POPUP_MENU is the ID of a popup menu to display for the icon.
You then need a handler for the tray icon notification message:

<PRE><TT><FONT COLOR="#990000">	LRESULT CMainFrame::OnTrayNotification(WPARAM wParam, LPARAM lParam)
	{
		// Delegate all the work back to the default implementation in CSystemTray.
		return m_TrayIcon.OnTrayNotification(wParam, lParam);
	}
</FONT></TT></PRE>


The menu used (IDR_POPUP_MENU) looks like the following:

<PRE><TT><FONT COLOR="#990000">	IDR_POPUP_MENU MENU PRELOAD DISCARDABLE 
	BEGIN
		POPUP "POPUP_MENU"
		BEGIN
			MENUITEM "&About...",      ID_APP_ABOUT
			MENUITEM SEPARATOR
			MENUITEM "&Options...",    ID_APP_OPTIONS
			MENUITEM SEPARATOR
			MENUITEM "E&xit",          ID_APP_EXIT
		END
	END
</FONT></TT></PRE>

A single right click on the tray icon will bring up this menu, while
a double click will send a ID_APP_ABOUT message back to the frame.


<h4><A NAME="TrackPopupMenu">NOTE on TrackPopupMenu</a></h4>

Many people have had troubles using TrackPopupMenu. They have reported that the popup
menu will often not disappear once the mouse is clicked outside of the menu, even though
they have set the last parameter of TrackPopupMenu() as NULL. This is a Microsoft
"feature", and is by design. The mind boggles, doesn't it?</p>
<p>Anyway - to workaround this "feature", one must set the current window as the 
foreground window <em>before</em> calling TrackPopupMenu. This then causes a second
problem - namely that the next time the menu is displayed it displays then immediately 
disappears. To fix <em>this</em> problem, you must make the currernt application 
active after the menu disappears. This can be done by sending a benign message such
as WM_NULL to the current window.</p>
<p>So - what should have been a simple:
<PRE><TT><FONT COLOR="#990000">	TrackPopupMenu(hSubMenu, TPM_RIGHTBUTTON, pt.x,pt.y, 0, hDlg, NULL);
</FONT></TT></PRE>
 becomes
<PRE><TT><FONT COLOR="#990000">	SetForegroundWindow(hDlg);
	TrackPopupMenu(hSubMenu, TPM_RIGHTBUTTON, pt.x,pt.y, 0, hDlg, NULL);
	PostMessage(hDlg, WM_NULL, 0, 0);
</FONT></TT></PRE>
Refer to KB article "PRB: Menus for Notification Icons Don't Work Correctly" for more info.

<br>


<!-- Remember to update this -->
<p>Last updated: 17 April 1998

<P><HR>

<!-- Codeguru contact details -->
<TABLE BORDER=0 WIDTH="100%">
<TR>
<TD WIDTH="33%"><FONT SIZE=-1><A HREF="http://www.codeguru.com">Goto HomePage</A></FONT></TD>

<TD WIDTH="33%">
<CENTER><FONT SIZE=-2>&copy; 1998 Zafir Anjum</FONT>&nbsp;</CENTER>
</TD>

<TD WIDTH="34%">
<DIV ALIGN=right><FONT SIZE=-1>Contact me: <A HREF="mailto:zafir@home.com">zafir@home.com</A>&nbsp;</FONT></DIV>
</TD>
</TR>
</TABLE>

<!-- Counter -->


</BODY>
</HTML>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
99久久99精品久久久久久| 成人综合日日夜夜| 国产精品麻豆99久久久久久| 7777精品伊人久久久大香线蕉经典版下载| 久久精品国产精品亚洲精品| 亚洲日本丝袜连裤袜办公室| 久久网站最新地址| 欧美日韩国产一区| 一本大道av伊人久久综合| 国产精品资源网站| 日韩成人伦理电影在线观看| 亚洲黄一区二区三区| 国产蜜臀97一区二区三区| 日韩精品一区国产麻豆| 欧美性视频一区二区三区| 丁香激情综合国产| 激情综合亚洲精品| 午夜成人免费电影| 一区二区在线观看av| 欧美激情在线观看视频免费| 精品国产一区二区三区久久影院| 日本精品视频一区二区| 成人综合在线网站| 国产精品主播直播| 国产呦精品一区二区三区网站| 三级欧美韩日大片在线看| 亚洲欧美国产高清| 国产精品成人在线观看| 国产网站一区二区三区| 精品国产一区二区在线观看| 91精品国产综合久久香蕉的特点 | 亚洲国产综合人成综合网站| 国产精品久久久久毛片软件| 久久精品在线免费观看| 欧美精品一区二区三区蜜桃| 91精选在线观看| 在线综合+亚洲+欧美中文字幕| 欧美猛男男办公室激情| 欧美日韩一区不卡| 欧美性xxxxxxxx| 欧美午夜精品理论片a级按摩| 日本丶国产丶欧美色综合| 99久久99久久精品免费观看| 91视频xxxx| 欧美在线观看视频在线| 欧美日韩一区在线| 中文字幕综合网| 亚洲欧洲精品成人久久奇米网| 国产精品电影院| 亚洲色欲色欲www在线观看| 亚洲欧洲国产专区| 亚洲综合视频在线观看| 日日夜夜精品视频天天综合网| 三级影片在线观看欧美日韩一区二区| 偷偷要91色婷婷| 麻豆精品一区二区| 国产成人一级电影| 99久久综合狠狠综合久久| 不卡大黄网站免费看| 色综合久久久久综合99| 欧美日韩一区二区在线观看| 欧美一区二区网站| 久久精品一区二区三区不卡牛牛| 国产精品不卡在线观看| 怡红院av一区二区三区| 婷婷成人激情在线网| 韩国女主播一区| 成人综合婷婷国产精品久久 | 91丨porny丨在线| 欧美精选午夜久久久乱码6080| 在线成人免费视频| 国产亚洲成av人在线观看导航| 亚洲精品视频自拍| 日本aⅴ免费视频一区二区三区| 国精产品一区一区三区mba桃花 | 中文字幕亚洲电影| 亚洲五月六月丁香激情| 美女网站色91| av激情亚洲男人天堂| 欧美日韩aaaaa| 久久久国产一区二区三区四区小说| 国产精品伦一区| 日韩中文字幕区一区有砖一区| 国产一区欧美二区| 欧亚一区二区三区| 久久精品视频一区二区| 亚州成人在线电影| 懂色av中文字幕一区二区三区| 欧美色图第一页| 国产三区在线成人av| 午夜精品视频一区| 成人午夜又粗又硬又大| 欧美精品在线视频| 亚洲三级电影网站| 国产精品综合一区二区三区| 欧美日本一区二区| 亚洲欧洲日产国产综合网| 美女视频网站久久| 欧美熟乱第一页| 国产精品家庭影院| 国产一区欧美日韩| 欧美精品 国产精品| 亚洲蜜臀av乱码久久精品蜜桃| 九一久久久久久| 欧美性淫爽ww久久久久无| 国产精品免费aⅴ片在线观看| 丝袜亚洲另类丝袜在线| 成人av动漫网站| 精品va天堂亚洲国产| 亚洲另类在线视频| 夫妻av一区二区| 精品国一区二区三区| 亚洲v中文字幕| 欧美三级乱人伦电影| 日韩毛片视频在线看| 国产99精品视频| 久久免费看少妇高潮| 老鸭窝一区二区久久精品| 欧美三级韩国三级日本一级| 亚洲视频精选在线| 99视频一区二区| 国产精品入口麻豆九色| 国产毛片一区二区| 日韩国产一二三区| 9191国产精品| 亚洲成人福利片| 欧美婷婷六月丁香综合色| 亚洲精品免费播放| 99久久免费视频.com| 国产精品狼人久久影院观看方式| 国产麻豆一精品一av一免费| 久久亚区不卡日本| 国产一区二区美女| 国产亚洲精品aa| 国产成人免费av在线| 国产婷婷精品av在线| 国产91高潮流白浆在线麻豆 | 中文字幕精品一区| 成人美女视频在线看| 欧美国产日韩在线观看| 成人福利视频在线| 国产精品久线在线观看| 色综合欧美在线| 亚洲国产综合色| 日韩午夜激情av| 国产一区二区三区四区在线观看| 久久精品综合网| 97se亚洲国产综合自在线不卡| 一区二区三区高清在线| 欧美日韩国产高清一区二区三区 | 九九**精品视频免费播放| 精品国产一区二区三区av性色| 久久精品二区亚洲w码| 久久亚洲捆绑美女| 精品国产免费视频| 激情六月婷婷综合| 国产精品毛片无遮挡高清| 99久久精品国产导航| 亚洲精品写真福利| 在线不卡的av| 精品亚洲porn| 国产日韩欧美一区二区三区综合 | 国产成都精品91一区二区三| 亚洲欧洲av色图| 欧美丰满一区二区免费视频| 久久国产精品99久久久久久老狼| 久久久亚洲高清| 91婷婷韩国欧美一区二区| 亚洲va国产va欧美va观看| 日韩精品一区二区三区在线播放| 韩国精品主播一区二区在线观看| 亚洲国产电影在线观看| 91黄视频在线观看| 久久精品国产色蜜蜜麻豆| 国产精品白丝在线| 欧美久久久久久蜜桃| 国产不卡在线播放| 亚洲一区在线观看视频| 久久青草国产手机看片福利盒子| 色综合久久久网| 国产精品综合在线视频| 亚洲一区二区三区视频在线播放 | 韩国在线一区二区| 中文字幕在线观看不卡| 欧美一区二区三区婷婷月色| 成人av免费在线播放| 在线视频国产一区| 精品综合久久久久久8888| 亚洲欧美激情小说另类| 精品日韩99亚洲| 91电影在线观看| 国产资源在线一区| 亚洲成人福利片| 国产精品国产成人国产三级| 日韩一区二区精品在线观看| 欧洲在线/亚洲| 成人黄色小视频| 国产一区二区三区免费看| 日韩精品视频网站| 亚洲精品久久嫩草网站秘色|