Subj : Re: Modal dialog box - how? To : borland.public.cpp.borlandcpp From : David Ayre Date : Wed Jul 07 2004 03:38 am Hi Bob, I thought it might help if I gave you an example og the code for the window. class GetInvNote : public Window { private : public : LRESULT WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam); }; LRESULT GetInvNote::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) { UINT iParam; LRESULT lResult = Window::WndProc(iMessage,wParam,lParam); switch (iMessage) { case WM_INITDIALOG : { SetIcon("ICN_MAILER"); CentreWindow(); } break; case WM_COMMAND : switch (wParam) { case IDOK : { char acCode[15]; GetDlgItemText(hWnd, TXT_NOMINAL, (LPSTR)acCode,sizeof(acCode)); if(acCode[0] == '\0')break; WritePrivateProfileString("INVOICE", "NOTE", (LPSTR)acCode, NMS_INIFILE); } case IDCANCEL : EndDialog(hWnd,0); break; default : lResult = DefWindowProc(hWnd,iMessage,wParam,lParam); } break; case WM_CLOSE : { Destroy(); } break; default : lResult = DefWindowProc(hWnd,iMessage,wParam,lParam); } return lResult; } Cheers, David .