Global hotkeys are a can of worms, but the older examples for windows ALL still work, provided you are testing, and this is important, OUTSIDE the Lazarus IDE since that already registers a lot of hotkeys.
Global hotkey? Test OUTSIDE of the IDE and the debugger.
One further caveat is that you can not easily change OS provided hotkeys like alt-tab, alt-f4 and all winkey + key.
You must also ensure the hotkeys are UNregistered when your program terminates, otherwise they will be in effect until system restart and can/WILL cause crashes.
Summary:
Your hotkey will likely work, but you run your program under control of the IDE or the debugger.
And that will fail..... Hotkeys on Windows rely internally on global atoms, independent of fpc/lazarus.