mGUtils API Reference
v1.2.0
A component of MiniGUI providing users with a number of common dialog templates
|
Data Structures | |
struct | _myWinButton |
struct | _myWinEntry |
Typedefs | |
typedef struct _myWinButton | myWINBUTTON |
typedef struct _myWinEntry | myWINENTRY |
Functions | |
MGUTILS_EXPORT int | myMessageBox (HWND hwnd, DWORD dwStyle, const char *title, const char *text,...) |
Creates a message box. More... | |
MGUTILS_EXPORT int | myWinMessage (HWND hwnd, const char *title, const char *button1, const char *text,...) |
Creates a message box within only one button. More... | |
MGUTILS_EXPORT int | myWinChoice (HWND hwnd, const char *title, const char *button1, const char *button2, const char *text,...) |
Creates a message box within two buttons. More... | |
MGUTILS_EXPORT int | myWinTernary (HWND hwnd, const char *title, const char *button1, const char *button2, const char *button3, const char *text,...) |
Creates a message box within three buttons. More... | |
MGUTILS_EXPORT void | errorWindow (HWND hwnd, const char *str, const char *title) |
A MiniGUI edition of perror. More... | |
MGUTILS_EXPORT HWND | createStatusWin (HWND hParentWnd, int width, int height, const char *title, const char *text,...) |
Creates a status main window. More... | |
MGUTILS_EXPORT void | destroyStatusWin (HWND hwnd) |
Destroies a status window. More... | |
MGUTILS_EXPORT HWND | createProgressWin (HWND hParentWnd, const char *title, const char *label, int id, int range) |
Creates a main window within a progress bar. More... | |
MGUTILS_EXPORT void | destroyProgressWin (HWND hwnd) |
Destroies progress window. More... | |
MGUTILS_EXPORT int | myWinMenu (HWND hParentWnd, const char *title, const char *label, int width, int listboxheight, char **items, int *listItem, myWINBUTTON *buttons) |
Creates a menu main window for the user to select an item. More... | |
MGUTILS_EXPORT int | myWinEntries (HWND hParentWnd, const char *title, const char *label, int width, int editboxwidth, BOOL fIME, myWINENTRY *items, myWINBUTTON *buttons) |
Creates a entry main window for the user to enter something. More... | |
MGUTILS_EXPORT int | myWinHelpMessage (HWND hwnd, int width, int height, const char *help_title, const char *help_msg) |
Creates a help message window. More... | |
This module defines some useful helpers, such as tool-tip window, progress window, and so on.
typedef struct _myWinButton myWINBUTTON |
Button info structure used by myWinMenu and myWinEntries function.
typedef struct _myWinEntry myWINENTRY |
Entry info structure used by myWinEntries function.
HWND createProgressWin | ( | HWND | hParentWnd, |
const char * | title, | ||
const char * | label, | ||
int | id, | ||
int | range | ||
) |
Creates a main window within a progress bar.
This function creates a main window within a progress bar and returns the handle. You can call destroyProgressWin to destroy it.
Note that you can use SendDlgItemMessage to send a message to the progress bar in the main window in order to update the progress bar.
hParentWnd | The hosting main window. |
title | The title of the progress window. |
label | The text in the label of the progress bar. |
id | The identifier of the progress bar. |
range | The maximal value of the progress bar (minimal value is 0). |
HWND createStatusWin | ( | HWND | hParentWnd, |
int | width, | ||
int | height, | ||
const char * | title, | ||
const char * | text, | ||
... | |||
) |
Creates a status main window.
This function creates a status main window and returns the handle to it. You can call destroyStatusWin to destroy it. This function also receives printf-like arguments to format a string.
hParentWnd | The hosting main window. |
width | The width of the status window. |
height | The height of the status window. |
title | The title of the status window. |
text | The format string. |
void destroyProgressWin | ( | HWND | hwnd | ) |
Destroies progress window.
This function destroies the specified progress window hwnd, which is returned by createProgressWin.
hwnd | The handle to the progress window. |
void destroyStatusWin | ( | HWND | hwnd | ) |
Destroies a status window.
This function destroies the specified status window hwnd, which is returned by createStatusWin.
hwnd | The handle to the status window. |
void errorWindow | ( | HWND | hwnd, |
const char * | str, | ||
const char * | title | ||
) |
A MiniGUI edition of perror.
This function creates a message box by using myMessageBox, and display the current system error message. You can consider it as an alternative of perror.
hwnd | The hosting main window. |
str | The string will be appeared before the system error message. |
title | The title of the message box. |
int myMessageBox | ( | HWND | hwnd, |
DWORD | dwStyle, | ||
const char * | title, | ||
const char * | text, | ||
... | |||
) |
Creates a message box.
This function creates a message box calling MessageBox and passing hwnd, dwStyle and title to it. This function also receives printf-like arguments to format a string.
hwnd | The hosting main window. |
dwStyle | The style of the message box. |
title | The title of the message box. |
text | The format string. |
int myWinChoice | ( | HWND | hwnd, |
const char * | title, | ||
const char * | button1, | ||
const char * | button2, | ||
const char * | text, | ||
... | |||
) |
Creates a message box within two buttons.
This function creates a message box hosted to the main window hwnd, displays a message and an application icon in the message box, and creates two buttons in it. This function also receives printf-like arguments to format a string.
This function can be used to prompt the user to choose one item between two.
hwnd | The hosting main window. |
title | The title of the message box. |
button1 | The title of the first button. |
button2 | The title of the second button. |
text | The format string. |
int myWinEntries | ( | HWND | hParentWnd, |
const char * | title, | ||
const char * | label, | ||
int | width, | ||
int | editboxwidth, | ||
BOOL | fIME, | ||
myWINENTRY * | items, | ||
myWINBUTTON * | buttons | ||
) |
Creates a entry main window for the user to enter something.
This function creates a entry main window including a few buttons and a few entries.
When the user click one of the buttons, this function will return the identifier of the button which leads to close the menu window, and the entered strings.
hParentWnd | The hosting main window. |
title | The title of the menu main window. |
label | The label of the entries. |
width | The width of the menu main window. |
editboxwidth | The width of the edit boxes. |
fIME | Whether active the IME window (obsolete). |
items | The pointer to the array of the entries, initial and returned. |
buttons | The buttons will be created. |
int myWinHelpMessage | ( | HWND | hwnd, |
int | width, | ||
int | height, | ||
const char * | help_title, | ||
const char * | help_msg | ||
) |
Creates a help message window.
This function creates a help message window including a scrollable help message and a spin box. When the user click the OK button, this function will return.
hwnd | The hosting main window. |
width | The width of the help message window. |
height | The height of the help message window. |
help_title | The title of the window. |
help_msg | The help message. |
int myWinMenu | ( | HWND | hParentWnd, |
const char * | title, | ||
const char * | label, | ||
int | width, | ||
int | listboxheight, | ||
char ** | items, | ||
int * | listItem, | ||
myWINBUTTON * | buttons | ||
) |
Creates a menu main window for the user to select an item.
This function creates a menu main window including a few buttons, and a list box with checkable item.
When the user click one of the buttons, this function will return the identifier of the button which leads to close the menu window, and the selections of the items via listItem.
hParentWnd | The hosting main window. |
title | The title of the menu main window. |
label | The label of the list box. |
width | The width of the menu main window. |
listboxheight | The height of the list box. |
items | The pointer to the array of the item strings. |
listItem | The pointer to the array of the check status of the items, initial and returned. |
buttons | The buttons will be created. |
int myWinMessage | ( | HWND | hwnd, |
const char * | title, | ||
const char * | button1, | ||
const char * | text, | ||
... | |||
) |
Creates a message box within only one button.
This function creates a message box hosted to the main window hwnd, displays a message and an application icon in the message box, and creates a button which can be used to close the box. This function also receives printf-like arguments to format a string.
This function can be used to display a information for the user.
hwnd | The hosting main window. |
title | The title of the message box. |
button1 | The text in the button. |
text | The format string. |
int myWinTernary | ( | HWND | hwnd, |
const char * | title, | ||
const char * | button1, | ||
const char * | button2, | ||
const char * | button3, | ||
const char * | text, | ||
... | |||
) |
Creates a message box within three buttons.
This function creates a message box hosted to the main window hwnd, displays a message and an application icon in the message box, and creates three buttons in it. This function also receives printf-like arguments to format a string.
This function can be used to prompt the user to choose one item among three choices.
hwnd | The hosting main window. |
title | The title of the message box. |
button1 | The title of the first button. |
button2 | The title of the second button. |
button3 | The title of the third button. |
text | The format string. |