📄 subject_19182.htm
字号:
<p>
序号:19182 发表者:jaimini 发表日期:2002-10-26 10:10:00
<br>主题:请问如何读取快捷方式文件里的程序路径?
<br>内容:请问如何读取快捷方式文件里的程序路径?<BR>请各位高手指点,谢谢!
<br><a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p>
<hr size=1>
<blockquote><p>
回复者:Norton AntivVirus 回复日期:2002-10-26 12:37:46
<br>内容:HRESULT ResolveShortcutFile(HWND hwnd, LPCTSTR pszShortcutFile, <BR> LPSTR pszPath, DWORD szPath, LPSTR pszDescription, DWORD szDescription)<BR>{<BR> USES_CONVERSION;<BR><BR> HRESULT hr;<BR> IShellLink *psl;<BR><BR> // Get a pointer to the IShellLink interface.<BR> hr = CoCreateInstance(CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, IID_IShellLink, <BR> (void**)&psl);<BR><BR> if (SUCCEEDED(hr))<BR> {<BR> IPersistFile* ppf;<BR><BR> // Get a pointer to the IPersistFile interface.<BR> hr = psl->QueryInterface(IID_IPersistFile, (void**)&ppf);<BR><BR> if (SUCCEEDED(hr))<BR> {<BR> // Load the shell link.<BR> hr = ppf->Load(T2OLE(pszShortcutFile), STGM_READ);<BR><BR> if (SUCCEEDED(hr))<BR> {<BR> // Resolve the link.<BR> hr = psl->Resolve(hwnd, SLR_ANY_MATCH);<BR><BR> if (SUCCEEDED(hr))<BR> {<BR> WIN32_FIND_DATA wfd;<BR><BR> if ( pszPath && szPath )<BR> {<BR> // Get the path to the link target.<BR> hr = psl->GetPath(pszPath, szPath, &wfd, SLGP_SHORTPATH);<BR> }<BR> <BR> if ( pszDescription && szDescription )<BR> {<BR> // Get the description of the target. <BR> hr = psl->GetDescription(pszDescription, szDescription);<BR> }<BR> }<BR> }<BR><BR> // Release pointer to IPersistFile interface.<BR> ppf->Release();<BR> }<BR><BR> // Release pointer to IShellLink interface.<BR> psl->Release();<BR> }<BR><BR> return hr;<BR>}
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:jaimini 回复日期:2002-11-01 21:50:20
<br>内容:我用了不行啊,使用有没有什么注意的地方?<BR>我把这个函数加到了对话框的基类中,第一个参数用m_hWnd,可以吗?
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
<font color=red>答案被接受</font><br>回复者:Norton AntivVirus 回复日期:2002-11-02 13:08:16
<br>内容:可以啊,就用m_hWnd啊
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
<hr size=1>
<blockquote><p>
回复者:jaimini 回复日期:2002-11-02 18:37:11
<br>内容:谢谢了,你的名字真有意思,呵呵,<BR>看到邮件标题的时候还愣了一下。:)
<br>
<a href="javascript:history.go(-1)">返回上页</a><br><a href=http://www.copathway.com/cndevforum/>访问论坛</a></p></blockquote>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -