Xcessity
Xcessity

Reputation: 539

Letting a Window believe it is still in focus although it is not

I have to deal with a nasty MS Windows application that quits doing its job as soon as it loses focus. My question is, how can I trick this application somehow to believe that it is still in focus, although it really is not?

My thoughts are:

  1. Is it possible to suppress the corresponding "WM" message from just this application?
  2. Can I send a fake message to this window that it acts like it is in focus?

Upvotes: 4

Views: 5445

Answers (1)

ascend4nt
ascend4nt

Reputation: 144

Sending the WM_ACTIVATE message works for some apps:

 SendMessage(hWnd, WM_ACTIVATE, WA_CLICKACTIVE, hWnd);

Leaving the last parameter as NULL might work too.

Upvotes: 5

Related Questions