13 |
|
|
14 |
Public Type NOTIFYICONDATA |
Public Type NOTIFYICONDATA |
15 |
cbSize As Long |
cbSize As Long |
16 |
hWnd As Long |
hwnd As Long |
17 |
uId As Long |
uId As Long |
18 |
uFlags As Long |
uFlags As Long |
19 |
uCallBackMessage As Long |
uCallBackMessage As Long |
48 |
|
|
49 |
Public nid As NOTIFYICONDATA |
Public nid As NOTIFYICONDATA |
50 |
|
|
51 |
|
Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long |
52 |
|
Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long |
53 |
|
|
54 |
Public Sub ShowTrayIcon(MainForm As Form, Caption As String) |
Public Sub ShowTrayIcon(MainForm As Form, Caption As String) |
55 |
' Symbol der Anwendung zum SysTray hinzufügen |
' Symbol der Anwendung zum SysTray hinzufügen |
56 |
With nid |
With nid |
57 |
.cbSize = Len(nid) |
.cbSize = Len(nid) |
58 |
.hWnd = MainForm.hWnd |
.hwnd = MainForm.hwnd |
59 |
.uId = vbNull |
.uId = vbNull |
60 |
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE |
.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE |
61 |
.uCallBackMessage = WM_MOUSEMOVE |
.uCallBackMessage = WM_MOUSEMOVE |
67 |
|
|
68 |
' Anwendung jetzt "verstecken" |
' Anwendung jetzt "verstecken" |
69 |
MainForm.Hide |
MainForm.Hide |
70 |
|
'MainForm.WindowState = vbMinimized |
71 |
|
|
72 |
End Sub |
End Sub |
73 |
|
|
74 |
Public Sub RemoveTrayIcon() |
Public Sub RemoveTrayIcon() |