Mail模組雜記2.doc

2019-04-14 21:29发布

l           获得hicon         m_hIcon = AfxGetApp()->LoadIcon(IDI_ICON3); l           ExStyle的获得                 DWORD dwExStyle = LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES | /*LVS_EX_SUBITEMIMAGES |*/                 m_List1.SetExtendedStyle(LVS_EX_FULLROWSELECT|LVS_EX_GRIDLINES);    Extended List-View Styles l           标准的list初始 static const struct                 {                         UINT nColHdrId;                         int  nFormat;                         int  nWidth;                 } colData[] = {{IDS_NULL,   LVCFMT_LEFT,   30},                 {IDS_NULL,       LVCFMT_LEFT,   30},                 {IDS_NULL,       LVCFMT_LEFT,   30},                 {IDS_LOG_COLUMN_MAIL_SENDER,        LVCFMT_LEFT,   100},                 {IDS_LOG_COLUMN_MAIL_RECEIVE_TIME,      LVCFMT_LEFT, 170},                        {IDS_LOG_COLUMN_MAIL_TITLE,    LVCFMT_LEFT,   180}};                                 const int nColCount = sizeof colData / sizeof colData[0];                                 for (int nColumn = 3; nColumn < nColCount; nColumn++)                 {                         strColumn.LoadString(colData[nColumn].nColHdrId);                         m_lcLogListCtrl.InsertColumn(nColumn, strColumn, colData[nColumn].nFormat,                                 colData[nColumn].nWidth); //                      if (nColumn > 0) m_lcLogListCtrl.EnableColumnHiding(nColumn, true);                 } l           命令的定义 /////////////////////////////////////////////////////////////////////////////// // //      Head of all commands // /////////////////////////////////////////////////////////////////////////////// #define DIR_CMD_BASE                                                    0x00000000 typedef struct _tag_CMD_HEAD {         DWORD    dwCmd;                                                            // command type         int             nBufSize;                                                  // command buffer size         BYTE       pBuf[0];                                                     // command buffer           _tag_CMD_HEAD()         {                 ZeroMemory(this, sizeof(_tag_CMD_HEAD));         }; } CMD_HEAD, *PCMD_HEAD;     /////////////////////////////////////////////////////////////////////////////// // This Message is From MAIL Client To Dir-Server : //  Upload A Attach File: /////////////////////////////////////////////////////////////////////////////// #define CMD_MAIL_CLT_UPLOAD_FILE_REQ                            DIR_CMD_BASE+4019 typedef struct _tag_Cmd_Mail_Clt_Upload_File_Req { //      char  szUser[M_ACCOUNT_SIZE]; //      CHAR       szAttachFile[MAX_LENGTH_ATTACH_FILE_PATH];         _tag_Cmd_Mail_Clt_Upload_File_Req()         {                 ZeroMemory(this, sizeof(_tag_Cmd_Mail_Clt_Upload_File_Req));         };   } Cmd_Mail_Clt_Upload_File_Req, *PCmd_Mail_Clt_Upload_File_Req;   #define CMD_MAIL_CLT_UPLOAD_FILE_RET                             DIR_CMD_BASE+4020 typedef struct _tag_Cmd_Mail_Clt_Upload_File_Ret {         CHAR       szUser[M_ACCOUNT_SIZE];   } Cmd_Mail_Clt_Upload_File_Ret, *PCmd_Mail_Clt_Upload_File_Ret; 使用                         Cmd_Mail_Update_Req strTemp;                         strTemp.dwCltExistedMails=12345;                         PCMD_HEAD pHead = (PCMD_HEAD)new BYTE[sizeof(CMD_HEAD)+sizeof(Cmd_Mail_Update_Req)];                         memset(