Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

System tray

Empfohlene Antworten

Das machst du mit API-Funktionen. Welche das sind weiß ich jetzt nicht. Guck doch mal in der Hilfe nach.

Hi!

Ich habe den Code und kann ihn dir morgen mal posten!

... uups, ob ich's morgen schaff, weiß ich nicht.

Aber bis MOntag spätestens.

Gruß,

Technician

Hi,

das macht Du mit der API Funktion Shell_NotifyIcon.

Wenn Du ein Beispiel haben willst schicke ich Dir gerne eins per Mail.

Gruss

HansiPansi

Hi!

Ich hab gestern abend noch das Tutorial rausgekramt. Ist eigentlich alles drin, was man mit dem Systray-Icon alles so machen kann (inklusive Menü)

Gruß und viel Spaß damit :)

Technician

- - - - - - - - - - - - - - - - - - -

Eigenes Icon in der Taskbar

Jeder kennt sie, die futzeligen Bildchen, meist unten rechts in der Ecke gelegen. Das geht auch mit VB. Neben dem Darstellen eines beliebigen Symbols und dem einschlägigem Starten des zugehörigen Progamms nach einem Doppelklick auf dieses, kann hiermit auch ein PopUp-Menü eingespielt werden. Weiterhin kann zwischen Klick & Doppelklick mit der rechten bzw. linken Maustaste reagiert werden. Auch ein Mausmoveereignis und die Möglichkeit des ToolTipTextes gibt es.


Option Explicit


Private Declare Function Shell_NotifyIcon Lib "shell32"Alias _

        "Shell_NotifyIconA" (ByVal dwMessage As Long, pnid As _

        NOTIFYICONDATA) As Boolean


Const NIM_ADD = &H0

Const NIM_MODIFY = &H1

Const NIM_DELETE = &H2

Const NIF_MESSAGE = &H1

Const NIF_ICON = &H2

Const NIF_TIP = &H4


Const WM_MOUSEMOVE = &H200

Const WM_LBUTTONDOWN = &H201

Const WM_LBUTTONUP = &H202

Const WM_LBUTTONDBLCLK = &H203

Const WM_RBUTTONDOWN = &H204

Const WM_RBUTTONUP = &H205

Const WM_RBUTTONDBLCLK = &H206


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


Dim TIcon As NOTIFYICONDATA


Private Sub Form_Load()

  Me.Hide

  App.TaskVisible = False

  mnBar.Visible = False


  TIcon.cbSize = Len(TIcon)

  TIcon.hWnd = Picture1.hWnd

  TIcon.uId = 1&

  TIcon.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE

  TIcon.ucallbackMessage = WM_MOUSEMOVE

  TIcon.hIcon = Me.Icon

  TIcon.szTip = "Was soll ich dazu sagen" & Chr$(0)


  Shell_NotifyIcon NIM_ADD, TIcon

End Sub


Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)

  Form1.Hide

  If UnloadMode = vbAppWindows Or UnloadMode = vbFormCode Then

    Shell_NotifyIcon NIM_DELETE, TIcon

  Else

    Cancel = 1

  End If

End Sub


Private Sub mnBeep_Click()

  Beep

End Sub


Private Sub mnExit_Click(Index As Integer)

  Shell_NotifyIcon NIM_DELETE, TIcon

  Unload Me

End Sub


Private Sub mnMsgShow_Click()

  MsgBox ("Hier bin ich")

End Sub


Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, _

                               x As Single, Y As Single)

  Dim Msg&

    Msg = x / Screen.TwipsPerPixelX


    Select Case Msg

      Case WM_MOUSEMOVE: Beep

      Case WM_LBUTTONDBLCLK: Me.Show

      Case WM_LBUTTONDOWN:

      Case WM_LBUTTONUP:

      Case WM_RBUTTONDBLCLK: Me.Show

      Case WM_RBUTTONDOWN:

      Case WM_RBUTTONUP: Me.PopupMenu mnBar

    End Select

End Sub


Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.