title: Windows application needs focus
body: <p>I am working on an application for a customer and have hit a problem.</p>
  
  <p>The application talks to the mobile phone and does a bunch of call handling. One of the things it does is to show an "answer call" button. Clicking this with the mouse works fine.</p>
  
  <p>But the customer wants to have a keyboard shortcut for this, and that's a problem. I can get the focus if a window in the application has focus. But Windows focus steal prevention doesn't allow me to take focus if the user is in a different application.</p>
  
  <p>Please don't discuss the pros and cons of focus stealing here. I know them already and have given them to my customer. Wrong or not, they still want to do this, and they are paying the bill, so they get to decide.</p>
  
  <p>There are a number of workarounds for this, but they do not seem to work anymore. For example, I set HKEY_CURRENT_USER\Control Panel\Desktop\ForegroundFlashCount to 3 and ...\ForegroundLockTimeout to 0.</p>
  
  <p>So what are my options? Is this impossible? Or do I have to build a keyboard hook application that virus checkers will hate?</p>
  
  <p>This is a Qt/C++ application, but if you have C# example code that can do this, that is great as well.</p>
  
  <p>I hope you can help.</p>