I have an MFC app built using Visual Studio 2008 and it needs to run on W2K, XP, 2003 and Vista. The application writes to HKLM in the registry and will only work on Vista if you run it as Administrator.
My question is: can I force the app to run as Adminstrator automatically? Does it involve creating a manifest file? At the moment I have the following in stdafx.h which I guess creates a manifest file on the fly:
#pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
Can I modify this line to force the elevation or do I need to do something with the VC project manifest settings?
Thanks in advance.