mCtrl
Macros | Functions
dialog.h File Reference

Dialog functions. More...

Go to the source code of this file.

Macros

#define mcCreateDialogW(hInstance, lpTemplateName, hWndParent, lpDialogFunc, dwFlags)
 Creates modeless dialog (unicode variant).
 
#define mcCreateDialogA(hInstance, lpTemplateName, hWndParent, lpDialogFunc, dwFlags)
 Creates modeless dialog (ANSI variant).
 
#define mcCreateDialogIndirectW(hInstance, lpTemplate, hWndParent, lpDialogFunc, dwFlags)
 Creates modeless dialog (unicode variant).
 
#define mcCreateDialogIndirectA(hInstance, lpTemplate, hWndParent, lpDialogFunc, dwFlags)
 Creates modeless dialog (ANSI variant).
 
#define mcDialogBoxW(hInstance, lpTemplateName, hWndParent, lpDialogFunc, dwFlags)
 Creates and runs modal dialog (unicode variant).
 
#define mcDialogBoxA(hInstance, lpTemplateName, hWndParent, lpDialogFunc, dwFlags)
 Creates and runs modal dialog (ANSII variant).
 
#define mcDialogBoxIndirectW(hInstance, lpTemplate, hWndParent, lpDialogFunc, dwFlags)
 Creates and runs modal dialog (unicode variant).
 
#define mcDialogBoxIndirectA(hInstance, lpTemplate, hWndParent, lpDialogFunc, dwFlags)
 Creates and runs modal dialog (ANSI variant).
 
Dialog flags
#define MC_DF_DEFAULTFONT   0x00000001
 Force a default font into the dialog template.
 
Unicode Resolution
#define mcCreateDialogParam   MCTRL_NAME_AW(mcCreateDialogParam)
 Unicode-resolution alias.
 
#define mcCreateDialog   MCTRL_NAME_AW(mcCreateDialog)
 Unicode-resolution alias.
 
#define mcCreateDialogIndirectParam   MCTRL_NAME_AW(mcCreateDialogIndirectParam)
 Unicode-resolution alias.
 
#define mcCreateDialogIndirect   MCTRL_NAME_AW(mcCreateDialogIndirect)
 Unicode-resolution alias.
 
#define mcDialogBoxParam   MCTRL_NAME_AW(mcDialogBoxParam)
 Unicode-resolution alias.
 
#define mcDialogBox   MCTRL_NAME_AW(mcDialogBox)
 Unicode-resolution alias.
 
#define mcDialogBoxIndirectParam   MCTRL_NAME_AW(mcDialogBoxIndirectParam)
 Unicode-resolution alias.
 
#define mcDialogBoxIndirect   MCTRL_NAME_AW(mcDialogBoxIndirect)
 Unicode-resolution alias.
 

Functions

HWND MCTRL_API mcCreateDialogParamW (HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD dwFlags)
 Creates modeless dialog (unicode variant).
 
HWND MCTRL_API mcCreateDialogParamA (HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD dwFlags)
 Creates modeless dialog (ANSI variant).
 
HWND MCTRL_API mcCreateDialogIndirectParamW (HINSTANCE hInstance, LPCDLGTEMPLATEW lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD dwFlags)
 Creates modeless dialog (unicode variant).
 
HWND MCTRL_API mcCreateDialogIndirectParamA (HINSTANCE hInstance, LPCDLGTEMPLATEA lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD dwFlags)
 Creates modeless dialog (ANSI variant).
 
INT_PTR MCTRL_API mcDialogBoxParamW (HINSTANCE hInstance, LPCWSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD dwFlags)
 Creates and runs modal dialog (unicode variant).
 
INT_PTR MCTRL_API mcDialogBoxParamA (HINSTANCE hInstance, LPCSTR lpTemplateName, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD dwFlags)
 Creates and runs modal dialog (ANSI variant).
 
INT_PTR MCTRL_API mcDialogBoxIndirectParamW (HINSTANCE hInstance, LPCDLGTEMPLATEW lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD dwFlags)
 Creates and runs modal dialog (unicode variant).
 
INT_PTR MCTRL_API mcDialogBoxIndirectParamA (HINSTANCE hInstance, LPCDLGTEMPLATEA lpTemplate, HWND hWndParent, DLGPROC lpDialogFunc, LPARAM lParamInit, DWORD dwFlags)
 Creates and runs modal dialog (ANSI variant).
 

Detailed Description

Dialog functions.

This module offers functions for creation of modal and modless dialogs in ery similar manner as standard functions DialogBox and CreateDialog do.

Therefore mCtrl functions are very similar to their USER32.DLL counterparts, including their function name and parameteres. Actually the only difference is that the mCtrl functions take an extra argument dwFlags. When the dwFlags is zero, the functions behace exactly as the original functions.

When set to non-zero, the functions provide new fucntionality. Currently only the flag MC_DF_DEFAULTFONT is supported. When set, it forces the dialog to use default font, as defined by MS user interface guide lines.

All the functions support the classic dialog templates (DLGTEMPLATE) as well as the extended dialog tempolates (DLGTEMPLATEEX).

Macro Definition Documentation

#define MC_DF_DEFAULTFONT   0x00000001

Force a default font into the dialog template.

When this flag is set, the dialog template is modified so the dialog uses a default font for the particular Windows version, according to the MS user itnerface guide lines.

Depending on Windows version, it forces the template to use MS Shell Dlg, MS Shell Dlg 2 or Segoe UI.

Note that when using this flag, the font specified originally in the dialog template is used only as a fallback in cae of any error.

Attention
Metrics of the default fonts does differ. When using this font you should test your dialog on multiple Windows version to ensure that no content overflows.
#define mcCreateDialogW (   hInstance,
  lpTemplateName,
  hWndParent,
  lpDialogFunc,
  dwFlags 
)
Value:
mcCreateDialogParamW((hInstance),(lpTemplateName),(hWndParent), \
(lpDialogFunc),0L,(dwFlags))

Creates modeless dialog (unicode variant).

Parameters
hInstance
lpTemplateName
hWndParent
lpDialogFunc
dwFlagsDialog flags.
Returns
Handle of the created dialog or NULL on error.
#define mcCreateDialogA (   hInstance,
  lpTemplateName,
  hWndParent,
  lpDialogFunc,
  dwFlags 
)
Value:
mcCreateDialogParamA((hInstance),(lpTemplateName),(hWndParent), \
(lpDialogFunc),0L,(dwFlags))

Creates modeless dialog (ANSI variant).

Parameters
hInstance
lpTemplateName
hWndParent
lpDialogFunc
dwFlagsDialog flags.
Returns
Handle of the created dialog or NULL on error.
#define mcCreateDialogIndirectW (   hInstance,
  lpTemplate,
  hWndParent,
  lpDialogFunc,
  dwFlags 
)
Value:
mcCreateDialogIndirectParamW((hInstance),(lpTemplate),(hWndParent), \
(lpDialogFunc),0L,(dwFlags))

Creates modeless dialog (unicode variant).

Parameters
hInstance
lpTemplate
hWndParent
lpDialogFunc
dwFlagsDialog flags.
Returns
Handle of the created dialog or NULL on error.
#define mcCreateDialogIndirectA (   hInstance,
  lpTemplate,
  hWndParent,
  lpDialogFunc,
  dwFlags 
)
Value:
mcCreateDialogIndirectParamA((hInstance),(lpTemplate),(hWndParent), \
(lpDialogFunc),0L,(dwFlags))

Creates modeless dialog (ANSI variant).

Parameters
hInstance
lpTemplate
hWndParent
lpDialogFunc
dwFlagsDialog flags.
Returns
Handle of the created dialog or NULL on error.
#define mcDialogBoxW (   hInstance,
  lpTemplateName,
  hWndParent,
  lpDialogFunc,
  dwFlags 
)
Value:
mcDialogBoxParamW((hInstance),(lpTemplateName),(hWndParent), \
(lpDialogFunc),0L,(dwFlags))

Creates and runs modal dialog (unicode variant).

Parameters
hInstance
lpTemplateName
hWndParent
lpDialogFunc
dwFlagsDialog flags.
Returns
The result of the dialog run as stored with EndDialog, or -1 if the function fails.
#define mcDialogBoxA (   hInstance,
  lpTemplateName,
  hWndParent,
  lpDialogFunc,
  dwFlags 
)
Value:
mcDialogBoxParamA((hInstance),(lpTemplateName),(hWndParent), \
(lpDialogFunc),0L,(dwFlags))

Creates and runs modal dialog (ANSII variant).

Parameters
hInstance
lpTemplateName
hWndParent
lpDialogFunc
dwFlagsDialog flags.
Returns
The result of the dialog run as stored with EndDialog, or -1 if the function fails.
#define mcDialogBoxIndirectW (   hInstance,
  lpTemplate,
  hWndParent,
  lpDialogFunc,
  dwFlags 
)
Value:
mcDialogBoxIndirectParamW((hInstance),(lpTemplate),(hWndParent), \
(lpDialogFunc),0L,(lpDialogFunc))

Creates and runs modal dialog (unicode variant).

Parameters
hInstance
lpTemplate
hWndParent
lpDialogFunc
dwFlagsDialog flags.
Returns
The result of the dialog run as stored with EndDialog, or -1 if the function fails.
#define mcDialogBoxIndirectA (   hInstance,
  lpTemplate,
  hWndParent,
  lpDialogFunc,
  dwFlags 
)
Value:
mcDialogBoxIndirectParamA((hInstance),(lpTemplate),(hWndParent), \
(lpDialogFunc),0L,(lpDialogFunc))

Creates and runs modal dialog (ANSI variant).

Parameters
hInstance
lpTemplate
hWndParent
lpDialogFunc
dwFlagsDialog flags.
Returns
The result of the dialog run as stored with EndDialog, or -1 if the function fails.
#define mcCreateDialogParam   MCTRL_NAME_AW(mcCreateDialogParam)

Unicode-resolution alias.

See Also
mcCreateDialogParamW mcCreateDialogParamA
#define mcCreateDialog   MCTRL_NAME_AW(mcCreateDialog)

Unicode-resolution alias.

See Also
mcCreateDialogW mcCreateDialogA
#define mcCreateDialogIndirectParam   MCTRL_NAME_AW(mcCreateDialogIndirectParam)
#define mcCreateDialogIndirect   MCTRL_NAME_AW(mcCreateDialogIndirect)

Unicode-resolution alias.

See Also
mcCreateDialogIndirectW mcCreateDialogIndirectA
#define mcDialogBoxParam   MCTRL_NAME_AW(mcDialogBoxParam)

Unicode-resolution alias.

See Also
mcDialogBoxParamW mcDialogBoxParamA
#define mcDialogBox   MCTRL_NAME_AW(mcDialogBox)

Unicode-resolution alias.

See Also
mcDialogBoxW mcDialogBoxA
#define mcDialogBoxIndirectParam   MCTRL_NAME_AW(mcDialogBoxIndirectParam)

Unicode-resolution alias.

See Also
mcDialogBoxIndirectParamW mcDialogBoxIndirectParamA
#define mcDialogBoxIndirect   MCTRL_NAME_AW(mcDialogBoxIndirect)

Unicode-resolution alias.

See Also
mcDialogBoxIndirectW mcDialogBoxIndirectA

Function Documentation

HWND MCTRL_API mcCreateDialogParamW ( HINSTANCE  hInstance,
LPCWSTR  lpTemplateName,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  dwFlags 
)

Creates modeless dialog (unicode variant).

Parameters
hInstance
lpTemplateName
hWndParent
lpDialogFunc
lParamInit
dwFlagsDialog flags.
Returns
Handle of the created dialog or NULL on error.
HWND MCTRL_API mcCreateDialogParamA ( HINSTANCE  hInstance,
LPCSTR  lpTemplateName,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  dwFlags 
)

Creates modeless dialog (ANSI variant).

Parameters
hInstance
lpTemplateName
hWndParent
lpDialogFunc
lParamInit
dwFlagsDialog flags.
Returns
Handle of the created dialog or NULL on error.
HWND MCTRL_API mcCreateDialogIndirectParamW ( HINSTANCE  hInstance,
LPCDLGTEMPLATEW  lpTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  dwFlags 
)

Creates modeless dialog (unicode variant).

Parameters
hInstance
lpTemplate
hWndParent
lpDialogFunc
lParamInit
dwFlagsDialog flags.
Returns
Handle of the created dialog or NULL on error.
HWND MCTRL_API mcCreateDialogIndirectParamA ( HINSTANCE  hInstance,
LPCDLGTEMPLATEA  lpTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  dwFlags 
)

Creates modeless dialog (ANSI variant).

Parameters
hInstance
lpTemplate
hWndParent
lpDialogFunc
lParamInit
dwFlagsDialog flags.
Returns
Handle of the created dialog or NULL on error.
INT_PTR MCTRL_API mcDialogBoxParamW ( HINSTANCE  hInstance,
LPCWSTR  lpTemplateName,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  dwFlags 
)

Creates and runs modal dialog (unicode variant).

Parameters
hInstance
lpTemplateName
hWndParent
lpDialogFunc
lParamInit
dwFlagsDialog flags.
Returns
The result of the dialog run as stored with EndDialog, or -1 if the function fails.
INT_PTR MCTRL_API mcDialogBoxParamA ( HINSTANCE  hInstance,
LPCSTR  lpTemplateName,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  dwFlags 
)

Creates and runs modal dialog (ANSI variant).

Parameters
hInstance
lpTemplateName
hWndParent
lpDialogFunc
lParamInit
dwFlagsDialog flags.
Returns
The result of the dialog run as stored with EndDialog, or -1 if the function fails.
INT_PTR MCTRL_API mcDialogBoxIndirectParamW ( HINSTANCE  hInstance,
LPCDLGTEMPLATEW  lpTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  dwFlags 
)

Creates and runs modal dialog (unicode variant).

Parameters
hInstance
lpTemplate
hWndParent
lpDialogFunc
lParamInit
dwFlagsDialog flags.
Returns
The result of the dialog run as stored with EndDialog, or -1 if the function fails.
INT_PTR MCTRL_API mcDialogBoxIndirectParamA ( HINSTANCE  hInstance,
LPCDLGTEMPLATEA  lpTemplate,
HWND  hWndParent,
DLGPROC  lpDialogFunc,
LPARAM  lParamInit,
DWORD  dwFlags 
)

Creates and runs modal dialog (ANSI variant).

Parameters
hInstance
lpTemplate
hWndParent
lpDialogFunc
lParamInit
dwFlagsDialog flags.
Returns
The result of the dialog run as stored with EndDialog, or -1 if the function fails.