NO

Author Topic: Multiple Windows  (Read 4353 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