Prev: arrangement of include files
Next: "Lock" splitter bar
From: hadi kazemi on 6 Oct 2009 01:34 hi i use window in my program user interface like this: [code] .... ShowWindow( g_hWnd, nCmdShow ); UpdateWindow (g_hWnd) ; if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) return 0; hInst = hInstance; // Main message loop MSG msg = {0}; while (!Done) { .... [/code] now i want to use dialog instead window and then use : [code] .... // ShowWindow( g_hWnd, nCmdShow ); if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) returhn 0; hInst = hInstance; // Main message loop MSG msg = {0}; BOOL Done = FALSE; DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG2), g_hWnd, AboutDlgProc); while (!Done) { .... [/code] but my program dont run code after DialogBox ! now what i do ?
From: C Programmer , MFC on 6 Oct 2009 02:53 On Oct 6, 10:34 am, hadi kazemi <hadikaz...(a)discussions.microsoft.com> wrote: > hi > i use window in my program user interface like this: > > [code] > > ... > ShowWindow( g_hWnd, nCmdShow ); > > UpdateWindow (g_hWnd) ; > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > return 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > while (!Done) > { > > ... > > [/code] > > now i want to use dialog instead window and then use : > > [code] > ... > > // ShowWindow( g_hWnd, nCmdShow ); > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > returhn 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > BOOL Done = FALSE; > > DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG2), g_hWnd, AboutDlgProc); > > while (!Done) > { > > ... > [/code] > > but my program dont run code after DialogBox ! now what i do ? it's resting in while loop
From: huang on 6 Oct 2009 04:58 The DialogBox macro creates a modal dialog box from a dialog box template resource. DialogBox does not return control until the specified callback function terminates the modal dialog box by calling the EndDialog function. That means program will not go on running "while" loop until the dialog is closed. "hadi kazemi" <hadikazemi(a)discussions.microsoft.com> wrote in message news:ECCD32D2-0271-49FC-9037-10CEB75D0DC7(a)microsoft.com... > hi > i use window in my program user interface like this: > > [code] > > ... > ShowWindow( g_hWnd, nCmdShow ); > > UpdateWindow (g_hWnd) ; > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > return 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > > while (!Done) > { > > ... > > [/code] > > now i want to use dialog instead window and then use : > > [code] > ... > > // ShowWindow( g_hWnd, nCmdShow ); > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > returhn 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > BOOL Done = FALSE; > > DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG2), g_hWnd, AboutDlgProc); > > while (!Done) > { > > ... > [/code] > > but my program dont run code after DialogBox ! now what i do ?
From: AliR on 6 Oct 2009 11:17 In addition to what Huang stated, what are you going to do in your while loop? AliR. "hadi kazemi" <hadikazemi(a)discussions.microsoft.com> wrote in message news:ECCD32D2-0271-49FC-9037-10CEB75D0DC7(a)microsoft.com... > hi > i use window in my program user interface like this: > > [code] > > ... > ShowWindow( g_hWnd, nCmdShow ); > > UpdateWindow (g_hWnd) ; > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > return 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > > while (!Done) > { > > ... > > [/code] > > now i want to use dialog instead window and then use : > > [code] > ... > > // ShowWindow( g_hWnd, nCmdShow ); > > if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) > returhn 0; > > hInst = hInstance; > > // Main message loop > MSG msg = {0}; > > BOOL Done = FALSE; > > DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG2), g_hWnd, AboutDlgProc); > > while (!Done) > { > > ... > [/code] > > but my program dont run code after DialogBox ! now what i do ?
From: AliR on 6 Oct 2009 11:46
Agha Hadi, How come you are not using MFC? AliR. "AliR" <AliR(a)online.nospam> wrote in message news:u7RbrhpRKHA.4048(a)TK2MSFTNGP05.phx.gbl... > In addition to what Huang stated, what are you going to do in your while > loop? > > AliR. > > "hadi kazemi" <hadikazemi(a)discussions.microsoft.com> wrote in message > news:ECCD32D2-0271-49FC-9037-10CEB75D0DC7(a)microsoft.com... >> hi >> i use window in my program user interface like this: >> >> [code] >> >> ... >> ShowWindow( g_hWnd, nCmdShow ); >> >> UpdateWindow (g_hWnd) ; >> >> if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) >> return 0; >> >> hInst = hInstance; >> >> // Main message loop >> MSG msg = {0}; >> >> >> while (!Done) >> { >> >> ... >> >> [/code] >> >> now i want to use dialog instead window and then use : >> >> [code] >> ... >> >> // ShowWindow( g_hWnd, nCmdShow ); >> >> if( FAILED( InitWindow( hInstance, nCmdShow ) ) ) >> returhn 0; >> >> hInst = hInstance; >> >> // Main message loop >> MSG msg = {0}; >> >> BOOL Done = FALSE; >> >> DialogBox(g_hInst, MAKEINTRESOURCE(IDD_DIALOG2), g_hWnd, AboutDlgProc); >> >> while (!Done) >> { >> >> ... >> [/code] >> >> but my program dont run code after DialogBox ! now what i do ? > > |