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.
 
Yeah, that's one of the weird quirks with Microsoft Paint 3D - it doesn't behave like traditional desktop apps when launched via Process.Start. Since it's a UWP app, Windows handles it differently under the hood, and you don’t get back a usable process object. I ran into the same issue and ended up falling back to classic Paint too. If Paint 3D is ever critical for a workflow, I guess the workaround would be asking the user to confirm manually when editing is done, though I totally get why that’s not ideal.
 
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.
 
Back
Top