2013-03-16 20:25:38 +00:00
|
|
|
/*
|
|
|
|
* PROJECT: ReactOS Software Control Panel
|
|
|
|
* FILE: dll/cpl/appwiz/createlink.c
|
|
|
|
* PURPOSE: ReactOS Software Control Panel
|
|
|
|
* PROGRAMMER: Gero Kuehn (reactos.filter@gkware.com)
|
|
|
|
* Dmitry Chapyshev (lentind@yandex.ru)
|
|
|
|
* Johannes Anderwald
|
2007-10-08 15:56:31 +00:00
|
|
|
* UPDATE HISTORY:
|
|
|
|
* 06-17-2004 Created
|
2007-10-03 17:50:43 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "appwiz.h"
|
|
|
|
|
2009-09-14 22:55:44 +00:00
|
|
|
BOOL
|
|
|
|
IsShortcut(HKEY hKey)
|
|
|
|
{
|
|
|
|
WCHAR Value[10];
|
|
|
|
DWORD Size;
|
|
|
|
DWORD Type;
|
|
|
|
|
|
|
|
Size = sizeof(Value);
|
|
|
|
if (RegQueryValueExW(hKey, L"IsShortcut", NULL, &Type, (LPBYTE)Value, &Size) != ERROR_SUCCESS)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (Type != REG_SZ)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
return (wcsicmp(Value, L"yes") == 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
BOOL
|
|
|
|
IsExtensionAShortcut(LPWSTR lpExtension)
|
|
|
|
{
|
|
|
|
HKEY hKey;
|
|
|
|
WCHAR Buffer[100];
|
|
|
|
DWORD Size;
|
|
|
|
DWORD Type;
|
|
|
|
|
|
|
|
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, lpExtension, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (IsShortcut(hKey))
|
|
|
|
{
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
Size = sizeof(Buffer);
|
|
|
|
if (RegQueryValueEx(hKey, NULL, NULL, &Type, (LPBYTE)Buffer, &Size) != ERROR_SUCCESS || Type != REG_SZ)
|
|
|
|
{
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
|
|
|
|
if (RegOpenKeyExW(HKEY_CLASSES_ROOT, Buffer, 0, KEY_READ, &hKey) != ERROR_SUCCESS)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
if (IsShortcut(hKey))
|
|
|
|
{
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
return TRUE;
|
|
|
|
}
|
|
|
|
|
|
|
|
RegCloseKey(hKey);
|
|
|
|
return FALSE;
|
|
|
|
}
|
2007-10-04 23:51:10 +00:00
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
BOOL
|
2007-10-04 23:51:10 +00:00
|
|
|
CreateShortcut(PCREATE_LINK_CONTEXT pContext)
|
|
|
|
{
|
2009-09-14 22:55:44 +00:00
|
|
|
IShellLinkW *pShellLink, *pSourceShellLink;
|
2007-10-04 23:51:10 +00:00
|
|
|
IPersistFile *pPersistFile;
|
|
|
|
HRESULT hr;
|
2009-09-14 22:55:44 +00:00
|
|
|
WCHAR Path[MAX_PATH];
|
|
|
|
LPWSTR lpExtension;
|
|
|
|
|
|
|
|
/* get the extension */
|
|
|
|
lpExtension = wcsrchr(pContext->szTarget, '.');
|
|
|
|
|
|
|
|
if (IsExtensionAShortcut(lpExtension))
|
|
|
|
{
|
2013-05-19 21:21:20 +00:00
|
|
|
hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_ALL, &IID_IShellLinkW, (void**)&pSourceShellLink);
|
2009-09-14 22:55:44 +00:00
|
|
|
|
|
|
|
if (hr != S_OK)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
hr = pSourceShellLink->lpVtbl->QueryInterface(pSourceShellLink, &IID_IPersistFile, (void**)&pPersistFile);
|
|
|
|
if (hr != S_OK)
|
|
|
|
{
|
|
|
|
pSourceShellLink->lpVtbl->Release(pSourceShellLink);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = pPersistFile->lpVtbl->Load(pPersistFile, (LPCOLESTR)pContext->szTarget, STGM_READ);
|
|
|
|
pPersistFile->lpVtbl->Release(pPersistFile);
|
|
|
|
|
|
|
|
if (hr != S_OK)
|
|
|
|
{
|
|
|
|
pSourceShellLink->lpVtbl->Release(pSourceShellLink);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = pSourceShellLink->lpVtbl->GetPath(pSourceShellLink, Path, sizeof(Path) / sizeof(WCHAR), NULL, 0);
|
|
|
|
pSourceShellLink->lpVtbl->Release(pSourceShellLink);
|
|
|
|
|
|
|
|
if (hr != S_OK)
|
|
|
|
{
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
wcscpy(Path, pContext->szTarget);
|
|
|
|
}
|
2007-10-04 23:51:10 +00:00
|
|
|
|
|
|
|
hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_ALL,
|
2013-05-19 21:21:20 +00:00
|
|
|
&IID_IShellLinkW, (void**)&pShellLink);
|
2007-10-04 23:51:10 +00:00
|
|
|
|
|
|
|
if (hr != S_OK)
|
|
|
|
return FALSE;
|
|
|
|
|
|
|
|
|
2009-09-14 22:55:44 +00:00
|
|
|
pShellLink->lpVtbl->SetPath(pShellLink, Path);
|
2007-10-04 23:51:10 +00:00
|
|
|
pShellLink->lpVtbl->SetDescription(pShellLink, pContext->szDescription);
|
|
|
|
pShellLink->lpVtbl->SetWorkingDirectory(pShellLink, pContext->szWorkingDirectory);
|
2007-10-19 23:21:45 +00:00
|
|
|
|
2007-10-04 23:51:10 +00:00
|
|
|
hr = pShellLink->lpVtbl->QueryInterface(pShellLink, &IID_IPersistFile, (void**)&pPersistFile);
|
|
|
|
if (hr != S_OK)
|
|
|
|
{
|
|
|
|
pShellLink->lpVtbl->Release(pShellLink);
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
hr = pPersistFile->lpVtbl->Save(pPersistFile, pContext->szLinkName, TRUE);
|
|
|
|
pPersistFile->lpVtbl->Release(pPersistFile);
|
|
|
|
pShellLink->lpVtbl->Release(pShellLink);
|
|
|
|
return (hr == S_OK);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2007-10-03 17:50:43 +00:00
|
|
|
INT_PTR
|
|
|
|
CALLBACK
|
|
|
|
WelcomeDlgProc(HWND hwndDlg,
|
|
|
|
UINT uMsg,
|
|
|
|
WPARAM wParam,
|
|
|
|
LPARAM lParam)
|
|
|
|
{
|
2007-10-04 23:51:10 +00:00
|
|
|
LPPROPSHEETPAGEW ppsp;
|
|
|
|
PCREATE_LINK_CONTEXT pContext;
|
|
|
|
LPPSHNOTIFY lppsn;
|
|
|
|
WCHAR szPath[MAX_PATH];
|
|
|
|
WCHAR szDesc[100];
|
2007-10-19 23:21:45 +00:00
|
|
|
BROWSEINFOW brws;
|
2007-10-04 23:51:10 +00:00
|
|
|
LPITEMIDLIST pidllist;
|
2007-10-21 16:20:14 +00:00
|
|
|
IMalloc* malloc;
|
2007-10-04 23:51:10 +00:00
|
|
|
|
2007-10-03 17:50:43 +00:00
|
|
|
switch(uMsg)
|
|
|
|
{
|
|
|
|
case WM_INITDIALOG:
|
2007-10-04 23:51:10 +00:00
|
|
|
ppsp = (LPPROPSHEETPAGEW)lParam;
|
|
|
|
pContext = (PCREATE_LINK_CONTEXT) ppsp->lParam;
|
|
|
|
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pContext);
|
2007-10-03 17:50:43 +00:00
|
|
|
PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
|
|
|
|
break;
|
|
|
|
case WM_COMMAND:
|
|
|
|
switch(HIWORD(wParam))
|
|
|
|
{
|
|
|
|
case EN_CHANGE:
|
|
|
|
if (SendDlgItemMessage(hwndDlg, IDC_SHORTCUT_LOCATION, WM_GETTEXTLENGTH, 0, 0))
|
|
|
|
{
|
|
|
|
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_NEXT);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
|
|
|
|
}
|
2007-10-04 23:51:10 +00:00
|
|
|
break;
|
2007-10-03 17:50:43 +00:00
|
|
|
}
|
2007-10-04 23:51:10 +00:00
|
|
|
switch(LOWORD(wParam))
|
|
|
|
{
|
|
|
|
case IDC_SHORTCUT_BROWSE:
|
2007-10-31 17:13:52 +00:00
|
|
|
ZeroMemory(&brws, sizeof(brws));
|
2007-10-04 23:51:10 +00:00
|
|
|
brws.hwndOwner = hwndDlg;
|
|
|
|
brws.pidlRoot = NULL;
|
|
|
|
brws.pszDisplayName = szPath;
|
|
|
|
brws.ulFlags = BIF_BROWSEINCLUDEFILES;
|
|
|
|
brws.lpfn = NULL;
|
2013-05-19 21:21:20 +00:00
|
|
|
pidllist = SHBrowseForFolderW(&brws);
|
2007-10-04 23:51:10 +00:00
|
|
|
if (!pidllist)
|
|
|
|
break;
|
|
|
|
|
2013-05-19 21:21:20 +00:00
|
|
|
if (SHGetPathFromIDListW(pidllist, szPath))
|
2007-10-04 23:51:10 +00:00
|
|
|
SendDlgItemMessage(hwndDlg, IDC_SHORTCUT_LOCATION, WM_SETTEXT, 0, (LPARAM)szPath);
|
|
|
|
|
2007-10-21 16:20:14 +00:00
|
|
|
/* Free memory, if possible */
|
|
|
|
if (SUCCEEDED(SHGetMalloc(&malloc)))
|
|
|
|
{
|
|
|
|
IMalloc_Free(malloc, pidllist);
|
|
|
|
IMalloc_Release(malloc);
|
|
|
|
}
|
|
|
|
|
2007-10-04 23:51:10 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_NOTIFY:
|
|
|
|
lppsn = (LPPSHNOTIFY) lParam;
|
|
|
|
if (lppsn->hdr.code == PSN_WIZNEXT)
|
|
|
|
{
|
|
|
|
pContext = (PCREATE_LINK_CONTEXT) GetWindowLongPtr(hwndDlg, DWLP_USER);
|
|
|
|
SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_LOCATION, WM_GETTEXT, MAX_PATH, (LPARAM)pContext->szTarget);
|
|
|
|
///
|
|
|
|
/// FIXME
|
|
|
|
/// it should also be possible to create a link to folders, shellobjects etc....
|
|
|
|
///
|
|
|
|
if (GetFileAttributesW(pContext->szTarget) == INVALID_FILE_ATTRIBUTES)
|
|
|
|
{
|
|
|
|
szDesc[0] = L'\0';
|
|
|
|
szPath[0] = L'\0';
|
2007-10-19 23:21:45 +00:00
|
|
|
if (LoadStringW(hApplet, IDS_CREATE_SHORTCUT, szDesc, 100) < 100 &&
|
2007-10-04 23:51:10 +00:00
|
|
|
LoadStringW(hApplet, IDS_ERROR_NOT_FOUND, szPath, MAX_PATH) < MAX_PATH)
|
|
|
|
{
|
|
|
|
WCHAR szError[MAX_PATH + 100];
|
|
|
|
#ifdef _MSC_VER
|
|
|
|
_swprintf(szError, szPath, pContext->szTarget);
|
|
|
|
#else
|
|
|
|
swprintf(szError, szPath, pContext->szTarget);
|
|
|
|
#endif
|
|
|
|
MessageBoxW(hwndDlg, szError, szDesc, MB_ICONERROR);
|
|
|
|
}
|
|
|
|
SendDlgItemMessage(hwndDlg, IDC_SHORTCUT_LOCATION, EM_SETSEL, 0, -1);
|
|
|
|
SetFocus(GetDlgItem(hwndDlg, IDC_SHORTCUT_LOCATION));
|
2009-05-09 12:27:40 +00:00
|
|
|
SetWindowLongPtr(hwndDlg, DWL_MSGRESULT, PSNRET_INVALID_NOCHANGEPAGE);
|
2007-10-04 23:51:10 +00:00
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
WCHAR * first, *last;
|
|
|
|
wcscpy(pContext->szWorkingDirectory, pContext->szTarget);
|
|
|
|
first = wcschr(pContext->szWorkingDirectory, L'\\');
|
|
|
|
last = wcsrchr(pContext->szWorkingDirectory, L'\\');
|
|
|
|
wcscpy(pContext->szDescription, &last[1]);
|
|
|
|
|
|
|
|
if (first != last)
|
|
|
|
last[0] = L'\0';
|
|
|
|
else
|
|
|
|
first[1] = L'\0';
|
|
|
|
|
|
|
|
first = wcsrchr(pContext->szDescription, L'.');
|
2008-12-20 20:48:08 +00:00
|
|
|
|
|
|
|
if(first)
|
|
|
|
first[0] = L'\0';
|
2007-10-04 23:51:10 +00:00
|
|
|
}
|
2007-10-03 17:50:43 +00:00
|
|
|
|
2007-10-04 23:51:10 +00:00
|
|
|
}
|
|
|
|
break;
|
2007-10-03 17:50:43 +00:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
INT_PTR
|
|
|
|
CALLBACK
|
|
|
|
FinishDlgProc(HWND hwndDlg,
|
|
|
|
UINT uMsg,
|
|
|
|
WPARAM wParam,
|
|
|
|
LPARAM lParam)
|
|
|
|
{
|
2007-10-04 23:51:10 +00:00
|
|
|
LPPROPSHEETPAGEW ppsp;
|
|
|
|
PCREATE_LINK_CONTEXT pContext;
|
|
|
|
LPPSHNOTIFY lppsn;
|
|
|
|
|
2007-10-03 17:50:43 +00:00
|
|
|
switch(uMsg)
|
|
|
|
{
|
|
|
|
case WM_INITDIALOG:
|
2007-10-04 23:51:10 +00:00
|
|
|
ppsp = (LPPROPSHEETPAGEW)lParam;
|
|
|
|
pContext = (PCREATE_LINK_CONTEXT) ppsp->lParam;
|
|
|
|
SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pContext);
|
|
|
|
SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_NAME, WM_SETTEXT, 0, (LPARAM)pContext->szDescription);
|
2007-10-03 17:50:43 +00:00
|
|
|
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_FINISH);
|
|
|
|
break;
|
2007-10-04 23:51:10 +00:00
|
|
|
case WM_COMMAND:
|
|
|
|
switch(HIWORD(wParam))
|
|
|
|
{
|
|
|
|
case EN_CHANGE:
|
2008-08-06 18:18:43 +00:00
|
|
|
if (SendDlgItemMessage(hwndDlg, IDC_SHORTCUT_NAME, WM_GETTEXTLENGTH, 0, 0))
|
2007-10-04 23:51:10 +00:00
|
|
|
{
|
|
|
|
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK | PSWIZB_FINISH);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
PropSheet_SetWizButtons(GetParent(hwndDlg), PSWIZB_BACK);
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case WM_NOTIFY:
|
|
|
|
lppsn = (LPPSHNOTIFY) lParam;
|
|
|
|
pContext = (PCREATE_LINK_CONTEXT) GetWindowLongPtr(hwndDlg, DWLP_USER);
|
|
|
|
if (lppsn->hdr.code == PSN_WIZFINISH)
|
|
|
|
{
|
|
|
|
SendDlgItemMessageW(hwndDlg, IDC_SHORTCUT_NAME, WM_GETTEXT, MAX_PATH, (LPARAM)pContext->szDescription);
|
|
|
|
wcscat(pContext->szLinkName, pContext->szDescription);
|
|
|
|
wcscat(pContext->szLinkName, L".lnk");
|
|
|
|
if (!CreateShortcut(pContext))
|
|
|
|
{
|
|
|
|
MessageBox(hwndDlg, _T("Failed to create shortcut"), _T("Error"), MB_ICONERROR);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2007-10-03 17:50:43 +00:00
|
|
|
}
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
LONG CALLBACK
|
2007-10-04 23:51:10 +00:00
|
|
|
ShowCreateShortcutWizard(HWND hwndCPl, LPWSTR szPath)
|
2007-10-03 17:50:43 +00:00
|
|
|
{
|
|
|
|
PROPSHEETHEADERW psh;
|
|
|
|
HPROPSHEETPAGE ahpsp[2];
|
|
|
|
PROPSHEETPAGE psp;
|
|
|
|
UINT nPages = 0;
|
2007-10-04 23:51:10 +00:00
|
|
|
UINT nLength;
|
2010-07-16 12:52:37 +00:00
|
|
|
DWORD attrs;
|
2007-10-04 23:51:10 +00:00
|
|
|
|
|
|
|
PCREATE_LINK_CONTEXT pContext = (PCREATE_LINK_CONTEXT) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(CREATE_LINK_CONTEXT));
|
|
|
|
if (!pContext)
|
|
|
|
{
|
|
|
|
/* no memory */
|
|
|
|
return FALSE;
|
|
|
|
}
|
|
|
|
nLength = wcslen(szPath);
|
|
|
|
if (!nLength)
|
|
|
|
{
|
2011-10-02 12:22:39 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, pContext);
|
|
|
|
|
2007-10-04 23:51:10 +00:00
|
|
|
/* no directory given */
|
|
|
|
return FALSE;
|
|
|
|
}
|
2010-07-16 12:52:37 +00:00
|
|
|
|
|
|
|
attrs = GetFileAttributesW(szPath);
|
2011-05-19 18:04:10 +00:00
|
|
|
if (attrs == INVALID_FILE_ATTRIBUTES)
|
2010-07-16 12:52:37 +00:00
|
|
|
{
|
2011-10-02 12:22:39 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, pContext);
|
|
|
|
|
2010-07-16 12:52:37 +00:00
|
|
|
/* invalid path */
|
|
|
|
return FALSE;
|
|
|
|
}
|
2007-10-04 23:51:10 +00:00
|
|
|
|
|
|
|
wcscpy(pContext->szLinkName, szPath);
|
|
|
|
if (pContext->szLinkName[nLength-1] != L'\\')
|
|
|
|
{
|
|
|
|
pContext->szLinkName[nLength] = L'\\';
|
|
|
|
pContext->szLinkName[nLength+1] = L'\0';
|
|
|
|
}
|
|
|
|
|
2007-10-03 17:50:43 +00:00
|
|
|
|
|
|
|
/* Create the Welcome page */
|
|
|
|
psp.dwSize = sizeof(PROPSHEETPAGE);
|
|
|
|
psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
|
|
|
|
psp.hInstance = hApplet;
|
|
|
|
psp.pfnDlgProc = WelcomeDlgProc;
|
|
|
|
psp.pszTemplate = MAKEINTRESOURCE(IDD_SHORTCUT_LOCATION);
|
2007-10-04 23:51:10 +00:00
|
|
|
psp.lParam = (LPARAM)pContext;
|
2007-10-03 17:50:43 +00:00
|
|
|
ahpsp[nPages++] = CreatePropertySheetPage(&psp);
|
|
|
|
|
|
|
|
/* Create the Finish page */
|
|
|
|
psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
|
|
|
|
psp.pfnDlgProc = FinishDlgProc;
|
|
|
|
psp.pszTemplate = MAKEINTRESOURCE(IDD_SHORTCUT_FINISH);
|
|
|
|
ahpsp[nPages++] = CreatePropertySheetPage(&psp);
|
|
|
|
|
|
|
|
|
|
|
|
/* Create the property sheet */
|
|
|
|
psh.dwSize = sizeof(PROPSHEETHEADER);
|
|
|
|
psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK;
|
|
|
|
psh.hInstance = hApplet;
|
|
|
|
psh.hwndParent = NULL;
|
|
|
|
psh.nPages = nPages;
|
|
|
|
psh.nStartPage = 0;
|
|
|
|
psh.phpage = ahpsp;
|
|
|
|
psh.pszbmWatermark = MAKEINTRESOURCE(IDB_WATERMARK);
|
|
|
|
|
|
|
|
/* Display the wizard */
|
|
|
|
PropertySheet(&psh);
|
2007-10-04 23:51:10 +00:00
|
|
|
HeapFree(GetProcessHeap(), 0, pContext);
|
2007-10-03 17:50:43 +00:00
|
|
|
return TRUE;
|
|
|
|
}
|
2007-10-04 23:51:10 +00:00
|
|
|
|
|
|
|
|
|
|
|
LONG
|
|
|
|
CALLBACK
|
|
|
|
NewLinkHere(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
|
|
|
|
{
|
|
|
|
WCHAR szFile[MAX_PATH];
|
|
|
|
|
2010-07-16 12:52:37 +00:00
|
|
|
if (MultiByteToWideChar(CP_ACP, 0, (LPSTR) lParam1, -1, szFile, MAX_PATH))
|
2007-10-04 23:51:10 +00:00
|
|
|
{
|
|
|
|
return ShowCreateShortcutWizard(hwndCPl, szFile);
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LONG
|
|
|
|
CALLBACK
|
|
|
|
NewLinkHereW(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
|
|
|
|
{
|
2010-07-16 12:52:37 +00:00
|
|
|
return ShowCreateShortcutWizard(hwndCPl, (LPWSTR) lParam1);
|
2007-10-04 23:51:10 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
LONG
|
|
|
|
CALLBACK
|
|
|
|
NewLinkHereA(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
|
|
|
|
{
|
|
|
|
WCHAR szFile[MAX_PATH];
|
|
|
|
|
2010-07-16 12:52:37 +00:00
|
|
|
if (MultiByteToWideChar(CP_ACP, 0, (LPSTR) lParam1, -1, szFile, MAX_PATH))
|
2007-10-04 23:51:10 +00:00
|
|
|
{
|
|
|
|
return ShowCreateShortcutWizard(hwndCPl, szFile);
|
|
|
|
}
|
|
|
|
return -1;
|
|
|
|
}
|