Tuesday, November 21, 2006

Windows Vista CreateProcess Issues

Windows Vista has been nothing but fun. I came across an issue where all CreateProcess calls in the application I'm upgrading to Vista now fail. The processes are launched from within a GUI application. The launched process requires Administrator rights. The launched process was upgraded to include the appropriate Vista Maniftest, though when launched from the old application the CreateProcess call fails with error 740 ERROR_ELEVATION_REQUIRED.

Turns out I can no longer use CreateProcess to launch the process. I have to use ShellExecute instead.


::ShellExecute(
m_hWnd,
_T("runas"),
szProcess,
0, // params
0, // directory
SW_SHOWNORMAL
);



I've found this resources somewhat useful Microsoft Vista Developer Reference. Though most of Microsoft's Vista documentation tends to be a bunch of marketing fluff with no real substance. My favorite example of this can be found here. In it's current state the article is nothing more than a poorly organized mess, sprinkled with keywords, giving the developer no real hope of ever figuring out what wonderful changes are ahead with Microsoft Vista.

1 comment:

Anonymous said...

thanks!i found this article helpful :)
btw, just wanna share a useful link i encountered http://weblogs.asp.net/kennykerr/archive/2006/09/29/Windows-Vista-for-Developers-_1320_-Part-4-_1320_-User-Account-Control.aspx