HSPでAppIDs(Application Identity)を設定してみる(その1)。任意のタイミングでApplication Identityを設定する方法やっています。が、エラーは出てないけど、正常に動いてなさそう。その2も参照して。
HSPでAppIDs(Application Identity)を設定してみる(その1)。任意のタイミングでApplication Identityを設定する方法やっています。が、エラーは出てないけど、正常に動いてなさそう。その2も参照して。
// 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, sptrpropStorePtr = 0IID_IPropertyStore_Array = 0x886d8eeb, 0x44468cf2, 0xbacd028d, 0x99cfbd1dSHGetPropertyStoreForWindow 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 wstringcnvstow 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, 0xF3D5E12DIPropertyStore_SetValue propStore, varptr(PKEY_AppUserModel_ID), varptr(ppropvar)mes strf("0x%08x, %d", stat, stat)}