Skip to content

systemtray

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #190942

    hay guys i need a code to send the program to systemtray anyone got it? thanks

    #190944
    Admin
    Administrator

    Well I found this on I dont understand it tho, but thats an example they gave 😕

    Option Explicit

    Private Declare Function Shell_NotifyIcon Lib "shell32" Alias "Shell_NotifyIconA" ( _
    ByVal dwMessage As Long, _
    pnid As NOTIFYICONDATA) _
    As Long

    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

    Private Const NIM_ADD = &H0
    Private Const NIM_MODIFY = &H1
    Private Const NIM_DELETE = &H2
    Private Const NIF_MESSAGE = &H1
    Private Const NIF_ICON = &H2
    Private Const NIF_TIP = &H4

    Private Const WM_LBUTTONDBLCLK = &H203
    Private Const WM_LBUTTONDOWN = &H201
    Private Const WM_RBUTTONUP = &H205

    Private Sub Form_Load()
    Dim NID As NOTIFYICONDATA

    'Set the data
    With NID
    .cbSize = Len(NID)
    .hIcon = Me.Icon
    .hWnd = Me.hWnd
    .szTip = "Tray Application" & vbNullChar
    .ucallbackMessage = WM_LBUTTONDBLCLK
    .uFlags = NIF_MESSAGE Or NIF_ICON Or NIF_TIP
    .uId = 1&
    End With
    'Add the Icon
    Shell_NotifyIcon NIM_ADD, NID
    End Sub

    Private Sub Command1_Click()
    Shell_NotifyIcon NIM_DELETE, NID
    End Sub
    #190943
    Admin
    Administrator

    k…

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.