RegisterHotKey method not registering the hotkey with high privilege.

Smrithi Surendran 61 Reputation points
2023-02-24T13:51:43.6666667+00:00

I am creating one overlay and registering hotkey( Ctrl+O) to open the overlay.
Same key ( Ctrl+O) has been mentioned for opening Microsoft edge in my system.
Currently Microsoft edge is getting opened by click on those keys but overlay is not getting opened.

While click on keys which is registering hotkey( Ctrl+O) for overlay, I want to open the overlay, not other application.

Could you please suggest here that how to identify the existing hotkey before registering and unregister it.
Or Could you please suggest a way to registering hotkey with high privilege ?

Windows development | Windows API - Win32
Developer technologies | C#
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RLWA32 49,641 Reputation points
    2023-02-24T17:36:08.36+00:00

    If Ctrl+O is already assigned you should pick a different hotkey. According to the documentation at RegisterHotKey function "RegisterHotKey fails if the keystrokes specified for the hot key have already been registered by another hot key."

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.