在托盤上顯示Balloon Tooltip(VB.NET) (轉)
使用VB編寫在托盤上顯示Balloon提示的功能就需要了,但是和程式碼上還是有些不同的,紅色部分即為二者區別
Imports System.Runtime.InteropServices
Public Class Form1
Inherits System..Forms.Form
#Region "Win32Api_NotifyIcon"
Private Declare Function _NotifyIcon Lib "shell32.dll" Alias _
"Shell_NotifyIconA" (ByVal dwMessage As Int32, _
ByRef lpData As NOTIFYICONDATA) As Int32
Public cbSize As Int32
Public hwnd As IntPtr
Public uId As Int32
Public uFlags As Int32
Public uCallBackMessage As Int32
Public hIcon As IntPtr
Public szTAs String
Public dwState As Int32
Public dwStateMask As Int32
Public szInfo As String
Public uTimeoutOrVersion As Int32
Public szInfoTitle As String
Public dwInfoFlags As Int32
End Structure
Private Const NOTIFYICON_VERSION = 3
Private Const NOTIFYICON_OLDVERSION = 0
Private Const NIM_ADD = &H0
Private Const NIM_MODIFY = &H1
Private Const NIM_DELETE = &H2
Private Const NIM_SETFOCUS = &H3
Private Const NIM_SETVERSION = &H4
Private Const NIF_MESSAGE = &H1
Private Const NIF_ICON = &H2
Private Const NIF_TIP = &H4
Private Const NIF_STATE = &H8
Private Const NIF_INFO = &H10
Private Const NIS_HIDDEN = &H1
Private Const NIS_SHAREDICON = &H2
Private Const NIIF_NONE = &H0
Private Const NIIF_WARNING = &H2
Private Const NIIF_ERROR = &H3
Private Const NIIF_INFO = &H1
Private nfIconData As NOTIFYICONDATA
#End Region
Private Sub Form1_Load(ByVal sender As System., ByVal e As System.EventArgs) Handles MyBase.Load
nfIconData = New NOTIFYICONDATA()
With nfIconData
.cbSize = System.Runtime.InteropServices.Marshal.SizeOf(nfIconData)
.hwnd = Me.Handle
.uId = vbNull
.uFlags = NIF_INFO Or NIF_ICON Or NIF_TIP Or NIF_MESSAGE
.hIcon = Me.Icon.Handle
.szTip = "123" '& .VisualBasic.vbNullChar
.dwState = 0
.dwStateMask = 0
.szInfo = "Balloon Style Tool-tip" & Chr(13) & "哈哈" '& vbNullChar
.uTimeoutOrVersion = 15000
.szInfoTitle = "看到了麼?" '& Microsoft.VisualBasic.vbNullChar
.dwInfoFlags = NIIF_INFO
End With
Call Shell_NotifyIcon(NIM_ADD, nfIconData)
End Sub
Private Sub Form1_Closed(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Closed
Call Shell_NotifyIcon(NIM_DELETE, nfIconData)
End Sub
End Class
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/10752043/viewspace-962117/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 在托盤上顯示Balloon Tooltip (轉)
- 在托盤上顯示Balloon Tooltip
- Winform設定托盤程式,托盤顯示ORM
- win10托盤圖示不顯示怎麼回事_win10工作列托盤圖示顯示不完全如何修復Win10
- 系統托盤中的快捷圖示(轉)
- element table 表頭顯示 tooltip
- 關於對話方塊最小化到托盤後,點選托盤圖示後只在工作列顯示而無法還原視窗的解決方法。
- 【Qt開發】實現系統托盤,托盤選單,托盤訊息QT
- 在工作列上顯示圖示 (轉)
- flutter在IOS上顯示英文FlutteriOS
- 托盤程式設計全接觸(轉)程式設計
- 托盤程式設計全接觸 (轉)程式設計
- 自己動手寫類似酷狗播放器(4)_系統托盤的顯示播放器
- 在Ubuntu 18.04中安裝Wine QQ、微信、TIM,並安裝圖示托盤Ubuntu
- C# 托盤通知C#
- 系統托盤建立
- Windows10系統怎麼隱藏托盤圖示Windows
- Delphi托盤程式設計實戰演練 (轉)程式設計
- Qt視窗在螢幕上居中顯示QT
- Element 利用Tooltip提示框實現動態顯示文字提示
- element-plus中的el-table元件tooltip顯示錯位元件
- 紋理是怎樣顯示在模型上的模型
- App在iOS 11下真機顯示正常模擬器上顯示有問題APPiOS
- 在VB.NET中尋找App (轉)APP
- Avalonia 實現動態托盤
- JAVA托盤程式SystemTray的心得Java
- swt 簡單的托盤程式
- 敲擊鍵盤後字元怎麼出現在顯示器字元
- 10g ocm 資訊顯示在oracle 官網上Oracle
- 在 Linux 上為你的任務建立一個自定義的系統托盤指示器Linux
- java 在控制檯上輸入密碼時,密碼不顯示在控制檯上Java密碼
- (轉)iOS長按textView複製貼上顯示中文iOSTextView
- Java中如何使用系統托盤Java
- 系統托盤建立M4
- 淺析VB.NET實現下拉選單的折行顯示
- win7系統隱藏NVIDIA托盤圖示的操作方法Win7
- 三種方法教你在 Mac 上顯示隱藏檔案Mac
- VC實現對話方塊上資訊的顯示 (轉)