#define DefaultControlProc (__mg_def_proc[2]) |
The default control callback procedure.
This function is the default control callback procedure. You should call this function for all messages, you do not want to handle in your own control procedure.
hWnd | The handle to the window. | |
message | The message identifier. | |
wParam | The first parameter of the message. | |
lParam | The second parameter of the message. |
#define DefaultDialogProc (__mg_def_proc[1]) |
The default dialog box procedure.
This function is the default dialog box procedure. You should call this function in your dialog box procedure to process the unhandled messages.
hWnd | The handle to the window. | |
message | The message identifier. | |
wParam | The first message parameter. | |
lParam | The second message parameter. |
#define DefaultMainWinProc (__mg_def_proc[0]) |
Is the default main window callback procedure.
This function is the default main window callback procedure. You should call this function for all messages, you do not want to handle in your main window procedure.
hWnd | The handle to the window. | |
message | The message identifier. | |
wParam | The first parameter of the message. | |
lParam | The second parameter of the message. |
#define HWND_DESKTOP __mg_hwnd_desktop |
#define MainWindowCleanup | ( | hwnd | ) | MainWindowThreadCleanup(hwnd) |
Is an alias of MainWindowThreadCleanup.
typedef struct _MAINWINCREATE MAINWINCREATE |
Structure defines a main window.
HWND GUIAPI CreateMainWindow | ( | PMAINWINCREATE | pCreateInfo | ) | [inline, static] |
A simplified version of CreateMainWindowEx.
This function creates a main window by calling CreateMainWindow function and passing NULL for werdr_name, we_attrs, window_name, and layer_name parameters.
Definition at line 5037 of file window.h.
References CreateMainWindowEx(), and NULL.
HWND GUIAPI CreateMainWindowEx | ( | PMAINWINCREATE | pCreateInfo, | |
const char * | werdr_name, | |||
const WINDOW_ELEMENT_ATTR * | we_attrs, | |||
const char * | window_name, | |||
const char * | layer_name | |||
) |
Creates a main window.
This function creates a main window by using some information, and returns the handle to the main window.
pCreateInfo | The pointer to a MAINWINCREATE structure. | |
werdr_name | The name of window element renderer. NULL for default renderer. | |
we_attrs | The pointer to window element attribute table. NULL for default window attribute table. | |
window_name | The window name; reserved for future use. | |
layer_name | The layer name; reserved for future use. |
Example:
/* * The following code initializes a MAINWINCREATE struct and then * creates a main window. */ { MAINWINCREATE CreateInfo; HWND hWnd; /* Initialize the MAINWINCREATE structure. */ CreateInfo.dwStyle = WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | WS_CAPTION; CreateInfo.spCaption= "MiniGUI step three"; CreateInfo.dwExStyle = WS_EX_NONE; CreateInfo.hMenu = createmenu(); CreateInfo.hCursor = GetSystemCursor(0); CreateInfo.hIcon = 0; CreateInfo.MainWindowProc = MainWinProc; CreateInfo.lx = 0; CreateInfo.ty = 0; CreateInfo.rx = 640; CreateInfo.by = 480; CreateInfo.iBkColor = COLOR_lightwhite; CreateInfo.dwAddData = 0; CreateInfo.hHosting = HWND_DESKTOP; /* Create the main window. */ hWnd = CreateMainWindow(&CreateInfo); if (hWnd == HWND_INVALID) return 0; }
Referenced by CreateMainWindow().
int GUIAPI CreateThreadForMainWindow | ( | pthread_t * | thread, | |
pthread_attr_t * | attr, | |||
void *(*)(void *) | start_routine, | |||
void * | arg | |||
) |
Create a thread for main window.
The default window callback procedure.
This window procedure can be used for main windows, dialog boxes, and child windows.
This function is the default window callback procedure. You should call this function for all messages you do not want to handle in your window procedure.
hWnd | The handle to the window. | |
message | The message identifier. | |
wParam | The first parameter of the message. | |
lParam | The second parameter of the message. |
Destroys a main window.
This function destroys the main window specified by hWnd. It does not release all system resource used by the main window. You should call MainWindowThreadCleanup to destroy the main window actually.
hWnd | The handle to the main window. |
Example:
/* * The following code destroies all resource used by the main window * and then destroies the main window itself. */ case MSG_CLOSE: /* Destroy the resource used by the main window. */ DestroyLogFont (logfont1); DestroyLogFont (logfont2); DestroyLogFont (logfont3); /* Destroy the child windows. */ DestroyWindow(hWndButton); DestroyWindow(hWndEdit); /* Destroy the main window. */ DestroyMainWindow (hWnd); /* Send a MSG_QUIT message to quit the message loop. */ PostQuitMessage(hWnd); return 0;
pthread_t GUIAPI GetMainWinThread | ( | HWND | hMainWnd | ) |
Get the thread id which main window belongs to.
void GUIAPI MainWindowThreadCleanup | ( | HWND | hMainWnd | ) |
Cleans up system resource associated with a main window.
This function cleans up the system resource such as message queue associated with the main window hMainWnd. DestroyMainWindow does not destroy all resource used by a main window, therefore, you should call this function after calling DestroyMainWindow and skipping out from the message loop. After calling this function, the main window object will destroyed actually.
hMainWnd | The handle to the main window. |
Set window (a main window, or a child window which is also known as "control")'s Mask Rect with MYBITMAP data.
hWnd | The handle to the window. | |
mask | The mask of the window which indicate the transparency of each pixel on this window. |
Set window (a main window, or a child window which is also known as "control")'s Mask Rect with BITMAP data,.
hWnd | The handle to the window. | |
hdc | The reference dc which indicate the colorformat of the mask. | |
mask | The mask of the window which indicate the transparency of each pixel on this window. |
Set window's Mask Rect with CLIPRGN data.
hWnd | The handle to the window. | |
region | The region to indicate which part of the window is visible. |
int GUIAPI WaitMainWindowClose | ( | HWND | hWnd, | |
void ** | returnval | |||
) |
Suspends execution of the calling thread which main window belongs to until the target thread terminates, unless the target thread has already terminated.
The default window callback procedure array.