Sunday, March 30, 2008

Why are tabstops not working in my modeless dialog box?

The Microsoft Knowledge base has an article explaining this issue MS KB 71450. I do not know why they didn't decide to put tab functionality in the default dialog procedure. Instead you must keep track of which dialog box is active and call IsDialogMessage inside your message pump to process tab messages.
while(GetMessage(&msg, NULL, 0, 0))
{
if(!hDlgCurrent || !IsDialogMessage(hDlgCurrent, &msg))
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

No comments: