VB shell_notifyicon这个API到底怎么用?系统托盘
模块代码:PrivateTypeNOTIFYICONDATAcbSizeAsLonghWndAsLonguIdAsLonguFlagsAsLongucallbackMes...
模块代码:
Private Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uId As Long
uFlags As Long
ucallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Dim TrayI As NOTIFYICONDATA
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONUP = &H205
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Private Sub Form_Load()
Totray.Into_Tray Me.hWnd, Me.Icon, "Tray Example"
Me.Hide
End Sub
但是以上这段代码,总是提示 form要求对象,对象是什么呢?
还有这到底是什么意思,会的话请详细描述下吧。谢谢 展开
Private Type NOTIFYICONDATA
cbSize As Long
hWnd As Long
uId As Long
uFlags As Long
ucallbackMessage As Long
hIcon As Long
szTip As String * 64
End Type
Dim TrayI As NOTIFYICONDATA
Public Const NIM_ADD = &H0
Public Const NIM_MODIFY = &H1
Public Const NIM_DELETE = &H2
Public Const NIF_MESSAGE = &H1
Public Const NIF_ICON = &H2
Public Const NIF_TIP = &H4
Public Const WM_LBUTTONDBLCLK = &H203
Public Const WM_LBUTTONDOWN = &H201
Public Const WM_RBUTTONUP = &H205
Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean
Private Sub Form_Load()
Totray.Into_Tray Me.hWnd, Me.Icon, "Tray Example"
Me.Hide
End Sub
但是以上这段代码,总是提示 form要求对象,对象是什么呢?
还有这到底是什么意思,会的话请详细描述下吧。谢谢 展开
3个回答
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
你在form_load过程中写的代码有问题.
应该先给变量TrayI赋值,然后再调用API函数Shell_NotifyIcon .
应该先给变量TrayI赋值,然后再调用API函数Shell_NotifyIcon .
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
没看到呢调用 Shell_NotifyIcon
调用她的代码呢
调用她的代码呢
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询