Pete, I used this Windows Hotkey Explorer (free version): http://hkcmdr.anymania.com/ and found out that F12 is System debugger. Also after you mentioned RegisterHotKey i jumped to documentation and found out that F12 is binded to system debugger by kernel. Luckily one can reassign it to different key using registry and then all works perfect. Thank you for pointing me in the right direction!
Link to page explaining how to reassign system debugger:
http://muzso.hu/2011/12/13/setting-f12-as-a-global-hotkey-in-windows
In short: Now this is pretty much upsetting. But not all is lost. I tried to google for a way to disable the kernel from registering F12, but found instead the description of theHKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\UserDebuggerHotKey registry key. Modifying this you can set the keycode (scancode) that is registered as a global hotkey for the debugger. By default it's value is zero (0x0), but you can set it to eg. 0x2F (VK_HELP) which is not present on most PC keyboards, thus you can free up the F12 key. Of course a reboot is necessary after having set this registry key.