Why can't correctly get the full path use app name on windows vista(windows7)

liquanhai 2010-10-02 07:53:48
I revised a example to get the full path use the application name.
AssocQueryString(ASSOCF_IGNOREUNKNOWN|ASSOCF_NOTRUNCATE|ASSOCF_OPEN_BYEXENAME,
ASSOCSTR_EXECUTABLE,
lpszExt,
NULL,
lpszApplication,
nSize);

This function works correctly to get the full path of "EXCEL.EXE" on winXP and Vista(windows7). It can get the full path as following (winword.exe,notepad.exe,Acrobat.exe,etc)
But it can't get the "WinRAR.exe" on vista or windows7.It also fails to get full path of other software (cuteftppro.exe,QQ.exe,egui.exe).
I want to know how to resolve this problem.
Thank you very much!

这个是我在codeproject上看到的一个有意思的帖子,我修改过作者的源码后,发现代码在vista上有时不能正常的得到结果,所以发帖。希望探究这个API函数的使用。
原帖的地址是:http://www.codeproject.com/KB/shell/ExecApp.aspx
...全文
111 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
adamsos 2010-10-06
  • 打赏
  • 举报
回复
Hi,you can use this function:
liquanhai 2010-10-06
  • 打赏
  • 举报
回复
liquanhai 2010-10-06
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 arong1234 的回复:]

嘿嘿,要人家帮忙还要人家资源分。这个函数功能也不是很复杂,用处也不是很大,何来“经典”?引用 2 楼 liquanhai 的回复:
欢迎大家一起来完善这个经典的代码,下载地址为:http://download.csdn.net/source/2731320
[/Quote]不要资源分啊,怪了,还是显示着。但是真正下载时,会显示不要分数啊。我估计是csdn系统没有更新
战在春秋 2010-10-06
  • 打赏
  • 举报
回复
这个......,怎么还要资源分才能下载啊?
arong1234 2010-10-06
  • 打赏
  • 举报
回复
嘿嘿,要人家帮忙还要人家资源分。这个函数功能也不是很复杂,用处也不是很大,何来“经典”?[Quote=引用 2 楼 liquanhai 的回复:]
欢迎大家一起来完善这个经典的代码,下载地址为:http://download.csdn.net/source/2731320
[/Quote]
liquanhai 2010-10-02
  • 打赏
  • 举报
回复
欢迎大家一起来完善这个经典的代码,下载地址为:http://download.csdn.net/source/2731320
arong1234 2010-10-02
  • 打赏
  • 举报
回复
我觉得这依赖于你在注册表中对应注册项的值以及你能否访问这些项的权限设置。在regedit中看HKEY_CLASSES_ROOT中对应文件扩展名中的内容,比较一下就知道了

2,640

社区成员

发帖
与我相关
我的任务
社区描述
VC/MFC 硬件/系统
社区管理员
  • 硬件/系统社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧