Yoav.
http://www.howtogeek.com/howto/windows-vista/using-windows-vista-compatibility-mode/
So I took a random little test program of mine, marked it as running in compatibility
(based on the above-cited page) then opened the Registry Editor to see if any bit crumbs
were left.
The program was called cstr.exe and is a random little test program I wrote. I found the
following Registry entry
[HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\\tests\\cstr\\Debug\\cstr.exe"="WINXPSP2 DISABLETHEMES DISABLEDWM"
So just mark it "by hand" to have the compatibility you want, examine the key, and then
create the code to write the Registry key as appropriate. What you might do to make this
transparent to the user is to see if the key exists with the right contents; if it does
not, then you aren't in compatibility mode. So what you would do is create the key (for
example, in your InitInstance handler), GetModuleFileName(NULL, name, len) to get the name
of the program, CreateProcess on that program (remember to pass in the command line), and
return FALSE from InitInstance. Appropriate tests might be desirable to avoid going into
an infinite loop of this if the key doesn't get created correctly.
joe
Joseph M. Newcomer [MVP]
email: newc...@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
"Yoavo" <yo...@cimatron.co.il> wrote in message news:OrJBJ0pt...@TK2MSFTNGP02.phx.gbl...