⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 window.h

📁 MiniGui在ucOS-ii下的一个例子
💻 H
📖 第 1 页 / 共 5 页
字号:
 * * \sa RegisterListenFD */#define MSG_FDEVENT         0x0146/** * \def MSG_SRVNOTIFY * \brief Indicates a notification from the server of MiniGUI-Lite. * * This message will be broadcasted to all of the main window  * in a client process when the client receives a MSG_SRVNOTIFY message * from the server. * * The server, i.e. 'mginit' defines the meaning of two parameters of this message. * * \note Only available on MiniGUI-Lite. */#define MSG_SRVNOTIFY       0x0147#define MSG_UNEXPOSECLIENT  0x0148#define MSG_ACTIVECLIENT    0x0149#endif/** * \def MSG_DOESNEEDIME * \brief Sends to a window to query whether the window needs to open IME window. * * The system will send this message when the window gain the input focus * to determine whether the window needs to open IME window. * * The application should handle this message and return TRUE when * the window need IME window.  * Default window procedure returns FALSE. * * \note This is a asynchronical message. */#define MSG_DOESNEEDIME     0x0150#define MSG_IME_REGISTER    0x0151#define MSG_IME_UNREGISTER  0x0152#define MSG_IME_OPEN        0x0153#define MSG_IME_CLOSE       0x0154#define MSG_IME_SETSTATUS   0x0156#define MSG_IME_GETSTATUS   0x0157    #define IS_ENABLE       1    #define IS_FULLCHAR     2    #define IS_FULLPUNC     3    #define IS_METHOD       4#define MSG_IME_SETTARGET   0x0158#define MSG_IME_GETTARGET   0x0159#define MSG_SHOWMENU        0x0160#define MSG_HIDEMENU        0x0161#define MSG_ADDTIMER        0x0162#define MSG_REMOVETIMER     0x0163#define MSG_RESETTIMER      0x0164#define MSG_WINDOWCHANGED   0x0165#define MSG_BROADCASTMSG    0x0166#define MSG_REGISTERWNDCLASS    0x0167#define MSG_UNREGISTERWNDCLASS  0x0168#define MSG_NEWCTRLINSTANCE     0x0169#define MSG_REMOVECTRLINSTANCE  0x016A#define MSG_GETCTRLCLASSINFO    0x016B#define MSG_CTRLCLASSDATAOP     0x016C    #define CCDOP_GETCCI        0x01    #define CCDOP_SETCCI        0x02#define MSG_REGISTERKEYHOOK     0x016D#define MSG_REGISTERMOUSEHOOK   0x016E#define MSG_LASTSYSTEMMSG   0x016F    /** @} end of system_msgs */    /**     * \defgroup menu_msgs Internal menu messages     * @{     */    /* Group 10 from 0x0170 to 0x018F, the menu messages */#define MSG_FIRSTMENUMSG    0x0170#define MSG_INITMENU        0x0170#define MSG_INITMENUPOPUP   0x0171#define MSG_MENUSELECT      0x0172#define MSG_MENUCHAR        0x0173#define MSG_ENTERMENULOOP   0x0174#define MSG_EXITMENULOOP    0x0175#define MSG_CONTEXTMENU     0x0176#define MSG_NEXTMENU        0x0177#define MSG_LASTMENUMSG     0x018F    /** @} end of menu_msgs */    /**     * \defgroup user_msgs User-defined  messages     * @{     */#define MSG_FIRSTUSERMSG    0x0800/** * \def MSG_USER * \brief The first user-defined message. * * MiniGUI reserved the range from 0x0800 to 0xEFFF for user-defined messages. * MSG_USER is the first user-defined message you can use it by your own. */#define MSG_USER            0x0800#define MSG_LASTUSERMSG     0xEFFF    /** @} end of user_msgs */    /** @} end of msgs */    /**     * \addtogroup fns Functions     * @{     */    /**     * \defgroup msg_fns Message functions     * @{     */    /**     * \defgroup msg_pass_fns Message passing functions     * @{     *//** * The message structure. * \sa GetMessage, PostMessage, msgs */typedef struct _MSG{	/** the handle to the window which receives this message. */    HWND             hwnd;	/** the message identifier. */    int              message;    /** The first parameter of the message (32-bit integer). */    WPARAM           wParam;    /** The second parameter of the message (32-bit integer). */    LPARAM           lParam;    unsigned int     time;#ifndef _LITE_VERSION    void*            pAdd;#endif} MSG;typedef MSG* PMSG;#define QS_NOTIFYMSG        0x10000000#ifndef _LITE_VERSION  #define QS_SYNCMSG        0x20000000#else  #define QS_DESKTIMER      0x20000000#endif#define QS_POSTMSG          0x40000000#define QS_QUIT             0x80000000#define QS_INPUT            0x01000000#define QS_PAINT            0x02000000#define QS_TIMER            0x0000FFFF#define QS_EMPTY            0x00000000/** * \fn int GetMessage (PMSG pMsg, HWND hMainWnd) * \brief Gets a message from the message queue of a main window. * * This function gets a message from the message queue of the main window \a hMainWnd, * and returns until there is a message in the message queue. * * \param pMsg Pointer to the result message. * \param hMainWnd Handle to the window. * \return 0 on MSG_QUIT have been found, else gets a message. * * \sa HavePendingMessage, PostQuitMesasge, MSG * * Example: * * \include getmessage.c */int GUIAPI GetMessage (PMSG pMsg, HWND hMainWnd);/** * fn BOOL HavePendingMessage (HWND hMainWnd) * \brief Checks if there is any pending message in the message queue of a main window. * * This function checks whether there is any pending message in the * message queue of the main window \a hMainWnd. * * \param hMainWnd The handle to the main window. * \return TRUE for pending message, FALSE for empty message queue. * * \sa GetMessage, MSG */BOOL GUIAPI HavePendingMessage (HWND hMainWnd);#define PM_NOREMOVE     0x0000#define PM_REMOVE       0x0001#define PM_NOYIELD      0x0002BOOL GUIAPI PeekPostMessage (PMSG pMsg, HWND hWnd, int iMsgFilterMin,                         int iMsgFilterMax, UINT uRemoveMsg);/** * \fn int PostMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam) * \brief Posts a message into the message queue of a window and returns immediatly. * * This functions posts a message into the message queue of the window \a hWnd  * and returns immediatly. * * \param hWnd The handle to the window. * \param iMsg The identifier of the message. * \param wParam The first parameter of the message. * \param lParam The second parameter of the message. * \return ERR_OK on success, < 0 on errors. * * \retval ERR_OK Post message successfully. * \retval ERR_QUEUE_FULL The message queue is full. * \retval ERR_INV_HWND Invalid window handle. * * \sa SendMessage */               int GUIAPI PostMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);/** * \fn int SendMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam) * \brief Sends a message to a window. * * This function sends a message to the window \a hWnd, and will return  * until the message-handling process returns. * * \param hWnd The handle to the window. * \param iMsg The identifier of the message. * \param wParam The first parameter of the message. * \param lParam The second parameter of the message. * \return The return value of the message handler. * * \sa PostMessage */int GUIAPI SendMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);/** * \fn void GUIAPI SetAutoRepeatMessage (HWND hwnd, int msg, WPARAM wParam, LPARAM lParam) * \brief Sets the auto-repeat message. * * This function sets the auto-repeat message. When the default message * procedure receives an MSG_IDLE message, the default handler will send * the auto-repeat message to the target window as a notification message. * * \param hwnd The handle to the target window. Set it to HWND_DESKTOP *        to disable the auto-repeat message. * \param msg The identifier of the auto-repeat message. * \param wParam The first parameter of the auto-repeat message. * \param lParam The second parameter of the auto-repeat message. */void GUIAPI SetAutoRepeatMessage (HWND hwnd, int msg, WPARAM wParam, LPARAM lParam);#ifdef _LITE_VERSION/** * \def SendAsyncMessage * \brief Is an alias of \a SendMessage for MiniGUI-Lite. * \sa SendMessage */ #define SendAsyncMessage SendMessage#define CLIENTS_TOPMOST          -1#define CLIENTS_ALL              -2#define CLIENTS_EXCEPT_TOPMOST   -3#define CLIENT_ACTIVE            -4/** * \fn int Send2Client (MSG* msg, int cli) * \brief Sends a message to a client. * * This function sends a message to the specified client \a cli. * * \param msg The pointer to the message. * \param cli Either be the identifier of the targe client or one of the following values: *      - CLIENT_ACTIVE\n *        The current active client on the topmost layer. *      - CLIENTS_TOPMOST\n *        All clients in the topmost layer. *      - CLIENTS_EXCEPT_TOPMOST\n *        All clients except clients in the topmost layer. *      - CLIENTS_ALL\n *        All clients. * \return SOCKERR_OK if all OK, < 0 on error. * * \retval SOCKERR_OK       Read data successfully. * \retval SOCKERR_IO       There are some I/O errors occurred. * \retval SOCKERR_CLOSED   The socket has been closed by the peer. * \retval SOCKERR_INVARG   You passed invalid arguments. * * \note This function is only defined for MiniGUI-Lite, and *       can be called only by the server, i.e. \a mginit. * * \sa Send2TopMostClients, Send2ActiveClient */    int GUIAPI Send2Client (MSG* msg, int cli);/** * \def send2client Send2Client * \brief Is an alias of \a Send2Client * * \sa Send2Client */#define send2client Send2Client/** * \fn BOOL Send2TopMostClients (int iMsg, WPARAM wParam, LPARAM lParam) * \brief Sends a message to all clients in the topmost layer. * * This function sends the message specified by (\a iMsg, \a wParam, \a lParam)  * to all clients in the topmost layer. * * \param iMsg The message identifier. * \param wParam The first parameter of the message. * \param lParam The second parameter of the message. * \return TRUE on success, FALSE on error. * * \note This function is only defined for MiniGUI-Lite, and *       can be called only by the server, i.e. \a mginit. * * \sa Send2Client */    BOOL GUIAPI Send2TopMostClients (int iMsg, WPARAM wParam, LPARAM lParam);/** * \fn BOOL Send2ActiveClient (int iMsg, WPARAM wParam, LPARAM lParam) * \brief Sends a message to the active client in the topmost layer. * * This function sends the message specified by (\a iMsg, \a wParam, \a lParam)  * to the current active client in the topmost layer. * * \param iMsg The message identifier. * \param wParam The first parameter of the message. * \param lParam The second parameter of the message. * \return TRUE on success, FALSE on error. * * \note This function is only defined for MiniGUI-Lite, and *       can be called only by the server, i.e. \a mginit. * * \sa Send2Client */    BOOL GUIAPI Send2ActiveClient (int iMsg, WPARAM wParam, LPARAM lParam);#else/** * \fn int PostSyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam) * \brief Posts a synchronical message to a window which is in different thread. * * This function posts the synchronical message specified by  * (\a iMsg, \a wParam, \a lParam) to the window \a hWnd which  * is in different thread. This function will return until  * the message is handled by the window procedure. * * \note The destination window must belong to other thread. * * \param iMsg The message identifier. * \param wParam The first parameter of the message. * \param lParam The second parameter of the message. * \return The return value of the message handler. * * \sa SendMessage */    int GUIAPI PostSyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);/** * \fn int SendAsyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam) * \brief Sends an asynchronical message to a window. * * This function sends the asynchronical message specified by  * (\a iMsg, \a wParam, \a lParam) to the window \a hWnd  * which is in different thread. This function calls  * the window procedure immediately. So it is very dangerous. * * \param iMsg The message identifier. * \param wParam The first parameter of the message. * \param lParam The second parameter of the message. * \return The return value of the message handler. * * \note This function may corrupt your data. * * \sa PostSyncMessage */    int GUIAPI SendAsyncMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);#endif/** * \fn int SendNotifyMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam) * \brief Sends a notification message to a window. * * This function sends the notification message specified by (\a iMsg, \a wParam, \a lParam) * to the window \a hWnd. This function puts the notication message in the message queue * and then returns immediately. * * \param hWnd The handle to the window. * \param iMsg The message identifier. * \param wParam The first parameter of the message. * \param lParam The second parameter of the message. * \return 0 if all OK, < 0 on error. * * \sa SendMessage, PostMessage */int GUIAPI SendNotifyMessage (HWND hWnd, int iMsg, WPARAM wParam, LPARAM lParam);/** * \fn int BroadcastMessage (int iMsg, WPARAM wParam, LPARAM lParam) * \brief Broadcasts a message to all main window on the desktop. * * This function posts the message specified by (\a iMsg, \a wParam, \a lParam) * to all the main windows on the desktop. * * \param iMsg The message identifier. * \param wParam The first parameter of the message. * \param lParam The second parameter of the message. * \return 0 if all OK, < 0 on error. * * \sa PostMessage */int GUIAPI BroadcastMessage (int iMsg, WPARAM wParam, LPARAM lParam);/** * \fn int PostQuitMessage (HWND hWnd) * \brief Puts a MSG_QUIT message into the message queue of a main window. * * This function puts a MSG_QUIT message into the message queue of the * main window \a hWnd. The next call to \a GetMessage will return 0. * * \param hWnd The handle to the main window. * \return 0 if all OK, < 0 on error. * * \sa GetMessage */int GUIAPI PostQuitMessage (HWND hWnd);#define KBD_LAYOUT_DEFAULT  "default"#define KBD_LAYOUT_FRPC     "frpc"#define KBD_LAYOUT_FR       "fr"#define KBD_LAYOUT_DE       "de"#define KBD_LAYOUT_DELATIN1 "delatin1"#define KBD_LAYOUT_IT       "it"#define KBD_LAYOUT_ES       "es"#define KBD_LAYOUT_ESCP850  "escp850"/** * \fn BOOL SetKeyboardLayout (const char* kbd_layout) * \brief Sets a new keyboard layout. * * This function sets the keymaps to translate key scancodes to MSG_CHAR * or MSG_KEYSYM messages. The default keymaps is for US PC keyboard  * layout, you can call this function to set a different keyboard layout. * The argument of \a kbd_layout specifies the name of the keyboard layout. * * \param kbd_layout The keyboard layout name. It can be one of the following values: * *      - KBD_LAYOUT_DEFAULT\n *        The default keyboard layout, i.e., US PC. *      - KBD_LAYOUT_FRPC\n *        The France PC keyboard layout. *      - KBD_LAYOUT_FR\n *        The France keyboard layout. *      - KBD_LAYOUT_DE\n

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -