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))
    {
      TranslateMessage(&message);
      DispatchMessage(&message);
    }
  }

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

Thanks in advance,

Bill
wcornishAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ohellCommented:
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.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Microsoft Development

From novice to tech pro — start learning today.