First, you need Microsoft Visual Studio. From it you need to create a dummy exe file that does nothing.
You can do this by creating a new C# command line project, pasting this code in it, changing it to a windows application from its settings then compiling it. I named mine Noop.exe
Code: Select all
using System;
using System.Threading;
class Program {
static void Main() {
while(true) {
Thread.Sleep(100); // So we don't spam the CPU too much
}
}
}
After this in Rainmeter game mode's settings activate Additional process list and write Noop.exe or the name of your exe file.
This will start the game mode when Noop.exe is launched and turn it off again when Noop.exe is closed. At the moment, you can only close it from task manager.
To make the desktop shortcut open notepad and paste this code, replace Noop.exe with the name of your own file and save it as GameMode.bat in the same folder with Noop.exe
Code: Select all
SETLOCAL EnableExtensions
set EXE=Noop.exe
FOR /F %%x IN ('tasklist /NH /FI "IMAGENAME eq %EXE%"') DO IF %%x == %EXE% goto FOUND
echo Not running
start Noop.exe
goto FIN
:FOUND
echo Running
TASKKILL /im Noop.exe /f /t
:FIN
You can just make a desktop shortcut of GameMode.bat and use it, but it shows a cmd window for a second when you use it. If you don't want to see that you can open notepad again, paste this code and save it as GameMode.vbs
Code: Select all
Set WshShell = CreateObject("WScript.Shell")
WshShell.Run chr(34) & "GameMode.bat" & Chr(34), 0
Set WshShell = Nothing
Make a desktop shortcut of GameMode.vbs and change its icon to something you want. You can now use that to turn the game mode on/off.