Skip to content

Commit

Permalink
Alert and quit if hotkey cannot be registered
Browse files Browse the repository at this point in the history
  • Loading branch information
Photosounder committed Oct 23, 2022
1 parent 5968f10 commit e880580
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions screenshot.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,11 @@ int main(int argc, char *argv[])
SDL_Event event;

// Hotkey registration
if (RegisterHotKey(NULL, 1, 2 /*MOD_CONTROL*/ | 0x4000 /*MOD_NOREPEAT*/, 0x70 /*VK_F1*/)==0)
fprintf_rl(stderr, "Hotkey already registered, error #%d\n", GetLastError());
if (RegisterHotKey(NULL, 1, 2 /*MOD_CONTROL*/ | 0x4000 /*MOD_NOREPEAT*/, 0x70 /*VK_F1*/) == 0)
{
sdl_box_printf("rouziclib screenshot", "Hotkey already registered, error #%d\n", GetLastError());
exit(0);
}

if (init)
{
Expand Down

0 comments on commit e880580

Please sign in to comment.