I am making a screenshot program and right now I have a feature that lets the user edit the screenshot in MS Paint. The only problem is, I want the file browser (for saving a paint file) to automatically browse to this path:
%SystemRoot%\system32\mspaint.exe "C:\Users\My Name\Documents\ruush"
Could someone give me some insight into how I would do that?
Here is the code I intend to put it in (in the first if):
DialogResult dialogResult = MessageBox.Show("Would you like to edit your screenshot in paint?", "Edit", MessageBoxButtons.YesNo);
if (dialogResult == DialogResult.Yes)
{
Process.Start("mspaint", @"""c:\Users\My Name\Documents\ruush\Screenshot.png""");
}
else if (dialogResult == DialogResult.No)
{
//do something else
}
Save the file first, open in Paint second. Paint will remember the location of the file that it already opened.
Rather than forcing Paint, you can also try using the default image editor... though I've seen a lot of systems where the default image program only has view support, so I understand wanting Paint in this case. The best option would be to detect the default image program, and only fall back to MS Paint if you get a result that matches the Photos app, Picture Viewer, or a web browser (more common than you might think).