Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • December 08, 2016, 02:09:04 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: System Tray plugin  (Read 4924 times)

joshuawood

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 22
    • View Profile
    • Donate to Member
System Tray plugin
« on: January 16, 2009, 08:37:09 PM »
Hi all,

Here's an alpha of a plugin I'm tried to put together. It lists the system tray apps you have running, and allows you to simulate mouse clicking them. Extract the zip to your plugins directory. You can activate it by typing "tray". Once an item is launched, it will bring up a menu asking which mouse button you wish to simulate. Under Vista, the menu hotkeys do not appear to be highlighted. You can press l for left click, r for right click, d for double click for a shortcut. The menu will appear where the mouse cursor is. I can make my menu appear wherever I like (I had it at the top of FARR at one stage), but the systray menu can only appear where the mouse is due to the way it works. I could however move the mouse to somewhere like the top of FARR, but some people might not like this, so I've opted to make my menu appear where the mouse is, as does the systray menu.

This is incomplete. There will surely be issues and bugs. Some that are known:

Under XP:
-Icons do not have transparency (they are in BMP format since Visual Studio has no ICO encoder, if anyone can help pls do).
-Network icons don't get their text sometimes. Eg LAN or Wireless. Retrying once or several more times will get it ok. So if you see something with no text, it will probably be a network icon. You can still access the functions are normal however.

Under Vista:
-Icons have transparency! Same format as above, so Vista must render something differently. And proper ICO format would still be best however.
-System icons such as volume, network, battery indicator are found in a different area of the tray. I'm not sure how to get these apps yet, if possible.

Under Se7en:
-Since the tray has changed a bit, those icons that are "hidden" in the up arrow section are not displayed by this plugin. However unlike Vista, the battery, volume, network indicators are correctly found (MS must have recombined the "split" tray sections Vista used).
-The mouse simulation doesn't work for all icons. Eg, left click on volume doesn't work, but does on battery.

Under all:
-Dunno how to get the clock, if possible.
-FARR tray app itself has issues with the icon for some reason. First time the plugin will get it ok, then other times fail. With my test app sometimes it will always fail, other times it will always get it; I haven't been able to reproduce the get once then not again issue. However, I'm sure it's to do with why I can sometimes never get it (exception is thrown). Currently I ignore the FARR icon to avoid this issue.
-You can't append search terms. Eg, you can't type "tray win" to find only tray apps with "win" in their name. This will come later, the SDK needs to be updated first I think.
-Some tray names will be funny, or possibly missing. I can't do anything about this, I can only relay the tooltip text of the tray app (no tooltip = no name).

Note: If you hear a "beep" once you type "tray", it indicates an error has occurred. I'm not sure why this sometimes happens. If it does, try the "no icon" build attached, and let me know if the "beep" goes away with that version.

Tested on XP Pro 32bit, Vista Home Premium 32bit with UAC off/on, Se7en Pro 32bit with UAC off. With UAC on it will not currently work if you load FARR normally. You need to run FARR "as administrator" for it to work.

This plugin has been tested on FARR 2.80.02 under Se7en only, but should work under other OSs ok. 64 bit OSs probably won't work, I couldn't figure out why.

Important credits:
// Hacked together by Joshua Wood, Jan 2009, from the following parts:
// Big thanks to vitalyb for his FARR C# SDK: http://www.donationc...ex.php?topic=10992.0
// System Tray enumeration code (slightly modified) from Karl Wagner: http://www.aeroxp.or...ystem-tray-from-net/
// Big thanks to skajfes and mouser on donationcoder.com forums for their help
// Additional extras\coding by Joshua Wood
« Last Edit: November 28, 2009, 04:07:33 PM by joshuawood »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,416
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: System Tray plugin
« Reply #1 on: January 16, 2009, 08:55:19 PM »
very cool idea and great progress...
It's not quite working right here.. as i type "tray" i get 2 items shown in the results, and no more.  which two seem to be random (actually the first one is FARR but the other is random).
I dont see any icons for the items.
The clicking simulations dont seem to work.
Note that i am on winxp64 which could be causing some of the issues, but the fact that it is definitely finding them and listing 2 randomly suggests to me that that isnt it.

joshuawood

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 22
    • View Profile
    • Donate to Member
Re: System Tray plugin
« Reply #2 on: January 18, 2009, 02:17:13 PM »
Does FARR "beep" once you finish typing "tray"? I have found that the beep does indicate some error in the plugin occuring. You get the menu listing left/right/double click once you execute a result right? But just nothing happens after that?

« Last Edit: January 18, 2009, 02:20:03 PM by joshuawood »

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 36,416
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Read more about this member.
    • Donate to Member
Re: System Tray plugin
« Reply #3 on: January 18, 2009, 02:19:01 PM »
Yes! i hear the beep!

daanvink

  • Supporting Member
  • Joined in 2008
  • **
  • default avatar
  • Posts: 18
    • View Profile
    • Donate to Member
Re: System Tray plugin
« Reply #4 on: February 13, 2009, 01:54:15 PM »
Hi Joshuawood,
On my laptop (XP) everything works fine, but on my desktop it doesn't seem to be loaded as a plugin. If I do goreload the farrtray is not loaded.
Greetings.

joshuawood

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 22
    • View Profile
    • Donate to Member
Re: System Tray plugin
« Reply #5 on: February 19, 2009, 03:23:57 AM »
What OS and what version (32 or 64) is on your desktop?

I've noticed the plugin doesn't load under Win 7. I havent looked at this plugin for ages, been too busy. I would like to try and get 64 bit working for Mouser at least ;)

i9uq9p702

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: System Tray plugin
« Reply #6 on: February 19, 2009, 03:26:17 PM »
Hi, joshuawood,

I tested PS Tray Factory recently but it didn't quite work for me, so I was very interested to discover your plugin.

A few things that are not quite working yet (on my system - XP Home) that I hope will help you :

* FARR itself appears as a folder icon in the list instead of the default white F in the blue circle which is how it appears in the tray
* I have three hidden XP icons right now - two appear in the plugin's list, the other doesn't
* ZoneAlarm which is not hidden doesn't appear in the plugin's list
* FARR doesn't disappear once I have picked an entry
* I do see Volume, even though you said that you didn't know how to get system icons such as this
* trying to select an entry with no tooltip and therefore no title causes an Access Violation - I won't do it again but maybe you could hide them in the first place.

I am planning to continue trying the plugin, so if you need some help testing a new version then let me know.  Thank-you for your hard work so far. I hope that you find some more time to spend on this project.


joshuawood

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 22
    • View Profile
    • Donate to Member
Re: System Tray plugin
« Reply #7 on: February 20, 2009, 09:47:39 PM »
Hi, joshuawood,

I tested PS Tray Factory recently but it didn't quite work for me, so I was very interested to discover your plugin.

A few things that are not quite working yet (on my system - XP Home) that I hope will help you :

* FARR itself appears as a folder icon in the list instead of the default white F in the blue circle which is how it appears in the tray

This is by design. Currently I have issues retrieving the icon of FARR, so I ignore it. This defaults to a folder icon instead.

Quote
* I have three hidden XP icons right now - two appear in the plugin's list, the other doesn't
* ZoneAlarm which is not hidden doesn't appear in the plugin's list

By "hidden" do you mean they are visible in the tray, but are hidden the by << icon? Or are you using a program to totally hide them?

Quote
* FARR doesn't disappear once I have picked an entry

This is by design. It's easy enough for me to change. Otherwise, if you go into FARR options, settings, Window mode/focus and select the option to hide FARR when it loses focus, it will also then work as you desire.

Quote
* I do see Volume, even though you said that you didn't know how to get system icons such as this

The volume and other system icons are only an issue on Vista, not XP.

Quote
* trying to select an entry with no tooltip and therefore no title causes an Access Violation - I won't do it again but maybe you could hide them in the first place

This is interesting. It shouldn't, but there are several funny things with this plugin. What software or such does not display a tooltip? I don't have anything to test here, so let me know so I can perhaps try.

I would like to continue work on this, unfortunately most of the code is not mine, and it's far beyond my ability to debug, even though I can follow the basic gist of what it's doing. I've just pieced things together.

Mouser has suggested an alternative method to obtaining the icons, so I'll try and get that going. Icons are really a last issue for me though, working functionality for all is the main goal before beauty.

Thanks for trying. I will post the source in the next few days for anyone interested, like I said I would.
« Last Edit: February 20, 2009, 09:49:25 PM by joshuawood »

i9uq9p702

  • Participant
  • Joined in 2009
  • *
  • default avatar
  • Posts: 8
    • View Profile
    • Donate to Member
Re: System Tray plugin
« Reply #8 on: February 24, 2009, 02:46:17 PM »
Quote
This is by design. Currently I have issues retrieving the icon of FARR, so I ignore it. This defaults to a folder icon instead.
OK, thanks.

Quote
By "hidden" do you mean they are visible in the tray, but are hidden the by << icon? Or are you using a program to totally hide them?
Sorry I wasn't clear - hidden by the << icon.

Quote
The volume and other system icons are only an issue on Vista, not XP.
Ah yes, I should have read more carefully what you originally wrote. Sorry.

Quote
What software or such does not display a tooltip?
This icon is for the internal ADSL modem.

Thanks for the reply.

joshuawood

  • Participant
  • Joined in 2008
  • *
  • default avatar
  • Posts: 22
    • View Profile
    • Donate to Member
Re: System Tray plugin
« Reply #9 on: April 07, 2009, 05:47:12 AM »
Hi mouser,

Does this version work for you regarding the click events? The only thing I've done differently is compile this for x64 only. Worth a short, it maybe some data types were not getting converted correctly from 32 to 64bit, such as ints. But my understanding is that 32bit code should run fine in a compatibility mode under x64. Give it a shot anyways.