摘要:
ID--HANDLE--HWND三者之间的互相转换id->句柄、、、、、hWnd = ::GetDlgItem(hParentWnd,id);id->指针、、、、、CWnd::GetDlgItem();句柄->id、、、、、id = GetWindowLong(hWnd,GWL_ID);句柄->指针、、、、CWnd *pWnd=CWnd::FromHandle(hWnd);指针->ID、、、、、id = GetWindowLong(pWnd->GetSafeHwnd,GWL_ID);指针->句柄、、、、hWnd=cWnd.GetSafeHandle() 阅读全文
阅读排行榜
listctrl得到某行某列的值
2012-11-02 10:40 by 龙成, 2381 阅读, 收藏,
摘要:
先添加消息响应,然后添加如下代码,获得列值 1 void C界面测试Dlg::OnNMRClickList1(NMHDR *pNMHDR, LRESULT *pResult) 2 { 3 LPNMLISTVIEW pNMLV = reinterpret_cast<LPNMLISTVIEW>(pNMHDR); 4 m_line = pNMLV->iSubItem; 5 // TODO: 在此添加控件通知处理程序代码 6 *pResult = 0; 7 CMenu menu ,* pSubMenu; //定义下面要用到的cmenu对象 8 menu.... 阅读全文
MFC读写配置文件
2012-11-01 09:41 by 龙成, 2372 阅读, 收藏,
摘要:
void CFileTextDoc::OnIniread() {// TODO: Add your command handler code hereCString strStudName; int nStudAge; GetPrivateProfileString("Info","Name","默认姓名",strStudName.GetBuffer(MAX_PATH),MAX_PATH,"./student.ini"); //读入整型值 nStudAge = GetPrivateProfileInt(" 阅读全文
MFC打开目录
2012-11-01 10:26 by 龙成, 1487 阅读, 收藏,
摘要:
1 TCHAR szPath[MAX_PATH]; //存放选择的目录路径 2 CString str; 3 4 ZeroMemory(szPath, sizeof(szPath)); 5 6 BROWSEINFO bi; 7 bi.hwndOwner = m_hWnd; 8 bi.pidlRoot = NULL; 9 bi.pszDisplayName = szPath; 10 bi.lpszTitle = _T("请选择需要打开的目录:"); 11 bi.ulFlags = 0;... 阅读全文
windows服务简单实现(非系统服务)
2012-11-01 09:25 by 龙成, 1397 阅读, 收藏,
摘要:
// ServiceTest.cpp : Defines the entry point for the application.//#include "stdafx.h"#include "stdio.h"#include "tchar.h"#include "dos.h"#include "conio.h"//定义全局函数变量void Init();BOOL IsInstalled();BOOL Install();//BOOL Uninstall();void LogEvent(LPCTS 阅读全文
浙公网安备 33010602011771号