Results 1 to 3 of 3

Thread: How do you get your app to appear on the task bar?

  1. #1
    Guest

    Cool

    Dear all,

    How do you get yor app to appear on the task bar located on the bottom right hand corner of the windows screen.

    I would alo like to control my app from here.

    Can any any one HELP me!

    Thanks in advance

  2. #2
    Junior Member
    Join Date
    Mar 2000
    Location
    Germany
    Posts
    21
    One solution is to use Microsofts SysTray.ocx.
    But try it like this:

    Private Declare Function Shell_NotifyIcon Lib "shell32.dll" Alias _
    "Shell_NotifyIconA" (ByVal dwMessage As Long, lpData 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

    'Make your own constant, e.g.:
    Private Const NIF_DOALL = NIF_MESSAGE Or NIF_ICON Or NIF_TIP

    Private Const WM_MOUSEMOVE = &H200
    Private Const WM_LBUTTONDBLCLK = &H203
    Private Const WM_LBUTTONDOWN = &H201
    Private Const WM_RBUTTONDOWN = &H204


    Public Sub CreateIcon()
    Dim Tic As NOTIFYICONDATA
    Dim erg As Long
    Tic.cbSize = Len(Tic)
    Tic.hwnd = Picture1.hwnd
    Tic.uID = 1&
    Tic.uFlags = NIF_DOALL
    Tic.uCallbackMessage = WM_MOUSEMOVE
    Tic.hIcon = TrayIcon.Picture
    Tic.szTip = app.title
    erg = Shell_NotifyIcon(NIM_ADD, Tic)
    End Sub


    Public Sub DeleteIcon()
    Dim Tic As NOTIFYICONDATA
    Dim erg As Long
    Tic.cbSize = Len(Tic)
    Tic.hwnd = Picture1.hwnd
    Tic.uID = 1&
    erg = Shell_NotifyIcon(NIM_DELETE, Tic)
    End Sub


    Private Sub Form_Load()

    CreateIcon

    End Sub


    VB 6.0; VC++ 6.0; PERL; PASCAL; BASIC; PHP4; HTML; mySQL

  3. #3
    Guest

    Thumbs up

    Thnaks a lot. I shall try this a little later. Shall post a reply soon.

    Thanks a lot


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