【HSP3】HSPでAppIDs(Application Identity)を設定してみる(その3)

HSPでAppIDs(Application Identity)を設定してみる(その3)。任意のタイミングでApplication Identityを設定する方法やっています。CommitとPKEY_AppUserModel_IDに5を追加しましたら、成功しました。

HSPでAppIDs(Application Identity)を設定してみる(その3)。任意のタイミングでApplication Identityを設定する方法やっています。CommitとPKEY_AppUserModel_IDに5を追加しましたら、成功しました。

  • hk1v
  • 2013/12/4 19:14
  • タグ:
  • タグはありません
#packopt name "test1"
#uselib "shell32"
#func SHGetPropertyStoreForWindow "SHGetPropertyStoreForWindow" sptr, sptr, sptr
#func GetCurrentProcessExplicitAppUserModelID "GetCurrentProcessExplicitAppUserModelID" wptr
#func SetCurrentProcessExplicitAppUserModelID "SetCurrentProcessExplicitAppUserModelID" wstr
#uselib "Propsys"
#func InitPropVariantFromString "InitPropVariantFromString" wstr, sptr
#func InitPropVariantFromStringVector "InitPropVariantFromStringVector" wptr, int, sptr
#func PropVariantToStringAlloc "PropVariantToStringAlloc" sptr, wptr
#define IID_IPropertyStore "{886d8eeb-8cf2-4446-8d02-cdba1dbdcf99}"
#define CLSID_PropertyStore "{e4796550-df61-448b-9193-13fc1341b163}"
#usecom IPropertyStore IID_IPropertyStore CLSID_PropertyStore
#comfunc IPropertyStore_SetValue 6 sptr, sptr
#comfunc IPropertyStore_Commit 7
propStorePtr = 0
IID_IPropertyStore_Array = 0x886d8eeb, 0x44468cf2, 0xbacd028d, 0x99cfbd1d
SHGetPropertyStoreForWindow hwnd, varptr(IID_IPropertyStore_Array), varptr(propStorePtr)
if stat == 0{
newcom propStore, IPropertyStore, -1, propStorePtr
// Win7
// propsys.dll 7.0
/*
mes varptr(InitPropVariantFromString)
InitPropVariantFromString "net.hinekure.test.hsp3", varptr(ppropvar)
*/
// Unicode
sdim wstring
cnvstow wstring, "net.hinekure.test.hsp3"
// (1)
wstrings = varptr(wstring)
// PROPVARIANT
dim ppropvar, 4
// Unicode→PROPVARIANT
InitPropVariantFromStringVector varptr(wstrings), 1, varptr(ppropvar)
mes strf("0x%08x, %d", stat, stat)
PKEY_AppUserModel_ID = 0x9F4C2855, 0x4B399F79, 0xD4E1D0A8, 0xF3D5E12D, 5
IPropertyStore_SetValue propStore, varptr(PKEY_AppUserModel_ID), varptr(ppropvar)
mes strf("0x%08x, %d", stat, stat)
IPropertyStore_Commit propStore
mes strf("0x%08x, %d", stat, stat)
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX