launch Paint 3d

joefa

Member
Joined
Sep 16, 2010
Messages
19
Programming Experience
5-10
Hi

Does anyone know how to launch the new Windows 10 Paint 3d app programmatically? I've got the code below for opening a file for the user to edit with Paint using the ProcessStartInfo class, and I'm trying to do the same with Paint 3d, which seems determined to hide its program location from me!

Dim pInfo As New ProcessStartInfo()
pInfo.FileName = "mspaint.exe"
pInfo.Arguments = """" + System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\DrawingTemplate.bmp" + """"
Dim p As Process = Process.Start(pInfo)
p.WaitForInputIdle()
p.WaitForExit()

Thanks
 
I found you can start the app with "ms-paint:", but can't see that it supports command line arguments.
 
Thanks for the reply. It's not great that this doesn't work though really is it :-(
I'm trying just setting the filename property to the image directly, then would have to insist that the user sets the default program to Paint-3d if they want to use it. Annoying if this is the only way to do it.
 
This is getting a little frustrating. I replaced

pInfo.FileName = "mspaint.exe"
pInfo.Arguments = """" + System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\DrawingTemplate.bmp" + """"

with

pInfo.FileName = System.Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) & "\DrawingTemplate.bmp"

to allow the OS to choose the program to use, then changed the default app for opening bitmap files to Paint-3d. Now, Paint-3d opens correctly with the image after the Process.Start is invoked, but the process object is still Nothing nonetheless! This means of course that the code crashes on p.WaitForInputIdle() with an object reference not set to an instance of an object exception. I need my program to wait until the user has finished modifying and saving the image before continuing, because the next thing is does is stream the image into RAM and then store it in a database.

Any ideas?

Thanks
 
It is probably reusing or handing off to an existing process.
Any ideas?
Let user tell your application when editing is finished with a 'store now' button or something?
 
Not really, that would be extremely unnatural the way the program works.

I think I'm going to have to park it and go back to using Paint (which works perfectly) for now. Thanks for the replies anyway.
 
Also, I've hit the same wall trying to integrate Paint 3D app into a workflow where I need to wait on the user before continuing. It’s frustrating that UWP apps like Paint 3D don’t behave like traditional desktop apps with Process.Start(). I ended up doing the same - falling back to classic Paint because at least you can properly track the process and resume when it's closed. Hopefully, Microsoft offers better support for this kind of automation in future updates. Would love to hear if anyone's found a solid workaround beyond user prompts.
 
Paint 3D is a UWP (modern Windows) app, not a normal desktop program, so you can’t launch or track Paint 3D with Process.Start like mspaint.exe.
You can open Paint 3D using the URI ms-paint: or ms-paint pathToYourFile, but Paint 3D doesn’t return any process handle, so you can’t wait for it to close.
This is just how Paint 3D and other UWP apps work — they run in a sandbox.
If your workflow needs to pause until the user finishes editing, you’ll need to ask the user to confirm when done, or use classic Paint instead of Paint 3D.
 
Paint 3D is a UWP (modern Windows) app, not a normal desktop program, so you can’t launch or track Paint 3D with Process.Start like mspaint.exe.
You can open Paint 3D using the URI ms-paint: or ms-paint pathToYourFile, but Paint 3D doesn’t return any process handle, so you can’t wait for it to close.
This is just how Paint 3D and other UWP apps work — they run in a sandbox.
If your workflow needs to pause until the user finishes editing, you’ll need to ask the user to confirm when done, or use classic Paint instead of Paint 3D.
One more thing Paint 3D doesn’t support command line options like old Paint does so even if you open it with ms paint you can’t send extra commands or know when the user closes it If you need that kind of control it’s better to use classic Paint or another simple image editor that supports command line use
 
Back
Top