This code opens a folder if the “TotalFileCount” == 0. I want to open the folder and have it centered on the screen and I want it to be a specific size. Is there a way to do that in C#?
if (TotalFileCount == 0)
{
MessageBox.Show("There are no files in this directory. Please add pictures to this folder: " + AppVars.PolicyImagesDirectory + " and try again.", "Error!", MessageBoxButtons.OK, MessageBoxIcon.Error);
btnBrowse.Focus();
System.Diagnostics.Process process = new System.Diagnostics.Process();
process.StartInfo.FileName = AppVars.PolicyImagesDirectory;
process.Start();
}
When the new Windows Explorer window opens, can I make it a specific size and center it on the screen?
get the handle from the process then call the native SetWindowPos from the win32 api