by follow a instruction of this link the below code works fine.
#IfWinActive ahk_class Notepad
a::MsgBox pressed "a"
However, I want to apply the hotkey on OneNote only (windows 10, MS office 2016). On the detail panel on TaskManager, the onenote is named ; ONENOTE.EXE but all the below codes are do not work.
#IfWinActive ahk_class ONENOTE
a::MsgBox pressed "a"
nor
#IfWinActive ahk_class ONENOTE.EXE
a::MsgBox pressed "a"
Let me know if I made some mistakes!