According to this MSDN: http://msdn.microsoft.com/en-us/library/53ezey2s.aspx
...you will not get back a Process
object when the process is already running.
I found this on a forum relating to the nature of WindowsPhotoViewer:
Actually, the Windows Photo Viewer is part of Windows Explorer, and generally runs in the Explorer.exe process. In fact, what you're calling the Photo Viewer is really just the "preview" verb for images. It isn't a standalone application, and opening it without an image or images doesn't really make any sense.
Thus, you are not getting back a Process
object because it is already running by virtue of the fact that explorer.exe
is already running.
In the end, I think it means that if your images open in WindowsPhotoViewer, you will not be able to make WaitForExit()
work because the owner process will never exit.