Friday 15 May 2015

c++ - Not able execute CreateProcess with PhotoViewer.dll -


In my application there is an interface where the user can choose any file based on the file association and open it in its default application.

I am using FindExecutable and CreateProcessAsUser with Explorer Token

The problem is now in the case of picture files. Jpg, FindExecutable Returns "C: \ Program Files \ Windows Photo Gallery \ PhotoViewer.dll", then CreateProcessAsUser returns "ERROR_BAD_EXE_FORMAT (1 9 3)% 1 is not a valid Win32 application." I see NULL as the second parameter of CreateProcessAsUser Was passing in, sending executable route to lpCommandLine (example: CreateProcessAsUser (hToken, NULL, szCmdline, ...)).

Can anyone help me solve this?

Regards, Manoj

There is a Win32 executable extension. EXE; A DLL is not executable CreateProcess can not create a single process with just one .dll. Missing. EXE is "rundll32.exe"

However, it is not what you want after that: if you want shell behavior ShellExecuteEx () is usually the most convenient function ASCAction String () may be appropriate in this case, with the correct flag: ASSOCSTR_EXECUTABLE is still not running in the case of getting executable, and ASSOCSTR_DDEAPPLICATION etc. If the application already runs


No comments:

Post a Comment