Compatibility under Win7 platform development

Source: Internet
Author: User
Tags msmq microsoft website

1. Avoid using the GetVersion function whenever possible

The internal version number of Windows 7 and Windows Server 2008 R2 is 6.1.

Try to replace "<" when checking the version! =, Which allows the application to run in the updated operating system. The minimum requirement is that the application always accepts the supported OS version numbers greater than or equal to the minimum.

C ++

A. Get the version number through GetVersionEx to determine

&osvi, = &= ( (osvi.dwMajorVersion > ) ||== ) && (osvi.dwMinorVersion >= ) ));

 

 

B. VerifyVersionInfo is used for direct detection.

 

=  op=&osvi, = = = = = =&| VER_MINORVERSION ||

 


C #

 (Environment.OSVersion.Version <  Version(, 

 

When a feature is different on different platforms, the application should not perform an OS version check. If you need a specific function, you are advised to try it. The function fails only when it cannot be found.

C ++

Use GetProcAddress () to determine whether a function exists.

 

C #

 

 


2. Windows Mail and Windows Movie Maker are no longer supported in Win7.

 

3. Windows 7 no longer supports Microsoft Agent

Microsoft Agent is a programmable real-time interactive animation role based on Microsoft Windows. Developers can use this role as an assistant for introduction, wizard, and entertainment, or as a means to enhance interactive development of websites and applications. Microsoft Agent allows programmers and website developers to design a more user-friendly user interaction interface. In addition to the input of the keyboard and mouse, Microsoft Agent can also understand the user's voice commands, the animation role will root the user's quasi-standard voice commands through synchronous voice, the recording or text box provides corresponding feedback.

Windows 7 no longer supports Microsoft Agent, but you can still download the repair patch on the official Microsoft website to support this function.

 

4. Use Trident to determine the IE version

When IE8 and later versions use the compatibility mode, the user-agent version token displays its compatible version. In this case, you need to determine the IE version based on Trident.

For example, in IE8, if the version token is MSIE 8.0 and compatible with IE7, the version token is MSIE 7.0, but the Trident/4.0 string is appended to indicate that IE is IE8 currently, in addition, Trident/5.0 corresponds to IE9, and Trident/6.0 corresponds to IE10

 

5. removed the Registry reflection mechanism.

Windows Server 2008, Windows Vista, Windows Server 2003, and Windows XP use a reflection mechanism to synchronize 32-bit and 64-bit registries. However, from Windows 7 and Windows Server 2008 R2, MS removes registry reflection and integrates the reflection key.

 

6. MSMQ uses SHA-2 signature by default

This will cause MSMQ incompatibility between Win7 and earlier versions.

 

7. UAC data redirection

When the application needs to write data to the system directory or registry, but there is no corresponding permission, UAC data redirection will write data to a virtualized path, when you switch to another user or start or disable UAC, you cannot access the previously written data.

Therefore, when developing an application, you should not write to sensitive system areas. You should always consider running the application under the permissions of standard users rather than the administrator.

When you need to write data to the system directory or to a location that requires special permissions, you can set the project to requireAdministrator so that the application can obtain administrator permissions during running.

 

 

 

Application compatibility Toolkit (ACT) 5.5

Http://www.microsoft.com/en-us/download/details.aspx? Id = 7352

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.