I have a dll file with a function that creates a dialog. To close the dialog I need to be able to press escape key.
I've tried RegisterHotKey, but then the hotkey also works when I have switched to another task, and that's not my intention. Another way I can use is to subclass all controls that can get focus on my dialog, and check for WM_KEYUP, but that seems a bit unwieldly.
I wonder what other people use for this problem?
I've tried RegisterHotKey, but then the hotkey also works when I have switched to another task, and that's not my intention. Another way I can use is to subclass all controls that can get focus on my dialog, and check for WM_KEYUP, but that seems a bit unwieldly.
I wonder what other people use for this problem?
that's what hot keys do. Yeah use WM_KEYUP or DOWN if you want to stay in task.