We have an application that is run with admin privileges, where (apart from other operations that actually require admin privileges) the user can send emails.
Our email system works like this: admin-run application precompiles the email fields and launches (via CreateProcess) our email application that calls the actual email send. If the email is complete and ready it will send it directly, otherwise it will show the Outlook email form to let the user fill the missing fields and send.
Our email application uses TJclEmail to handle email sending and showing Outlook email form. My problem is this: the email application won't show the Outlook email form if Outlook isn't run as administrator, I guess because it's called from the admin-run application so it inherits privileges. Since Outlook is hardly ever run as administrator I'd like to find a way to call CreateProcess with normal user privileges, insted of inheriting admin privileges from its caller.
Is there a way to do so?
Per How can I launch an unelevated process from my elevated process and vice versa?:
And then the article goes on to show an example that gets the desktop's
IShellFolderViewDualinterface, and from that anIShellDispatch2interface, and then callsIShellDispatch2::ShellExecute()to execute the new process as the logged-in user (which is basically the same example provided on MSDN: Execute In Explorer Sample):And per How can I launch an unelevated process from my elevated process, redux:
And here is the example from that article: