Hi,
I got the solution from here:
http://social.msdn.microsoft.com/Forums/vstudio/en-US/c11c1760-c72e-45f3-8d29-28c80b937d6f/how-can-i-launch-set-default-programs-from-mfc?forum=vclanguage[
^]
Basically this what I needed:
CString sExe("control.exe");
CString sArg(" /name Microsoft.DefaultPrograms /page pageDefaultProgram");
int nRetVal = (int) ::ShellExecute(this->m_hWnd, _T("open"), sExe, sArg, NULL, SW_SHOW);
The thing is that the
pageDefaultProgram
value is undocumented. Thanks to Microsoft I wasted many hours on this, because Microsoft decided not document it.