Add shortcut to Desktop - to cast desktop via ChromeCast

I am in need of a solution to add some kind of Shortcut to a Desktop where by the shortcut will cast the desktop to Chromecast.

I'm basically looking to simply the process for our Users as they can't seem to do ALT + F, then C or click the 3 dots.. cast etc.

I've had a Google, but can't seem to find any successful results.

I was thinking of going along the lines of creating a Batch File for this or perhaps a Macro that could quickly do it? I'm out of ideas to be honest. I know I can launch Chrome via the batch script.


Solution 1:

Make sure you have Chrome version 76.0.3809.132 or later. Install AutoHotkey. Make 2 files and place them on your desktop:

CastOn.ahk:

; AutoHotKey Script to start ChromeCast in Desktop Mode
;
; Declare variables
delay := 1000
; Run Chrome
Run, C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --fullscreen --start-maximized
Sleep, delay
Send !f
Sleep, delay
Send c
Sleep, delay
Send {tab}{tab}
Sleep, delay
Send {Enter}
Sleep, delay
Send {Down}{Down}
Sleep, delay
Send {Enter}
Sleep, delay
Send +{tab}
Send {Enter}
Sleep, delay * 2
Send {tab}
Sleep, Delay
Send {tab}
Sleep, Delay
Send {tab}
Sleep, Delay
Send {Enter}
Sleep, delay
Send #{down} ; minimize window, casting starts

CastOff.ahk:

; AutoHotKey Script to stop ChromeCast in Desktop Mode
;
; Declare variables
delay := 1000
; Run Chrome
Run, C:\Program Files (x86)\Google\Chrome\Application\chrome.exe --fullscreen --start-maximized
Sleep, delay
Send !f
Sleep, delay
Send c
Sleep, delay
Send {tab}
Send {Enter}
Sleep, delay
Send {ESC}
Sleep, delay
Send !{f4} ; close window

Now you have 2 ahk icons on your desktop. Double clicking CastOn.ahk starts casting and leaves Chrome minimized (just wait for the magic to happen). Double clicking CastOff.ahk stops casting and closes the opened Chrome window invoked in this script.

"Sleep" is needed to avoid the simulated keystrokes to launch to early, you can however experiment with the delay variable (now set to 1000 ms, one second).

Newer versions of Chrome may lead to new UI changes in the ChromeCast functionality, which would mean this script needs to be adjusted.

Chrome may be installed in a different path as mentioned in the ahk scripts. It would not be too difficult to sort out the correct location of Chrome.exe.