How do I have my apps dialog box pop up and take focus from the current running app?

Posted by simba on Stack Overflow See other posts from Stack Overflow or by simba
Published on 2010-06-08T23:31:29Z Indexed on 2010/06/08 23:32 UTC
Read the original article Hit count: 169

Filed under:
|
|
|
|

I know this type of thing is looked negatively upon but I write software for people with disabilities and sometimes good gui practices don't make sense. In this case, the user interacts with a assistive interface and under certain conditions, my control app needs to prompt the user with a question. My background process creates a dialog (I'm using wxwidgets wxDialog class) and calls Show(). The dialog box appears but it does not have focus (the application that the user was previously using keeps it). Since my users can't use mice, they can't simply click on the window. I've tried calling show and then followed by SetFocus(HWND) but that doesn't do it. What's the problem? Is this even possible? Window7. I'm thinking that it might have something to do with it being a dialog and not a full window (wxFrame). Any help is greatly appreciated.

© Stack Overflow or respective owner

Related posts about c++

Related posts about Windows