minigui編程基礎知識

頭文件是很好的用戶與源文件之間的接口,好的頭文件可以看出,具體函數的使用以及各參數的含義。

毋庸置疑,minigui作爲開源軟件,也做到了這一點。

使用minigui,只要熟悉了其的頭文件,就再也不怕對其的瞭解是書本或教程上的片面的東西了。

以下摘自window.h ,示例如下:

/**
 * \def MSG_CREATE
 * \brief Indicates the window has been created, and gives you a chance to initialize your private objects.
 *
 * This messages is sent to the window after the window has been created 
 * and registered to the system. You can initialize your own objects when 
 * you receive this message, and return zero to the system in order to 
 * indicates the success of your initialization. If you return non-zero to 
 * the system after handled this message, the created window will be 
 * destroyed immediately.
 *
 * \code
 * MSG_CREATE for main windows:
 * PMAINWINCREATE create_info = (PMAINWINCREATE)lParam;
 *
 * MSG_CREATE for controls:
 * HWND parent = (HWND)wParam;
 * DWORD add_data = (DWORD)lParam;
 * \endcode
 *
 * \param create_info The pointer to the MAINWINCREATE structure which is 
 *        passed to CreateMainWindow function.
 * \param parent The handle to the parent window of the control.
 * \param add_data The first additional data passed to CreateWindowEx function.
 *
 * \sa CreateMainWindow, CreateWindowEx, MAINWINCREATE
 */
#define MSG_CREATE          0x0060



一、minigui的各控件的風格、消息可見各控件的頭文件。如static.h;

二、minigui的控件標示符,除預定義的幾個外,使用中都需用戶自己在創建控件時指定。

預定義的幾個控件標示符可見window.h,如下:

/* Standard control IDs */
#define IDC_STATIC    0
#define IDOK          1
#define IDCANCEL      2
#define IDABORT       3
#define IDRETRY       4
#define IDIGNORE      5
#define IDYES         6
#define IDNO          7


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章