NO

Author Topic: Multiple Windows  (Read 2341 times)

Trajecto

  • Guest
Multiple Windows
« on: July 17, 2007, 09:38:18 pm »
Everything I have written for PPC has only had one main window.

Let's say I want to add a "more info" button that opens another window. That window would have a "back" button on it to go back to the original window. Does anyone have any examples of this?

Thanks!
Chris

joerg

  • Guest
Re: Multiple Windows
« Reply #1 on: July 25, 2007, 11:14:45 pm »
I think you have to create a non modal Mainwindow like this:

  [...]

    wc.hInstance = hInstance;
    wc.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDR_ICO_MAIN));
    wc.lpszClassName = L"vinfo_w3Class";
    if (!RegisterClass(&wc))
        return 0;

    hwnd = CreateDialog(hInstance, MAKEINTRESOURCE(DLG_MAIN), NULL, (DLGPROC)MainDlgProc);
   
    if (hwnd == NULL)
      return 1;


    ShowWindow(hwnd, nCmdShow);
    UpdateWindow(hwnd);

    while (GetMessage(&msg, NULL, 0, 0))
    {
        TranslateMessage(&msg);
        DispatchMessage(&msg);
    }

    return msg.wParam;


and the following window you can create non modal or modal with the   
    DialogBox-Function.

I never tried it, but I think it should work