ReactOS 0.4.16-dev-112-g52265ae
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));
117 return hr;
118
119 if (pszTargetPath)
120 {
121 hr = psl->SetPath(pszTargetPath);
123 return hr;
124 }
125 else if (pidlTarget)
126 {
127 hr = psl->SetIDList(pidlTarget);
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));
152 return hr;
153
154 hr = ppf->Save(pszLinkPath, TRUE);
156 return hr;
157
158 return hr;
159}
#define ERR(fmt,...)
Definition: precomp.h:57
#define E_INVALIDARG
Definition: ddrawi.h:101
#define NULL
Definition: types.h:112
#define FAILED_UNEXPECTEDLY(hr)
Definition: precomp.h:121
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
return TRUE
Definition: sendmail.cpp:174
_In_ LPCSTR pszDir
Definition: shellapi.h:584
HRESULT hr
Definition: shlfolder.c:183
#define IID_PPV_ARG(Itype, ppType)

Referenced by CDeskLinkDropHandler::Drop().

Variable Documentation

◆ g_ModuleRefCnt

LONG g_ModuleRefCnt
extern

Definition at line 13 of file ACPPage.cpp.