#include <windows.h>
#include <shlobj.h>
#include <objidl.h>
#include <shlwapi.h>
#include <stdio.h>
Go to the source code of this file.
◆ WIN32_LEAN_AND_MEAN
◆ CreateShellLink()
Definition at line 19 of file create-links.c.
20{
24
26
27 printf(
"creating shortcut file '%s' to %s...\n", linkPath,
cmd);
28
31
34
37
38 if (iconPath)
40
43
45
48
50
52 }
53
55 }
56
59 else
61
63}
#define MultiByteToWideChar
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
HRESULT SetPath([in] LPCSTR pszFile)
HRESULT SetArguments([in] LPCSTR pszArgs)
HRESULT SetIconLocation([in] LPCSTR pszIconPath, [in] int iIcon)
HRESULT SetDescription([in] LPCSTR pszName)
HRESULT SetWorkingDirectory([in] LPCSTR pszDir)
HRESULT QueryInterface([in] REFIID riid, [out, iid_is(riid)] void **ppvObject)
#define comment(fmt, arg1)
const GUID IID_IPersistFile
Referenced by main().
◆ main()
Definition at line 66 of file create-links.c.
67{
70
72
73
76
79
80 strcpy(
p,
"start-winhello.lnk");
82
83
84
87
90
91 strcpy(
p,
"start-winemine.lnk");
93
95
96 return 0;
97}
HRESULT CreateShellLink(LPCSTR linkPath, LPCSTR cmd, LPCSTR arg, LPCSTR dir, LPCSTR iconPath, int icon_nr, LPCSTR comment)
HRESULT WINAPI CoInitialize(LPVOID lpReserved)
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
BOOL WINAPI SHGetSpecialFolderPathA(HWND hwndOwner, LPSTR szPath, int nFolder, BOOL bCreate)