Monday, 20 April 2009

Optimizing for Vista

It's taken quite a long time to get my hands on a computer capable of running Vista, a couple of months ago I managed it.
The obvious thing to do was to check that all the Wessex Programs worked. They did - WPP1 & WPP2 (written in VB6) had no issues. WPP3 however threw up a couple of interesting things.
The first was the graded colour background to many of the forms which finished (in Vista) before the bottom border. This is because the Menu & border widths are smaller in Vista, so I had to find code that would allow for XP & Vista. This turned out to be (instead of hard-coding for the physical width of the menu & border) to use "Me.DisplayRectangle.Height".
The 2nd issue was when opening another program (PDF reader or Media player) an error message appeared saying no application was associated with the process - the application then went on to open correctly! Annoying or what?
After a bit of digging I found the answer in "VB 2008" published by Wrox (it also applied to VB 2003 that WPP3 is written in). It was to add 1 line of code -
" myProcess.StartInfo.Verb = "Open"" It works without this line in XP, why does it need it in Vista?
Along the way I also tried a preview of the upcoming Windows 7 (Vista as it should have been) and found the programs were fine with that too.
So - Wessex now have the modified WPP3 (version 3.2.1) and all's well ?!

No comments:

Post a Comment