📄 mgext.h
字号:
* An application sends a LVM_SETSTRCMPFUNC message to set a * new STRCMP function to sort items in the Listview control. * * Note that you should send this message before adding * any item to the Listview control. * * \code * static int my_strcmp (const char* s1, const char* s2, size_t n) * { * ... * return 0; * } * * LVM_SETSTRCMPFUNC * * wParam = 0; * lParam = (LPARAM) my_strcmp; * \endcode * * \param my_strcmp Your own function to compare two strings. * * \return One of the following values: * - 0\n Success * - -1\n Not an empty TreeView control */#define LVM_SETSTRCMPFUNC 0xF140 /** @} end of mgext_ctrl_listview_msgs */ /** * \defgroup mgext_ctrl_listview_ncs Notification code of ListView control * @{ *//** * \def LVN_ITEMRDOWN * \brief This notification code informs parent window the right mouse button down * on a listview item. */#define LVN_ITEMRDOWN 4/** * \def LVN_ITEMRUP * \brief This notification code informs parent window the right mouse button up * on a listview item. */#define LVN_ITEMRUP 5/** * \def LVN_HEADRDOWN * \brief This notification code informs parent window the right mouse button down * on the listview header. */#define LVN_HEADRDOWN 6/** * \def LVN_HEADRUP * \brief This notification code informs parent window the right mouse button up * on the listview header. */#define LVN_HEADRUP 7/** * \def LVN_KEYDOWN * \brief This notification code informs parent window that a key has been pressed. */#define LVN_KEYDOWN 8/** * * \def LVN_ITEMDBCLK * \brief This notification code informs parent window the current selected item * has be double clicked. */#define LVN_ITEMDBCLK 9/** * \def LVN_ITEMCLK * \brief This notification code informs parent window the current selected item * has been clicked. */#define LVN_ITEMCLK 10/** * \def LVN_SELCHANGE * \brief This notification code informs parent window the current selected item * has changed. */#define LVN_SELCHANGE 11/** * \def LVN_COLCHANGE * \brief This notification code informs parent window the current selected column * has changed. */#define LVN_COLCHANGE 12 /** @} end of mgext_ctrl_listview_ncs */ /** @} end of mgext_ctrl_listview */#endif /* _EXT_CTRL_LISTVIEW */#ifdef _EXT_CTRL_GRID /** * \defgroup mgext_ctrl_grid Grid control * @{ */#define CTRL_GRID ("Grid")/** Grid return value */#define GRID_OKAY 0#define GRID_ERR (-1)#define GRID_ERRSPACE (-2)/** Column and header flags */#define GRIDCF_LEFTALIGN 0x0000 // column text left align, default#define GRIDCF_RIGHTALIGN 0x0001 // column text right align#define GRIDCF_CENTERALIGN 0x0002 // column text center align #define GRIDHF_LEFTALIGN 0x0000 // header text left align, default#define GRIDHF_RIGHTALIGN 0x0004 // header text right align#define GRIDHF_CENTERALIGN 0x0008 // header text center align #define GRID_COL_PRIORTY 0x0010/** * Structure of the grid column header info, contains column header informations. * This structure is used for creating or retrieving column header. */typedef struct _GRIDCOLHEADER{ /** Width of the header*/ int nWidth; /** The column number */ int nCols; /** The title of this column */ char *pszHeadText; /** max text len */ int nTextMax; /** Image of the header */ DWORD image; /** Header flags */ DWORD flags; /** Cell infomations */ DWORD colflags;} GRIDCOLHEADER;typedef GRIDCOLHEADER *PGRIDCOLHEADER;/** * Structure of the grid row header info, contains row header informations. * This structure is used for creating or retrieving row header. */typedef struct _GRIDROWHEADER{ /** Height of the header*/ int nHeight; /** The row number */ int nRows; /** The title of this row*/ char *pszHeadText; /** max text len */ int nTextMax; /** Image of the header */ DWORD image; /** Header flags */ DWORD flags; /** Cell infomations*/ DWORD rowflags;} GRIDROWHEADER;typedef GRIDROWHEADER *PGRIDROWHEADER;/** * Structure of cell, contains text info. * Use this structure when set a certain cell. */typedef struct _GRIDCELL{ /** Column number */ int nCols; /** Row number */ int nRows; /** Text in cell */ char *pszInfo; /** Text color */ int nTextColor; /** Additional data */ DWORD addData;} GRIDCELL;typedef GRIDCELL *PGRIDCELL;/** Contains grid general notification information */typedef struct _GRIDNM_NORMAL{ /** wParam parameter of the message */ WPARAM wParam; /** lParam parameter of the message */ LPARAM lParam;} GRIDNM_NORMAL;typedef GRIDNM_NORMAL *PGRIDNM_NORMAL; /** keydown notification information */typedef GRIDNM_NORMAL GRIDNM_KEYDOWN;typedef GRIDNM_KEYDOWN *PGRIDNM_KEYDOWN; /** Contains listview notification information when mouse down on the header */typedef GRIDNM_NORMAL GRIDNM_HEADRDOWN;typedef GRIDNM_HEADRDOWN *PGRIDNM_HEADRDOWN; /** Contains listview notification information when mouse up on the header */typedef GRIDNM_NORMAL GRIDNM_HEADRUP;typedef GRIDNM_HEADRUP *PGRIDNM_HEADUP; /** Contains listview notification information when mouse down on the item area */typedef GRIDNM_NORMAL GRIDNM_ITEMRDOWN;typedef GRIDNM_ITEMRDOWN *PGRIDNM_ITEMRDOWN; /** Contains listview notification information when mouse up on the item area */typedef GRIDNM_NORMAL GRIDNM_ITEMRUP;typedef GRIDNM_ITEMRUP *PGRIDNM_ITEMRUP; /** \defgroup mgext_control_grid_msgs Messages of grid control * @{ *//** * \def GRIDM_GETCOLCOUNT * \brief Gets the number of all columns in the grid control. * * An application sends an GRIDM_GETCOLCOUNT message to get the number of all columns in the grid control. * * \code * GRIDM_GETCOLCOUNT * * wParam = 0; * lParam = 0; * \endcode * * \return The column number. */#define GRIDM_GETCOLCOUNT 0xF210/** * \def GRIDM_SETCOLCOUNT * \brief Sets the number of all columns in the gird control. * * An application sends an GRIDM_SETCOLCOUNT message to set the number of all columns in the grid control. * * \code * GRIDM_SETCOLCOUNT * * wParam = (WPARAM)colnum; * lParam = 0; * \endcode * * \param column Column number to be set. * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. * */#define GRIDM_SETCOLCOUNT 0xF211/** * \def GRIDM_GETROWCOUNT * \brief Gets the number of all rows in the grid control. * * An application sends an GRIDM_GETROWS message to get the number of all rows in the control. * * \code * GRIDM_GETROWCOUNT * * wParam = 0; * lParam = 0; * \endcode * * \return The number of rows. */#define GRIDM_GETROWCOUNT 0xF212/** * \def GRIDM_SETROWCOUNT * \brief Set the number of all rows in the grid control. * * An application sends an GRIDM_SETROWS message to set the number of all rows in the grid control. * * \code * GRIDM_SETROWCOUNT * int nRows; * * wParam = (WPARAM)nRows; * lParam = 0; * \endcode * * \param nRows Row number to be set. * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. * */#define GRIDM_SETROWCOUNT 0xF213/** * \def GRIDM_ADDCOL * \brief Adds a new column to the control. * * An application sends a GRIDM_ADDCOL message to add a new column to the control. * * \code * GRIDM_ADDCOL * PGRIDCOLHEADER pColHeader; * * wParam = 0; * lParam = (LPARAM)pColHeader; * \endcode * * \param pColHeader Struct of column header data, such as column numbers flags ... * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. */#define GRIDM_ADDCOL 0xF214/** * \def GRIDM_DELCOL * \brief Deletes a column. * An application sends a GRIDM_DELCOL message to delete a specific column. * * \code * GRIDM_DELCOL * int nCols * * wParam = (WPARAM)nCols; * lParam = 0; * \endcode * * \param nCols The column to be deleted. * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. */#define GRIDM_DELCOL 0xF215/** * \def GRIDM_ADDROW * \brief Adds a new row to the control. * * An application sends a GRIDM_ADDROW message to add a new row to the control. * * \code * GRIDM_ADDROW * PGRIDROWHEADER pRowHeader; * * wParam = 0; * lParam = (LPARAM)pRowHeader; * \endcode * * \param pRowHeader Struct of row header data, such as row numbers flags ... * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. */#define GRIDM_ADDROW 0xF216/** * \def GRIDM_DELROW * \brief Deletes a row. * An application sends a GRIDM_DELROW message to delete a specific row. * * \code * GRIDM_DELROW * int nRows * * wParam = (WPARAM)nRows; * lParam = 0; * \endcode * * \param nRows The row to be deleted. * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. */#define GRIDM_DELROW 0xF217/** * \def GRIDM_SETHEADHEIGHT *\brief Sets column header height. * * an application sends a GRIDM_SETHEADHEIGHT message to set column header height. * * \code * GRIDM_SETHEADHEIGHT * int nHeight; * * wParam = (WPARAM)nHeight; * lParam = 0; * \endcode * * \param nHeight Height of header to set. * * \return Returns GRID_OKAY if successful, or GRID_ERR other. */#define GRIDM_SETHEADHEIGHT 0xF218/** * \def GRIDM_SETHEADWIDTH *\brief Sets row header width. * * an application sends a GRIDM_SETHEADHEIGHT message to set row header width. * * \code * GRIDM_SETHEADWIDTH * int nWidth; * * wParam = (WPARAM)nWidth; * lParam = 0; * \endcode * * \param nWidth Width of header to set. * * \return Returns GRID_OKAY if successful, or GRID_ERR other. */#define GRIDM_SETHEADWIDTH 0xF219/** * \def GRIDM_GETHEADWIDTH * \brief Gets control's header width. * * An application sends an GRIDM_GETHEADWIDTH message to get control's header width. * * \code * GRIDM_GETHEADWIDTH * * wParam = 0; * lParam = 0; * \endcode * * \return The control's width. */#define GRIDM_GETHEADWIDTH 0xF21A/** * \def GRIDM_GETHEADHEIGHT * \brief Gets control header's height. * * An application sends an GRIDM_GETHEADHEIGHT message to get control's header height. * * \code * GRIDM_GETROWS * * wParam = 0; * lParam = 0; * \endcode * * \return The control's header height. */#define GRIDM_GETHEADHEIGHT 0xF21B/** * \def GRIDM_SETCOLHDR * \brief Modifies column header. * * An application sends a GRIDM_SETCOLHDR message to set column header data such as titile, flags ... * *\code * GRIDM_SETCOLHDR * int nCols; * PGRIDCOLHEADER pColHeader; * * wParam = (WPARAM)nCols; * lParam = (LPARAM)pColHeader; * \endcode * * \param nCols The column to set. * \param pColHeader The data structure include titile, flags ... * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. */#define GRIDM_SETCOLHDR 0xF21C/** * \def GRIDM_GETCOLHDR * \brief Gets column header data. * * An application sends a GRIDM_GETCOLDHR message to get column header data such as titile, flags ... * *\code * GRIDM_GETCOLHDR * int nCols; * PGRIDCOLHEADER pColHeader; * * wParam = (WPARAM)nCols; * lParam = (LPARAM)pColHeader; * \endcode * * \param nCols The column to get. * \param pColHeader The data structure to hold titile, flags ... * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. */#define GRIDM_GETCOLHDR 0xF21D/** * \def GRIDM_SETROWHDR * \brief Sets row header data. * * An application sends a GRIDM_SETROWHDR message to set row header data such as titile, flags ... * *\code * GRIDM_SETROWHDR * int nRows; * PGRIDROWHEADER pRowHeader; * * wParam = (WPARAM)nRows; * lParam = (LPARAM)pRowHeader; * \endcode * * \param nRows The row to set. * \param pRowHeader The data structure include titile, flags ... * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. */#define GRIDM_SETROWHDR 0xF21E/** * \def GRIDM_GETROWHDR * \brief Gets row header data. * * An application sends a GRIDM_GETROWHDR message to get row header data such as titile, flags ... * *\code * GRIDM_GETROWHDR * int nRows; * PGRIDROWHEADER pRowHeader; * * wParam = (WPARAM)nRows; * lParam = (LPARAM)pRowHeader; * \endcode * * \param nRows The row to get. * \param pRowHeader The data structure to hold titile, flags ... * * \return Returns GRID_OKAY if successful, or GRID_ERR otherwise. */#define GRIDM_GETROWHDR 0xF21F/** * \def GRIDM_SETCOLWIDTH * \brief Sets specific column's width. * * An application sends an GRIDM_SETCOLWIDTH message to set specific column's width. * * \code * GRIDM_SETCOLWIDTH * int nCols; * * wParam = (WPARAM)nCols; * lParam = (LPARAM)nWidth; * \endcode * * \param nCols The number of Column to be set. * \param nWidth Width in pixel to set. * * \retu
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -