The problem with Windows!

I had some fun the last few weeks working on some code in EZGUI 5.0. I was working on the new Auto Resize engine in the runtime and I had some problems.

My code ran flawlessly on Windows XP, which is what I develop on. But when it was run on Windows Vista and Windows 7, I had all sorts of problems. The code was dealing with resizing controls on a form during the forms WM_SIZE message. To make matters more complicated, the code would run fine on Vista and Windows 7, when Aero was turned off, but when Aero was running, it was a mess. To make things even more complicated, I was testing the code when the “drag windows content” option was on in Windows. Personally I don’t like this feature, because it is very difficult to get a perfect flicker free resize when Windows is updating the form numerous times per second as you drag the border of a form to resize it, but some end users do use this feature in Windows so I have to write code which will work well under that situation.

Now the code I am writing is a bit complex in that it also must generate new regions for controls which use them (ie. a round ownerdraw button control). Another problem is how Windows redraws controls. Most controls don’t double buffer (they erase the background in one step and then draw text in another step) so they flicker terribly. Now Vista and Windows 7 do add the ability to double buffer a few controls, but that won’t work on XP and EZGUI must run well on XP too.

Backward compatibility used to be important to Microsoft in the past, but it appears that it isn’t as important now. It is difficult to write software which runs well on multiple versions of Windows and I expect it will continue to get more difficult in the future. Maybe thats why Windows 7 (Pro) also comes with XP which runs in a virtual environment. I guess they think it is too difficult to support Windows XP apps on Windows 7.

When writing software for Windows, one needs to make sure it is tested on a variety of versions of Windows. I write software for the lower denominator (XP) and then test on the later versions afterwards. It truly is a challenge. Before its all and done, I also need to test it on Windows 95 , since EZGUI is designed to run on Windows 95 to Windows 7. Few programmers today target so many different versions of Windows as I do, so I can appreciate even more the challenge of writing software which will run well on multiple operating systems. Interestingly though, because I work so hard in making EZGUI run well on even legacy versions of Windows, I have even gotten a good degree of compatibility for Linux running Wine (a Windows emulator).

You have to work a lot harder if you want compatibility over a variety of Windows versions, but in the long run I think it is well worth it. You have to do a good bit of testing to accomplish this. Also I don’t think it is enough to simply let Beta testers to all the testing on different platforms. You really need to have access to your own computers with different versions of Windows on them and even at different speeds. Currently I have PC’s with Linux (Wine), Windows 95, Windows XP Home, Windows Vista Home and Windows 7 Premium (64 bit).  This provides me with enough variety for testing.

On an interesting side note. I have been criticized by some for still trying to support Windows 95. Yet, in the long run it has actually been a benefit. Why ? Because a good many of the API’s which are at the core of the Windows operating system, have been around since Windows 95. The API’s which are still current in Windows 7 (meaning the API docs don’t say they have been superceded) which have existed since Windows 95, I find are the most likely to be “rock solid” (reliable) and dependable, not matter what versions of Windows you are writing for. One of my favorites is DIB sections. DIB’s are so powerful and they are at the core of the Windows operating system. Later code in the operating system was even built upon them. I doubt DIB’s will disappear anytime soon. This is one of the reasons why my sprite engine (even EZSprite) runs so well on so many different platforms, even Linux with Wine.

So, if you are writing software for Windows, consider taking the time to make sure it runs well on multiple versions of Windows.

Another side note. I recently downloaded Microsofts “Small Basic” which is a freeware programming language which is suppose to help more kids (and adults) learn how to write software for Windows. I first tried to install it on my Windows XP computer (SP2). It wouldn’t install because it said I had to have service pack 3 (yes, I plan on upgrading to sp3). I then tried to install it on my Vista Home Basic computer. It wouldn’t installed because it said I needed dot.net 3.5. So finally, I had to install it on my latest computer which is running Windows 7 (64 bit). I really don’t think a freeware tool simply for learning, should have been written so it won’t run on most computers. Just requiring the dot.net 3.5 runtime in my opinion is a poor choice. How many schools are running older computers, which simply won’t run Small Basic ? This programmer gives Small Basic a low rating just for this alone!