In my application there is an interface where user can select any file and open in its default application depending on the file association.
I am using FindExecutable and CreateProcessAsUser with Explorer token.
Now the problem is in the case of picture files say .jpg, FindExecutable returns "C:\Program Files\Windows Photo Gallery\PhotoViewer.dll", then CreateProcessAsUser returns "ERROR_BAD_EXE_FORMAT(193) %1 is not a valid Win32 application.". I was passing NULL as the second parameter for CreateProcessAsUser, sending executable path in lpCommandLine(eg: CreateProcessAsUser(hToken, NULL, szCmdline, ...)).
Can anyone help me in solving this?
Regards, Manoj