SHINITDLGINFO

Windows Mobile 6.5
A version of this page is also available for
4/8/2010

This structure sets members for the SHInitDialog function.


typedef struct tagSHINITDIALOG {
  DWORD dwMask;
  HWND hDlg;
  DWORD dwFlags;
} SHINITDLGINFO, *PSHINITDLGINFO;

dwMask

Bitfield indicating which members of the SHINITDLGINFO structure are valid. Possible values are:

#define SHIDIM_FLAGS 0x0001
hDlg

Handle to the dialog box. This member is required.

dwFlags

Flags indicating what action to take. Ignored unless SHIDIM_FLAGS is set. The following table shows the possible values for this member.

Flag Description

SHIDIF_FULLSCREENNOMENUBAR

Sizes the dialog box to full screen. Does not leave room at the bottom for a menu bar.

SHIDIF_SIZEDLG

On devices with QVGA displays, this action has the same behavior as on Windows Mobile Professional and Windows Mobile Classic. The dialog box is resized based on the current position of the software input panel.

On devices with full displays, the dialog box is moved out of the way of the software input panel.

SHIDIF_SIZEDLGFULLSCREEN

Sizes the dialog box to full screen, regardless of the position of the input panel.

SHIDIF_DONEBUTTON

Puts the OK button on the menu bar or on a caption.

Aa924964.note(en-us,MSDN.10).gifNote:
This flag is supported only for Windows Mobile Professional and Windows Mobile Classic.

SHIDIF_EMPTYMENU

Creates an empty menu bar on the dialog.

Aa924964.note(en-us,MSDN.10).gifNote:
This flag is supported only for Windows Mobile Professional and Windows Mobile Classic.

SHIDIF_SIPDOWN

Puts the input panel down.

Aa924964.note(en-us,MSDN.10).gifNote:
This flag is supported only for Windows Mobile Professional and Windows Mobile Classic.

SHIDIF_CANCELBUTTON

Adds the Cancel [x] button to close the dialog with IDCANCEL, ignoring changes.

Aa924964.note(en-us,MSDN.10).gifNote:
This flag is supported only for Windows Mobile Professional and Windows Mobile Classic.

SHIDIF_WANTSCROLLBAR

Adds a scroll bar on the dialog, if the dialog does not fit on the screen.

Aa924964.note(en-us,MSDN.10).gifNote:
This flag is supported only for Windows Mobile Professional and Windows Mobile Classic.

The following code example demonstrates how to use SHINITDLGINFO with dwFlags set to SHIDIF_CANCELBUTTON. Note that this code example is applicable only to Windows Mobile Professional and Windows Mobile Classic.

Aa924964.note(en-us,MSDN.10).gifNote:
To make the following code example easier to read, security checking and error handling are not included. This code example should not be used in a release configuration unless it has been modified to include them.
BOOL CALLBACK DlgProc(HWND hdlg, UINT msg, WPARAM wp, LPARAM lp)
{
    SHINITDLGINFO shidi;
    switch (msg)
    {
        case WM_INITDIALOG:
            shidi.dwMask  = SHIDIM_FLAGS;
            shidi.hDlg    = hdlg;
            shidi.dwFlags = SHIDIF_CANCELBUTTON | SHIDIF_SIZEDLG;
            SHInitDialog(&shidi);
            return TRUE;
      case WM_COMMAND:
            if (LOWORD(wp) == IDCANCEL)
            {
                // The user pressed Cancel.
                EndDialog(hdlg, IDCANCEL);
            }
            return TRUE;
    }
    return FALSE;
}

Headeraygshell.h
Libraryaygshell.lib
Windows Embedded CEWindows CE 3.0 and later
Windows MobilePocket PC 2000 and later, Smartphone 2002 and later

Community Additions

Show: