ReactOS  0.4.15-dev-1150-g593bcce
precomp.hpp File Reference
#include <windows.h>
#include <shlwapi.h>
#include <shlobj.h>
#include <shobjidl.h>
#include <atlbase.h>
#include <atlcom.h>
#include <atlwin.h>
#include <atlstr.h>
#include <shlguid_undoc.h>
#include <shellapi.h>
#include <shellutils.h>
#include <strsafe.h>
#include <wine/debug.h>
#include "CDeskLinkDropHandler.hpp"
#include "sendmail_version.h"
#include "resource.h"
Include dependency graph for precomp.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define COBJMACROS
 
#define WIN32_NO_STATUS
 

Functions

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)
 

Variables

LONG g_ModuleRefCnt
 

Macro Definition Documentation

◆ COBJMACROS

#define COBJMACROS

Definition at line 8 of file precomp.hpp.

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 9 of file precomp.hpp.

Function Documentation

◆ CreateShellLink()

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 
)

Definition at line 102 of file sendmail.cpp.

111 {
113  HRESULT hr = CoCreateInstance(CLSID_ShellLink, NULL,
114  CLSCTX_INPROC_SERVER,
115  IID_PPV_ARG(IShellLinkW, &psl));
116  if (FAILED_UNEXPECTEDLY(hr))
117  return hr;
118 
119  if (pszTargetPath)
120  {
121  hr = psl->SetPath(pszTargetPath);
122  if (FAILED_UNEXPECTEDLY(hr))
123  return hr;
124  }
125  else if (pidlTarget)
126  {
127  hr = psl->SetIDList(pidlTarget);
128  if (FAILED_UNEXPECTEDLY(hr))
129  return hr;
130  }
131  else
132  {
133  ERR("invalid argument\n");
134  return E_INVALIDARG;
135  }
136 
137  if (pszArg)
138  hr = psl->SetArguments(pszArg);
139 
140  if (pszDir)
141  hr = psl->SetWorkingDirectory(pszDir);
142 
143  if (pszIconPath)
144  hr = psl->SetIconLocation(pszIconPath, iIconNr);
145 
146  if (pszComment)
147  hr = psl->SetDescription(pszComment);
148 
150  hr = psl->QueryInterface(IID_PPV_ARG(IPersistFile, &ppf));
151  if (FAILED_UNEXPECTEDLY(hr))
152  return hr;
153 
154  hr = ppf->Save(pszLinkPath, TRUE);
155  if (FAILED_UNEXPECTEDLY(hr))
156  return hr;
157 
158  return hr;
159 }
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:79
#define FAILED_UNEXPECTEDLY(hr)
Definition: shellutils.h:71
_In_ LPCSTR pszDir
Definition: shellapi.h:582
return TRUE
Definition: sendmail.cpp:174
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:110

Referenced by CDeskLinkDropHandler::Drop().

Variable Documentation

◆ g_ModuleRefCnt

LONG g_ModuleRefCnt

Definition at line 13 of file ACPPage.cpp.