[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [h-e-w] Windows 10 Taskbar Behavior
From: |
Rob Davenport |
Subject: |
Re: [h-e-w] Windows 10 Taskbar Behavior |
Date: |
Mon, 19 Oct 2015 19:33:06 +0000 |
Just taking a quick stab at it, I'd start changing addpm.c like so:
303a304,309
>
> wchar_t GNUEmacsAppIDstring[10];
> const PROPERTYKEY DECLSPEC_SELECTANY PKEY_AppUserModel_ID =
> { { 0x9F4C2855, 0x9F79, 0x4B39,
> { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, } }, 5 };
>
307a314,335
>
> // get the shortcut's propertystore interface
> IPropertyStore *store;
> result = IShellLinkA_QueryInterface (shortcut,
> &IID_IPropertyStore,
> (void **) &store);
> // todo: check result, handle errors
>
> // get the current app id, if any
> PROPVARIANT pv;
> result = store->GetValue(PKEY_AppUserModule_ID, &pv);
> // todo: check result, handle errors
>
> // set it to "GNU.Emacs"
> wcscpy(GNUEmacsAppIDstring, L"GNU.Emacs");
> pv.vt = VT_LPWSTR;
> pv.pwszVal = GNUEmacsAppIDstring;
> result = store->SetValue(PKEY_AppUserModule_ID, pv);
> // todo: check result, handle errors
> // if successful,
> IPropertyStore_Release(store); //?
>
> // save the shortcut file
334a363,368
>
> wchar_t GNUEmacsAppIDstring[10];
> const PROPERTYKEY DECLSPEC_SELECTANY PKEY_AppUserModel_ID =
> { { 0x9F4C2855, 0x9F79, 0x4B39,
> { 0xA8, 0xD0, 0xE1, 0xD4, 0x2D, 0xE1, 0xD5, 0xF3, } }, 5 };
>
338a373,394
>
> // get the shortcut's propertystore interface
> IPropertyStore *store;
> result = IShellLinkA_QueryInterface (shortcut,
> &IID_IPropertyStore,
> (void **) &store);
> // todo: check result, handle errors
>
> // get the current app id, if any
> PROPVARIANT pv;
> result = store->GetValue(PKEY_AppUserModule_ID, &pv);
> // todo: check result, handle errors
>
> // set it to "GNU.Emacs"
> wcscpy(GNUEmacsAppIDstring, L"GNU.Emacs");
> pv.vt = VT_LPWSTR;
> pv.pwszVal = GNUEmacsAppIDstring;
> result = store->SetValue(PKEY_AppUserModule_ID, pv);
> // todo: check result, handle errors
> // if successful,
> IPropertyStore_Release(store); //?
>
> // save the shortcut file
I don't have mingw setup to compile or test it yet. And there's more to do
(proper return value checking and error handling), and my C may be rusty, but
that's the gist of it.
Rob
-----Original Message-----
From: address@hidden [mailto:address@hidden On Behalf Of Eli Zaretskii
Sent: Monday, October 19, 2015 11:07 AM
To: Juanma Barranquero <address@hidden>
Cc: address@hidden; address@hidden; address@hidden
Subject: Re: [h-e-w] Windows 10 Taskbar Behavior
> From: Juanma Barranquero <address@hidden>
> Date: Mon, 19 Oct 2015 16:24:35 +0200
> Cc: Rob Davenport <address@hidden>,
> "address@hidden" <address@hidden>, Ben Key
> <address@hidden>
>
> On Mon, Oct 19, 2015 at 6:46 AM, Eli Zaretskii <address@hidden> wrote:
> >
> > > From: Rob Davenport <address@hidden>
> > > Date: Mon, 19 Oct 2015 00:10:34 +0000
> > >
> > > Addpm could be modified to add the app id when it creates the
> > > shortcut, and eliminate step 2.
> >
> > Do you know how to do that from a C program? I didn't find a way,
> > but I'm not an expert on that stuff.
>
> The (BSD-licensed) code for Win7AppId is accessible from here:
>
> https://code.google.com/p/win7appid/
Thanks. This is C++, whereas I meant C. The relevant COM interfaces are all
defined in C++, so it's a small wonder it should be possible to do in C++.
It doesn't even compile with g++, at least not with mingw.org's headers. Maybe
MinGW64's g++ will succeed, I don't know.
I will try to convert this into C, if no one beats me to it, and see if it's
possible.
- Re: [h-e-w] Windows 10 Taskbar Behavior, (continued)
Re: [h-e-w] Windows 10 Taskbar Behavior, Ben Key, 2015/10/18