ReactOS  0.4.14-dev-815-ge410a12
CSendToMenu.cpp File Reference
#include "precomp.h"
Include dependency graph for CSendToMenu.cpp:

Go to the source code of this file.

Macros

#define IDS_FRIENDLYNAME   10195
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (shell)
 
static BOOL CreateEmptyFile (LPCWSTR pszFile)
 
static HRESULT CreateShellLink (LPCWSTR pszLinkPath, LPCWSTR pszTargetPath OPTIONAL, LPCITEMIDLIST pidlTarget OPTIONAL, LPCWSTR pszArg OPTIONAL, LPCWSTR pszDir OPTIONAL, LPCWSTR pszIconPath OPTIONAL, INT iIconNr OPTIONAL, LPCWSTR pszComment OPTIONAL)
 

Macro Definition Documentation

◆ IDS_FRIENDLYNAME

#define IDS_FRIENDLYNAME   10195

Function Documentation

◆ CreateEmptyFile()

static BOOL CreateEmptyFile ( LPCWSTR  pszFile)
static

Definition at line 189 of file CSendToMenu.cpp.

190 {
191  HANDLE hFile;
195  return hFile != INVALID_HANDLE_VALUE;
196 }
#define CloseHandle
Definition: compat.h:406
#define INVALID_HANDLE_VALUE
Definition: compat.h:399
#define FILE_SHARE_READ
Definition: compat.h:125
#define GENERIC_WRITE
Definition: nt_native.h:90
smooth NULL
Definition: ftsmooth.c:416
#define FILE_ATTRIBUTE_NORMAL
Definition: compat.h:126
_In_ HANDLE hFile
Definition: mswsock.h:90
#define CREATE_ALWAYS
Definition: disk.h:72
#define CreateFileW
Definition: compat.h:408

Referenced by CSendToMenu::CreateSendToFiles().

◆ CreateShellLink()

static HRESULT CreateShellLink ( LPCWSTR  pszLinkPath,
LPCWSTR pszTargetPath  OPTIONAL,
LPCITEMIDLIST pidlTarget  OPTIONAL,
LPCWSTR pszArg  OPTIONAL,
LPCWSTR pszDir  OPTIONAL,
LPCWSTR pszIconPath  OPTIONAL,
INT iIconNr  OPTIONAL,
LPCWSTR pszComment  OPTIONAL 
)
static

Definition at line 199 of file CSendToMenu.cpp.

208 {
210  HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL,
211  CLSCTX_INPROC_SERVER,
212  IID_PPV_ARG(IShellLinkW, &psl));
213  if (FAILED_UNEXPECTEDLY(hr))
214  return hr;
215 
216  if (pszTargetPath)
217  {
218  hr = psl->SetPath(pszTargetPath);
219  if (FAILED_UNEXPECTEDLY(hr))
220  return hr;
221  }
222  else if (pidlTarget)
223  {
224  hr = psl->SetIDList(pidlTarget);
225  if (FAILED_UNEXPECTEDLY(hr))
226  return hr;
227  }
228  else
229  {
230  ERR("invalid argument\n");
231  return E_INVALIDARG;
232  }
233 
234  if (pszArg)
235  hr = psl->SetArguments(pszArg);
236 
237  if (pszDir)
238  hr = psl->SetWorkingDirectory(pszDir);
239 
240  if (pszIconPath)
241  hr = psl->SetIconLocation(pszIconPath, iIconNr);
242 
243  if (pszComment)
244  hr = psl->SetDescription(pszComment);
245 
247  hr = psl->QueryInterface(IID_PPV_ARG(IPersistFile, &ppf));
248  if (FAILED_UNEXPECTEDLY(hr))
249  return hr;
250 
251  hr = ppf->Save(pszLinkPath, TRUE);
252  if (FAILED_UNEXPECTEDLY(hr))
253  return hr;
254 
255  return hr;
256 }
#define TRUE
Definition: types.h:120
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)
#define E_INVALIDARG
Definition: ddrawi.h:101
smooth NULL
Definition: ftsmooth.c:416
LONG HRESULT
Definition: typedefs.h:77
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
_In_ LPCSTR pszDir
Definition: shellapi.h:580
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define ERR(fmt,...)
Definition: debug.h:109

Referenced by CSendToMenu::CreateSendToFiles().

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( shell  )