Okay. I finally found what happened.
As you might imagine, the issue is not caused by the code itself. It was actually running under a Windows service (Local System), and thus in another environment. The PDF viewer was launched in the virtual user SYSTEM environment and not visible for the current user.
I am planning to use the
CreateProcessAsUser function to make it run in the environment of the current user.
Thank you all for your help ! :)
Regards,
Yass