1/* 2 * Copyright (C) 2011 Tobias Häußler 3 * 4 * Permission is hereby granted, free of charge, to any person obtaining a 5 * copy of this software and associated documentation files (the "Software"), 6 * to deal in the Software without restriction, including without limitation 7 * the rights to use, copy, modify, merge, publish, distribute, sublicense, 8 * and/or sell copies of the Software, and to permit persons to whom the 9 * Software is furnished to do so, subject to the following conditions: 10 * 11 * The above copyright notice and this permission notice (including the next 12 * paragraph) shall be included in all copies or substantial portions of the 13 * Software. 14 * 15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 21 * DEALINGS IN THE SOFTWARE. 22 */ 23 24#ifndef PROPERTYSTORE_H 25#define PROPERTYSTORE_H 26 27#include <windows.h> 28 29#ifdef __MINGW64_VERSION_MAJOR 30/* If we are using headers from mingw-w64 project, it provides the PSDK headers this needs ... */ 31#include <propkey.h> 32#include <propsys.h> 33#else /* !__MINGW64_VERSION_MAJOR */ 34/* ... otherwise, we need to define all this stuff ourselves */ 35 36typedef struct _tagpropertykey { 37 GUID fmtid; 38 DWORD pid; 39} PROPERTYKEY; 40 41#define REFPROPERTYKEY const PROPERTYKEY * 42#define REFPROPVARIANT const PROPVARIANT * 43 44WINOLEAPI PropVariantClear(PROPVARIANT *pvar); 45 46#ifdef INTERFACE 47#undef INTERFACE 48#endif 49 50#define INTERFACE IPropertyStore 51DECLARE_INTERFACE_(IPropertyStore, IUnknown) 52{ 53 STDMETHOD(QueryInterface) (THIS_ REFIID, PVOID *) PURE; 54 STDMETHOD_(ULONG, AddRef) (THIS) PURE; 55 STDMETHOD_(ULONG, Release) (THIS) PURE; 56 STDMETHOD(GetCount) (THIS_ DWORD) PURE; 57 STDMETHOD(GetAt) (THIS_ DWORD, PROPERTYKEY) PURE; 58 STDMETHOD(GetValue) (THIS_ REFPROPERTYKEY, PROPVARIANT) PURE; 59 STDMETHOD(SetValue) (THIS_ REFPROPERTYKEY, REFPROPVARIANT) PURE; 60 STDMETHOD(Commit) (THIS) PURE; 61}; 62 63#undef INTERFACE 64typedef IPropertyStore *LPPROPERTYSTORE; 65 66DEFINE_GUID(IID_IPropertyStore, 0x886d8eeb, 0x8cf2, 0x4446, 0x8d, 0x02, 0xcd, 67 0xba, 0x1d, 0xbd, 0xcf, 0x99); 68 69#ifdef INITGUID 70#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) GUID_EXT const PROPERTYKEY DECLSPEC_SELECTANY name = { { l, w1, w2, { b1, b2, b3, b4, b5, b6, b7, b8 } }, pid } 71#else 72#define DEFINE_PROPERTYKEY(name, l, w1, w2, b1, b2, b3, b4, b5, b6, b7, b8, pid) GUID_EXT const PROPERTYKEY name 73#endif 74 75DEFINE_PROPERTYKEY(PKEY_AppUserModel_ID, 0x9F4C2855, 0x9F79, 0x4B39, 0xA8, 0xD0, 76 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, 5); 77 78#endif /* !__MINGW64_VERSION_MAJOR */ 79 80typedef HRESULT(__stdcall * SHGETPROPERTYSTOREFORWINDOWPROC) (HWND, REFIID, 81 void **); 82 83#endif 84