-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
removed the form completely and added error handling if the executabl…
…e for Razer Chroma Visualizer cannot be found
- Loading branch information
1 parent
0bba901
commit baee07e
Showing
12 changed files
with
48 additions
and
498 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" /> | ||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8" /> | ||
</startup> | ||
</configuration> |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,37 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using System.Threading.Tasks; | ||
using System.Windows.Forms; | ||
using System.IO; | ||
using System.Diagnostics; | ||
using System.Windows; | ||
|
||
namespace ToggleChromaVisualiser | ||
{ | ||
static class Program | ||
class Program | ||
{ | ||
/// <summary> | ||
/// Der Haupteinstiegspunkt für die Anwendung. | ||
/// </summary> | ||
[STAThread] | ||
static void Main() | ||
static string ChromaVisualizerExec = @"C:\Program Files (x86)\Razer\Synapse3\AudioVisualizer\ChromaVisualizer.exe"; | ||
static void Main(string[] args) | ||
{ | ||
Application.EnableVisualStyles(); | ||
Application.SetCompatibleTextRenderingDefault(false); | ||
Application.Run(new Form1()); | ||
if (!File.Exists(ChromaVisualizerExec)) | ||
MessageBox.Show("The Razer Chroma Visualizer executable cannot be found."); | ||
else | ||
{ | ||
bool isrunning = false; | ||
|
||
Process[] allprocesses = Process.GetProcesses(); | ||
for (int i = 0; i < allprocesses.Length; i++) | ||
{ | ||
if (allprocesses[i].ProcessName.Contains("ChromaVisualizer")) | ||
{ | ||
isrunning = true; | ||
allprocesses[i].Kill(); | ||
break; | ||
} | ||
} | ||
if (isrunning == false) | ||
{ | ||
Process startit = new Process(); | ||
startit.StartInfo.FileName = ChromaVisualizerExec; | ||
startit.Start(); | ||
} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.