On 6/2/17 10:49 AM, Nikolay Sivov wrote:
On 02.06.2017 17:24, Aric Stewart wrote:
Presently the wine file explorer has a create shortcut entry that does nothing. This implements the FCIDM_SHVIEW_CREATELINK command.
Signed-off-by: Aric Stewart <aric(a)codeweavers.com> --- dlls/shell32/shlview_cmenu.c | 50 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+)
+ if (!SUCCEEDED(CoCreateInstance( &CLSID_ShellLink, NULL, CLSCTX_INPROC_SERVER, + &IID_IShellLinkW, (LPVOID*)&shelllink))) + { + ERR("couldn't create ShellLink object\n"); + return; + }
This should be FAILED(). You can use IShellLink_Constructor() instead of going through generic object creation.
+ SHGetSpecialFolderPathW(NULL, root, CSIDL_STARTMENU, TRUE); + lnkfile=HeapAlloc(GetProcessHeap(), 0, (lstrlenW(root)+1+lstrlenW(wszFilename)+5) * sizeof(*lnkfile)); + lstrcpyW(lnkfile, root); + lstrcatW(lnkfile, backslashW); + lstrcatW(lnkfile, wszFilename); + lstrcatW(lnkfile, lnkW);
Why is it created in Start Menu dir? I think usual behavior is to create it in target directory.
Create the link in the same directory as the original program exists? That seems counter intuitive to me. I could seen an argument for the desktop instead of the start menu. But again I have not used windows myself in years. -aric