Q: Visual basic closing a program I have a really simple question, or at least I think it should be as simple as it can gets...
I'm opening a jpg file by the simple statement:
Process.Start(PlatiBild)
Where the variable "PlatiBild" just indicates the path and filename.
The default program by which this file is opened is "Pictures" from Microsoft itself.
This works just fine.
Now I want to close this file when a condition is met, but here is my problem.
It just won't work.
There is no such thing like:
Process.Close(PlatiBild)
So I tried for example:
Process.GetProcessesByName("Pictures")(0).Kill()
But still, the Pictures app just wont close.
In my opinion it should be just one simple line of code, am I wrong?
Thanks to everyone who at least takes a look at this!

A: I just found out by myself and of course by your comments,
that to close the Photos App from Microsoft you need to call the following:
Process.GetProcessesByName("Microsoft.Photos")(0).Kill()
So you actually have to call 'Microsoft.Photos' and not just 'Photos' as indicated in the Process names of the Taskmanager.
Also as minimalist mentioned you need to kill, as it looks like that the statement CloseMainWindow() doesn't work for this application!
Thanks to everyone who took time to watch at this issue!
