掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
バルーンヘルプを表示するには? (ID:112331)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
参考までに 私の環境 WinXP SP1 Shell32.dll 6.0.2800.1145 で動作したソースを載せておきます フォームにボタンとラベルを貼り付けておいてください Module1 -------------------------------------------------------- 'API宣言 Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Long '構造体宣言 Public Type NOTIFYICONDATA cbSize As Long hWnd As Long uID As Long uFlags As Long uCallbackMessage As Long hIcon As Long szTip As String * 128 dwState As Long dwStateMask As Long szInfo As String * 256 uTimeoutOrVersion As Long szInfoTitle As String * 64 dwInfoFlags As Long End Type 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 NIF_INFO = &H10 'マウス操作 Public Const WM_MOUSEMOVE = &H200 Public Const WM_USER = &H400 Public Const NIN_BALLOONSHOW = (WM_USER + 2) Public Const NIN_BALLOONUSERCLICK = (WM_USER + 5) -------------------------------------------------------- Form1 -------------------------------------------------------- Option Explicit Private Sub Command1_Click() Dim ret As Long Dim trayicon As NOTIFYICONDATA '-------------バルーン表示------------- With trayicon .cbSize = Len(trayicon) .uFlags = NIF_INFO .hWnd = Form1.hWnd .szInfoTitle = "TitleTest" & Chr(0) .szInfo = "MessageTest" & Chr(0) .dwInfoFlags = 1 End With ret = Shell_NotifyIcon(NIM_MODIFY, trayicon) '-------------バルーン表示END------------- End Sub Private Sub Form_Load() Dim ret As Long Dim trayicon As NOTIFYICONDATA Form1.ScaleMode = 3 '-------------タスクトレイへ表示------------- With trayicon .cbSize = Len(trayicon) .hWnd = Form1.hWnd .uID = 0& .uFlags = NIF_ICON Or NIF_MESSAGE Or NIF_TIP .uCallbackMessage = WM_MOUSEMOVE .hIcon = Form1.Icon .szTip = "TipTest" & Chr(0) End With ret = Shell_NotifyIcon(NIM_ADD, trayicon) '-------------タスクトレイへ表示END------------- End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Select Case X Case NIN_BALLOONSHOW Label1.Caption = "表示された" Case NIN_BALLOONUSERCLICK Label1.Caption = "クリック" End Select End Sub Private Sub Form_Unload(Cancel As Integer) Dim ret As Long Dim trayicon As NOTIFYICONDATA '-------------タスクトレイから削除------------- With trayicon .cbSize = Len(trayicon) .hWnd = Form1.hWnd .uID = 0& End With ret = Shell_NotifyIcon(NIM_DELETE, trayicon) '-------------タスクトレイから削除END------------- End Sub -------------------------------------------------------- このままだといろいろと不都合があると思われますので 参考程度にとどめておいてください
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2020 Takeshi Okamoto All Rights Reserved.