ReactOS  0.4.14-dev-1025-gd1ac13c
createlink.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS Software Control Panel
3  * FILE: dll/cpl/appwiz/createlink.c
4  * PURPOSE: ReactOS Software Control Panel
5  * PROGRAMMER: Gero Kuehn (reactos.filter@gkware.com)
6  * Dmitry Chapyshev (lentind@yandex.ru)
7  * Johannes Anderwald
8  * Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
9  * UPDATE HISTORY:
10  * 06-17-2004 Created
11  */
12 
13 #include "appwiz.h"
14 #include <commctrl.h>
15 #include <shellapi.h>
16 #include <strsafe.h>
17 
18 BOOL
20 {
21  WCHAR Value[10];
22  DWORD Size;
23  DWORD Type;
24 
25  Size = sizeof(Value);
26  if (RegQueryValueExW(hKey, L"IsShortcut", NULL, &Type, (LPBYTE)Value, &Size) != ERROR_SUCCESS)
27  return FALSE;
28 
29  if (Type != REG_SZ)
30  return FALSE;
31 
32  return (wcsicmp(Value, L"yes") == 0);
33 }
34 
35 BOOL
37 {
38  HKEY hKey;
39  WCHAR Buffer[100];
40  DWORD Size;
41  DWORD Type;
42 
44  return FALSE;
45 
46  if (IsShortcut(hKey))
47  {
48  RegCloseKey(hKey);
49  return TRUE;
50  }
51 
52  Size = sizeof(Buffer);
54  {
55  RegCloseKey(hKey);
56  return FALSE;
57  }
58 
59  RegCloseKey(hKey);
60 
62  return FALSE;
63 
64  if (IsShortcut(hKey))
65  {
66  RegCloseKey(hKey);
67  return TRUE;
68  }
69 
70  RegCloseKey(hKey);
71  return FALSE;
72 }
73 
74 BOOL
76 {
77  IShellLinkW *pShellLink, *pSourceShellLink;
78  IPersistFile *pPersistFile;
79  HRESULT hr;
82 
83  /* get the extension */
85 
87  {
88  hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_ALL, &IID_IShellLinkW, (void**)&pSourceShellLink);
89 
90  if (FAILED(hr))
91  return FALSE;
92 
93  hr = IUnknown_QueryInterface(pSourceShellLink, &IID_IPersistFile, (void**)&pPersistFile);
94  if (FAILED(hr))
95  {
96  IUnknown_Release(pSourceShellLink);
97  return FALSE;
98  }
99 
100  hr = pPersistFile->lpVtbl->Load(pPersistFile, (LPCOLESTR)pContext->szTarget, STGM_READ);
101  IUnknown_Release(pPersistFile);
102 
103  if (FAILED(hr))
104  {
105  IUnknown_Release(pSourceShellLink);
106  return FALSE;
107  }
108 
109  hr = IShellLinkW_GetPath(pSourceShellLink, Path, _countof(Path), NULL, 0);
110  IUnknown_Release(pSourceShellLink);
111 
112  if (FAILED(hr))
113  {
114  return FALSE;
115  }
116  }
117  else
118  {
119  StringCchCopyW(Path, _countof(Path), pContext->szTarget);
120  }
121 
122  hr = CoCreateInstance(&CLSID_ShellLink, NULL, CLSCTX_ALL,
123  &IID_IShellLinkW, (void**)&pShellLink);
124 
125  if (hr != S_OK)
126  return FALSE;
127 
128  pShellLink->lpVtbl->SetPath(pShellLink, Path);
129  pShellLink->lpVtbl->SetDescription(pShellLink, pContext->szDescription);
130  pShellLink->lpVtbl->SetWorkingDirectory(pShellLink, pContext->szWorkingDirectory);
131 
132  hr = IUnknown_QueryInterface(pShellLink, &IID_IPersistFile, (void**)&pPersistFile);
133  if (hr != S_OK)
134  {
135  IUnknown_Release(pShellLink);
136  return FALSE;
137  }
138 
139  hr = pPersistFile->lpVtbl->Save(pPersistFile, pContext->szLinkName, TRUE);
140  IUnknown_Release(pPersistFile);
141  IUnknown_Release(pShellLink);
142  return (hr == S_OK);
143 }
144 
145 BOOL
147 {
148  IUniformResourceLocatorW *pURL = NULL;
149  IPersistFile *pPersistFile = NULL;
150  HRESULT hr;
153 
154  hr = CoCreateInstance(&CLSID_InternetShortcut, NULL, CLSCTX_ALL,
155  &IID_IUniformResourceLocatorW, (void **)&pURL);
156  if (FAILED(hr))
157  return FALSE;
158 
159  hr = IUnknown_QueryInterface(pURL, &IID_IPersistFile, (void **)&pPersistFile);
160  if (FAILED(hr))
161  {
162  IUnknown_Release(pURL);
163  return FALSE;
164  }
165 
166  pURL->lpVtbl->SetURL(pURL, pContext->szTarget, 0);
167 
168  hr = pPersistFile->lpVtbl->Save(pPersistFile, szPath, TRUE);
169 
170  IUnknown_Release(pPersistFile);
171  IUnknown_Release(pURL);
172 
173  return SUCCEEDED(hr);
174 }
175 
177 {
178  return (PathIsURLW(pszLocation) || wcsstr(pszLocation, L"www.") == pszLocation);
179 }
180 
181 /* Remove all invalid characters from the name */
182 void
184 {
185  LPWSTR pch1, pch2;
186  for (pch1 = pch2 = szName; *pch1; ++pch1)
187  {
188  if (wcschr(L"\\/:*?\"<>|", *pch1) != NULL)
189  {
190  /* *pch1 is an invalid character */
191  continue;
192  }
193  *pch2 = *pch1;
194  ++pch2;
195  }
196  *pch2 = 0;
197 }
198 
199 BOOL
201 {
202  SIZE_T cch;
203  LPCWSTR pch, pszName = pContext->szDescription;
204 
205  if (!pszName || !pszName[0])
206  return FALSE;
207 
208  cch = wcslen(pContext->szOrigin) + wcslen(pszName) + 1;
209  if (cch >= MAX_PATH)
210  return FALSE;
211 
212  pch = pszName;
213  for (pch = pszName; *pch; ++pch)
214  {
215  if (wcschr(L"\\/:*?\"<>|", *pch) != NULL)
216  {
217  /* *pch is an invalid character */
218  return FALSE;
219  }
220  }
221 
222  return TRUE;
223 }
224 
225 INT_PTR
226 CALLBACK
228  UINT uMsg,
229  WPARAM wParam,
230  LPARAM lParam)
231 {
232  LPPROPSHEETPAGEW ppsp;
233  PCREATE_LINK_CONTEXT pContext;
234  LPPSHNOTIFY lppsn;
235  WCHAR szPath[MAX_PATH * 2];
236  WCHAR szDesc[100];
237  BROWSEINFOW brws;
238  LPITEMIDLIST pidllist;
239  LPWSTR pch;
241 
242  switch(uMsg)
243  {
244  case WM_INITDIALOG:
245  ppsp = (LPPROPSHEETPAGEW)lParam;
246  pContext = (PCREATE_LINK_CONTEXT) ppsp->lParam;
247  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pContext);
248  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
249  break;
250  case WM_COMMAND:
251  switch(HIWORD(wParam))
252  {
253  case EN_CHANGE:
255  {
257  }
258  else
259  {
260  PropSheet_SetWizButtons(GetParent(hwndDlg), 0);
261  }
262  break;
263  }
264  switch(LOWORD(wParam))
265  {
266  case IDC_SHORTCUT_BROWSE:
267  ZeroMemory(&brws, sizeof(brws));
268  brws.hwndOwner = hwndDlg;
269  brws.pidlRoot = NULL;
270  brws.pszDisplayName = szPath;
272  brws.lpfn = NULL;
273  pidllist = SHBrowseForFolderW(&brws);
274  if (!pidllist)
275  break;
276 
277  if (SHGetPathFromIDListW(pidllist, szPath))
279 
280  /* Free memory, if possible */
281  CoTaskMemFree(pidllist);
282  break;
283  }
284  break;
285  case WM_NOTIFY:
286  lppsn = (LPPSHNOTIFY) lParam;
287  pContext = (PCREATE_LINK_CONTEXT)GetWindowLongPtr(hwndDlg, DWLP_USER);
288  if (lppsn->hdr.code == PSN_SETACTIVE)
289  {
290  SetDlgItemTextW(hwndDlg, IDC_SHORTCUT_LOCATION, pContext->szTarget);
291  }
292  else if (lppsn->hdr.code == PSN_WIZNEXT)
293  {
294  GetDlgItemTextW(hwndDlg, IDC_SHORTCUT_LOCATION, pContext->szTarget, _countof(pContext->szTarget));
295  StrTrimW(pContext->szTarget, L" \t");
296 
298  StringCchCopyW(pContext->szTarget, _countof(pContext->szTarget), szPath);
299 
300  if (IsInternetLocation(pContext->szTarget))
301  {
302  /* internet */
303  WCHAR szName[128];
305  StringCchCopyW(pContext->szDescription, _countof(pContext->szDescription), szName);
306 
307  pContext->szWorkingDirectory[0] = 0;
308  }
309  else if (GetFileAttributesW(pContext->szTarget) != INVALID_FILE_ATTRIBUTES)
310  {
311  /* file */
315 
316  /* get display name */
317  FileInfo.szDisplayName[0] = 0;
318  if (SHGetFileInfoW(pContext->szTarget, 0, &FileInfo, sizeof(FileInfo), SHGFI_DISPLAYNAME))
319  StringCchCopyW(pContext->szDescription, _countof(pContext->szDescription), FileInfo.szDisplayName);
320 
321  /* set working directory */
323  pContext->szTarget);
326  if (pch && *pch)
327  *pch = 0;
329  }
330  else
331  {
332  /* not found */
333  WCHAR szError[MAX_PATH + 100];
334 
336 
337  LoadStringW(hApplet, IDS_CREATE_SHORTCUT, szDesc, _countof(szDesc));
339  StringCchPrintfW(szError, _countof(szError), szPath, pContext->szTarget);
340  MessageBoxW(hwndDlg, szError, szDesc, MB_ICONERROR);
341 
342  /* prevent the wizard to go next */
343  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
344  return TRUE;
345  }
346  }
347  else if (lppsn->hdr.code == PSN_RESET && !lppsn->lParam)
348  {
349  /* The user has clicked [Cancel] */
350  DeleteFileW(pContext->szOldFile);
352  }
353  break;
354  }
355  return FALSE;
356 }
357 
358 INT_PTR
359 CALLBACK
361  UINT uMsg,
362  WPARAM wParam,
363  LPARAM lParam)
364 {
365  LPPROPSHEETPAGEW ppsp;
366  PCREATE_LINK_CONTEXT pContext;
367  LPPSHNOTIFY lppsn;
368  LPWSTR pch;
370  WCHAR szMessage[128];
371 
372  switch(uMsg)
373  {
374  case WM_INITDIALOG:
375  ppsp = (LPPROPSHEETPAGEW)lParam;
376  pContext = (PCREATE_LINK_CONTEXT) ppsp->lParam;
377  SetWindowLongPtr(hwndDlg, DWLP_USER, (LONG_PTR)pContext);
379  break;
380  case WM_COMMAND:
381  switch(HIWORD(wParam))
382  {
383  case EN_CHANGE:
385  {
387  StrTrimW(szText, L" \t");
388  if (szText[0])
390  else
392  }
393  else
394  {
396  }
397  break;
398  }
399  break;
400  case WM_NOTIFY:
401  lppsn = (LPPSHNOTIFY) lParam;
402  pContext = (PCREATE_LINK_CONTEXT) GetWindowLongPtr(hwndDlg, DWLP_USER);
403  if (lppsn->hdr.code == PSN_SETACTIVE)
404  {
405  /* TODO: Use shell32!PathCleanupSpec instead of DoConvertNameForFileSystem */
407  SetDlgItemTextW(hwndDlg, IDC_SHORTCUT_NAME, pContext->szDescription);
408  }
409  else if (lppsn->hdr.code == PSN_WIZFINISH)
410  {
411  GetDlgItemTextW(hwndDlg, IDC_SHORTCUT_NAME, pContext->szDescription, _countof(pContext->szDescription));
412  StrTrimW(pContext->szDescription, L" \t");
413 
414  if (!DoValidateShortcutName(pContext))
415  {
417 
418  LoadStringW(hApplet, IDS_INVALID_NAME, szMessage, _countof(szMessage));
419  MessageBoxW(hwndDlg, szMessage, NULL, MB_ICONERROR);
420 
421  /* prevent the wizard to go next */
422  SetWindowLongPtr(hwndDlg, DWLP_MSGRESULT, -1);
423  return TRUE;
424  }
425 
426  /* if old shortcut file exists, then delete it now */
427  DeleteFileW(pContext->szOldFile);
429 
430  if (IsInternetLocation(pContext->szTarget))
431  {
432  /* internet */
433  StringCchCopyW(pContext->szLinkName, _countof(pContext->szLinkName),
434  pContext->szOrigin);
435  PathAppendW(pContext->szLinkName, pContext->szDescription);
436 
437  /* change extension if any */
438  pch = PathFindExtensionW(pContext->szLinkName);
439  if (pch && *pch)
440  *pch = 0;
441  StringCchCatW(pContext->szLinkName, _countof(pContext->szLinkName), L".url");
442 
443  if (!CreateInternetShortcut(pContext))
444  {
445  LoadStringW(hApplet, IDS_CANTMAKEINETSHORTCUT, szMessage, _countof(szMessage));
446  MessageBoxW(hwndDlg, szMessage, NULL, MB_ICONERROR);
447  }
448  }
449  else
450  {
451  /* file */
452  StringCchCopyW(pContext->szLinkName, _countof(pContext->szLinkName),
453  pContext->szOrigin);
454  PathAppendW(pContext->szLinkName, pContext->szDescription);
455 
456  /* change extension if any */
457  pch = PathFindExtensionW(pContext->szLinkName);
458  if (pch && *pch)
459  *pch = 0;
460  StringCchCatW(pContext->szLinkName, _countof(pContext->szLinkName), L".lnk");
461 
462  if (!CreateShortcut(pContext))
463  {
464  WCHAR szMessage[128];
465  LoadStringW(hApplet, IDS_CANTMAKESHORTCUT, szMessage, _countof(szMessage));
466  MessageBoxW(hwndDlg, szMessage, NULL, MB_ICONERROR);
467  }
468  }
469  }
470  else if (lppsn->hdr.code == PSN_RESET && !lppsn->lParam)
471  {
472  /* The user has clicked [Cancel] */
473  DeleteFileW(pContext->szOldFile);
475  }
476  break;
477  }
478  return FALSE;
479 }
480 
481 static int CALLBACK
483 {
484  // NOTE: This callback is needed to set large icon correctly.
485  HICON hIcon;
486  switch (uMsg)
487  {
488  case PSCB_INITIALIZED:
489  {
491  SendMessageW(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
492  break;
493  }
494  }
495  return 0;
496 }
497 
500 {
501  PROPSHEETHEADERW psh;
502  HPROPSHEETPAGE ahpsp[2];
503  PROPSHEETPAGE psp;
504  UINT nPages = 0;
505  UINT nLength;
506  PCREATE_LINK_CONTEXT pContext;
507  WCHAR szMessage[128];
508  LPWSTR pch;
509 
510  pContext = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(*pContext));
511  if (!pContext)
512  {
513  /* no memory */
514  LoadStringW(hApplet, IDS_NO_MEMORY, szMessage, _countof(szMessage));
515  MessageBoxW(hwndCPl, szMessage, NULL, MB_ICONERROR);
516  return FALSE;
517  }
518 
519  nLength = wcslen(szPath);
520  if (!nLength)
521  {
522  HeapFree(GetProcessHeap(), 0, pContext);
523 
524  /* no directory given */
525  LoadStringW(hApplet, IDS_NO_DIRECTORY, szMessage, _countof(szMessage));
526  MessageBoxW(hwndCPl, szMessage, NULL, MB_ICONERROR);
527  return FALSE;
528  }
529 
530  if (!PathFileExistsW(szPath))
531  {
532  HeapFree(GetProcessHeap(), 0, pContext);
533 
534  /* invalid path */
535  LoadStringW(hApplet, IDS_INVALID_PATH, szMessage, _countof(szMessage));
536  MessageBoxW(hwndCPl, szMessage, NULL, MB_ICONERROR);
537  return FALSE;
538  }
539 
540  /* build the pContext->szOrigin and pContext->szOldFile */
542  {
543  StringCchCopyW(pContext->szOrigin, _countof(pContext->szOrigin), szPath);
544  pContext->szOldFile[0] = 0;
545  }
546  else
547  {
548  StringCchCopyW(pContext->szOrigin, _countof(pContext->szOrigin), szPath);
549  pch = PathFindFileNameW(pContext->szOrigin);
550  if (pch && *pch)
551  *pch = 0;
552 
553  StringCchCopyW(pContext->szOldFile, _countof(pContext->szOldFile), szPath);
554 
556  if (pch && *pch)
557  {
558  /* build szDescription */
559  StringCchCopyW(pContext->szDescription, _countof(pContext->szDescription), pch);
560  *pch = 0;
561 
562  pch = PathFindExtensionW(pContext->szDescription);
563  *pch = 0;
564  }
565  }
566  PathAddBackslashW(pContext->szOrigin);
567 
568  /* Create the Welcome page */
569  psp.dwSize = sizeof(PROPSHEETPAGE);
570  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
571  psp.hInstance = hApplet;
572  psp.pfnDlgProc = WelcomeDlgProc;
573  psp.pszTemplate = MAKEINTRESOURCEW(IDD_SHORTCUT_LOCATION);
574  psp.lParam = (LPARAM)pContext;
575  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
576 
577  /* Create the Finish page */
578  psp.dwFlags = PSP_DEFAULT | PSP_HIDEHEADER;
579  psp.pfnDlgProc = FinishDlgProc;
580  psp.pszTemplate = MAKEINTRESOURCEW(IDD_SHORTCUT_FINISH);
581  ahpsp[nPages++] = CreatePropertySheetPage(&psp);
582 
583  /* Create the property sheet */
584  psh.dwSize = sizeof(PROPSHEETHEADER);
585  psh.dwFlags = PSH_WIZARD97 | PSH_WATERMARK | PSH_USEICONID | PSH_USECALLBACK;
586  psh.hInstance = hApplet;
588  psh.hwndParent = NULL;
589  psh.nPages = nPages;
590  psh.nStartPage = 0;
591  psh.phpage = ahpsp;
592  psh.pszbmWatermark = MAKEINTRESOURCEW(IDB_SHORTCUT);
594 
595  /* Display the wizard */
596  PropertySheet(&psh);
597  HeapFree(GetProcessHeap(), 0, pContext);
598  return TRUE;
599 }
600 
601 LONG
602 CALLBACK
603 NewLinkHereW(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
604 {
606  return ShowCreateShortcutWizard(hwndCPl, (LPWSTR)lParam1);
607 }
608 
609 LONG
610 CALLBACK
611 NewLinkHereA(HWND hwndCPl, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
612 {
613  WCHAR szFile[MAX_PATH];
614 
615  if (MultiByteToWideChar(CP_ACP, 0, (LPSTR)lParam1, -1, szFile, _countof(szFile)))
616  {
618  return ShowCreateShortcutWizard(hwndCPl, szFile);
619  }
620  return -1;
621 }
#define RegQueryValueEx
Definition: winreg.h:524
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2374
#define WM_GETTEXTLENGTH
Definition: winuser.h:1601
BOOL WINAPI PathIsDirectoryW(LPCWSTR lpszPath)
Definition: path.c:1702
HWND hwndParent
Definition: prsht.h:295
static HICON
Definition: imagelist.c:84
UINT WINAPI GetDlgItemTextW(HWND hDlg, int nIDDlgItem, LPWSTR lpString, int nMaxCount)
Definition: dialog.c:2265
#define TRUE
Definition: types.h:120
#define IDS_NO_MEMORY
Definition: resource.h:28
VOID WINAPI CoTaskMemFree(LPVOID ptr)
Definition: ifs.c:420
Type
Definition: Type.h:6
#define ERROR_SUCCESS
Definition: deptool.c:10
HRESULT hr
Definition: shlfolder.c:183
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
struct _PSHNOTIFY * LPPSHNOTIFY
#define KEY_READ
Definition: nt_native.h:1023
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
#define CP_ACP
Definition: compat.h:99
#define _countof(array)
Definition: fontsub.cpp:30
#define BIF_BROWSEINCLUDEFILES
Definition: shlobj.h:1158
BOOL WINAPI SHGetPathFromIDListW(LPCITEMIDLIST pidl, LPWSTR pszPath)
Definition: pidl.c:1280
#define CALLBACK
Definition: compat.h:27
_In_ DWORD nLength
Definition: wincon.h:476
#define PSWIZB_NEXT
Definition: prsht.h:154
HWND hwndOwner
Definition: shlobj.h:1126
#define ZeroMemory
Definition: winbase.h:1642
DWORD WINAPI GetFullPathNameW(IN LPCWSTR lpFileName, IN DWORD nBufferLength, OUT LPWSTR lpBuffer, OUT LPWSTR *lpFilePart)
Definition: path.c:1105
HWND WINAPI SetFocus(_In_opt_ HWND)
HINSTANCE hApplet
Definition: access.c:17
UINT_PTR WPARAM
Definition: windef.h:207
#define SendDlgItemMessage
Definition: winuser.h:5817
int32_t INT_PTR
Definition: typedefs.h:63
#define IDC_SHORTCUT_BROWSE
Definition: resource.h:40
#define PSH_USECALLBACK
Definition: prsht.h:48
char * LPSTR
Definition: xmlstorage.h:182
#define PSN_SETACTIVE
Definition: prsht.h:115
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define SetWindowLongPtr
Definition: treelist.c:70
WPARAM wParam
Definition: combotst.c:138
#define pch(ap)
Definition: match.c:418
#define DWLP_MSGRESULT
Definition: winuser.h:864
BOOL WINAPI PathIsURLW(LPCWSTR lpstrPath)
Definition: url.c:2432
BOOL WINAPI PathAppendW(LPWSTR lpszPath, LPCWSTR lpszAppend)
Definition: path.c:121
STRSAFEAPI StringCchCatW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:325
BOOL WINAPI SetDlgItemTextW(_In_ HWND, _In_ int, _In_ LPCWSTR)
UINT code
Definition: winuser.h:3134
#define IDS_CANTMAKESHORTCUT
Definition: resource.h:27
NMHDR hdr
Definition: prsht.h:330
LONG WINAPI RegCloseKey(HKEY hKey)
Definition: reg.c:423
unsigned char * LPBYTE
Definition: typedefs.h:53
#define PSH_USEICONID
Definition: prsht.h:42
#define PSN_WIZFINISH
Definition: prsht.h:122
static const WCHAR szText[]
Definition: dialog.c:139
LPWSTR WINAPI PathAddBackslashW(LPWSTR lpszPath)
Definition: path.c:289
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
LPWSTR pszDisplayName
Definition: shlobj.h:1128
DWORD WINAPI GetFileAttributesW(LPCWSTR lpFileName)
Definition: fileinfo.c:802
STRSAFEAPI StringCchCopyW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszSrc)
Definition: strsafe.h:149
struct _PSP * HPROPSHEETPAGE
Definition: mstask.idl:90
BOOL WINAPI DeleteFileW(IN LPCWSTR lpFileName)
Definition: delete.c:39
PFNPROPSHEETCALLBACK pfnCallback
Definition: prsht.h:311
static DWORD DWORD void LPSTR DWORD cch
Definition: str.c:201
#define PSNRET_INVALID_NOCHANGEPAGE
Definition: prsht.h:131
smooth NULL
Definition: ftsmooth.c:416
struct _PROPSHEETPAGEW * LPPROPSHEETPAGEW
#define PROPSHEETHEADER
Definition: prsht.h:392
#define PSN_WIZNEXT
Definition: prsht.h:121
LPWSTR WINAPI PathFindFileNameW(LPCWSTR lpszPath)
Definition: path.c:389
LONG_PTR LPARAM
Definition: windef.h:208
#define SHGFI_DISPLAYNAME
Definition: shellapi.h:164
Definition: bufpool.h:45
BOOL WINAPI PathFileExistsW(LPCWSTR lpszPath)
Definition: path.c:1756
#define PropSheet_SetWizButtons(d, f)
Definition: prsht.h:357
LPWSTR WINAPI PathFindExtensionW(LPCWSTR lpszPath)
Definition: path.c:442
#define IDS_CANTMAKEINETSHORTCUT
Definition: resource.h:26
#define CreatePropertySheetPage
Definition: prsht.h:399
#define PSWIZB_FINISH
Definition: prsht.h:155
#define STGM_READ
Definition: objbase.h:916
#define PSP_DEFAULT
Definition: prsht.h:22
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
_CONST_RETURN wchar_t *__cdecl wcschr(_In_z_ const wchar_t *_Str, wchar_t _Ch)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
Definition: reg.c:4116
int WINAPI MessageBoxW(_In_opt_ HWND, _In_opt_ LPCWSTR, _In_opt_ LPCWSTR, _In_ UINT)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
__wchar_t WCHAR
Definition: xmlstorage.h:180
DWORD_PTR WINAPI SHGetFileInfoW(LPCWSTR path, DWORD dwFileAttributes, SHFILEINFOW *psfi, UINT sizeofpsfi, UINT flags)
Definition: shell32_main.c:413
#define PSWIZB_BACK
Definition: prsht.h:153
LONG HRESULT
Definition: typedefs.h:78
#define IDS_NO_DIRECTORY
Definition: resource.h:29
HINSTANCE hInstance
Definition: prsht.h:296
#define MAX_PATH
Definition: compat.h:26
#define IDC_SHORTCUT_NAME
Definition: resource.h:41
#define EM_SETSEL
Definition: winuser.h:2000
LPCWSTR pszIcon
Definition: prsht.h:299
unsigned long DWORD
Definition: ntddk_ex.h:95
LRESULT WINAPI SendDlgItemMessageW(_In_ HWND, _In_ int, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
DWORD dwSize
Definition: prsht.h:293
#define IDS_INVALID_NAME
Definition: resource.h:31
#define INVALID_FILE_ATTRIBUTES
Definition: vfdcmd.c:23
DWORD dwFlags
Definition: prsht.h:294
#define IDD_SHORTCUT_LOCATION
Definition: resource.h:12
#define IDC_SHORTCUT_LOCATION
Definition: resource.h:39
#define IDS_CREATE_SHORTCUT
Definition: resource.h:23
static const WCHAR L[]
Definition: oid.c:1250
LPARAM lParam
Definition: prsht.h:227
#define DWLP_USER
Definition: winuser.h:866
#define MB_ICONERROR
Definition: winuser.h:781
#define IDS_INVALID_PATH
Definition: resource.h:30
#define WM_COMMAND
Definition: winuser.h:1722
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
PCIDLIST_ABSOLUTE pidlRoot
Definition: shlobj.h:1127
void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
Definition: changenotify.c:340
LPWSTR WINAPI PathRemoveBackslashW(LPWSTR lpszPath)
Definition: path.c:862
#define wcsicmp
Definition: string.h:1152
_In_ LPCSTR _In_opt_ LPCSTR lpExtension
Definition: winbase.h:3028
#define SHCNF_PATHW
Definition: shlobj.h:1763
struct CREATE_LINK_CONTEXT * PCREATE_LINK_CONTEXT
HPROPSHEETPAGE * phpage
Definition: prsht.h:309
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
LPITEMIDLIST WINAPI SHBrowseForFolderW(LPBROWSEINFOW lpbi)
Definition: brsfolder.c:1156
ULONG_PTR SIZE_T
Definition: typedefs.h:79
HWND WINAPI GetParent(_In_ HWND)
#define S_OK
Definition: intsafe.h:59
UINT ulFlags
Definition: shlobj.h:1130
PRTL_UNICODE_STRING_BUFFER Path
#define PSCB_INITIALIZED
Definition: prsht.h:75
HICON hIcon
Definition: msconfig.c:44
LPCWSTR szPath
Definition: env.c:35
#define PSN_RESET
Definition: prsht.h:118
#define SHCNE_DELETE
Definition: shlobj.h:1730
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
STRSAFEAPI StringCchPrintfW(STRSAFE_LPWSTR pszDest, size_t cchDest, STRSAFE_LPCWSTR pszFormat,...)
Definition: strsafe.h:530
BFFCALLBACK lpfn
Definition: shlobj.h:1131
__int3264 LONG_PTR
Definition: mstsclib_h.h:276
unsigned int UINT
Definition: ndis.h:50
DWORD WINAPI ExpandEnvironmentStringsW(IN LPCWSTR lpSrc, IN LPWSTR lpDst, IN DWORD nSize)
Definition: environ.c:519
#define HEAP_ZERO_MEMORY
Definition: compat.h:123
#define MultiByteToWideChar
Definition: compat.h:100
#define IDS_ERROR_NOT_FOUND
Definition: resource.h:24
BOOL WINAPI StrTrimW(LPWSTR lpszStr, LPCWSTR lpszTrim)
Definition: string.c:1869
const GUID IID_IPersistFile
#define IDB_SHORTCUT
Definition: resource.h:18
static const WCHAR szName[]
Definition: msipriv.h:1194
#define PropertySheet
Definition: prsht.h:400
struct FileInfo FileInfo
#define HIWORD(l)
Definition: typedefs.h:247
LONG WINAPI RegOpenKeyExW(HKEY hKey, LPCWSTR lpSubKey, DWORD ulOptions, REGSAM samDesired, PHKEY phkResult)
Definition: reg.c:3366
HICON WINAPI LoadIconW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
Definition: cursoricon.c:2044
#define HKEY_CLASSES_ROOT
Definition: winreg.h:10
VOID WINAPI InitCommonControls(void)
Definition: commctrl.c:863
#define MAKEINTRESOURCEW(i)
Definition: winuser.h:582
#define GetWindowLongPtr
Definition: treelist.c:73
#define IDI_APPINETICO
Definition: resource.h:9
WCHAR * LPWSTR
Definition: xmlstorage.h:184
#define IDD_SHORTCUT_FINISH
Definition: resource.h:13
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
#define IDS_NEW_INTERNET_SHORTCUT
Definition: resource.h:25
LPARAM lParam
Definition: prsht.h:331
ITEMIDLIST UNALIGNED * LPITEMIDLIST
Definition: shtypes.idl:41
#define WM_INITDIALOG
Definition: winuser.h:1721
LPARAM lParam
Definition: combotst.c:139
#define LOWORD(l)
Definition: pedump.c:82
size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define HeapFree(x, y, z)
Definition: compat.h:402
#define PROPSHEETPAGE
Definition: prsht.h:389
#define WM_NOTIFY
Definition: richedit.h:61
#define SUCCEEDED(hr)
Definition: intsafe.h:57
#define ICON_BIG
Definition: tnclass.cpp:51
UINT nStartPage
Definition: prsht.h:304
#define REG_SZ
Definition: layer.c:22
#define EN_CHANGE
Definition: winuser.h:2004