您的位置:首页 > 其它

双击默认文件打开方式

2010-12-02 16:48 239 查看
1.HKEY_Class_Root/.ABC 写入 (默认)串值(REG_SZ)为 "ABCfile ";

2.HKEY_Class_Root/ABCfile/Shell/Open/Command写入,(默认)串值为 "abc.exe %1 "。

HKEY hkey;

RegCreateKey(HKEY_CLASSES_ROOT,L"Software//文仔//admin",&hkey);

RegSetValue(hkey,NULL,REG_SZ,L"文仔",strlen("文仔"));

RegCloseKey(hkey);

3.BOOL CMyApp::InitInstance()

{
// ...
if (m_lpCmdLine[0] ==
'/0')
{
//
创建一个新(空的)文档
OnFileNew();
}
else
{
//
打开作为第一个命令行参数传递的文件
OpenDocumentFile(m_lpCmdLine);
}
// ...
}

m_lpCmdLine 得到双击文件的全路径文件名。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: