I wanted to reference the Paint.NET assemblies directly and use a its functionality that way. i dont know how to use the .dll file PaintDotNet.Core.dll and use it functionality in C# visual studio any helps. Please
want to reference to these assemblies: C:\Program Files\Paint.NET\PaintDotNet.*.dll Then poke around the classes in those namespaces.
Codes:-
private void button2_Click(object sender, EventArgs e)
{
OpenFileDialog ofd = new OpenFileDialog();
string filename = "";
if (ofd.ShowDialog() == DialogResult.OK)
{
filename = System.IO.Path.GetFullPath(ofd.FileName);
}
// MessageBox.Show(filename, "file");
pictureBox1.ImageLocation = filename;
pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
DialogResult result = MessageBox.Show("Do you wish to continue?", "Save Changes", MessageBoxButtons.YesNo, MessageBoxIcon.Question);
if (result == DialogResult.Yes)
{
System.Diagnostics.Process.Start(@"C:\Program Files\Paint.NET\PaintDotNet.exe");
// here i need to perform the function like
//Open + O`
//ctrl + Shift + L)` then `
//(ctrl + Shift + G)`. then save
//`ctrl + Shift + S`
}
else
{
return;
}
}

Just follow the instruction to send the shortcut key to another application
Add this namespace to the class
Then declare
SetForegroundWindowfunction withDllImportstatement. this will create object of that method which has been created inUser32.dllAnd add the following code to your button click or anywhere in your project. This code will navigate the
OpenFileDialogto open the existing file inPaint.NETapplication.most of programmers made the mistake between
Ctrl+OandCtrl+oseems similar but, the ascii value of both key is different. So, make sure the key character is not in uppercase. You can also read the full information aboutSendKeymethod on msdn. You can make any key combination and send through theSendWait()method.