TAB not being responded to in modeless

Posted on 1997-09-03
Last Modified: 2013-12-03
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,

Question by:wcornish
1 Comment

Accepted Solution

ohell earned 100 total points
ID: 1405588
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.

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

zlib is a free compression library (a DLL) on which the popular gzip utility is built.  In this article, we'll see how to use the zlib functions to compress and decompress data in memory; that is, without needing to use a temporary file.  We'll be c…
For most people, the WrapPanel seems like a magic when they switch from WinForms to WPF. Most of us will think that the code that is used to write a control like that would be difficult. However, most of the work is done by the WPF engine, and the W…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA.…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question