Delphi Handbooks Collection


Delphi XE Handbook


Delphi 2010 Handbook


October 2, 2009

Old Delphi Applications More Compatible with Windows 7

I've noticed that Windows 7 is more compatible with old Delphi applications than Vista. Here are two cases I found.

I've noticed that Windows 7 is more compatible with old Delphi applications than Vista. Here are two cases I found (mostly while giving my talk on Windows 7 at EKON last Tuesday).

The first relates with the preview of the application main form available in Windows Flip (the task bar preview), Windows Flip 3D, or even the plain list of windows you obtain using Alt+Tab keys. In Vista, a traditional Delphi application would have been represented by its icon when it was minimized and displayed in any of these views. The fix came to the VCL in Delphi 2007 with the MainFormOnTaskbar property of the TApplication class. In Windows 7, however, a traditional Delphi application would show properly in the various previews, even when minimized. This basically means that the MainFormOnTaskbar property becomes much less relevant, although it will still affect the title displayed for the application in the taskbar. With older versions of Delphi, or in case the property is set to False, the title will match the Title property of the Application global object; on the other hand, if MainFormOnTaskbar is set to True, the title is the Caption of the main form.

Another relevant change relates to the behavior of Windows Resource Protection and Virtual Storage (the area created for each user to host the document and configuration files that old “non-themed” applications save in Program Files sub-folders or in the Windows folder). Windows 7 expands the virtual storage area to include the root of the C: drive. As an example, the FileAccess program discussed in my “Delphi 2007 Handbook” tried to save a file to the root of the C: drive with the code: "Memo1.Lines.SaveToFile ('C:\SomeText.txt');". In Vista this code used to fail with an error both for a themed and a non-themed application, in Windows 7 the themed application succeeds and saves the file to the basic folder of the virtual storage area, which on my computer (for my account) is: C:\Users\Marco\AppData\Local\VirtualStore.

So, with all fanfare saying you have to move to .NET to build Windows applications, Microsoft is putting extra effort to let old Delphi (and I suspect, Visual Basic 6) programs work better with the latest version of their operating system. Maybe I missed other extended compatibilities (or incompatibilties) between Delphi programs and Vista, fell free to share others on the blog or email me.

PS. Delphi 2010 offers native support for a number of interesting new features of Windows 7, covered in my talk and part of my coming "Delphi 2010 Handbook". These are all native or COM libraries, so no .NET required either. But that's a different story.





 

7 Comments

Old Delphi Applications More Compatible with Windows 7 

 A lot of old delphi application compatibilty or 
incompatibility comes down to HOW the app designer 
wrote the code.    For example, I have a lot of older 
apps from my Delphi7 era that write configuration 
information (ini files etc) to "C:\Program Files".

These will work I think on vista if you're an 
administrator and fail if you aren't, and I think 
that on Win7 by default not even administrators have 
write permission to Program Files unless they have a 
rights elevation granted such as could be done for 
installers.

W
Comment by Warren on October 2, 19:31

Old Delphi Applications More Compatible with Windows 7 

"document and configuration files that old “non-
themed” applications"
I didn't understand the "themed" meaning. Since 
Windows 2000 - which had no theme - applications 
should have stored their files outside program files 
and system directories which became read-only for non-
privileged users. "Document and settings" has been 
available since then.
The fact that too many developers ignored it and 
didn't cause troubles just shows how many users 
accessed their systems with too elevate privileges.
Frankly, I would have preferred Vista and 7 to block 
those applications wholly, instead of employing those 
tricks that sometimes can lead to some strange 
effects.
Comment by Luigi D. Sandon [http://www.sandon.it] on October 2, 21:48

Old Delphi Applications More Compatible with Windows 7 

"... in Windows 7 the themed application succeeds and
saves the file to the basic folder of the virtual
storage area, ..."
Really? >Themed< apps can save files into secured
folders which are then redirected? Shouldn't that be
the unthemed old apps?
Comment by Christian Wimmer [http://blog.delphi-jedi.net] on October 2, 22:39

Old Delphi Applications More Compatible with Windows 7 

I didn't test Windows 7, but it cannot be less
compatible than Vista. Vista broke more applications
than any other Windows release. That made users very
unhappy (to say the least).

If Windows 7 is to succeed, it must be friendly to old
apps. Otherwise people will start looking elsewhere...
That would reduce the value of MS considerably..
Comment by Omar on October 16, 00:11

Old Delphi Applications More Compatible with Windows 7 

With windows 7 it is hard to change my apps icon, 
mostly i can't change windows registry directly from 
my apps and few multimedia problem, the rest is fine 
and stable. i use delphi 6 for programming language.
Comment by Wawan [] on May 20, 03:36

Old Delphi Applications More Compatible with Windows 7 

Thanks for the info regarding the Application Title
property. We have a Telnet Application written in 
D2007 using the ribbon menu and the Window Caption 
Changes with the users navigation through their 
Company menus. We have to link with a thirdparty 
Electronic Parts Catalog which uses the window 
caption to resolve the active window to pass thru 
data. By using the application title the issue was 
resolved.

The one issue with windows 7 we have found is 
painting to the canvas problems which we were able to 
work around.

Cheers

Jeff
Comment by Jeff [http://www.gatewaydealersolutions.com.au] on April 13, 20:14

Old Delphi Applications More Compatible with Windows 7, maybe not 

"Microsoft Office Controls" from old Borland Delphi 7 
(like TExcelApplication) doesn't works on Windows 7.
Comment by Joey [] on August 17, 15:25


Post Your Comment

Click here for posting your feedback to this blog.

There are currently 0 pending (unapproved) messages.