Tuesday, September 09, 2008

Greener By Nature

Greener By Nature is a great new online shop for all things beautiful, ethical, and sustainable. It was started by some friends of ours who are passionate about high quality natural products, and I heartily recommended that you take a look.

Perfect for gifts, and remember that there are only 107 shopping days left until Christmas ;-)

Sunday, September 07, 2008

Google Chrome Bug

I've been impressed with Google Chrome, although the benefits beyond IE8 are marginal. It is a very smart play by Google for reasons that are beyond the scope of this post.

I had a problem on my home media PC (Vista Home Premium) where the Window control buttons (Minimize, Maximize, Close) were not responding to mouse clicks. It was fixed by disabling display scaling: Start > All Programs > Google Chrome > Google Chrome properties (right-click) > Compatibility > "Disable display scaling on high DPI settings".

I run with very large text and see this sort of problem with many applications (including many from Microsoft). Vista has more options for coping with this sort of thing, but some programs are still unusable.

Why did the problem manifest in this way in Chrome? I noticed that the layout of the system bar (at the top of the application) is non-standard when maximized to squeeze in another 20 pixels of content (20 / 1080 = 2% = not worth the trouble IMHO). This implies some hack into the display rendering and event handling code; my guess is that it is not fully DPI aware.

I don't want to take anything away from the Chrome team though: they are clearly excellent Windows application developers. I look forward to browsing the source code.

Thursday, September 04, 2008

GetTempFileName bad behaviour

If you call System.IO.Path.GetTempFileName it will create a file of the form tmpXXXX.tmp where the hex suffix can run from 0000 to FFFF.

If Windows runs out of names it throws an IOException with the thoroughly unhelpful message: "The file exists". Which file? Where? So what?

I realize that this is the documented behavior - it's just crap. Especially given that this problem is incredibly unlikely to happen on the bench, and could be caused by another program hogging all the names before your poor application comes along. At the very least throw an exception with a meaningful message to allow some hope of diagnosing the problem in the field.