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.
 
Back
Top