Results 1 to 2 of 2

Thread: show the icons in the windows taskbar

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2002
    Posts
    97

    show the icons in the windows taskbar

    hi all
    how can i show the icons of my program in the windows task bar and when i right click on it give me option of close the program
    thanx alot

  2. #2
    Addicted Member
    Join Date
    Sep 2002
    Posts
    251

    Hail

    To put your Icon in the system tray copy and paste this into your code form...

    Option Explicit

    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 NID As NOTIFYICONDATA

    Private Const NIM_ADD = &H0
    Private Const NIM_MODIFY = &H1
    Private Const NIM_DELETE = &H2
    Private Const WM_MOUSEMOVE = &H200
    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_LBUTTONUP = &H202
    Private Const WM_RBUTTONDBLCLK = &H206
    Private Const WM_RBUTTONDOWN = &H204
    Private Const WM_RBUTTONUP = &H205

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

    Private Sub Form_Load()

    Me.Hide
    NID.cbSize = Len(NID)
    NID.hWnd = Me.hWnd
    NID.uid = vbNull
    NID.uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE
    NID.uCallBackMessage = WM_MOUSEMOVE
    NID.hIcon = Me.Icon
    NID.szTip = "This Is A Test" & vbNullChar
    Shell_NotifyIcon NIM_ADD, NID

    End Sub

    Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
    '==========================================
    Dim msg As Long

    msg = X / Screen.TwipsPerPixelX
    Select Case msg
    Case WM_LBUTTONDOWN
    PopupMenu mnuFile
    Case WM_LBUTTONUP

    Case WM_LBUTTONDBLCLK

    Case WM_RBUTTONDOWN

    Case WM_RBUTTONUP

    Case WM_RBUTTONDBLCLK

    End Select

    End Sub


    Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As Integer)
    Shell_NotifyIcon NIM_DELETE, NID
    End Sub

    Private Sub mnuExit_Click()
    Unload Me
    End Sub

    ++++++++++++++++++++++++++++++++++++++++++++++

    I am not sure... But I think its have something to do with make a menu, where the head is invisible.. and the rest that is inside of it, is visible....

    Hope that it helps.. =-)

    Elminster

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width