想用VB实现在windows下方的闪烁图标!

hanxiucao_mimosa 2003-03-03 04:12:48
我做了一个任务管理,因为需要在线刷新用户当前的任务,所以需要象QQ那样,放在window的最右下方(一登录就进入扫描状态),发现新的任务就闪烁,用户点击后就弹处我完成的任务处理界面,怎么实现呢?请赐教!
...全文
129 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
wu_yongcai 2003-03-05
  • 打赏
  • 举报
回复
循环换一换图标不就有闪烁效果了吗,用得着这么兴师动众吗?
hanxiucao_mimosa 2003-03-03
  • 打赏
  • 举报
回复
图标倒是生成了,可是我的登录界面一关闭,这个图标也关闭了!我又怎么双击这个图标时弹出我的任务处理界面呢?请给点详细的说明吧!拜托了!谢谢!
hanxiucao_mimosa 2003-03-03
  • 打赏
  • 举报
回复
请问:你这段程序如何执行?
ClientDC 2003-03-03
  • 打赏
  • 举报
回复
Private Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2
Private Type NOTIFYICONDATA
cbSize As Long
hwnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
sTip As String * 64
End Type
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4
Private Const NIF_DOALL = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
Private Const WM_MOUSEMOVE = &H200
Private Const WM_LBUTTONDBLCLK = &H203
Private Const WM_RBUTTONUP = &H205
Private sysIcon As NOTIFYICONDATA

With sysIcon
.cbSize = LenB(sysIcon)
.hwnd = Me.hwnd
.uID = 1&
.uFlags = NIF_DOALL
.uCallbackMessage = WM_MOUSEMOVE
.hIcon = ImageList1.ListImages(6).Picture
.sTip = value & vbNullChar
End With
Shell_NotifyIcon NIM_ADD, sysIcon '生成图标,可在时间控件中不停调用改变图标

Shell_NotifyIcon NIM_DELETE, sysIcon '删除
hanxiucao_mimosa 2003-03-03
  • 打赏
  • 举报
回复
谢谢你的详细介绍,可能是我没说清楚,我是希望界面象QQ那样注册一个图表在window任务栏上(和音量、输入法什么的在一起),如果有新的数据,图表就闪烁,我点开后就是任务处理界面了!你看看能解决不?
dbcontrols 2003-03-03
  • 打赏
  • 举报
回复
Step-by-Step Example
The following section describes how to flash a form while that form does not have the focus:


Start 16-bit or 32-bit Visual Basic 4.0, or, if it is already running, click New Project on the File menu.

Add a Timer control to the Form1 form.

Copy the following code to the Code window of the Form1 form:

Private Sub Form_GotFocus()
Timer1.Enabled = False
End Sub

Private Sub Form_Load()
Timer1.Interval = GetCaretBlinkTime()
Form2.Show
End Sub

Private Sub Timer1_Timer()
Success = FlashWindow(Form1.hwnd, 1)
End Sub



On the Insert menu, click Form to insert a second form into the project.

Copy the following code to the Code window of the Form2 form:

Private Sub Form_Click()
Form1.Timer1.Enabled = True
End Sub



On the Insert menu, click Module to insert a module into the project.

Copy the following code to the Code window of the Module1 module:

'Depending on what operating system you are using determines the
'correct function declares and variables. This is an example of
'conditional compilation.

#If Win32 Then
Declare Function FlashWindow Lib "user32" ( _
ByVal hwnd As Long, _
ByVal bInvert As Long) As Long

Declare Function GetCaretBlinkTime Lib "user32" () As Long

Dim Success As Long

#Else
Declare Function FlashWindow Lib "User" ( _
ByVal hwnd As Integer, _
ByVal bInvert As Integer) As Integer

Declare Function GetCaretBlinkTime Lib "User" () As Integer

Dim Success As Integer

#End If



On the Run menu, click Start or press the F5 key to start the program. Form1 will be in the foreground with Form2 in the background. Click anywhere in Form2; Form1's Caption Bar will flash until you click Form1.
dbcontrols 2003-03-03
  • 打赏
  • 举报
回复
API函数FlashWindow
内容概要:本文研究油浸式变压器在不同气候条件下的能量极限问题,通过Matlab代码实现建模与仿真,深入分析环境温度、湿度等气候因素对变压器热稳定性、负载能力及运行安全性的影响,进而确定其在多种工况下的最大能量承载极限。研究采用多智能体方法提升模型的适应性与仿真精度,综合考虑热平衡方程与环境参数输入,旨在为变压器的设计优化、容量规划、动态负载管理及智能电网中的可靠性分析提供科学依据和技术支撑。; 适合人群:具备电力系统基础知识和Matlab编程能力,从事电气工程、能源系统仿真、电力设备设计等相关领域的科研人员与工程师,特别适合研究生及工作1-5年的专业技术人才; 使用场景及目标:①评估油浸式变压器在极端气候环境下的安全运行边界;②优化变压器的负载调度与能效管理策略;③支持智能电网背景下设备级动态容量规划与韧性电网建设;④为高可靠性供电系统的设计与运维提供理论参考; 阅读建议:学习者应结合提供的Matlab代码深入理解建模流程,重点掌握热传导模型构建、环境变量设定、多智能体协同机制及仿真参数调优方法,并通过调整气候条件进行多场景仿真实验,以深化对变压器能量极限形成机理的认知。

1,488

社区成员

发帖
与我相关
我的任务
社区描述
VB API
社区管理员
  • API
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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