Pelles C forum

C language => Pocket PC and Smartphone questions => Topic started by: Trajecto on July 17, 2007, 09:38:18 PM

Title: Multiple Windows
Post by: Trajecto 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
Title: Re: Multiple Windows
Post by: joerg 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