SnarlTray exp1 now available

145 views
Skip to first unread message

Chris Peel

unread,
Jul 23, 2010, 2:32:13 PM7/23/10
to snarl-...@googlegroups.com

This can be downloaded from sourceforge here:

https://sourceforge.net/projects/snarlwin/files/Boneyard/

Simply unzip and run setup.exe. If SnarlTray is running it will be
stopped automatically before installation commences.

Changes:

1. Installer now opens the Snarl Tray Start Menu folder on completion
rather than actually running SnarlTray. The reasons for this are two-
fold:
a) To avoid process escalation issues on Vista/Windows 7;
b) To give you the opportunity to launch SnarlTray in debug mode.

2. Vista and Windows 7 are now supported (hopefully) - the code makes
no use of additional tray icon features in Vista/Windows 7 as yet.

3. Less debug output spamming


Max Norris

unread,
Jul 23, 2010, 3:24:43 PM7/23/10
to Snarl Discussion
This newer version seems to be working well with Windows 7, where the
previous version from the 2.3 RC installation did not. Neat stuff :)

JonusC

unread,
Jul 24, 2010, 1:10:44 AM7/24/10
to Snarl Discussion
Doesn't work for me with 'Safely Remove Hardware' balloon
notifications. Can I ask which balloon tips you tested yourself Max?
Also are you on 32 or 64-bit (64 here). I would like to test more
notifications but the Safely Remove Hardware is the only one I can
think of that is easily reproduced.

Would be interested to know Chris, possible to intercept WM_COPYDATA
messages (then decode them) which are sent to the tray via the
Shell_NotifyIcon() API? Not sure if that's what you already do here,
but I remember this is how Glass Toast did it for Vista - however that
was a horrible hack-up (memory leaks, crashes, etc) and the author's
site is gone without a cache... bummer.

Additional references and links:
http://msdn.microsoft.com/en-us/library/bb762159%28VS.85%29.aspx
Growl for Windows code -
http://code.google.com/p/growl-for-windows/source/browse/branches/Mono/Growl/Growl/_source/SystemBalloonIntercepter.cs

Andreas Verhoeven is the creator of GlassToasts and the source for
this program WAS at http://mpj.tomaatnet.nl/GlassToastFiles.zip - but
I'm pretty sure this is the same Andreas who made AveDesk. If you want
to find his old code for Glass Toast which I remember worked for all
Vista/7 balloon tips (albeit was buggy) perhaps you could contact him
at http://www.avedesk.org/ =)

Chris

unread,
Jul 24, 2010, 4:39:46 AM7/24/10
to snarl-...@googlegroups.com
It may be an issue with 64 bit Windows - not sure. You're right though, the DLL I use installs a message hook in the tray window's message looper which forwards the WM_COPYDATA messages it receives as part of ShellNotifyIcon(). SnarlTray only uses a small subset (the NIF_INFO flag) of the whole SHELLNOTIFYICON structure.

Sent from my iPhone

> --
> You received this message because you are subscribed to the Google Groups "Snarl Discussion" group.
> To post to this group, send email to snarl-...@googlegroups.com.
> To unsubscribe from this group, send email to snarl-discus...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/snarl-discuss?hl=en.
>

JonusC

unread,
Jul 24, 2010, 7:38:46 AM7/24/10
to Snarl Discussion
Yeah, probably the x64 architecture is the issue. Here's the log I get
-

WM_CREATE
Registered with Snarl (token=744)
window: 001B0756

...and that's all. I also tried making a TrayTip test script in
AutoIt, compiling it to both 32-bit and 64-bit binaries to no avail.

I'll take a crack at porting it to C++ regardless ;)

Chris

unread,
Jul 24, 2010, 7:50:01 AM7/24/10
to snarl-...@googlegroups.com
Do you get no further output than that? Presumably explorer.exe is a 64-bit process and given the hook DLL is 32 bit that may well be the problem.

Sent from my iPhone

JonusC

unread,
Jul 24, 2010, 9:23:33 AM7/24/10
to Snarl Discussion
That's all there is in the debug output, nothing else. I think you are
right, 32-bit hooks will only work on 32-bit processes. And unlike
Vista, Win7 doesn't let us run explorer.exe in a 32-bit process
anymore so I can't test it - but I don't think there's any need.

I've already contact Ave and asked him to share the source for
GlassToasts, it's a C# application and would be good to get to save
you from this 64-bit hassle. I'd be happy to take a crack at coding it
up for you and hand it over =)

On Jul 24, 9:50 pm, Chris <chris....@fullphat.net> wrote:
> Do you get no further output than that? Presumably explorer.exe is a 64-bit process and given the hook DLL is 32 bit that may well be the problem.
>
> Sent from my iPhone
>

Chris

unread,
Jul 24, 2010, 11:40:54 AM7/24/10
to snarl-...@googlegroups.com
Well geOTraySpy is open source and written in c++ - I think I have the source code somewhere - can it be recompiled as a 64-bit EXE? presumably using 32 or 64-bit hooks depending on the O/S? If so, it should then be seamless to SnarlTray...

Sent from my iPhone

Max Norris

unread,
Jul 24, 2010, 1:07:14 PM7/24/10
to Snarl Discussion
> Can I ask which balloon tips you tested yourself Max?
> Also are you on 32 or 64-bit (64 here). I would like to test more
> notifications but the Safely Remove Hardware is the only one I can
> think of that is easily reproduced.

I didn't give it a thorough testing or anything, just a couple
quickies. Off the top of my head, uTorrent threw a notification
(duplicate though, one in Snarl, one regular popup). I also fired off
a few via Visual Studio (C#) which captured it properly, Delphi (also
captured it properly), and if I recall mIRC threw a few too properly.
This system is 32 bit, only has 3GB RAM so never bothered with 64. My
other machines are running in 64 bit but are BSD, not Windows.

JonusC

unread,
Jul 25, 2010, 8:21:41 AM7/25/10
to Snarl Discussion
Hey thanks Max, good to know it works well on Windows 7 with pretty
much everything it seems.

Chris, you're totally right! The geOTraySpy.dll is what does the
actual hooking, right? So if compiled to x64 you should *hopefully* be
able to build a 64-bit version from VB6... how does it use the DLL
anyway is it just a static link? Should be OK I think.

I have uploaded geOTraySpy to the Files section in this group, has the
source and both 32 and 64 bit builds of the DLL included. Hopefully
that is all you need to make a SnarlTray for x64 which I can test.

On Jul 25, 1:40 am, Chris <chris....@fullphat.net> wrote:
> Well geOTraySpy is open source and written in c++ - I think I have the source code somewhere - can it be recompiled as a 64-bit EXE? presumably using 32 or 64-bit hooks depending on the O/S? If so, it should then be seamless to SnarlTray...
>
> Sent from my iPhone
>

Chris

unread,
Jul 25, 2010, 9:22:35 AM7/25/10
to snarl-...@googlegroups.com
VB6 can't create 64-bit apps but hopefully I can reference both DLLs in SnarlTray and select the appropriate one based on which O/S is running. Anyone know which API returns this?

Sent from my iPhone

Jonus Conrad

unread,
Jul 25, 2010, 9:53:56 AM7/25/10
to
Apparently you'll need to have some form of interprocess communication code if you want to access a 64-bit DLL from 32-bit code. Bummer.

Source: http://stackoverflow.com/questions/339848/is-it-possible-to-access-a-64-bit-dll-from-a-32-bit-application

SnarlTray is a relatively simple application though, maybe we can try to port it to C++? I'll investigate that tomorrow, I'm off to bed  =)

Regards,
Jonus C.

Tokelil

unread,
Jul 25, 2010, 11:13:34 AM7/25/10
to Snarl Discussion
Have a look here:
http://msdn.microsoft.com/en-us/library/aa384249%28v=VS.85%29.aspx

[...]
"However, 32-bit processes cannot load 64-bit DLLs for execution, and
64-bit processes cannot load 32-bit DLLs for execution. This
restriction does not apply to DLLs loaded as data files or image
resource files; for more information, see LoadLibraryEx.

A 32-bit application can detect whether it is running under WOW64 by
calling the IsWow64Process function. The application can obtain
additional information about the processor by using the
GetNativeSystemInfo function."
[...]

Might not be so easy to load a 64bit DLL and communicating with it.
(Since the app is run in WOW64 and the dll would not be!)

- Toke

On Jul 25, 3:22 pm, Chris <chris....@fullphat.net> wrote:
> VB6 can't create 64-bit apps but hopefully I can reference both DLLs in SnarlTray and select the appropriate one based on which O/S is running.  Anyone know which API returns this?
>
> Sent from my iPhone
>

Chris

unread,
Jul 25, 2010, 6:15:50 PM7/25/10
to snarl-...@googlegroups.com
Thanks for the replies - TraySpy is unusual as it injects itself into the explorer.exe process via the windows hook mechanism. Given this, using it from a VB6 app might still work. The alternative is to write a 64-bit version of SnarlTray in something other than VB6 if anyone fancies it!

Sent from my iPhone

Jonus Conrad

unread,
Jul 25, 2010, 6:29:13 PM7/25/10
to
I'm going to try and whip something up in AutoIt x64, which supports DLLCall's and whatnot. At least to see if we can get anywhere with the 64-bit geotrayspy.dll

JonusC

unread,
Jul 25, 2010, 8:14:33 PM7/25/10
to Snarl Discussion
Well I started but I pretty much have no idea what I'm doing. I
started a thread over at the AutoIt forums to ask the guru's over
there for help here, hopefully one of the top guys takes a special
interest in this. Thread - http://www.autoitscript.com/forum/index.php?showtopic=117645

FYI, I decided to use AutoIt to try and get the x64 stuff working
because it's extremely easy for quick tasks like this and has an
awesome-helpful community. We can port it to C++ or whatever in future
if needed.

JonusC

unread,
Aug 5, 2010, 12:01:28 AM8/5/10
to Snarl Discussion
I'm stuck on this.... I don't know how to get my app "talking" with
the hook. I'm just trying to get a Message Box response for now...

...if anyone comes across this thread and can provide a simple example
use of the geotrayspy.dll in either C++, C# or AutoIt, I would be very
appreciative... no need for Snarl-specific code yet, if we work this
initial bit out then the actual Snarl extension code can be done after
quite easily. Until then I/we x64 users have no use for SnarlTray :(

Chris

unread,
Jul 9, 2012, 2:33:24 PM7/9/12
to snarl-...@googlegroups.com
Hey!

That's great - I'm away from my PC at the moment but hopefully someone else will be able to test and provide feedback - if not I'll do it at the weekend.

Any chance you could do a 64 bit version?

On 9 Jul 2012, at 10:54, Joy <sym...@gmail.com> wrote:

Hi sorry to bump up this 2 year old thread.

But I didn't found anything similar on the net.

I've attached a debug build of SnarlTray, it's a port of GrowlTray.
I'm not sure if this works with 64bit OS, as I only use 32bit system.

My codes is not on the source control yet. need to clean up.
If you let me know if this works, I can build the extension (after I get some free time) 

Thanks.
--
You received this message because you are subscribed to the Google Groups "Snarl Discussion" group.
To view this discussion on the web visit https://groups.google.com/d/msg/snarl-discuss/-/60dOjxVhdz8J.

To post to this group, send email to snarl-...@googlegroups.com.
To unsubscribe from this group, send email to snarl-discus...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/snarl-discuss?hl=en.
<SnarlTray.zip>

Joy

unread,
Jul 10, 2012, 12:30:32 PM7/10/12
to snarl-...@googlegroups.com
I think it should work on a 64 bit system, however I'm not sure as I don't have access to a 64 bit system.

Thanks for the reply.
To unsubscribe from this group, send email to snarl-discuss+unsubscribe@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/snarl-discuss?hl=en.
<SnarlTray.zip>

Joy

unread,
Jul 10, 2012, 3:57:20 PM7/10/12
to snarl-...@googlegroups.com
I've created the extension, it's working on my windows 7 (32 bit), still not sure about 64 bit os :)
Hopefully will work.

The extension creates debug log files in the executing directory, so don't copy it to programs files, save it to roaming\full phat\snarl\extension\
You can click on the "Configure Extension" button in Snarl, it will open the DebugLog Viewer.

However, I'm having problem redirecting events from snarl notification to the window(that wanted to create the balloon message).
If someone have an idea or solution please come forth :)

And any testers are welcome. 

Have a nice day.
SnarlTrayExtension.7z

Joy

unread,
Jul 14, 2012, 9:53:53 AM7/14/12
to snarl-...@googlegroups.com
So far, forwarding event to the source application is not successful.
It works for couple of balloon messages, but after restart or randomly it stops working at all.

I've checked the source window with Spy++, it shows the window receives messages but does not responds. (weird)

PS: I changed the extension to a standalone application like before. It seems with extension, Snarl stops the execution (extension) when UserAway event is fired. This in turn renders the taskbar UI unresponsive (because of the hooking).

So, I think this would be a good idea to replace this with a native windows shell extension, which will redirect all the balloon message to Snarl.
And it should be called WindowsSnarlExtension.

Happy coding.

Chris

unread,
Jul 14, 2012, 11:59:16 AM7/14/12
to snarl-...@googlegroups.com


On 14 Jul 2012, at 14:53, Joy <sym...@gmail.com> wrote:

So far, forwarding event to the source application is not successful.
It works for couple of balloon messages, but after restart or randomly it stops working at all.

Handling the system tray is notoriously unreliable, which probably explains the limited official documentation on it.


I've checked the source window with Spy++, it shows the window receives messages but does not responds. (weird)

Are you sending the full detail?  I can't remember the exact requirements for wParam and lparam but these are at least documented by Microsoft.


PS: I changed the extension to a standalone application like before. It seems with extension, Snarl stops the execution (extension) when UserAway event is fired. This in turn renders the taskbar UI unresponsive (because of the hooking).

Correct - you'll get stuck in a message lock-out.  The tray notifies the extension with a synchronous message, this halts the extension's thread while it processes the message.  The problem is that because the extension is part of Snarl's process space, Snarl itself is locked out.

You'll see the current SnarlTray implementation is a standalone exe which simply proxies the tray for this exact reason.

To view this discussion on the web visit https://groups.google.com/d/msg/snarl-discuss/-/fxnTLQ5-9vkJ.

To post to this group, send email to snarl-...@googlegroups.com.
To unsubscribe from this group, send email to snarl-discus...@googlegroups.com.

Joy

unread,
Jul 15, 2012, 12:50:04 PM7/15/12
to snarl-...@googlegroups.com
"Handling the system tray is notoriously unreliable, which probably explains the limited official documentation on it."
learned this the hardway...

but I did figured something out (maybe),

Even if you disable the windows balloon in the registry, shell will spawn the balloon notify window.
and applications will send the messages to that window, but it will not be displayed (registry settings).

[if balloon is enabled in the registry]
Application calls on the windows balloon message, it shows the balloon message, and waits for the timeout or any user interaction (click, close etc...)

[SnarlTray]
We hook to TryNotifyWnd then wait for the windows message for the balloon request, intercept it and show the Snarl notification.
In the meantime we also send a pop message to the balloon window, which closes the balloon and (balloon window) sends a windows message to the calling application which requested the balloon (sometimes shows in Spy++). So when Snarl sends the NotificationEvent, the application does not responds, because it already received a message (from balloon window).

[Workaround]
#1 Hide the balloon message. (works for only one balloon, then application does not responds, I don't know why)
#2 Move the balloon message out of visible screen area. (works, but some times it delays so you can see the default balloon for a second or 2)
     This also requires windows notification settings to be changed so that balloon messages are displayed for a longer period of time.


[If balloon disabled in registry]
Windows will not show the balloon.
[SnarlTray]
We catch and show the Snarl notification, call back works sometimes and sometime doesn't (pretty random).

Also tried of closing the balloon window, but have same effect as if the balloons are disabled in the registry

so far this are my findings, I'm not very experienced with Windows API, Hooking.
But this project turn out to be quite complex, then the actual function.

Joy

unread,
Jul 18, 2012, 7:43:14 AM7/18/12
to snarl-...@googlegroups.com
Hi all,

I've re-written the trayhook to provide a more mature way to intercept Windows Balloon Notifications.

From current testing, I can say that, the Notifications are correctly captured and Events are properly forwarded to the Calling Application.

No Registry modifications needed.
The App will redirect all the balloon notification if Snarl is running, otherwise the windows default notification will show.

Tested with Windows7 32 Bit, Should work on 64 Bit also.

I've attached the current test release to this post. Please download and test it.
If any bugs or error post here or send me an e-mail (Subject: SnarlTray)

Thanks Everyone.

Joy

unread,
Jul 18, 2012, 1:40:08 PM7/18/12
to snarl-...@googlegroups.com
Sorry All, forgot to attach the file.

Now I've attached it to this post.

Kind Regards.
WindowsNotification.7z

Chris

unread,
Jul 19, 2012, 2:56:53 PM7/19/12
to snarl-...@googlegroups.com
Thanks Joy - will try it out this weekend!
To view this discussion on the web visit https://groups.google.com/d/msg/snarl-discuss/-/9kgDP5L9y7QJ.

To post to this group, send email to snarl-...@googlegroups.com.
To unsubscribe from this group, send email to snarl-discus...@googlegroups.com.

Joy

unread,
Jul 20, 2012, 7:10:45 PM7/20/12
to snarl-...@googlegroups.com
@Chris

If you haven't tried it yet, try this one instead. (Attached to post)

I've added some new logic to detect and add callback message from some stubborn apps/windows process.

So forwarding event is now perfect I think.

Also no platform dependent code. But if TrayHook.dll gives up, please post here so I can modify it 

Have fun and enjoy your weekend! :)
WindowsNotificationFinal.7z

Chris

unread,
Jul 21, 2012, 4:02:19 AM7/21/12
to snarl-...@googlegroups.com
Thanks joy - I tried it quickly on an xp system but it wouldn't load.  I think that's most likely because I haven't got .net or the vc runtimes installed on it.

I'll test this updated version properly in the next day or so :-)
To view this discussion on the web visit https://groups.google.com/d/msg/snarl-discuss/-/HtixuvYkJmQJ.

To post to this group, send email to snarl-...@googlegroups.com.
To unsubscribe from this group, send email to snarl-discus...@googlegroups.com.

For more options, visit this group at http://groups.google.com/group/snarl-discuss?hl=en.
<WindowsNotificationFinal.7z>

dragonmage

unread,
Jul 22, 2012, 12:14:00 PM7/22/12
to snarl-...@googlegroups.com
WinXP SP3 starting wnotify.exe registers with Snarl then shoots Explorer in the head, when Dr. Watson runs to investigate he also gets taken down. I end up with two drwatson processes, one of them a ghost, ending the process of the other allows Explorer to restart. Balloons appear to be captured (Add/Remove Hardware at least) but are not displayed by Snarl 2.6 beta4. Everything looks fine in your debug log.

[7/22/2012 11:53:56 AM] [info] Windows Notification Redirection Starting...
[7/22/2012 11:53:57 AM] [info] Registered with Snarl.
[7/22/2012 11:53:57 AM] [info] TrayHook Installed.
[7/22/2012 11:53:57 AM] [info] Windows Notification Redirection Started.
[7/22/2012 11:54:59 AM] [info] Windows Explorer restarted, reinstalling TrayHook.
[7/22/2012 11:54:59 AM] [info] TrayHook Installed.
[7/22/2012 12:07:31 PM] [info] Debug Log window created.

Let me know if I can help, my time is limited but I'll try to run tests when I can.

Joy

unread,
Jul 22, 2012, 3:32:39 PM7/22/12
to snarl-...@googlegroups.com
Oh! poor Explorer and Dr. Watson... Really sad... I wonder what went wrong....

I'm developing this application constantly... So, I don't have the source for the version you tried, but I've downloaded and tried one from my post, it run fine with XP SP3 with out any error. But if you end process it, explorer will crash, for the hook still in explorer memory.

Anyway, give this one a try. I added a queue to hold the notification data and an experimental method to delay/stop crash if the wnotify.exe ends (sometimes works).

Post any result you want to share...

Regards.
WindowsNotification.7z

dragonmage

unread,
Jul 23, 2012, 4:49:53 PM7/23/12
to snarl-...@googlegroups.com
All seems good so far wnotify seems to have curbed it's homicidal tendencies. Thanks.

Joy

unread,
Jul 24, 2012, 1:56:12 PM7/24/12
to snarl-...@googlegroups.com
Nice to hear that :)
and
Thanks for the feedback.
Reply all
Reply to author
Forward
0 new messages