原创 VC製作系統托盤程序
Windows操作系統中的某些程序運行時不顯示運行窗口,只在任務欄上顯示一個圖標,表示程序正在運行,用戶可以通過鼠標與應用程序交互,比如金山毒霸等應用
原创 判斷一行字符串中是否包含半個中文(包含Unicode總數 爲奇數)
bool IsHalfUnicode(CString strText){ const char* szStrText = (LPCTSTR)strText; LPCTSTR p= szStrText; int nCount
原创 CEdit & CRichEdit 使用技巧
.設置edit只讀屬性 方法一: m_edit1.SetReadOnly(TRUE); 方法二: ::SendMessage(m_edit1.m_hWnd, EM_S
原创 ListCtrl的總結
ListCtrl在工作中,常常用到,也常常看到大家發帖問怎麼用這個控件, 故總結了一下自己的使用經驗,以供參考使用。 先註明一下,這裏,我們用m_listctrl來表示一個CListCtrl的類對象, 然後這裏我們的ListCtrl
原创 Item 27. Minimizing Compile-time Dependencies part 2
I l@ve RuBoard Item 27. Minimizing Compile-time Dependencies桺art 2 Difficulty: 6 Now that the unnecessary headers h
原创 Windows ListCtrl使用技巧
Windows ListCtrl使用技巧1. ListCtrl 風格 LVS_ICON: 爲每個item顯示大圖標 LVS_SMALLICON: 爲每個item顯示小圖標 LVS_LIST: 顯示一列帶有小
原创 Item 26. Minimizing Compile-time Dependencies part 1
I l@ve RuBoard Item 26. Minimizing Compile-time Dependencies桺art 1 Difficulty: 4 When we talk about dependencies, w
原创 取得大文件大小
_int64 GetFileSize(const char *szFileName){ //低位,高位,錯誤代碼 DWORD dwSizeLow = 0, dwSizeHigh = 0; HANDLE hFile = Cre
原创 轉換UTF8
void ConvertGBKToUtf8(CString& strGBK) { int len=MultiByteToWideChar(CP_
原创 printf 的簡單實現
void Printf(char*str...){ va_list list; int intType; char* charType; float floatType; char* curType = str; va_star
原创 double 轉換成網絡字節
void Int64ToByte(BYTE *pData){ BYTE *pBegin = pData; BYTE *pEnd = pData +
原创 memcpy 與 memmove 實現
void* Memcpy(void *p, void *p1,size_t count){ assert(p && p1); char *pDest = static_cast<char*>(p); char *pSrt =
原创 判斷文件(夾)是否存在
bool FileExists(LPCTSTR lpszFileName, bool bIsDirCheck){ DWORD dwAttributes = GetFileAttributes(lpszFileName); if(dw
原创 Item 28. Minimizing Compile-time Dependencies part 3
I l@ve RuBoard Item 28. Minimizing Compile-time Dependencies桺art 3 Difficulty: 7 Now the unnecessary headers have b
原创 在對話框上加工具欄及在工具欄上按下拉菜單
頭文件中加入 afx_msg void OnDropDown(NMHDR* pNotifyStruct, LRESULT*pResult); BEGIN_MESSAGE_MAP(CDlgFileShare, CDialog) /