Skip to content

Commit

Permalink
Fix window not showing after first plug in on autostart
Browse files Browse the repository at this point in the history
  • Loading branch information
koyuawsmbrtn committed Jan 12, 2024
1 parent f14a160 commit 5b5b080
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions PlaySync/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using Microsoft.Win32;
using static System.Net.Mime.MediaTypeNames;

namespace PlaySync
{
Expand All @@ -27,7 +26,7 @@ public partial class Main : Form
bool cansync = false;
bool updateshown = false;
bool autostart = false;
string version = "2";
string version = "3";
string oldtext = "";
string deviceinfo = "";
string[] games;
Expand Down Expand Up @@ -887,6 +886,8 @@ private void timer1_Tick(object sender, EventArgs e)
{
if (getPlaydatePort() != "" && pluggedin == false)
{
this.ShowInTaskbar = true;
this.WindowState = FormWindowState.Normal;
this.Show();
string versioninfo = sendSerial(getPlaydatePort(), "version");
string battery = sendSerial(getPlaydatePort(), "batpct");
Expand Down Expand Up @@ -1234,7 +1235,7 @@ private void toolStripMenuItem2_Click(object sender, EventArgs e)
else
{
RegistryKey rk = Registry.CurrentUser.OpenSubKey("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true);
rk.SetValue("PlaySync", "\"" + System.Windows.Forms.Application.ExecutablePath + "\" --autostart");
rk.SetValue("PlaySync", "\"" + Application.ExecutablePath + "\" --autostart");
toolStripMenuItem2.Checked = true;
}
}
Expand Down

0 comments on commit 5b5b080

Please sign in to comment.