Fix System.ComponentModel.Win32Exception with Process.Start
MODIFY
XRayBuilder/src/UI/Preview/frmPreviewEA.cs
XRayBuilder/src/UI/Preview/frmPreviewEA.cs
@@ -171,13 +171,13 @@ public new void ShowDialog()
private void btnFollow_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(_authorUrl)) return;
- Process.Start(_authorUrl);
+ Process.Start(new ProcessStartInfo(_authorUrl) { UseShellExecute = true });
}
private void linkStore_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (!string.IsNullOrEmpty(_asin))
- Process.Start($"http://www.amazon.{Settings.Default.amazonTLD}/dp/{_asin}");
+ Process.Start(new ProcessStartInfo($"http://www.amazon.{Settings.Default.amazonTLD}/dp/{_asin}") { UseShellExecute = true });
}
}
}
\ No newline at end of file

MODIFY
XRayBuilder/src/UI/Preview/frmPreviewSA.cs
XRayBuilder/src/UI/Preview/frmPreviewSA.cs
@@ -174,7 +174,7 @@ private void ListViewItem_SetSpacing(ListView listview, short leftPadding, short
private void linkStore_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
if (!string.IsNullOrEmpty(_asin))
- Process.Start($"http://www.amazon.{Settings.Default.amazonTLD}/dp/{_asin}");
+ Process.Start(new ProcessStartInfo($"http://www.amazon.{Settings.Default.amazonTLD}/dp/{_asin}") { UseShellExecute = true });
}
}
}

MODIFY
XRayBuilder/src/UI/UIFunctions.cs
XRayBuilder/src/UI/UIFunctions.cs
@@ -23,7 +23,7 @@ public static void OpenDirectory(string dir)
if (!Directory.Exists(dir))
MessageBox.Show("Specified directory does not exist.", "Directory Not Found...", MessageBoxButtons.OK, MessageBoxIcon.Warning);
else
- Process.Start(dir);
+ Process.Start(new ProcessStartInfo(dir) { UseShellExecute = true });
}
public static string GetFile([Localizable(true)] string title, string defaultFile, string filter = "All files (*.*)|*.*", string initialDir = "")

MODIFY
XRayBuilder/src/UI/frmAbout.cs
XRayBuilder/src/UI/frmAbout.cs
@@ -37,7 +37,7 @@ private void lnklblIcons_LinkClicked(object sender, LinkLabelLinkClickedEventArg
{
try
{
- Process.Start("https://icons8.com");
+ Process.Start(new ProcessStartInfo("https://icons8.com") { UseShellExecute = true });
}
catch
{

MODIFY
XRayBuilder/src/UI/frmAuthorList.cs
XRayBuilder/src/UI/frmAuthorList.cs
@@ -56,13 +56,13 @@ private void frmAuthorList_Load(object sender, EventArgs e)
private void linkStore_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- Process.Start(_authorList[cbResults.SelectedIndex].Url);
+ Process.Start(new ProcessStartInfo(_authorList[cbResults.SelectedIndex].Url) { UseShellExecute = true });
}
private void dgvOtherBooks_CellContentClick(object sender, DataGridViewCellEventArgs e)
{
if (e.RowIndex >= 0 && _authorList[cbResults.SelectedIndex].Books != null)
- Process.Start(_authorList[cbResults.SelectedIndex].Books[e.RowIndex].AmazonUrl);
+ Process.Start(new ProcessStartInfo(_authorList[cbResults.SelectedIndex].Books[e.RowIndex].AmazonUrl) { UseShellExecute = true });
}
}
}
\ No newline at end of file

MODIFY
XRayBuilder/src/UI/frmBookInfo.cs
XRayBuilder/src/UI/frmBookInfo.cs
@@ -242,7 +242,7 @@ private void OpenLink(string url)
try
{
- Process.Start(url);
+ Process.Start(new ProcessStartInfo(url) { UseShellExecute = true });
}
catch (Exception ex)
{

MODIFY
XRayBuilder/src/UI/frmGR.cs
XRayBuilder/src/UI/frmGR.cs
@@ -51,7 +51,7 @@ private void cbResults_SelectedIndexChanged(object sender, EventArgs e)
private void linkID_LinkClicked(object sender, LinkLabelLinkClickedEventArgs e)
{
- Process.Start(_toolTip1.GetToolTip(linkID));
+ Process.Start(new ProcessStartInfo(_toolTip1.GetToolTip(linkID)) { UseShellExecute = true });
}
private void frmGR_Load(object sender, EventArgs e)

Fix System.ComponentModel.Win32Exception with Process.Start