怎样把程序图标最小化到右下脚状态栏中(显示时间的那个栏)

jett 2001-12-31 10:29:10
还有其他的一些功能包括右击弹出菜单,双击打开等等,都是怎么做的,望高手指点。功力不够只能加到38,如嫌分数不够,另外专门开贴子加。
...全文
105 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
flesh 2001-12-31
  • 打赏
  • 举报
回复
Shell_NotifyIcon 是什么东东?
jett 2001-12-31
  • 打赏
  • 举报
回复
thx
kofkim 2001-12-31
  • 打赏
  • 举报
回复
Private Sub Form_Load()
Me.Show
Me.Refresh
With nid
.cbSize = Len(nid)
.hwnd = Me.hwnd
.uId = vbNull
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.uCallBackMessage = WM_MOUSEMOVE
.hIcon = Me.Icon
.szTip = "炸弹工作中" & vbNullChar
End With
Shell_NotifyIcon NIM_ADD, nid
End Sub

Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'this procedure receives the callbacks from the System Tray icon.
Dim Result As Long
Dim msg As Long
'the value of X will vary depending upon the scalemode setting
If Me.ScaleMode = vbPixels Then
msg = X
Else
msg = X / Screen.TwipsPerPixelX
End If
Select Case msg
Case WM_LBUTTONUP '514 restore form window
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
Case WM_LBUTTONDBLCLK '515 restore form window
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
Case WM_RBUTTONUP '517 display popup menu
Result = SetForegroundWindow(Me.hwnd)
Me.PopupMenu Me.mPopupSys
End Select
End Sub

Private Sub Form_Resize()
'this is necessary to assure that the minimized window is hidden
If Me.WindowState = vbMinimized Then Me.Hide
End Sub

Private Sub Form_Unload(Cancel As Integer)
'this removes the icon from the system tray
Shell_NotifyIcon NIM_DELETE, nid
End Sub

Private Sub mPopExit_Click()
'called when user clicks the popup menu Exit command
Unload Me
End Sub

Private Sub mPopRestore_Click()
'called when the user clicks the popup menu Restore command
Me.WindowState = vbNormal
Result = SetForegroundWindow(Me.hwnd)
Me.Show
End Sub

在FORM中编辑MENU EDITOR编辑一个INVISIBLE一及菜单和两个可见的二级彩单!具体命名见程序中所含!

自己看吧~
dbcontrols 2001-12-31
  • 打赏
  • 举报
回复
在网上搜索"托盘"可以得到一车一车的代码.
lcooky 2001-12-31
  • 打赏
  • 举报
回复
CSDN上有很多例子(systray)
dbcontrols 2001-12-31
  • 打赏
  • 举报
回复
这个问题问的太多,安装目录里面就有个代码,叫什么Tray

7,763

社区成员

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

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