Results 1 to 6 of 6

Thread: Help!! Notify icon Problem

  1. #1

    Thread Starter
    Lively Member nokia8210's Avatar
    Join Date
    Dec 2002
    Location
    Coventry
    Posts
    92

    Help!! Notify icon Problem

    Hi,
    I have a notify icon in my system tray and all works well but when i go to shutdown my machine it does nothing.

    When I close down the program from the system tray then shutdown its shuts down as normal.

    is there any bit of code i could use to close the program when windows shut's down.

    i'm using this code but it doesn't seem to work.

    Private Sub FaultReport_Closing(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles MyBase.Closing
    If frmclose = True Then
    Else
    If Microsoft.Win32.SessionEndReasons.SystemShutdown = True Then
    Me.Close()
    Else
    Me.Hide()
    e.Cancel = True
    End If

    End If

    End Sub


    Private Sub MnuClose_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MnuClose.Click
    frmclose = True

    Me.Close()

    End Sub

  2. #2
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    Try this to exit the application .
    VB Code:
    1. Application.Exit()

  3. #3

    Thread Starter
    Lively Member nokia8210's Avatar
    Join Date
    Dec 2002
    Location
    Coventry
    Posts
    92
    have tried replacing me.close with application.exit
    but doesn't seem to work.

    any other ideas???

  4. #4
    Sleep mode
    Join Date
    Aug 2002
    Location
    RUH
    Posts
    8,083
    What do you want to do exactly ?

  5. #5

    Thread Starter
    Lively Member nokia8210's Avatar
    Join Date
    Dec 2002
    Location
    Coventry
    Posts
    92
    when this program is exited rather than closing it hides and and notify icon apears in the system tray rather like msn messenger. to close it properly u right click the click the icon and select close.
    but if you try and shutdown/log out of windows it does nothing cuz in some way the program stops the shutdown/lof off comand. when you close the program fully it shuts down fine. what i want it to do is when the system is shutting down for it to close automatically but it wont? any ideas?

  6. #6
    Member McBain2's Avatar
    Join Date
    Sep 2003
    Location
    UK, Glos.
    Posts
    60
    Well this has nothing to do with the notify icon, but...
    is exactly the problem i had and posted on here the other day...

    http://www.vbforums.com/showthread.p...33#post1606833

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