How to execute a program in compatibility mode from code?

蹲街弑〆低调 提交于 2019-12-04 11:05:14

I am not sure if I understand your problem exactly, but if you want to run the Program always in the Compatibility mode you can set the registry to make it work so.

Registry Key:
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers

Add a new String entry with,
Name : Your Application Path in Full.
Type: REG_SZ
Data : Required Compat Value. I think it is WIN2003 OR WIN2003SP1 in your case.

Example:
C:\Program Files\System32\Notepad.exe REG_SZ WIN2003

You can check for the current OS version you are running under and you can set and unset this registry value before calling the program.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!