Center the Game Controllers window at ANY resolution: Single, Triple and Ultrawide Monitors

BP

Premium
Triple and UltraWide monitor racers rejoice! :roflmao:

Ever get annoyed that the Game Controller window keeps opening near the top left corner of your screen(s) with no way to save it to the center? I certainly did, so after about a day of learning some basic coding, lots of trial and error and borrowing a few lines from public forums, I finally figured out how to create a single executable that will call the Game Controller window to the center of the monitor, no matter the resolution or how many monitors you have in Nvidia Surround/AMD Eyefinity. Tested at all available resolutions I have access to, from single monitor 800 x 600 to triple monitor 5856 x 1080.

It's totally safe (the only thing it checks is your current desktop resolution) and just uses a cmd program named cmdow (located here) to move the window using simple math. I initially planned to upload just the code from the batch file, but it's much simpler to just wrap everything up in one file, plus you can just pin this to the taskbar/start menu (can't do that with batch files). Regardless, here's the batch file code for full transparency (I know people are wary of .EXE files):

Code:
@ECHO OFF
REM BFCPEOPTIONSTART
REM Advanced BAT to EXE Converter www.BatToExeConverter.com
REM BFCPEEXE=C:\Users\BJP\Desktop\GC Center Screen.exe
REM BFCPEICON=M:\7Stacks Shortcuts\bullseye_blue_zIV_icon.ico
REM BFCPEICONINDEX=2
REM BFCPEEMBEDDISPLAY=0
REM BFCPEEMBEDDELETE=1
REM BFCPEADMINEXE=0
REM BFCPEINVISEXE=0
REM BFCPEVERINCLUDE=1
REM BFCPEVERVERSION=1.0.0.0
REM BFCPEVERPRODUCT=Games Controller Center Screen
REM BFCPEVERDESC=Centers the Game Controller Window
REM BFCPEVERCOMPANY=johndough247
REM BFCPEVERCOPYRIGHT=johndough247
REM BFCPEEMBED=C:\cmdow.exe
REM BFCPEOPTIONEND
@ECHO ON
@ECHO OFF

setlocal
for /f "tokens=4,5 delims=. " %%a in ('ver') do set "version=%%a%%b"


if version lss 62 (
    ::set "wmic_query=wmic desktopmonitor get screenheight, screenwidth /format:value"
    for /f "tokens=* delims=" %%@ in ('wmic desktopmonitor get screenwidth /format:value') do (
        for /f "tokens=2 delims==" %%# in ("%%@") do set "x=%%#"
    )
    for /f "tokens=* delims=" %%@ in ('wmic desktopmonitor get screenheight /format:value') do (
        for /f "tokens=2 delims==" %%# in ("%%@") do set "y=%%#"
    )

) else (
    ::wmic path Win32_VideoController get VideoModeDescription,CurrentVerticalResolution,CurrentHorizontalResolution /format:value
    for /f "tokens=* delims=" %%@ in ('wmic path Win32_VideoController get CurrentHorizontalResolution  /format:value') do (
        for /f "tokens=2 delims==" %%# in ("%%@") do set "x=%%#"
    )
    for /f "tokens=* delims=" %%@ in ('wmic path Win32_VideoController get CurrentVerticalResolution /format:value') do (
        for /f "tokens=2 delims==" %%# in ("%%@") do set "y=%%#"
    )

)

set /A "W=%x%/2-195"
set /A "H=%y%/2-250"


CD /D C:\Windows\System32
START rundll32.exe Shell32.dll,Control_RunDLL joy.cpl
CD %MYFILES%
START %MYFILES%\cmdow "Game Controllers" /mov %W% %H%

endlocal

I called it the "Game Controller Center Screen". Fancy name, I know. Just extract the .exe anywhere on your PC and create a shortcut on your desktop, start menu or taskbar.

Enjoy!
https://mega.nz/#!xl8mSKoA!WhV9iscmYWq35jQNSP5wwJrQ6kY0EqzMR-pWdaWziXs
 

BP

Premium
Please note: your virus scanner may give you a false-positive when you download this file...again, it's totally harmless; only the code in the OP is what's in the executable. I ran it through Virustotal and most of the reports have to do with the cmdow program in the file.
 
Upvote 0

RaceDepartment Store

  • Featured
The colors of black and gold were chosen to bring out the competitive spirit of the driver. The CRP pedal’s design incorporates the essence of hyper car styling. Buy now from MOZA Racing ($499,00) Aluminum Alloy Pedal Assembly Almost every part of the CRP is made of CNC aluminum alloy...
  • Featured
Made from high-strength steel to ensure superior quality and exceptional endurance, the MOZA SRP Pedals come with adjustable pedal spacing and can be directly connected to a PC through the USB port. Buy now from Moza Racing ($39.90 – $218.90) With a high-precision pressure sensor of up to...
  • Featured
GT racing style wheel. Standard 300 mm GT wheel diameter. Grab ahold of the GS wheel and have a real racing experience. Buy now from MOZA Racing ($499,00) Alcantara® Made In Italy The GS is wrapped in Italian made Alcantara which feels exquisite. Forged Carbon Fibre Framework & Shifter Paddle...
  • Featured
With 16Nm of torque on tap the R16 can lay down an ultra-wide torque range that accurately reproduces the dynamic steering characteristics of top racing cars from F1 to IndyCar. Feel the road through the steering wheel. Buy now from MOZA Racing ($999,00) Beauty is Power Inspired by supercars...
  • Featured
RaceDepartment
Views
1k
Reaction score
1
Questions
1
The MOZA CM Digital Dash is a 5-inch colored HD dash, with 16.7 million colors and a 800 x 480 resolution that ensure stunning picture quality. The futuristic thin, floating dash sports a 60Hz refresh rate, and is compatible with most mainstream sim racing titles. Buy now from Moza Racing...
  • Featured
The R9's 9N·m of torque can simulate a full range of steering forces and car handling characteristics. Buy now from Moza Racing ($439,00) Minimum Weight & Maximum Torque Maximum torque from a compact body. Aviation Grade Aluminium Alloy Housing Unmatched quality and durability. The MOZA R9's...
Top