怎样把程序图标最小化到右下脚状态栏中(显示时间的那个栏)
还有其他的一些功能包括右击弹出菜单,双击打开等等,都是怎么做的,望高手指点。功力不够只能加到38,如嫌分数不够,另外专门开贴子加。 问题点数:38、回复次数:6Top
1 楼dbcontrols(泰山__抛砖引玉)回复于 2001-12-31 10:31:30 得分 5
这个问题问的太多,安装目录里面就有个代码,叫什么TrayTop
2 楼lcooky(今夜无雪)回复于 2001-12-31 10:31:33 得分 3
CSDN上有很多例子(systray)Top
3 楼dbcontrols(泰山__抛砖引玉)回复于 2001-12-31 10:32:26 得分 0
在网上搜索"托盘"可以得到一车一车的代码.Top
4 楼kofkim(小金)回复于 2001-12-31 10:36:37 得分 30
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一及菜单和两个可见的二级彩单!具体命名见程序中所含!
自己看吧~Top
5 楼wjying(葡萄)回复于 2001-12-31 11:30:09 得分 0
thxTop
6 楼flesh(肉仔)回复于 2001-12-31 12:18:18 得分 0
Shell_NotifyIcon 是什么东东?Top
相关问题
- 主Form的FormStyle为bsNone,最小化时怎么在左下脚显示呢,点击状态栏的图标没有用?
- 紧急求救!程序最小化显示到系统状态栏图标的问题?怎么出错?
- 这里有分要送,请问怎样在状态栏显示无标题栏窗体的最小化图标
- 新手的问题:如何让对话框最小化时图标在状态栏里(就是屏幕右下角),谢谢
- 请教在delphi中,如何让form最小化时,缩成一个图标在屏幕右下角的状态栏上。(实现c++builder中TrayIcon1的功能)
- 如何将窗体最小化到状态栏
- 怎样让程序最小化后到状态栏中?************************************************************************
- 怎么样使-----最小化窗体到状态栏
- 如何能让程序在最小化时进入状态栏?
- CFormView 的状态栏图标




