程序在托盘应该有直接的方法实现能拿到具体的实现
------解决方案--------------------------------------------------------
你用spy++看,可以找到任务栏的句柄,以及托盘的句柄,进而知道他们的位置。用findwindowapi和getwindowrect可以实现这个过程。
------解决方案--------------------------------------------------------
工具框notifyicon创建后会显视在托盘
------解决方案--------------------------------------------------------
d出框的大小肯定是固定的,难道图标离右边距有1Cm时你的d出框的宽度只有1Cm吗。
VB获取托盘tip,这样的代码和例子很多,这里不能贴链接,只能自己搜了
我以前的需求和你一样,也找了很多的例子,但是代码都不能在WIN7下使用,至少我测试的WIN7 64X无效,只能在XP下
如果是插入U盘安全删除该如何用键盘实现
WIN+D再用方向键和tab选择到系统托盘的移动硬盘上,你要仔细一点,因为光标这时很不好找,光标到移动硬盘上,回车,确定。
说实话,直接是打不开的
可以间接一点:
按WIN键————打开开始菜单---用上下左右方向键选择你在系统托盘要打开的程序————选中
,回车
行了。
要定位填写的对话框的话,我一直用Tab键,一按就是了,如果选择前一个对话框,就按shift+tab键切换
激活桌面图标也简单:用Tab选中要打开的图标,回车!
往回选的话,用shift+tab键
此外还有很多快捷键
比如
ALT+F4是关闭当前窗口
ALT+TAB是切换窗口
WIN+M是最小化所有程序……
看看我实现FORM1VERSION 500
Begin VBForm Form1
Caption = "Form1"
ClientHeight = 3090
ClientLeft = 60
ClientTop = 450
ClientWidth = 4680
LinkTopic = "Form1"
ScaleHeight = 3090
ScaleWidth = 4680
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin VBLabel Label1
Caption = "点击化按钮即化托盘"
Height = 615
Left = 240
TabIndex = 0
Top = 600
Width = 3735
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False'化托盘(类似于QQ)'说明:Form1ShowInTaskBar属性设置False(已修改完毕) 图标放入式 Private Sub Form_Load()
With nfIconData
hWnd = MehWnd
uID = MeIcon
uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP
uCallbackMessage = WM_MOUSEMOVE
hIcon = MeIconHandle
'定义鼠标移托盘显示Tip
szTip = AppTitle + "(版本 " & AppMajor & "" & AppMinor & "" & AppRevision & ")" & vbNullChar
cbSize = Len(nfIconData)
End With
Call Shell_NotifyIcon(NIM_ADD, nfIconData)End Sub Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)Call Shell_NotifyIcon(NIM_DELETE, nfIconData)
End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
Dim lMsg As Single
lMsg = X / ScreenTwipsPerPixelX
Select Case lMsg
Case WM_LBUTTONUP
'单击左键显示窗体
ShowWindow MehWnd, SW_RESTORE
End Select
End Sub
module1Attribute VB_Name = "Module1"
Option Explicit
Public Const MAX_TOOLTIP As Integer = 64
Public Const NIF_ICON = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_TIP = &H4
Public Const NIM_ADD = &H0
Public Const NIM_DELETE = &H2
Public Const WM_MOUSEMOVE = &H200
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_LBUTTONUP = &H202
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_RBUTTONDOWN = &H204
Public Const WM_RBUTTONUP = &H205
Public Const WM_RBUTTONDBLCLK = &H206Public Const SW_RESTORE = 9
Public Const SW_HIDE = 0Public nfIconData As NOTIFYICONDATA
Public Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uID As Long
uFlags As Long
uCallbackMessage As Long
hIcon As Long
szTip As String MAX_TOOLTIP
End TypePublic Declare Function ShowWindow Lib "user32" (ByVal hWnd As Long, ByVal nCmdShow As Long) As Long
Public Declare Function Shell_NotifyIcon Lib "shell32dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long
如果在[向日葵配置项]-[基本设置]中选择了“自动启动时,仅以服务方式运行,不显示系统托盘图标”,将不会显示向日葵托盘图标。
如果要重新显示并更新相关设置,只需在开始菜单中找到向日葵程序,点击运行,向日葵将会启动前端程序,并出现托盘图标。
以上就是关于请教C# win7系统中 如何获得任务栏托盘图标的坐标全部的内容,包括:请教C# win7系统中 如何获得任务栏托盘图标的坐标、求大神指点vb.net怎么获取托盘里面所有图标的信息呀、如何利用键盘实现打开系统托盘图标功能比如QQ.千千静听等!谢谢各位大侠等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)