Page 1 of 1

Tray Minimizer

Posted: Wed Sep 26, 2007 3:27 am
by r_hyde
I wanted to be able to always minimize certain applications to the system tray, and wasn't totally satisfied with any of the shareware tools I tried for this. Mainly, I didn't want to have to remember special keyboard shortcuts (I just want to use the regular ol' minimize button), and I didn't want to have to pay to register something that I could simply write for myself :P

As a result, here is my ultra-simple-no-frills Tray Minimizer! It creates its own icon in the systray, which you can double-click to open a window where you can add other applications you want always minimized to the tray. It's not really complete in the "professional software" sense, but I got it about as finished as I need it to be, and I figured I'd post it up here with source as a gift to a wonderful community (aww, can you feel the love?). Feel free to implement any missing or desired functionality, but please note the very liberal license statement in the opening comments in my source.

Special thanks to Sparkie, without whose help I probably would've got this thing written anyway, but it wouldn't have been as easy 8)

File:1->TrayMinimizer.zip
Image

Posted: Wed Sep 26, 2007 4:27 am
by rsts
Looks very nice.

Thanks for sharing with us :)

cheers

whoops - seems to be consuming quite a bit of the cpu - 80+% ?

Vista business

Posted: Wed Sep 26, 2007 4:52 am
by r_hyde
Fixed. I usually throw a Delay() into my main loop to prevent this, but this time I forgot.

Posted: Wed Sep 26, 2007 5:05 am
by rsts
Yes, much better :)

Thanks again for sharing this.

cheers

If you get bored, drag and drop would be nice :)

Posted: Wed Sep 26, 2007 7:12 am
by r_hyde
I don't think I'll be implementing drag/drop - that's why I published the source, so that features like this can be added by whoever is willing and able. I appreciate that you took the time to check it out, though, and thanks for the nice comments!

Posted: Wed Sep 26, 2007 11:05 pm
by HeX0R
Just took a quick look at your code, cause i wondered, why you should need a Delay() for this kind of application.
I don't see any reason to use WindowEvent() (as you did) instead of WaitWindowEvent() which should be the way to go.

And btw, it seems you used some userlib, my PB doesn't know a procedure called HandleToFileName().

Posted: Wed Sep 26, 2007 11:26 pm
by r_hyde
Thanks, you're correct - that function is from droopy's lib. I sometimes forget when I'm using 3rd party libs. Sorry 'bout that!

I also always manage to forget about WaitWindowEvent() :(