• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 284
  • Last Modified:

TAB not being responded to in modeless

I am working on a program in which I am opening a popup window from a property sheet. The popup window itself opens a modeless dialog box which contains many text edit boxes. While the edit boxes seem to respond normally to most input, TABs will not move focus from one to the next as they should. The TABs work fine within the property sheets. I also do not seem to be able to trap any kind of key down commands.

The message loop in the main window routine has been modified to check if the modeless dialog box is active and if so reroute the message, but it doesn't seem to work. The functions for the popup window & modeless dialog box responded to TABs okay when they were in a test program, but the instant I started calling them from a property sheet routine, they stopped working.

The main message loop is as follows:
  while (GetMessage(&message, NULL, NULL, NULL))
    if (!IsWindow(hwndModeless) ||!IsDialogMessage(hwndModeless, &message))

If anyone has any suggestions on where my trouble spots might be, I would appreciate it.

Thanks in advance,

1 Solution
The problem might be that your application uses the messages WM_USER and WM_USER+1. IsDialogMessage() sends DM_GETDEFID and DM_SETDEFID to the dialog box, which are defined to be WM_USER and WM_USER+1, so there is a chance of a conflict.
If it is indeed the case, the problem should go away if you shift the user message ids by 2 i.e start from WM_USER+2.

I hope this helps.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now