Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This structure sets members for the SHInitDialogfunction.

Syntax

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

Members

dwMask

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

Copy Code
#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 OKbutton on the menu bar or on a caption.

Note:
This flag is supported only for Windows Mobile Professional and Windows Mobile Classic.

SHIDIF_EMPTYMENU

Creates an empty menu bar on the dialog.

Note:
This flag is supported only for Windows Mobile Professional and Windows Mobile Classic.

SHIDIF_SIPDOWN

Puts the input panel down.

Note:
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.

Note:
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.

Note:
This flag is supported only for Windows Mobile Professional and Windows Mobile Classic.

Code Example

The following code example demonstrates how to use SHINITDLGINFOwith dwFlagsset to SHIDIF_CANCELBUTTON. Note that this code example is applicable only to Windows Mobile Professional and Windows Mobile Classic.

Note:
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.
Copy Code
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;
}

Requirements

Header aygshell.h
Library aygshell.lib
Windows Embedded CE Windows CE 3.0 and later
Windows Mobile Pocket PC 2000 and later, Smartphone 2002 and later