abhijit123
Programmer
Hi
I am a new VC++ programmer and struggling in processing the messages in Modeless Dialogs.Hope someone can help me..
I am developing modeless dialogs for a CAD application(Unigraphics), which has a Win32 API.It has is his own Wizard and start function is other than Win_Main/DLL_Main. I am building a dll...
As the parameter HINSTANCE hInstance is not available directly i am obtaining it through GetModuleHandle(dllName).
I am getting a Handle(hWndUG) of the Unigraphics Window through GetActiveWindow.
The Modeless Dialog is created with
hDialog = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),hWndUG,AboutDlgProc)Function.
The parent window handle used is Unigraphics Window Handle(hWndUG),application handle is hInstance and I am defining a dialog procedure for this dialog.
I have a provision of calling a DLL in Unigrapgics.The Dialog is appearing properly and able to process desired functionality.However though it is a modeless dialog it is behaving like modal dialog and not allowing me to do any functionality in Unigraphics. Even after closing the dialog, I am not able to do anything. I am required to kill the application everytime to come out.
For message processing I am using
while(GetMessage (&msg, NULL, 0, 0))
{
if(hDialog != NULL || IsDialogMessage(hDialog,&msg)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
The dialog procedure code is:
BOOL CALLBACK AboutDlgProc (HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG :
return TRUE ;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDOK :
case IDCANCEL :
EndDialog (hDlg, 0) ;
return TRUE ;
case IDC_BUTTON1:
return TRUE;
default:
return FALSE;
}
break ;
}
return FALSE ;
}
Can anyone tell me what is the problem.Hope to hear from you..
Thanks
Abhijit
I am a new VC++ programmer and struggling in processing the messages in Modeless Dialogs.Hope someone can help me..
I am developing modeless dialogs for a CAD application(Unigraphics), which has a Win32 API.It has is his own Wizard and start function is other than Win_Main/DLL_Main. I am building a dll...
As the parameter HINSTANCE hInstance is not available directly i am obtaining it through GetModuleHandle(dllName).
I am getting a Handle(hWndUG) of the Unigraphics Window through GetActiveWindow.
The Modeless Dialog is created with
hDialog = CreateDialog(hInstance,MAKEINTRESOURCE(IDD_DIALOG1),hWndUG,AboutDlgProc)Function.
The parent window handle used is Unigraphics Window Handle(hWndUG),application handle is hInstance and I am defining a dialog procedure for this dialog.
I have a provision of calling a DLL in Unigrapgics.The Dialog is appearing properly and able to process desired functionality.However though it is a modeless dialog it is behaving like modal dialog and not allowing me to do any functionality in Unigraphics. Even after closing the dialog, I am not able to do anything. I am required to kill the application everytime to come out.
For message processing I am using
while(GetMessage (&msg, NULL, 0, 0))
{
if(hDialog != NULL || IsDialogMessage(hDialog,&msg)
{
TranslateMessage(&msg);
DispatchMessage(&msg);
}
}
The dialog procedure code is:
BOOL CALLBACK AboutDlgProc (HWND hDlg, UINT message,
WPARAM wParam, LPARAM lParam)
{
switch (message)
{
case WM_INITDIALOG :
return TRUE ;
case WM_COMMAND :
switch (LOWORD (wParam))
{
case IDOK :
case IDCANCEL :
EndDialog (hDlg, 0) ;
return TRUE ;
case IDC_BUTTON1:
return TRUE;
default:
return FALSE;
}
break ;
}
return FALSE ;
}
Can anyone tell me what is the problem.Hope to hear from you..
Thanks
Abhijit