|
-
August 25th, 2003, 03:39 AM
#1
shortcut with parameters
I am trying to create a shortcut with parameters but it doesnt work. when I give up the parameters the shortcut work perfect.
i create a shortcut with this line:
FileLink("C:\\winnt\\system32\\control.exe" "appwiz.cpl" ,m_sDesktopDir+"\\Add-Remove Programs.lnk");
here is the function:
BOOL FileLink(const CString strPathObj,const CString strPathLink)
{
BOOL bRet = FALSE;
IShellLink *psl;
//CreateLink(strPathObj,strPathLink,"EmailResponder ACT!");
if (SUCCEEDED( CoCreateInstance(CLSID_ShellLink,
NULL,
CLSCTX_INPROC_SERVER,
IID_IShellLink,
(LPVOID*) &psl))
)
{
IPersistFile* ppf;
psl->SetPath(strPathObj);
if (SUCCEEDED(psl->QueryInterface( IID_IPersistFile, (LPVOID *) &ppf)))
{
WORD wsz[MAX_PATH];
MultiByteToWideChar(CP_ACP,
MB_PRECOMPOSED,
strPathLink,
-1,
wsz,
MAX_PATH);
if ( SUCCEEDED ( ppf->Save(wsz, TRUE) ) )
bRet = TRUE;
ppf->Release();
}
psl->Release();
}
return bRet;
}
any idea?
-
August 25th, 2003, 03:54 AM
#2
Look this function in MSDN:
IShellLink::SetArguments
I am Miss Maiden... Miss Iron Maiden :-D
-
August 25th, 2003, 04:25 AM
#3
10x
I miss it.
i used the setarguments function and ti si working fine.
rgrds megetron
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|