2/14/2007

On Windows Mobile powered devices, you can easily create full-screen top-level windows, with or without title bar icons, as well as full-screen dialog boxes for your application. When designing dialog boxes for your Windows Mobile powered device application, the following guidelines can help improve the usability of your application:

To create a full-screen dialog box, you call the SHInitDialog function during the handling of the WM_INITDIALOG message, as shown in the following example. The SHINITDLGINFO structure sets members for the SHInitDialog function.

On Windows Mobile 6 Standard, you must also override the Back key if the dialog box contains edit controls and you must create soft keys. For information about the Back key, see Navigation Keys. For information about creating soft keys, see How to Create a Soft Key Bar.

The following code example shows how to use the SHInitDialog function and SHINITDLGINFO structure to create a full-screen dialog box:

Copy Code
case WM_INITDIALOG:
{
    BOOL rb;
    int rc;
    

    sid.dwMask = SHIDIM_FLAGS;  // This is the only allowed value.
    sid.dwFlags = SHIDIF_SIZEDLGFULLSCREEN;  // Make the DB full screen.
    sid.hDlg = hwnd;  // Handle to the dialog box.

    
    if (rb == FALSE)  // SHInitDialog failed.
    {
        rc = MessageBox(NULL, _T(Could not create dialog box.),
                        _T(Error), MB_OK);
        if (rc == 0)  // Not enough memory to create MessageBox.
            return E_OUTOFMEMORY;
        return E_FAIL;  // Replace with specific error handling.
    }
    break;  // From case WM_INITDIALOG.
}

See Also