Windows application manifests
Gor Gyolchanyan
gor.f.gyolchanyan at gmail.com
Wed May 16 01:16:09 PDT 2012
So, this function basically does... uhh.... I have no idea. :-D
What exactly does it do again?
On Wed, May 16, 2012 at 7:44 AM, Mehrdad <wfunction at hotmail.com> wrote:
> On Tuesday, 15 May 2012 at 14:03:47 UTC, Gor Gyolchanyan wrote:
>
>> Can anyone, please, tell me what these manifests are, where do they fit
>> in my application binaries, why is one needed to get the pretty windows 7
>> buttons and how to use them with DMD?
>>
>
> Just FYI, you don't actually *need* to include manifests in your
> executable, if you know another DLL already has them.
>
> Here's a hack to show what I mean, for enabling visual styles:
>
> void enableVisualStyles()
> {
> TCHAR[MAX_PATH] dir;
> dir[GetSystemDirectory(dir.**ptr, dir.length)] = '\0';
> enum
> {
> ACTCTX_FLAG_ASSEMBLY_**DIRECTORY_VALID = 0x00000004,
> ACTCTX_FLAG_RESOURCE_NAME_**VALID = 0x00000008,
> ACTCTX_FLAG_SET_PROCESS_**DEFAULT = 0x00000010,
> }
> auto actCtx = ACTCTX(ACTCTX.sizeof,
> ACTCTX_FLAG_RESOURCE_NAME_**VALID |
> ACTCTX_FLAG_SET_PROCESS_**DEFAULT |
> ACTCTX_FLAG_ASSEMBLY_**DIRECTORY_VALID,
> "shell32.dll", PROCESSOR_ARCHITECTURE_INTEL,
> 0, dir.ptr, MAKEINTRESOURCE(124), null, null);
> auto hActCtx = CreateActCtx(actCtx);
> assert(hActCtx != INVALID_HANDLE_VALUE);
> ULONG_PTR ulpActivationCookie;
> BOOL success = ActivateActCtx(hActCtx, ulpActivationCookie);
> assert(success);
> }
>
> Basically, since shell32.dll already has our manifest, I can just call
> this function instead. :-)
>
--
Bye,
Gor Gyolchanyan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20120516/2f3b8147/attachment-0001.html>
More information about the Digitalmars-d
mailing list