Archive for the ‘microsoft’ Category

Devloping asp.NET websites in 3 simple steps…

Tuesday, December 7th, 2010

Step 1: Waste hours researching to find out how to do something trivial. (Like renaming the insert link)

Step 2: Curse Microsoft

Step 3: Throw out the MS way and program it yourself.

Repeat for every trivial issue.

Visual Studio 2005: Speeding up compiles

Tuesday, October 19th, 2010

There’s a hidden switch in Visual Studio 2005 while doubles compile speed.

I know, it sounds ridiculous.  But I’ve tested it. It’s MUCH faster now. The switch works by enabling multi-core processing. I have no idea why Microsoft has hidden this, instead of making it a big, obvious feature.

Anyways. You can enable it by adding /MP to the “Additional options” in “Configuration properties > C/C++ > Commandline”.

(Found it at 1 and 2)

Don’t force me to reboot on updates… (Windows XP)

Sunday, March 1st, 2009

I just experienced a kind of terribly bad ideas part II for software design.

Microsoft has rolled out a new update. It’s  great that it was downloaded automatically. It would certainly have been nice if Microsoft had ASKED me for permission before installing it.

And it would have been VERY nice  if Microsoft would just have accepted that Ihad better things to do than to reboot my computer right now. That stupid messages comes every few minutes. Now, what part of NO don’t you understand?

The inevitable thing happened. I was away from the PC for a few minutes, couldn’t click on the “no” button and the computer rebooted. I can only assume it, but I doubt that the reboot process would have stopped if I had any unsaved data. (Because Opera told me on start-up that it hadn’t been closed normally.) Data loss by design. Great idea, Microsoft!

Now here’s the fix. You can download this reg-file and double-click it. It will insert 2 keys into your registry and should protect you against this very bad default behaviour.

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.

Vista doesn’t like Demos

Sunday, September 14th, 2008

Vista is known to be “special” in some aspects. What’s perhaps not so well-known is that it doesn’t like anything called “Demo”. In fact, it will show an increased warning level for any installation file that has “_demo” in the filename.

A signed installer name “test_demo.exe” will generate a red warning. If you rename it to “test_trial.exe”, you’ll only get a yellow warning. Don’t ask me why, I got no idea (please contact me if YOU have). But I don’t call my demo “demo” any more…