Re: Catch WM_KEYDOWN even when modal dialog is open

"domehead100" <[email protected]> Fri, 15 Apr 2011 23:46:45 -0000
Newsgroups gmane.comp.windows.wtl
Message-ID <[email protected]>
You'd have to use a windows hook (either a keyboard hook or a message hook) if the dialog is modal.

If the dialog can be nonmodal (it could disable it's owner or the owner's top-level parent to simulate being modal), of course you could still use PreTranslateMessage.

Glancing at your code, from what you're trying to do I'm wondering why not just use WTL's built-in idle processing in the main GUI thread?

~Mike


--- In [email protected], Philipp Kursawe <phil.kursawe@...> wrote:
>
> Hello,
> 
> I have this PreTranslateMessage:
> 
> bool preTranslateMessage(MSG& msg) {
>     if (msg.message == WM_KEYDOWN && !lockWindow) {
>       if (keyBuffer.check(msg.wParam)) {
>         onDeviceIdle();
>         return true;
>       }
>     }
>     return BaseFrame::PreTranslateMessage(&msg) ||
> BaseFrame::IsDialogMessage(&msg) || sheet.PreTranslateMessage(&msg);
>   }
> 
> 
> Now, when a modal dialog is open, it has its own message loop and my
> message loop is bypassed. How could I catch WM_KEYDOWN messages anyway
> without modifying the dialogs message loop?
> 
> 
> Thanks,
> Phil
>




------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/wtl/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/wtl/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/