Hi all, I got a SDI application, in the InitInstance i launch a dialog defined as below: Code: IDD_RACES_DIALOG DIALOG DISCARDABLE 0, 0, 327, 124 STYLE WS_POPUP FONT 8, "MS Sans Serif" BEGIN DEFPUSHBUTTON "",IDOK,3,5,11,11 PUSHBUTTON "",IDC_BTN_PLAY,46,80,34,19 CONTROL "Slider1",IDC_SLIDER,"msctls_trackbar32",TBS_BOTH | TBS_NOTICKS | WS_TABSTOP,217,86,110,13 END I want to add a command on MainFrame to bring the dialog on the foreground and I tryed a lot of ways (for example SetWindowPos, SetFocus, PostMessage(WM_LBUTTONDOWN), ...) but the app alwais raises a runtime assertion: ASSERT:IsWindow(m_hWnd)). Is there a way to solve this problem? Thanks Paolo
U may go to InitInstance() method of APP class and insert the code as following steps. Create an instance for tat dialog. dialog_instance.DoModal(); I think this will work.