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

hanxiucao_mimosa 2003-03-03 04:12:48
我做了一个任务管理,因为需要在线刷新用户当前的任务,所以需要象QQ那样,放在window的最右下方(一登录就进入扫描状态),发现新的任务就闪烁,用户点击后就弹处我完成的任务处理界面,怎么实现呢?请赐教!
...全文
139 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
内容概要:本文针对无刷直流电机驱动的电子机械制动(EMB)执行器,建立了考虑Stribeck摩擦特性的非线性耦合动力学模型,并在Simulink环境中完成了系统级仿真分析。研究综合集成了电机动力学、齿轮传动机构与制动执行机构的动力学特性,构建了高保真的机电一体化系统模型。重点引入Stribeck摩擦模型以精确描述低速工况下执行器内部存在的静摩擦、粘滞摩擦与库仑摩擦之间的过渡行为,有效提升了系统在启停、反向运动等瞬态过程中的动态响应仿真精度。通过多工况仿真验证了模型的有效性,能够准确反映摩擦引起的爬行、滞后与定位误差等非线性现象,为EMB系统的高性能控制算法设计(如摩擦补偿、滑模控制)与结构优化提供了高可信度的仿真平台。; 适合人群:从事汽车电子制动系统、电机驱动控制、机电系统建模与仿真研究的研究生、科研人员及工程技术人员,需具备扎实的机械动力学、自动控制理论基础和MATLAB/Simulink仿真能力。; 使用场景及目标:①用于高精度电子机械制动系统的设计验证与性能预测;②为消除摩擦非线性影响的先进控制策略(如自适应控制、智能控制)提供精确的被控对象模型;③深入探究Stribeck摩擦等非线性因素对系统动态性能(如响应延迟、稳态误差)的作用机理; 阅读建议:读者应结合提供的Simulink模型文件,深入剖析Stribeck摩擦模块的数学实现与参数辨识方法,建议通过改变输入指令(如阶跃、正弦)和负载条件进行对比仿真,以直观理解非线性摩擦对系统动态特性的影响。

1,488

社区成员

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

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