how to handle messages to a hidden program?

  • Thread starter Thread starter nassar
  • Start date Start date
N

nassar

I want to know how i can make my program always get the
messages sent by keyboard even when its window is hidden,
minimized, or not in focus? i know that the usual message
handlers like:
void CMyclass::OnKeyDown(UINT nChar,...)
won't work when the program doesn't have the focus, so
what i can do?
thanx..
 
nassar said:
I want to know how i can make my program always get the
messages sent by keyboard even when its window is hidden,
minimized, or not in focus? i know that the usual message
handlers like:
void CMyclass::OnKeyDown(UINT nChar,...)
won't work when the program doesn't have the focus, so
what i can do?
thanx..
You will need to write windows hooks. Look in MSDN for
SetWindowsHookEx() method. That should start you off in the direction.
 
Back
Top