The humble progress bar

I’ve done a lot of programming over the years, but not very much on client applications.  My history is primarily with server applications and test code which in many cases only has an input file as UI or better still a SQL connection string.  So I wrote a progress bar today.  They’re not too hard and MSDN actually has an ok resource on how to build one *gasp* with example code!

I ended up not using that exact variation but came close.  This part is what gave me the most trouble, although it wasn’t that much.

SendMessage(hwndPB, PBM_SETRANGE, 0, MAKELPARAM(0, cb / 2048));
SendMessage(hwndPB, PBM_SETSTEP, (WPARAM) 1, 0);

The above code assumes you call the following which increments the bar by the 3rd parameter of the PBM_SETSTEP call.

SendMessage(hwndPB, PBM_STEPIT,  0, 0);

However this didn’t appear to work for me.  My bar didn’t move at all when I called SendMessage with a PBM_STEPIT, so I used PBM_ without calling the SendMessage with PBM_SETRANGE.  This is easy because without that cal the progress bar defaults to min/max of 0 to 100.  This way I had just a handful of places in my code where I wanted to advance the bar to specific intervals because the code inbetween was not equal in it’s progressness.  So using the following I was able to explicitly set my progress bar where the 3rd argument is a value from 0 to 100.

SendMessage(hwndPB, PBM_SETPOS, 10, 0);

This is a pretty simple implementation and I would probably use a variable in place of the 10 if it were more complex, but I only made 5 calls, so this works for now.  The MSDN article covers the rest pretty well including styles and dialog options.

Windows Phone 7, which one?

This is turning out to be a serious holiday season when it comes to new computer hardware.  PCs have never been faster, sleeker and lighter.  Microsoft has now entered the smartphone market for real now and offers 5 phones through 2 carriers, AT&T and T-Mobile.  Sprint is coming early next year as well as Verizon.

AT&T
1) HTC Surround – slide out speaker , mm ok.
2) Samsung Focus – lightest, best looking screen in my opinion
3) LG Quantum – slide out keyboard

T-Mobile
1) HTC HD7 – largest screen
2) Dell Venue Pro – slide out keyboard, nicest physical form factor in my opinion

I am currently on the AT&T network with you guessed it… my iPhone.  I love my iPhone, but I’m ready to give the Windows phone a shake.  I’ve seen several of the models hands on and it looks great!  The one I’ve been most impressed with is the Samsung.  At first I actually didn’t like it’s weight.  It felt too light, cheap even.  However that is a consequence of my age.  I associate heft with quality.  The Samsung phone on the AT&T network is very stiff and although it’s light it performs really well.  The screen was by far the clearest and brightest of the 5 phones I looked at.  Responsiveness is very crisp as well, faster than my iPhone 3GS.  I can’t speak for the iPhone 4, I don’t have one.

Still what I’m really looking forward to is the Windows Phone app store.  This is something Apple has had via iTunes for a while, but I have lived inside Visual Studio most of my programming life, so I will be much more likely to write my own applications for the Windows Phone and the developer pool out there is huge.  There are going to be some really good apps for the Windows phone in the coming months.

All of that being said, I’m still going to wait until January to see what Sprint’s offering is.  Their network is faster and cheaper than AT&Ts assuming you are in a 4G area, which I am.  My contract is up, so I can jump ship without penalty.  That will give the app store some time to fill out too.  I hate not being able to buy a new phone now, but delayed gratification is supposed to be a sign of maturity, or so I’m told.

Found it!

Ok, Lenovo just updated their website today and they now offer a W510 with a Class 2 GPU in the same ballpark as the ATI 5650.  The Lenovo looks like it could take on a truck, and certainly doesn’t get the sexy style points that the HP Envy or the Mac get, but it has…

1) A High Res Screen (>= 1400×900)
2) SSD Option
3) Class 2 GPU or better – NVIDIA FX 880M (1GB)
4) A 15” Screen Format

This whole package with a 160GB SSD, I mention that because it is the priciest upgrade, is about $2100.  The Macbook Pro with similar specs is $2600.  So I think I’ve found my machine.  Thank you Lenovo!

The.. Laptop

So being in OEM, I spend a lot of time looking at laptops from all over the world.  We often get machines early for testing and see many new models just as they are coming out.  We spend a lot of time analyzing and consulting on the performance of the images that OEMs put on their machines.  Of course the apple compete issue is always on our minds.

Since I am very much a laptop aficionado, this job is perfect for me.  I am always shopping for my next laptop.  I use several new laptops every month and I actually work from at least two or three per year.  When I say work from I mean that I go through the trouble of setting up e-mail accounts on rich client applications and actually do work on them instead of just kind of tinkering and judging news ones that go by.

After using so many, from 11” up to 17” I personally keep coming back to the 15”.  11” is just too small for my hands.  13” is nice and portable, but not so good for writing code or doing side by side document editing which I do a lot.  A 15” accommodates all of these.  A 17” does even better, but the size and weight really do start to become too much for me at that point.  A 17” is so big, I might as well have my desktop machine to work from.

So I like looking at 15” models.  Now I will confess that I do play video games on my laptop from time to time. Lately Civilization 5 has been a vice in airports waiting for a flight.  So I like to have a good GPU on my laptop for just such occasions.  I also like high resolution displays, meaning in the 1400×900 or greater range.  Being in the business of performance, I know that the disk the today’s primary bottleneck, just like it has been for the last 50 years.  So a SSD is the single most important hardware upgrade you can add to your computer to noticeably improve it’s performance.

I have found only 4 laptops that almost meet these criteria.

1) Lenovo T510 – GPU is Class 3 (notebookcheck.com)
2) Alienware MX15 – Does everything!  Except it looks like a gaming rig.
3) HP Envy 15 (No longer shipping, they only have the 14.5, but it’s only 1366×768)
4) Sony VPCEB390X – No SSD option

Now there’s #2 staring at me saying look I meet all of your criteria.  This is true.  However that notebook looks like something out of Toys’R’Us or a Car Toys bling factory.  I still have to meet with customers and business people with my laptop.  When you open that thing up, it says something about you, and that’s not what I want to communicate to my business associates.

The other contender that came close was the HP Envy 15”.  I don’t know why HP is no longer shipping that machine in favor of the 14.5” version.  The Envy 17” meets all of the criteria save for the fact that it is so large.  For some reason, OEMs assume that if you want a high resolution screen, you must want a 17”.

I even looked at our key competitor, Apple.  The Macbook Pro comes close and offers all of my criteria except the GPU is class 3, similar to the Lenovo.  However it’s also worth noting that the Macbook Pro spec compared to the Lenovo, literally the exact same hardware save for the design is $500 more expensive.

Win32 development for WinPE mode

So lately I’ve had to develop for the WinPE environment at Microsoft for some cool tools we’re working on in the OEM space. It’s like going back to 1998 in terms of Windows Programming so it’s kind of nostaligic as well as annoying. Still a little retro programming is good for the soul as long as I don’t make a habit out of it.

The main feature we created was the ability to restore a .wim file using the WIMGAPI which allows a compiled tool to do the same things as imagex without having to actually use imagex.