I wrote some scripts to add Demul light gun games to my front-end a while back.
These are extremely sloppy, amateur & will probably be unnecessary in the next version of Demul, but I'm gonna share them anyway.
Most of them are copied and pasted from other scripts I already had, so there are some unnecessary things like Gui 2 (instead of just Gui) that may not seem to make sense, but it works for me. It requires some tweaking to get it to work on different computers, so be forewarned that it isn't plug & play.
Demul .5.6 added command line options, but not an option to launch fullscreen.
Here is where the autohotkey script comes in.
The command line to launch a game in Demul is:
demul.exe -run=naomi -rom=[ROM]
(thanks to ptinolv for supplying that in another thread)
The messed up part here is that the active window title changes as the game launches, spg & gpu change.

The script needs to be tweaked to include a spg # that the emulator hangs at for a second, so the script recognizes the window, activates it, then presses ALT+ENTER to launch fullscreen. The full version of the script puts up a black window while the emulator launches, so you don't see any of these windows.
Here is a shortened version of the script that can be used to figure out what numbers to plug in:
(you could also just add a semicolon ; before the lines pertaining to the Gui and autohotkey will ignore them)
Run, C:\Emulators\Programs\Demul\demul.exe -run=atomiswave -rom=rangrmsn
WinWait, gpuDXv3 | spg: 61 gpu: 0 | Ranger Mission,
IfWinNotActive, gpuDXv3 | spg: 61 gpu: 0 | Ranger Mission, , WinActivate, gpuDXv3 | spg: 61 gpu: 0 | Ranger Mission,
WinWaitActive, gpuDXv3 | spg: 61 gpu: 0 | Ranger Mission,
Send, {ALTDOWN}{ENTER}{ALTUP}
ESC::
Process, Close, demul.exe
ExitAPP
return
You need to tweak the number in red here: gpuDXv3 | spg:
61 gpu: 0 | Ranger Mission in all four places to a number that works on your computer.
60 & 61 worked for most games on my test pc, but I had to change it on my mame pc. It will vary depending on the performance of your computer.
Run the script and watch for a number that the emulator sits at for a second or two, then try that one. This seems to be the right time to go fullscreen.
I've gotten errors trying to do it too soon or after the game has fully launched.
If the game doesn't go fullscreen, the script isn't recognizing the window. Try a different number. PRESS ESC
to exit the script and try a different value.
Once you get this working, add the other parts of the script that put up the black window that hides everything until the game has launched:
Gui, 2: +AlwaysOnTop -Caption +ToolWindow
Gui, 2: Color, 0
Gui, 2: Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%, HSHIDE
Run, C:\Emulators\Programs\Demul\demul.exe -run=atomiswave -rom=rangrmsn
WinWait, gpuDXv3 | spg: 67 gpu: 0 | Ranger Mission,
IfWinNotActive, gpuDXv3 | spg: 67 gpu: 0 | Ranger Mission, , WinActivate, gpuDXv3 | spg: 67 gpu: 0 | Ranger Mission,
WinWaitActive, gpuDXv3 | spg: 67 gpu: 0 | Ranger Mission,
Send, {ALTDOWN}{ENTER}{ALTUP}
Gui, 2:Destroy
ESC::
Process, Close, demul.exe
ExitAPP
return
This requires a script for every game, but there are only 9.
The other 8 are attached as text files.
If there is a better way, please chime in. You aren't going to hurt my feelings. I've always said that I'm more persistent than good.
I wanted the games on my front-end and I got them there. I'm happy.
EDIT: The simpler way is to just use a Sleep in place of all the Winwait stuff:Gui, 2: +AlwaysOnTop -Caption +ToolWindow
Gui, 2: Color, 0
Gui, 2: Show, x0 y0 h%A_ScreenHeight% w%A_ScreenWidth%, HSHIDE
Run, C:\Emulators\Programs\Demul\demul.exe -run=atomiswave -rom=rangrmsn
Sleep, 4000
Send, {ALTDOWN}{ENTER}{ALTUP}
Gui, 2:Destroy
ESC::
Process, Close, demul.exe
ExitAPP
return
Make the sleep longer if it doesn't work.