如何用C#做类似于MSN,常驻在屏幕右下角的应用程序?

willway 2007-03-29 04:52:53
如题。
问题一,
比如我点了主窗口上的(关闭)按钮,程序的窗口都关掉,然后在屏幕右下角出现我这个程序的图标。点了它以后可以再打开程序窗口。

问题二,
另外,我的程序是运行在那里的,socket通信。接收到socket消息之后,怎样让屏幕右下角的图标一闪一闪?同时有声音提示?

这个就象MSN的效果,,要怎么实现?有什么参考的教程,例子么?

...全文
367 10 打赏 收藏 转发到动态 举报
写回复
用AI写文章
10 条回复
切换为时间正序
请发表友善的回复…
发表回复
willway 2007-03-30
  • 打赏
  • 举报
回复
多谢各位!
bukater 2007-03-29
  • 打赏
  • 举报
回复
同意这个:
1 NotifyIcon控件
2 改变NotifyIcon的ICO

zhangzh2003 2007-03-29
  • 打赏
  • 举报
回复
mark
GXY2005 2007-03-29
  • 打赏
  • 举报
回复
1 NotifyIcon控件
2 改变NotifyIcon的ICO
CathySun118 2007-03-29
  • 打赏
  • 举报
回复
1.写托盘
2.收到数据时更改托盘图标
zhulei2008 2007-03-29
  • 打赏
  • 举报
回复
一搜一大片


<!--把下列代码加到head区域内-->
<head>
<SCRIPT language=javascript>
//more javascript from http://www.webjx.com
window.onload = enetgetMsg;
window.onresize = enetresizeDiv;
window.onerror = function(){}
var enetdivTop,enetdivLeft,enetdivWidth,enetdivHeight,enetdocHeight,enetdocWidth,enetobjTimer,i = 0;
function enetgetMsg()
{
try{
enetdivTop = parseInt(document.getElementById("enetMeng").style.top,10)
enetdivLeft = parseInt(document.getElementById("enetMeng").style.left,10)
enetdivHeight = parseInt(document.getElementById("enetMeng").offsetHeight,10)
enetdivWidth = parseInt(document.getElementById("enetMeng").offsetWidth,10)
enetdocWidth = document.body.clientWidth;
enetdocHeight = document.body.clientHeight;
document.getElementById("enetMeng").style.top = parseInt(document.body.scrollTop,10) + enetdocHeight + 10;// enetdivHeight
document.getElementById("enetMeng").style.left = parseInt(document.body.scrollLeft,10) + enetdocWidth - enetdivWidth
document.getElementById("enetMeng").style.visibility="visible"
enetobjTimer = window.setInterval("enetmoveDiv()",10)
}
catch(e){}
}
 
function enetresizeDiv()
{
i+=1
if(i>600) enetcloseDiv()
try{
enetdivHeight = parseInt(document.getElementById("enetMeng").offsetHeight,10)
enetdivWidth = parseInt(document.getElementById("enetMeng").offsetWidth,10)
enetdocWidth = document.body.clientWidth;
enetdocHeight = document.body.clientHeight;
document.getElementById("enetMeng").style.top = enetdocHeight - enetdivHeight + parseInt(document.body.scrollTop,10)
document.getElementById("enetMeng").style.left = enetdocWidth - enetdivWidth + parseInt(document.body.scrollLeft,10)
}
catch(e){}
}
function enetmoveDiv()
{
try
{
if(parseInt(document.getElementById("enetMeng").style.top,10) <= (enetdocHeight - enetdivHeight + parseInt(document.body.scrollTop,10)))
{
window.clearInterval(enetobjTimer)
enetobjTimer = window.setInterval("enetresizeDiv()",1)
}
enetdivTop = parseInt(document.getElementById("enetMeng").style.top,10)
document.getElementById("enetMeng").style.top = enetdivTop - 1
}
catch(e){}
}
function enetcloseDiv()
{
document.getElementById('enetMeng').style.visibility='hidden';
if(enetobjTimer) window.clearInterval(enetobjTimer)
}
</SCRIPT>
<!--把下列代码加到BODY区域内-->
<DIV id=enetMeng
style="BORDER-RIGHT: #455690 1px solid; BORDER-TOP: #a6b4cf 1px solid; Z-INDEX: 99999; LEFT: 0px; VISIBILITY: visible; BORDER-LEFT: #a6b4cf 1px solid; WIDTH: 241px; BORDER-BOTTOM: #455690 1px solid; POSITION: absolute; TOP: -200px; HEIGHT: 157px">
<TABLE WIDTH=255 BORDER=0 CELLPADDING=0 CELLSPACING=0 bgcolor="#DAE6FC">
<TR>

<TD height="30" valign="top" background="qqimages/heihei_1.jpg">
<table width="255" height="19" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="212" valign="bottom"><strong><font size="2"> <font color="#FF6600">消息框</font></font></strong></td>
<td width="43" style="cursor:hand" onClick="enetcloseDiv()">X</td>
</tr>
</table> </TD>
</TR>
<TR>
<TD height="122" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td width="95%"><table align="center" width="98%"><tr><td>
欢迎你来到网页教学网http://www.webjx.com</td><tr></table></td>
</tr>
</table> </TD>
</TR>
<TR>
<TD></TD>
</TR>
</TABLE></div>


stephen0126 2007-03-29
  • 打赏
  • 举报
回复
楼上的OK了
Red_angelX 2007-03-29
  • 打赏
  • 举报
回复
1 NotifyIcon控件
2 改变NotifyIcon的ICO
ufoteam 2007-03-29
  • 打赏
  • 举报
回复
http://www.51cto.com/art/200509/3974.htm
ufoteam 2007-03-29
  • 打赏
  • 举报
回复
http://blog.csdn.net/lincomin/archive/2006/10/08/1325849.aspx
二、当接收到消息之后,不断改变托盘的图标。

110,537

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧