title image


Smiley Re: Tasksymbol die x-te! Vielleicht weis es jetzt jemand...
Es ist lösbar etwa so:Folgendes kommt in ein Std.Modul:Public 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 Global tsym As NOTIFYICONDATA Global Const NIM_ADD = &H0 Global Const NIM_MODIFY = &H1 Global Const NIM_DELETE = &H2 Global Const NIF_MESSAGE = &H1 Global Const NIF_ICON = &H2 Global Const NIF_TIP = &H4 Global Const WM_MOUSEMOVE = &H200 Public Const WM_LBUTTONDBLCLK = &H203 Public Const WM_LBUTTONDOWN = &H201 Public Const WM_LBUTTONUP = &H202 Public Const WM_RBUTTONDBLCLK = &H206 Public Const WM_RBUTTONDOWN = &H204 Public Const WM_RBUTTONUP = &H205 Public Const WM_NULL = &H0 Public Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As LongDeclare Function Shell_NotifyIconA Lib "shell32" (ByVal dwMessage As Long, lpData As NOTIFYICONDATA) As Integer---------------------------------------------------------Und das in eine Form mit 2 buttons + eine Picture Box' TraysymbolDim AlsSymbolSub Tasksymbol(anaus) If anaus Then tsym.cbSize = Len(tsym) tsym.hWnd = Picture1.hWnd tsym.uID = 1& tsym.uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP tsym.uCallbackMessage = WM_MOUSEMOVE tsym.hIcon = Me.Icon tsym.szTip = "Tasksymbol Demo" & Chr$(0) Shell_NotifyIcon NIM_ADD, tsym Else Shell_NotifyIcon NIM_DELETE, tsym End IfEnd SubPrivate Sub cmdBeenden_Click() Tasksymbol (False) EndEnd SubPrivate Sub cmdMinimieren_Click() Me.Hide Tasksymbol (True)End SubPrivate Sub Form_Load() Me.Icon = LoadPicture("Icon.ico") AlsSymbol = True Tasksymbol (AlsSymbol) Me.HideEnd SubPrivate Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer) Tasksymbol FalseEnd SubPrivate Sub mnuBeenden_Click() Tasksymbol (False) Unload Me EndEnd SubPrivate Sub mnuInfo_Click() MsgBox "Info !"End SubPrivate Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)Static bRunning As Boolean Dim lMsg As Long lMsg = X / Screen.TwipsPerPixelX If Not (bRunning) Then bRunning = True Select Case lMsg 'Doppelklick linke Maustaste Case WM_LBUTTONDBLCLK: '... 'Klick linke Maustaste Case WM_LBUTTONUP: WindowState = 0 Me.Show 'Doppelklick rechte Maustaste Case WM_RBUTTONDBLCLK: '... 'Klick rechte Maustaste Case WM_RBUTTONUP: Me.PopupMenu mnuTask, , , , mnuInfo End Select bRunning = False End IfEnd Sub

geschrieben von

Login

E-Mail:
  

Passwort:
  

Beitrag anfügen

Symbol:
 
 
 
 
 
 
 
 
 
 
 
 
 

Überschrift: