Archive for November, 2008

Tips for minimizing your app to the Tray

Friday, November 28th, 2008

It’s a nice feature for your software if your customer can minimize it as an icon to the system tray. From our “minimize to tray” program I learned a few things about. Here’s a rundown of the basic and not-so-basic tricks.

  1. You can add / modify / remove a tray icon with Shell_NotifyIcon. You can specify a callback message (for example WM_USER) to react to left/right clicks on the icon. To hide your program when minimized simply use ShowWindow.
  2. To minimize to the tray when your user click the minimize button, handle the WM_NCLBUTTONDOWN message and watch for the HitTest HTMINBUTTON (or HTCLOSE if you want to override the X-button).
  3. If you want to prevent Windows from hiding the icon, make a tiny chnge to the icon every now and then. (Do this only if you have good reason!)
  4. You can use DrawAnimatedRects for a minmize animation. Use FindWindow(“Shell_TrayWnd”, …) to find the location (= target reactangle for the animation)
  5. If the windows explorer crashes, the tray icons are gone and your user can’t get your application back. To detect this, use Shell_NotifyIcon(NIM_MODIFY, … every now and then and check the return value. If the function fails, then your icon is gone and you have to add in again.
  6. Don’t forget to remove the tray icon if your program closes while being minimized.

Affiliate Fraud! – Is it?

Tuesday, November 4th, 2008

I was recently contacted by fellow software developer Michael Bauer, who called my attention to a certain website. That site is an affiliate of mine and I thought that it was my best affiliate.

A deeper look however showed that the website placed the usual affiliate cookie not just on the pages displaying my software, but on all. Each and every page that I visited (it’s a big site), had the cookie-setting-code. And not just for me, but for a number of other software vendors, too. The cookies expire in half a year.

In other words: Every person that visits any page of that website, would bring the website owner a provision if the visitor should decide to buy any software from any of the listed vendors within the next 6 month.

Previously I had thought, because of the sales, that this was my best affiliate. Now however, I have my doubts how many sales he *really* generated and for how many he just got the money.

Is this okay?

I don’t think so. Is this a violation of the terms or even illegal behavior? Well, so far Share-it (who handles the affiliate system) says that this okay and that I’m free to terminate my cooperation with the affiliate.

I’m no expert (even though I’m probably involuntarily on the road to become one, sigh) on this topics but on this seems similar to Cookie-Stuffing, so I won’t give up so easily on this and post updates on this.

But untill then, if you have an affiliate program, you should check your affiliates’ websites, especially those that you think are your best ones.