--- joko/ToolBox/Windows/VpnDial/src/TrayIcon.bas 2005/10/09 18:38:24 1.1 +++ joko/ToolBox/Windows/VpnDial/src/TrayIcon.bas 2005/11/22 22:19:00 1.2 @@ -13,7 +13,7 @@ Public Type NOTIFYICONDATA cbSize As Long - hWnd As Long + hwnd As Long uId As Long uFlags As Long uCallBackMessage As Long @@ -48,13 +48,14 @@ Public nid As NOTIFYICONDATA - +Public Declare Function GetWindowThreadProcessId Lib "user32" (ByVal hwnd As Long, lpdwProcessId As Long) As Long +Public Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Long) As Long Public Sub ShowTrayIcon(MainForm As Form, Caption As String) ' Symbol der Anwendung zum SysTray hinzufügen With nid .cbSize = Len(nid) - .hWnd = MainForm.hWnd + .hwnd = MainForm.hwnd .uId = vbNull .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE .uCallBackMessage = WM_MOUSEMOVE @@ -66,6 +67,8 @@ ' Anwendung jetzt "verstecken" MainForm.Hide + 'MainForm.WindowState = vbMinimized + End Sub Public Sub RemoveTrayIcon()