ERLEDIGT
NEIN
NEIN
ANTWORTEN
2
2
ZUGRIFFE
2892
2892
EMPFEHLEN
-
Hey Leute
Wie bekomme ich es hin, daß sich ein Tooltip, der sich über dem Icon eines Programmes in der Systemtray öffnet, ständig aktualisiert?
Ich habe da derzeit eine Funktion stehen, die die Zeit ausliest und anzeigt. Allerdings steht da diese Uhrzeit die ganze Zeit da. Sie wird erst aktualisiert, sobald ich das Programm wieder maximiert habe. Nach einem weiteren Minimieren steht zwar die "aktuellere" Uhrzeit da, jedoch bleibt diese wiederum stehen. Kann mir da jemand helfen, wie ich so etwas genauer angehen könnte?
Danke im Vorraus!Geändert von keiler (14.03.03 um 16:33 Uhr)
-
Ich kann dir zwar nicht helfen aber habe eine frage: Welchen Befehl nimmst du um das Programm zu Maxi/Minimieren ****? Ich habe VB .NET und habe noch keinen Befehl dafür gefunden. Danke schonma im VorrausOriginal geschrieben von keiler
Hey Leute
Wie bekomme ich es hin, daß sich ein Tooltip, der sich über dem Icon eines Programmes in der Systemtray öffnet, ständig aktualisiert?
Ich habe da derzeit eine Funktion stehen, die die Zeit ausliest und anzeigt. Allerdings steht da diese Uhrzeit die ganze Zeit da. Sie wird erst aktualisiert, sobald ich das Programm wieder maximiert habe. Nach einem weiteren Minimieren steht zwar die "aktuellere" Uhrzeit da, jedoch bleibt diese wiederum stehen. Kann mir da jemand helfen, wie ich so etwas genauer angehen könnte?
Danke im Vorraus!
-
das hier steht bei mir drinnen bzgl. minimieren (hab ich mal auf so einer anderen tutorial seite gefunden). Du musst eben eben noch einen Button mit der Bezeichnung cmdMinimizeMe erstellen.
Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
'Declare a user-defined variable to pass to the Shell_NotifyIcon 'function. 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 'Declare the constants for the API function. These constants can be 'found in the header file Shellapi.h. 'The following constants are the messages sent to the 'Shell_NotifyIcon function to add, modify, or delete an icon from the 'taskbar status area. Private Const NIM_ADD = &H0 Private Const NIM_MODIFY = &H1 Private Const NIM_DELETE = &H2 'The following constant is the message sent when a mouse event occurs 'within the rectangular boundaries of the icon in the taskbar status 'area. Private Const WM_MOUSEMOVE = &H200 'The following constants are the flags that indicate the valid 'members of the NOTIFYICONDATA data type. Private Const NIF_MESSAGE = &H1 Private Const NIF_ICON = &H2 Private Const NIF_TIP = &H4 'The following constants are used to determine the mouse input on the 'the icon in the taskbar status area. 'Left-click constants. Private Const WM_LBUTTONDBLCLK = &H203 'Double-click Private Const WM_LBUTTONDOWN = &H201 'Button down Private Const WM_LBUTTONUP = &H202 'Button up 'Right-click constants. Private Const WM_RBUTTONDBLCLK = &H206 'Double-click Private Const WM_RBUTTONDOWN = &H204 'Button down Private Const WM_RBUTTONUP = &H205 'Button up 'Declare the API function call. Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean 'Dimension a variable as the user-defined data type. Dim nid As NOTIFYICONDATA Private Sub cmdMinimizeMe_Click() WindowState = vbMinimized Visible = False End Sub ' Note: This will be called after the "WindowState = vbMinimized" line. This is not in cmdMinimizeMe_Click() because there are still other ways to minimize the application. Private Sub Form_Resize() If Me.WindowState = vbMinimized Then 'Set the individual values of the NOTIFYICONDATA data type. nid.cbSize = Len(nid) nid.hWnd = Me.hWnd nid.uId = vbNull nid.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE nid.uCallBackMessage = WM_MOUSEMOVE nid.hIcon = Me.Icon ' This is the icon that appears in the system tray nid.szTip = "[Enter tooltip here]" & vbNullChar 'Call the Shell_NotifyIcon function to add the icon to the taskbar 'status area. Shell_NotifyIcon NIM_ADD, nid End If End Sub Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single) Dim msg As Long Dim sFilter As String msg = X / Screen.TwipsPerPixelX Select Case msg ' Select your own event to use Case WM_LBUTTONUP WindowState = vbNormal Visible = True ' Remove the system tray icon Shell_NotifyIcon NIM_DELETE, nid Case WM_RBUTTONDOWN Dim ToolTipString As String ToolTipString = InputBox("Enter the new ToolTip:", _ "Change ToolTip") If ToolTipString <> "" Then nid.szTip = ToolTipString & vbNullChar Shell_NotifyIcon NIM_MODIFY, nid End If End Select End Sub
Ähnliche Themen
-
JFrame in SystemTray darstellen
Von Hal1983 im Forum Swing, Java2D/3D, SWT, JFaceAntworten: 2Letzter Beitrag: 19.07.07, 10:13 -
Java Applikation in SystemTray
Von fanste im Forum JavaAntworten: 16Letzter Beitrag: 22.02.06, 20:31 -
SystemTray Icon (c++ / API)
Von darko-micic im Forum C/C++Antworten: 4Letzter Beitrag: 11.09.05, 13:29 -
Programme verschwinden im Systemtray
Von jayjayjay im Forum Microsoft WindowsAntworten: 3Letzter Beitrag: 26.03.04, 10:18 -
Outlook Systemtray
Von Gunnitarrist im Forum Office-AnwendungenAntworten: 2Letzter Beitrag: 08.01.02, 20:59





Zitieren
Login





