📄 window.h
字号:
* wParam = 0;
* lParam = 0;
* \endcode
*
* \return The length of the text.
*
* \sa GetWindowTextLength
*/
#define MSG_GETTEXTLENGTH 0x0132
/**
* \def MSG_GETTEXT
* \brief Sent to the control to get the text.
*
* This message is sent to the control when you calling \a GetWindowText
* function to get the text.
*
* \code
* MSG_GETTEXT
* int max_len;
* char* text_buf;
*
* wParam = (WPARAM)max_len;
* lParam = (LPARAM)text_buf;
* \endcode
*
* \param max_len The maximal number of characters can be copied to the buffer.
* \param text_buf The pointer to a buffer receives the text.
* \return The length of the window text string.
*
* \sa GetWindowText
*/
#define MSG_GETTEXT 0x0133
/**
* \def MSG_SETTEXT
* \brief Sent to the control to set the text.
*
* This message is sent to the control when you calling \a SetWindowText
* function to set the text.
*
* \code
* MSG_GETTEXT
* char* text_buf;
*
* wParam = 0;
* lParam = (LPARAM)text_buf;
* \endcode
*
* \param text_buf The pointer to a buffer contains the text.
* \return The length of the text string.
*
* \sa SetWindowText
*/
#define MSG_SETTEXT 0x0134
/**
* \def MSG_ENABLE
* \brief Indicates the window is disabled/enabled.
*
* This message is sent to the window if the window has been disabled or enabled.
*
* \code
* MSG_ENABLE
* BOOL enabled = (BOOL)wParam;
* \endcode
*
* \param enabled Indicates whether the window was disabled or enabled.
*/
#define MSG_ENABLE 0x0135
#define MSG_LASTCONTROLMSG 0x013F
/** @} end of ctrl_msgs */
/**
* \defgroup system_msgs System messages
* @{
*/
/* Group 9 from 0x0140 to 0x016F, the system messages. */
#define MSG_FIRSTSYSTEMMSG 0x0140
#define MSG_QUIT 0x0140
/**
* \def MSG_IDLE
* \brief Indicates the system enters idle loop.
*
* This message is sent to the all main window when the system
* enters idle loop.
*/
#define MSG_IDLE 0x0142
#define MSG_TIMEOUT 0x0143
/**
* \def MSG_TIMER
* \brief Indicates a timer has expired.
*
* This message is sent to the window when a timer expired.
*
* \code
* MSG_TIMER
* int timer_id = (int)wParam;
* \endcode
*
* \param timer_id The identifier of the timer has expired.
*/
#define MSG_TIMER 0x0144
#define MSG_CARETBLINK 0x0145
#ifdef _LITE_VERSION
/**
* \def MSG_FDEVENT
* \brief Indicates an event of registered file descriptor occurred.
*
* You can use \a RegisterListenFD to register a file desciptor to
* MiniGUI-Lite for listening.
*
* When there is a read/write/except event on the fd, MiniGUI
* will post a MSG_FDEVENT message with wParam being equal to
* MAKELONG (fd, type), and the lParam being set to be the context
* to the target window.
*
* \code
* MSG_FDEVENT
* int fd = LOWORD(wParam);
* int type = HIWORD(wParam);
* void* context = (void*)lParam;
* \endcode
*
* \param fd The listened file descriptor.
* \param type The event type.
* \param context A context value.
*
* \note Only available on MiniGUI-Lite.
*
* \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 0x0002
BOOL 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
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -