diff --git a/Borderless.cs b/Borderless.cs index 4f6c544..f83195e 100644 --- a/Borderless.cs +++ b/Borderless.cs @@ -214,7 +214,7 @@ private void RemoveBorder(String procName) //actually make it frameless if (proc.ProcessName.Equals(procName)) { - Console.WriteLine(proc.ProcessName); + var pFoundWindow = proc.MainWindowHandle; var style = GetWindowLong(pFoundWindow, GWL_STYLE); @@ -306,11 +306,19 @@ private void workerTimer_Tick(object sender, EventArgs e) private void sendGameName(object sender, EventArgs e) { - if (selectedProcessName != null) + if (selectedProcessName != null && Favorites.canAdd(selectedProcessName)) + { Favorites.AddGame(selectedProcessName); - Favorites.Save("./Favorites.json"); - MessageBox.Show(processList.GetItemText(processList.SelectedItem) + " added to favorites", "Victory!", - MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + Favorites.Save("./Favorites.json"); + MessageBox.Show(selectedProcessName + " added to favorites", "Victory!", + MessageBoxButtons.OK, MessageBoxIcon.Exclamation); + } + else + { + MessageBox.Show("Unable to add " + selectedProcessName + " already added!", "Uh oh!", + MessageBoxButtons.OK, MessageBoxIcon.Error); + } } + } } \ No newline at end of file diff --git a/Favorites.cs b/Favorites.cs index a4b3a1b..d68c76f 100644 --- a/Favorites.cs +++ b/Favorites.cs @@ -44,6 +44,15 @@ public static void Remove(string path, string item) Save(path); } + public static bool canAdd(string item) + { + if (_favoriteGames.Contains(item)) + { + return false; + } + return true; + } + public static List List { get { return _favoriteGames; } diff --git a/Properties/AssemblyInfo.cs b/Properties/AssemblyInfo.cs index 2025fe5..c9500f7 100644 --- a/Properties/AssemblyInfo.cs +++ b/Properties/AssemblyInfo.cs @@ -1,15 +1,16 @@ using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; +using System.Resources; // General Information about an assembly is controlled through the following // set of attributes. Change these attribute values to modify the information // associated with an assembly. -[assembly: AssemblyTitle("WindowsFormsApplication2")] -[assembly: AssemblyDescription("")] +[assembly: AssemblyTitle("Borderless Gaming")] +[assembly: AssemblyDescription("Play your favorite games in a borderless window; no more time consuming alt-tabs")] [assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("WindowsFormsApplication2")] +[assembly: AssemblyCompany("Codeusa Software")] +[assembly: AssemblyProduct("BorderlessGaming")] [assembly: AssemblyCopyright("Copyright © 2014")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] @@ -32,5 +33,6 @@ // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] +[assembly: AssemblyVersion("2.0.0.0")] +[assembly: AssemblyFileVersion("2.0.0.0")] +[assembly: NeutralResourcesLanguageAttribute("en-US")]