Accessing the system tray icon

I've been programming a desktop application with ruby/tk. Using the win32api gem, I've managed to hide and set my program icon to work in the system tray. The icon is displayed succesfully and the texttip works etc.
Now I'd like for the app window to maximize when the tray icon is clicked, or show a menu, but I have no idea how to reference this icon. I used the win32api gem to a) minimize (or hide) the current window via ShowWindow() and b) to create an icon in the
system tray with Shell_NotifyIconA().
Now I want to access the window again via the icon. How can this be achieved?

Hello simon,
According to your description, it seems that this issue seems to be related with Rube development with win32api, for this, I think the Ruby forum is proper for it:
https://www.ruby-forum.com/forum
Regards.
We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
Click
HERE to participate the survey.

Similar Messages

  • Accessing the system tray, Windows 7

    I have Windows 7.  I have a program running named SlinCleaner Plus.  I have tried to uninstall and have not been able to do so.  It seems the program is running continuously in the background.  I apparently have to go the system tray
    to start the removal process.  However, I can not access the system tray.  Question ... What should I do?

    if you are not writing a software, you are on the wrong web site. 
    Visit answers.microsoft.com if you need help in using Windows.
    Visual C++ MVP

  • How to minimize window into the system tray icon

    Hi,
    I tried to fin how to minimize the application main window into the right down corner (system tray bar) only as an icon cause I don't want to have it on main bar.
    Thx for any ideas.
    Wenca

    I've already done that, some years ago.
    Sorry, but I cannot give you the code, cause it has vanished after a few (!!!) system re-installations ;)
    But this was the main idea:
    - make a jni-dll
    - inside the dll, get the handle to the window you want to minimize
    - alter that window's properties
    It's rather easy, once you've avoided all pitfalls. I'll suggest http://www.codeproject.com , they've certainly some tutorials on minimizing to the system tray.

  • Need to Lock down Keyboard Manager System Tray Icon

    I run 27 MacBooks at a Secondary School. I have them setup for Windows XP Pro (I'll be setting up the Mac OS over then next few weeks but this is a MS Windows School so lets start slow). Hoever I need to be able to disable the "Boot Mac OS" option on the Keyboard Manager. But still have access to Volume and Eject etc Keys.
    Solution: 1
    a .adm file so that I can contol what is avilable to students through Group Policy (disable reboot in Mac, Disable Boot Camp First time Run Help Screen)
    Solution 2
    A Keyboard driver that will make all the Keys work (and remote if possible) but has no System tray Icon
    Solution 3
    Hide the System tray icon (as say an option in the Boot Camp Control Panel which I can already disable through group policy) then all I need to kill is the anoying first time run help screen.
    The help screen is anoying because for each of the 800 student will probably only login into each laptop once each so that will come up every time, because I reimage every 3 months or so.
    The reboot in Mac OS would be no problem if it did not perminatly change to boot order and the Mac OS side boot change back is too complicated for most first time Mac users. The way I will be introducing the Mac OS is telling them about the hold the "option" key trick on boot. hence the dummys will get what they are expecting, and the smarties have the option without afecting the dummys.
    I relise this is a Devolopers thing but I can find no other way to inform them of the need. I dout I am the only System admin needing this.
    Thank You
    Message was edited by: Solus Venator

    Unfortunately no that did not help
    Using msconfig only stops the Keyboard Manager from running. I can do that simply be removing it from the registry with out the annoying msconfig messages. (good for testing though)
    I have also looked into the Hide tray Icon Path but that only tucks it behind a set of “<<”
    And the reboot function does Permanently Change the Boot Order. (Not the boot sector necessarily, The Boot Order) to change it back you need to login into the Mac OS and System Prefs Disk Boot Select the Boot Camp Part and Reboot …… Big Pain in neck.
    The Keyboard Manager icon does not have an eject option… If is needed for the Eject Key to work (and the Volume Mute, Up, Down, Brightness Up, Down. Note it is not Needed for the Play FF Rew Keys they work fine with the Fn Key)
    Here is the test
    With no icon showing, or an icon with no reboot option : Press The Eject Key if the CD Ejects Success, I also need Volume do not care about the others as much
    As Stated this is a Developer( Programmer) oversite and needs them to put in an option to remove the reboot option from the System tray Icon. Removal of the Icon would also be desirable
    Thank You

  • Disabling Right Click Menus for Network Magic's System Tray Icons for Standard and Guest Accounts

    OK, so I want to know how to disable the right click menus for Network Magic's system tray icons only for Vista's standard and Guest accounts?   I don't want other users signed in as a Standard account or guest account having the ability to disable the system tray icons for network magic.

    Hi, currently it's not possible to disable NM from being accessed by a Limited user account, but that is a good idea.
    My Cisco Network Magic Configuration:
    Router: D-Link WBR-2310 A1 FW:1.04, connected to Comcast High Speed Internet
    Desktop, iMac: NM is on the Windows Partition, using Boot camp to access Windows, Windows 7 Pro 32-bit RTM, Broadcom Wireless N Card, McAfee Personal Firewall 2009,
    Mac Partition of the iMac is using Mac OS X 10.6.1 Snow Leopard
    Laptop: Windows XP Pro SP3, Intel PRO/Wireless 2200BG, McAfee Personal Firewall 2008
    Please note that though I am a beta tester for Network Magic, I am not a employee of Linksys/Cisco and am volunteering my time here to help other NM users.

  • How do i get the current song to show in the system tray?

    howdy y'all,
    the system tray icon for itunes USED to show the current song when you hovered over it. now it only shows "itunes". not very useful ... [*grin*]
    how do i get the silly thing to show the current song?
    take care,
    lee

    howdy y'all,
    53 views and not one idea from anyone. [*sigh ...*] i suppose that means the nitwits in charge at apple have once again stripped a function away for no rational reason.
    i'm beginning to seriously wonder if i ought to switch to another music manager. i _really_ like the way smart playlists work in itunes, so i am _very_ reluctant to switch.
    anyway, if anyone has a suggestion, please post it! [*grin*]
    take care,
    lee

  • Dynadock V system tray icon has vanished

    I have had a Dynadock V since February, 2012. Recently, the system tray icon vanished. Because it's not there, I can't undock to take my laptop somewhere else. I have to shut down the laptop and then I figure it's safe to unplug the dynadock. I've searched for help on the Toshiba website, and all I get is the statement that the icon won't be present unless the computer is connected and a monitor is attached to the dynadock. Well, the computer IS connected and I'm right now watching the monitor connected via the dynadock. But no icon that lets me undock. The users manual clearly says not to disconnect the cable without undocking, and suggests clicking the "show hidden icons button." I've done that, and the icon is not there. Does anybody know what's going on and how to fix it?  Thanks in advance.
    Nancy
    Solved!
    Go to Solution.

    Solution. After messing around with this for way too many hours, I've found a fix. Maybe it can help someone else.
    In Windows Explorer, I found the application that puts the icon in the tray. In my case (Windows 7) it was located at C:/Program Files/TOSHIBA/Dynadock_II/TosDockApp.exe.  Double clicking that put the icon in the tray, but it would be gone the next time I rebooted.
    It needed to be in the Startup folder. I'm guessing that once upon a time it was there and got removed for some unknown reason. (a Windows update?) Right clicked on the application, clicked "Create Shortcut," clicked Yes to placing it on desktop. Then used the Start button, All Programs, and found Startup in the list. Right click, Open. Maneuevered the window so I could see the desktop simultaneously, and dragged the shortcut from the desktop to the list of files on the right side of the Startup window.
    This solution has survived one computer restart, so I'm hoping it will last.
    By the way, copying the application and pasting it in the startup folder didn't work. I had to make the shortcut.
    And Toshiba, if you're listening, I'm still ticked off. Someone in Customer Support should have been able to help me with this. Or it should have been on a troubleshooting page. I've been struggling to find a solution to this problem for months. It wasn't hard -- just not obvious to someone (me) who doesn't work with this software everyday.

  • [Desktop] System Tray Icon: Add back Playback Controls

    I just downloaded the latest version of Spotify with the minimize Spotify to the system tray.  Thank you for that.  You guys are getting there in fufilling my feedback request to keep the system tray icon.  When Spotify minimizes to the tray, it runs in the backround and does not use up alot of CPU just like the Spotify minmize to taskbar option; however, you still need to work on putting the play, pause, next and previous controls back in the system tray icon.  I'm glad the tray icon is back.  It definately makes our computer perform better when we are listening to our Spotify tunes.  Congratulations!  Hope to see this request get put back in the Spotify system tray icon.  Thank you!

    I agree play/pause, next and previous are needed.In addition, option to minimize the program to tray by double-click would be very useful.

  • System tray Icon!!!

    Hi all,
    I have created an application. Now i want that application to be converted to an exe and i also want to post that into the system tray.
    I just need to have an icon in the destop and wen double cliked it has to reach the system tray. On right clicking on the system tray icon i will need a pop window and show certain funcyions like open,etc....
    kindly help me...
    Thanx for reading....

    To generate an executable you need to use an ahead-of-time Java compiler. Here's one: http://gcc.gnu.org/java/. Although that's for *nix you could check whether it's available in cygwin (I'm assuming you need this for Windows). There are some available for windows but I think they're all commercial (i.e., cost money).
    Keep in mind that by doing this you're losing platform independence.
    As for the system tray icon, can't help you there.

  • System Tray Icon Not Displaying - Depending on Launch Style

    Good Morning-
    I'm using the java.awt.SystemTray and TrayIcon classes from 1.6 to create a system tray that acts essentially as a temperature monitor. It's very little code. When I test it from Eclipse, it works great. When I double-click the .jar on my workstation, it works great. When I launch it with java -jar temp.jar, it works great. When I launch it with javaw -jar temp.jar, I get no tray icon, but javaw sits in memory doing something.
    When my users launch it with a .vbs that calls java -jar temp.jar and hides the resulting terminal window, they get no tray icon. When they call java -jar temp.jar, they get the tray icon... and the console window. When they call javaw -jar temp.jar, they get no tray icon. Any of these practices yields a java process sitting in memory.
    When my users double-click the .jar file, they're asked to chose what to open it with. If they chose Java's executable, it says it doesn't know what to do (it isn't called with -jar). Windows doesn't see their jar files as executables like on mine.
    So I have two issues. The result is the system tray icon won't display on users' computers without a window to accompany it. Any idea why? Is it potentially a bug?
    Some code:
    public class SysTrayController {
         // The actual icon that will be updated
         private TrayIcon          icon;
         // The last-set temperature
         private int                    temp;
         // The box that may or may not appear
         private AlertBox          box;
         // No Data received (yet?)
         public final static int NO_DATA = 0;
         // High temperature threshold.  TODO:  Make this user-configurable.
         private final static int     HIGH_TEMP = 80;
         // ... you guess
         private final static String DEFAULT_ICON =  "icons/default.png";
          * Initiate everything.  Grab the system tray, plop the icon in it, and
          * get the icon all set up and ready to go with the default image.
         public SysTrayController() {
              box = new AlertBox();
              SystemTray tray = SystemTray.getSystemTray();
              Image image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(DEFAULT_ICON));
              PopupMenu popup = new PopupMenu();
              MenuItem exit = new MenuItem("Exit");
              exit.addActionListener(new ActionListener() {
                   public void actionPerformed(ActionEvent e) {
                        System.exit(0);
              popup.add(exit);
              icon = new TrayIcon(image, "Temperature Monitor", popup);
              // On double-click, display the alert box
              icon.addMouseListener(new MouseAdapter() {
                   public void mouseClicked(MouseEvent e) {
                        if (e.getClickCount() >= 2) {
                             box.setVisible(true);
              try {
                   tray.add(icon);
              } catch (AWTException e) {
                   System.out.println(e);
          * Set the temperature.
          * Call setIcon() to set the icon to the right number, update the alert
          * box, and if it's time to, display the alert box.
         public void setTemp(int temp) {
              if (this.temp != temp) {
                   this.temp = temp;
                   setIcon(temp);
                   icon.setToolTip(temp + " degrees");
                   box.setAlertMessage("Temperature in the Server Room is at " + temp + " degrees!");
                   box.setIcon(icon.getImage());
                   if (temp > HIGH_TEMP) {
                        box.setVisible(true);
                        icon.displayMessage("Alert", "Temperature in the server room is at " + temp + " degrees!", TrayIcon.MessageType.WARNING);
                   } else if (temp != NO_DATA){
                        box.setVisible(false);
          * Figure out which icon to set the tray icon to, scale it down, and
          * set it.
         public void setIcon(int number) {
              Image image = null;
              if (number == NO_DATA) {
                   image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(DEFAULT_ICON));
              } else if (number >= 60 && number < 100 ) {
                   String iconString = "icons/temp";
                   iconString += number;
                   iconString += ".png";
                   try {
                        image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(iconString));
                   } catch (NullPointerException e) {
                        image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(DEFAULT_ICON));
              image = image.getScaledInstance(16, 16, Image.SCALE_SMOOTH);
              icon.setImage(image);
          * Give back the current temperature.
         public int getTemp() {
              return temp;
    }The main() that calls it looks like this:
         public static void main(String[] args) {
              SysTrayController controller = new SysTrayController();
              Thermometer temp = new Thermometer(HOSTNAME);
              while (true) {
                   controller.setTemp(temp.getTemp());
                   try {
                        if (controller.getTemp() == SysTrayController.NO_DATA) {
                             Thread.sleep(1000);
                        } else {
                             Thread.sleep(SLEEPTIME);
                   } catch (Exception e) {
                        System.out.println(e);
         }

    From the code above, this line actually worked for me:
    image = Toolkit.getDefaultToolkit().getImage(getClass().getResource(iconString));Just place the image inside the source folder and change the iconString thing...
    For example mine looked like this
    image = Toolkit.getDefaultToolkit().getImage(getClass().getResource("/icon.gif"));

  • System Tray icon missing sometimes

    I have an HP printer 4100 series, Gateway computer, Vista.
    I've had two times when I booted up and the HP Printer system tray icon was not in the system tray.
    I will look at the Notification Area setup and one of the icons listed (under Past Items) is "Terminating Digital Imaging Monitor."
    However, I was still able to print normally.  If I reboot, the system tray icon will return.
    I've had the same printer/setup for over a year.  This never happened till today.  Normally the system tray icon will appear at startup.
    It may be one of Vista's quirks - I sometimes notice inconstent things about the system tray icons.
    Anyone know why this might happen?

    I am on the same os and having the same issue. I tried reloading java and found it did not help.
    Please advise.

  • X,Y position of your system tray icon

    Hi
    In my app i have a functionality by which i can minimize my desktop app to systray..On minimizing my app, an icon is created in the system tray..now is this possible for me to get the x,y position of that icon located in the system tray..i want to display notification pop up above it..with a pointer pointing the system tray icon.
    Thanks

    Just try this...
    Once you get proper character's index, use the following code,
    myTxtFld.getCharBoundaries(index); // this will return a rectangle.
    myTxtFld.getCharBoundaries(index).x; // ===========> will provide x coordinate and
    myTxtFld.getCharBoundaries(index).y; // ===========> will provide y coordinate.
    Good luck !!

  • Dynamic system tray icon tooltips?

    In AIR, can the system tray icon tooltip be dynamically
    generated?
    I want to dynamically display some data whenever the user
    hovers over system tray icon, but it doesn't appear I can do that
    with air.NativeApplication.nativeApplication.icon.tooltip ?
    for example, I tried to dynamically return the current
    date/time but it didn't work:
    air.NativeApplication.nativeApplication.icon.tooltip =
    function(){ return Date()};
    My other thought was to create my own custom "toolip" using
    NativeWindow when a user hovers over the systray (but would like to
    get it to work with
    air.NativeApplication.nativeApplication.icon.tooltip if
    possible)...any other suggestions/tips/thoughts?
    thanks

    I don't believe this is possible. A better strategy may be to
    change the tooltip when the state of your application changes such
    that the text should be updated (rather than in response to a user
    event). However, I don't think the tooltip display will change
    while it is already open.
    Using a native window wouldn't work in this scenario, either.
    The difficulty is still detecting when the mouse is hovering over
    the icon. It is also not possible to definitely locate the icon on
    the desktop, although you can guess using the usableBounds property
    of the Screen class.

  • Skype: no system-tray icon with Arch (+ xfce)

    When I close Skype (the one and only skype window), skype is still running in the background. When I run Zenwalk with xfce, there is a skype icon as part of the taskbar, which indicates that skype is still running in the background. This icon does not pop up in Arch and xfce.
    Here in the forum rdoggsv gave a hint to run "killall skype". However I would prefer to have the system-tray icon (and the right-click to close skype). By the way: skype on debian has this icon as well (see http://bbs.archlinux.org/viewtopic.php?id=14874). How can I get this xfce notification icon in Arch, as long as Skype is running?

    Are you sure you have system tray enabled on your xfce panel?  I don't use xfce, but skype shows up correctly in the tray using trayer...  I also remember it working correctly with xfce panel tray in the past so unless the latest version of xfce is buggy it should work without problems.

  • Issue with System tray icon

    So, I am developing an application that utilizes a system tray icon.
    It's all pretty standard: when you click close, it hides the window and puts a system tray icon in the system tray, when you right click the tray icon, it gives you a menu with options to restore the window or to exit, and if you double left click the icon, it restores the window.
    Also, any time you restore the window, the system tray icon is removed.
    All that stuff works great, its just that instead of putting the image that I want as the icon, the icon is just blank - transparent - nothing. There is a space where it should be, but the image just isn't there.
    The image I'm using is a gif that measures 240 x 240 pixels, and has transparency.
    When the window is hidden, the program does this:
         try {
                    tray.add(trayIcon);
                } catch (AWTException e) {
                    System.err.println("TrayIcon could not be added.");
                }to add the icon to the tray.
    Here's my initialization code. It's in a method called initSysTray, which is called once in the window's constructor.
    if (SystemTray.isSupported()) {
                tray = SystemTray.getSystemTray();
                //image that will be used for System tray Icon
                ImageIcon image = new ImageIcon("Icon2.gif");
                //action listener for the exit menu option
                //that is part of the tray icon's pop-up menu
                //it ends the application
                ActionListener exitListener = new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        System.out.println("Exiting...");
                        System.exit(0);
                //action listener for the restore menu option
                //that is part of the tray icon's pop-up menu
                //it unhides the window and removes the tray icon
                ActionListener unHideListener = new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        System.out.println("Unhiding");
                        setVisible(true);
                        tray.remove(trayIcon);
                //Action Listener that recieves events from tray icon
                //basically if someone double clicks the tray icon
                //then the window is restored
                ActionListener actionListener = new ActionListener() {
                    public void actionPerformed(ActionEvent e) {
                        System.out.println("Unhiding");
                        setVisible(true);
                        tray.remove(trayIcon);
                //create the pop-up menu
                PopupMenu popup = new PopupMenu();
                //create the exit option
                MenuItem defaultItem = new MenuItem("Exit");
                defaultItem.addActionListener(exitListener);
                //create the restore option
                MenuItem unHideItem = new MenuItem("Restore");
                unHideItem.addActionListener(unHideListener);
                //add the options to the menu
                popup.add(unHideItem);
                popup.add(defaultItem);
                //create the tray icon
                trayIcon = new TrayIcon(image.getImage(), "Bluetooth Remote by D Law", popup);
                trayIcon.setImageAutoSize(true);
                trayIcon.addActionListener(actionListener);
            else{
                System.out.println("System Tray not supported");
            }So, any help with my dissapearing icon would be greatly appreciated.

    Hi, are you not suppose to catch possible exceptions thrown by the TrayIcon constructor? :
    //create the tray icon
                trayIcon = new TrayIcon(image.getImage(), "Bluetooth Remote by D Law", popup);Try surrounding this line of code with a try and catch block. Referring to the API
    documentation, there are 4 possible exceptions that can be thrown. Errors may
    be present there, and we need a way to identify it. :)

Maybe you are looking for

  • I just updated my iTunes to 10.5 and now when I plug in my iPod touch and iPad it won't sync or even recognize them.

    I just updated my iTunes to 10.5 and now when I plug in my iPod touch and iPad it won't sync or even recognize them? Help!

  • MacBook Pro won't recognize 1TB external drive

    Hey team, My mid-2010 MacBook Pro won't recognize my WD My Passport 1TB drive.  I was copying files from the drive to my computer when my computer went to sleep (didn't run out of power, just went to standby mode).  Turned computer back on and now it

  • Button Highlight turns Black in Encore

    Hi all.  Am confused about what is happening here.  I am trying to make my own customized Button Highlights.  First thing I do is get my object in photoshop by doing the following.  Change "background" layer to a "layer".  Then using color range, del

  • I have Sent Items In Two Folders

    I upgraded to Leopard. During the upgrade, my e-mail name had changed, so I changed the name of the mailbox. When I did that, I left all the "sent" items in a folder that did not show up in mail. I found the old sent files in a file, at Mail/[email p

  • Contacts Display and Sort by Company Name

    I have over 1000 contacts in Outlook which synced wonderfully with my new iPhone. Alas, I need to lookup and sort by Company Name. This is a VERY standard method for contacts. The options presented by iphone are first and last name, sigh and tech sup