• Placing an icon in the system tray (2002 SP1)

    Home » Forums » AskWoody support » Productivity software by function » MS Access and database help » Placing an icon in the system tray (2002 SP1)

    Author
    Topic
    #382289

    I want to be able to run an Access app in the background, showing an icon in the system tray. I’ve managed to get the code to do everything I need except show the icon. In VB, you can use the following statement:

    nid.hIcon = Me.Icon

    where Me.Icon is a form icon, and nid is a reference to the Shell_NotifyIcon API call.

    Access doesn’t seem to expose an icon property. How can I get round this in VBA?

    Many thanks

    Mark Hartt-Palmer

    Viewing 2 reply threads
    Author
    Replies
    • #647476

      An Access “application” actually is a database; MSAccess.exe is the application running the database. An Access database can display a custom icon, but that icon isn’t stored in the database itself. The AppIcon property of the database is a string that can contain the path + filename of an icon file; it doesn’t contain an IPictureDisp object.

      Perhaps you can use LoadPicture(CurrentDb.Properties(“AppIcon”)) – haven’t tested that, though. You’d need to handle errors occurring when the AppIcon property hasn’t been set, or is invalid.

    • #647477

      Mark,

      Have a look at Subclassing form for SysTray functionality from the MVPs Access Web site.

      It may do what you are looking for.

    • #647649

      My MiniCalendar allows you to ‘drop’ the MiniCalendar to the system tray. (It also can hide Access, so in effect you have no visible signs of Access on your desktop, other then the system tray.). I must admit I used code from the Access Web to do it (http://www.mvps.org/Access). I think I revamped the code that actually sends it to the system try, but in order for that whole process to work, you need to have an AddressOf function, which VBA does not have. THere is a module on the Access web (and in my db) that replicates the ability. My MiniCalendar is on the Access Web (http://mvps.org/access/forms/frm0050.htm), but it is an older version. (Hold the shift key when opening it, then open the frmDateForm Form. Click the Cycle Mode button. When the MiniCalendar is in ‘cycle mode’, you get a computer screen icon with a moon in it. Clicking that will put the MiniCalendar into the System tray.

      The version on the Access Web is old. I can send you the latest current version by email if you want. (My site is down due to DSL issues.). I am also working on another new version, which is a complete revamp. Ironically I just started yesterday.

    Viewing 2 reply threads
    Reply To: Placing an icon in the system tray (2002 SP1)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: