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

HSPでAppIDs(Application Identity)を設定してみる(その1)。任意のタイミングでApplication Identityを設定する方法やっています。が、エラーは出てないけど、正常に動いてなさそう。その2も参照して。

HSPでAppIDs(Application Identity)を設定してみる(その1)。任意のタイミングでApplication Identityを設定する方法やっています。が、エラーは出てないけど、正常に動いてなさそう。その2も参照して。

  • hk1v
  • 2013/12/4 18:34
  • タグ:
  • タグはありません
// http://togarasi.wordpress.com/2009/10/19/win7-%E3%82%BF%E3%82%B9%E3%82%AF%E3%83%90%E3%83%BC%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%EF%BC%88appids%EF%BC%89/
//
#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
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
IPropertyStore_SetValue propStore, varptr(PKEY_AppUserModel_ID), varptr(ppropvar)
mes strf("0x%08x, %d", stat, stat)
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX