Main Page Class Hierarchy Compound List File List Compound Members File Members

# MNCommonDlg.h File Reference

More...

`#include "MNComponent.h"`

Go to the source code of this file.

## Defines
#define | MAX_PATH 260
| specifies the maximum length of file path + file name + file ext.
## Functions
LPSTR | ShowOpenFileDlg (MNComponent *parent, LPSTR default_dir=NULL, LPSTR filter=NULL, DWORD deffilter_index=0, DWORD flags=0)
| Displays an open file dialog and returns the full file name the user selected.
LPSTR | ShowSaveFileDlg (MNComponent *parent, LPSTR default_dir=NULL, LPSTR filter=NULL, DWORD deffilter_index=0, DWORD flags=0)
| Displays a save file dialog and returns the full file name the user selected.
void | ShowErrorDlg (MNComponent *parent, LPSTR text, LPSTR caption=NULL, DWORD style=MB_OK|MB_ICONERROR)
| Displays an error message box with a style of MB_OK | MB_ICONERROR.
int | MessageBox (MNComponent *parent, LPSTR text, LPSTR caption=NULL, DWORD style=MB_OK)
| Displays a general message box with a style of MB_OK.

## Detailed Description

## Function Documentation

int MessageBox | ( | MNComponent * | parent,
|  | LPSTR | text,
|  | LPSTR | caption,
|  | DWORD | style
| ) |

  | Displays a general message box with a style of MB_OK. Parameters:
  parent | The parent component this message box is modal against.
  text | The message to display.
  caption | The text to display in the title bar.
  style | see MessageBox() in the windows docs.
Returns: Usually ID_OK for MB_OK style, other return values are used for other styles, see MessageBox() in the windows docs.

void ShowErrorDlg | ( | MNComponent * | parent,
|  | LPSTR | text,
|  | LPSTR | caption,
|  | DWORD | style
| ) |

  | Displays an error message box with a style of MB_OK | MB_ICONERROR. Parameters:
  parent | The parent component this message box is modal against.
  text | The message to display.
  caption | The text to display in the title bar.
  style | see MessageBox() in the windows docs.

LPSTR ShowOpenFileDlg | ( | MNComponent * | parent,
|  | LPSTR | default_dir,
|  | LPSTR | filter,
|  | DWORD | deffilter_index,
|  | DWORD | flags
| ) |

| Displays an open file dialog and returns the full file name the user selected. You should specify them as follows:
       char *my_filter = "Sample Files\0*.TXT;*.CPP;*.H\0All Files\0*.*\0\0";
  Notice that the description and its extentions are sperated by a null character. Also notice that extension lists are created by seperating each extension with a semicolon. Parameters:
  parent | The parent component this dialog is to be modal against.
  default_dir | A string indicating the directory the dialog is to start in.
  filter | Pointer to a buffer containing pairs of null-terminated filter strings.
  deffilter_index | The index of the defualt filter to use.
  flags | Flags to use with this dialog (see OPENFILENAME windows docs).
Returns: The path + filename + extension of the file selected or NULL if the user canceled the operation.

LPSTR ShowSaveFileDlg | ( | MNComponent * | parent,
|  | LPSTR | default_dir,
|  | LPSTR | filter,
|  | DWORD | deffilter_index,
|  | DWORD | flags
| ) |

| Displays a save file dialog and returns the full file name the user selected. You should specify them as follows:
       char *my_filter = "Sample Files\0*.TXT;*.CPP;*.H\0All Files\0*.*\0\0";
  Notice that the description and its extentions are sperated by a null character. Also notice that extension lists are created by seperating each extension with a semicolon. Parameters:
  parent | The parent component this dialog is to be modal against.
  default_dir | A string indicating the directory the dialog is to start in.
  filter | Pointer to a buffer containing pairs of null-terminated filter strings.
  deffilter_index | The index of the defualt filter to use.
  flags | Flags to use with this dialog (see OPENFILENAME windows docs).
Returns: The path + filename + extension of the file selected or NULL if the user canceled the operation.