0

I have an electron app in which i am using Auto Hot key.I want to disable ALT+F4 for that i have written following script

!F4::Return

After execution of this script i am still able to close my electron app using Alt+F4 but for other application like for Notepad,folder etc script is working fine.

For reference: https://www.autohotkey.com/docs/AutoHotkey.htm

Vishal Shori
  • 384
  • 3
  • 5
  • Might be because of privileges, see https://stackoverflow.com/questions/1890351/why-is-visual-studio-catching-key-events-before-autohotkey/1905257#1905257 – Oleg Feb 09 '18 at 07:31

2 Answers2

1

This disabled Alt+F4 for all windows with "- Notepad" in the title

SetTitleMatchMode 2     ; All #If statements match anywhere in title

#IfWinActive - Notepad
!F4::return
#IfWinActive

Replace - Notepad with the title of your Electron app's window

Jim U
  • 3,318
  • 1
  • 14
  • 24
0

I think your probably better off setting closable: false in your browser window options so that the electron window won't close and the other windows won't close.

All browser window options

Joshua
  • 5,032
  • 2
  • 29
  • 45