WM_KEYDOWN and GetAsyncKeyState() for parent window
I have an application which displays files in a listview, and has several buttons to press for various functions.
I wish to capture the F5 key and the backspace key for the entire parent window, even when a child control has the focus. I can catch the two keys when the parent window has the focus and it works fine, but if a child window has the focus the main window procedure catches no such message.
I'm wondering which solution would be more efficient on memory and processing:
1) Subclassing all the child controls to catch the WM_KEYDOWN message
2) Creating a separate thread which loops GetAsyncKeyState() and see's the key press no matter what control has the focus.
Another alternative would be using a global keyboard hook, but that seems to be overdoing it, I know many anti-malware programs are set off by such actions.
Implementing solution 2 would be much easier, but I'm not sure if it would be frowned upon that I chose that over subclassing.