Results 1 to 4 of 4
  1. #1
    New Lounger
    Join Date
    Aug 2002
    Location
    England
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Placing an icon in the system tray (2002 SP1)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Placing an icon in the system tray (2002 SP1)

    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.

  3. #3
    5 Star Lounger
    Join Date
    Jul 2002
    Location
    Toronto, Ontario, Canada
    Posts
    1,139
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Placing an icon in the system tray (2002 SP1)

    Mark,

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

    It may do what you are looking for.
    --
    Bryan Carbonnell - Toronto <img src=/S/flags/Ontario.gif border=0 alt=Ontario width=30 height=18> <img src=/S/flags/Canada.gif border=0 alt=Canada width=30 height=18>
    Unfortunately common sense isn't so common!!
    Visit my website for useful Word, Excel and Access code, templates and Add-Ins

  4. #4
    4 Star Lounger
    Join Date
    Aug 2002
    Location
    Dallas, Texas, USA
    Posts
    594
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Placing an icon in the system tray (2002 SP1)

    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.

Posting Permissions

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