Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Dialog Message Problems (win32)

I've just started a project, and decided to base it on the following
article on codeproject.com http://www.codeproject.com/shell/StealthDialog.asp

The problem is once i edit the resource file and add extra controls to the Dialog, the dialog no longer continues to function correctly. For instance i can't tab between controls (system default beep also plays)

I've searched around and the only suggestion that would be causing this is that the function IsDialogMessage isn't getting called in the main message loop.

The original code from the project has the following

while (GetMessage(&msg, NULL, 0, 0))
{
if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg) || !
IsDialogMessage(msg.hwnd,&msg) )
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}

I've attached zip of the project if thats any help.
[1033 byte] By [jmcclarnon] at [2007-11-11 10:19:36]
# 1 Re: Dialog Message Problems (win32)
you edited the resource file directly?
jonnin at 2007-11-11 20:59:03 >
# 2 Re: Dialog Message Problems (win32)
Yes I did, does that make a difference?

the only changes between the version i downloaded and the version i modified are

resource.h

#define IDC_EDIT1 1001

Win32 Dialog.rc

EDITTEXT IDC_EDIT1,112,17,60,14, WS_TABSTOP | ES_AUTOHSCROLL

any suggestions?
jmcclarnon at 2007-11-11 21:00:04 >
# 3 Re: Dialog Message Problems (win32)
I think you should try another condition:
if( ! TranslateAccelerator(msg.hwnd, hAccelTable, &msg) && !
IsDialogMessage(msg.hwnd,&msg))
{
. . .
}
I hope this helps.
Viorel at 2007-11-11 21:01:07 >