www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - Windows application manifests

reply Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> writes:
--f46d0401fb1319723904c013ab68
Content-Type: text/plain; charset=UTF-8

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?

-- 
Bye,
Gor Gyolchanyan.

--f46d0401fb1319723904c013ab68
Content-Type: text/html; charset=UTF-8

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?<br clear="all"><div><br></div>-- <br>Bye,<br>
Gor Gyolchanyan.<br>

--f46d0401fb1319723904c013ab68--
May 15 2012
next sibling parent reply "Kagamin" <spam here.lot> writes:
Manifests are extensible resources, they are used for various 
things which require storing metadata in executable modules, for 
example they're used to load version 6 of comctl32.dll instead of 
version 5 (pre-XP), thus getting different set of common 
controls, which support ux themes.
May 15 2012
parent reply Denis Shelomovskij <verylonglogin.reg gmail.com> writes:
15.05.2012 20:16, Gor Gyolchanyan написал:
 On Tue, May 15, 2012 at 8:07 PM, Kagamin <spam here.lot
 <mailto:spam here.lot>> wrote:

     Manifests are extensible resources, they are used for various things
     which require storing metadata in executable modules, for example
     they're used to load version 6 of comctl32.dll instead of version 5
     (pre-XP), thus getting different set of common controls, which
     support ux themes.


 Thanks for the reply! How do I include such a manifest to my DMD-built
 executable?

 --
 Bye,
 Gor Gyolchanyan.

An example of my own preferred configuration: http://deoma-cmd.ru/files/other/DWinResExample.7z Everything in common folder is really common. `requestedExecutionLevel` should be also defined in manifest or Windows 6.x's UAC will use heuristics to choose required privilege level. -- Денис В. Шеломовский Denis V. Shelomovskij
May 15 2012
parent Denis Shelomovskij <verylonglogin.reg gmail.com> writes:
15.05.2012 22:08, Gor Gyolchanyan написал:
 Thanks!
 It doesn't compile. After I fixed the path to the Windows SDK, I got the
 error: C:\Program Files (x86)\Microsoft
 SDKs\Windows\v7.0A\Include\SpecStrings.h(11) : fatal error RC1015:
 cannot open include file 'sal.h'

Looks like you didn't change `/i"%ProgramFiles%\Microsoft Visual Studio 9.0\VC\include"` to your path (sal.h is there) or you hasn't it installed. -- Денис В. Шеломовский Denis V. Shelomovskij
May 15 2012
prev sibling next sibling parent Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> writes:
--bcaec54c52a06f6ce204c0158531
Content-Type: text/plain; charset=UTF-8

On Tue, May 15, 2012 at 8:07 PM, Kagamin <spam here.lot> wrote:

 Manifests are extensible resources, they are used for various things which
 require storing metadata in executable modules, for example they're used to
 load version 6 of comctl32.dll instead of version 5 (pre-XP), thus getting
 different set of common controls, which support ux themes.

Thanks for the reply! How do I include such a manifest to my DMD-built executable? -- Bye, Gor Gyolchanyan. --bcaec54c52a06f6ce204c0158531 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote">On Tue, May 15, 2012 at 8:07 PM, Kagamin <span d= ir=3D"ltr">&lt;<a href=3D"mailto:spam here.lot" target=3D"_blank">spam here= .lot</a>&gt;</span> wrote:<br><blockquote class=3D"gmail_quote" style=3D"ma= rgin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Manifests are extensible resources, they are used for various things which = require storing metadata in executable modules, for example they&#39;re use= d to load version 6 of comctl32.dll instead of version 5 (pre-XP), thus get= ting different set of common controls, which support ux themes.<br> </blockquote></div><div><br></div>Thanks for the reply! How do I include su= ch a manifest to my DMD-built executable?<br><br>-- <br>Bye,<br>Gor Gyolcha= nyan.<br> --bcaec54c52a06f6ce204c0158531--
May 15 2012
prev sibling next sibling parent Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> writes:
--f46d040714c54dd27504c01716d8
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Thanks!
It doesn't compile. After I fixed the path to the Windows SDK, I got the
error: C:\Program Files (x86)\Microsoft
SDKs\Windows\v7.0A\Include\SpecStrings.h(11) : fatal error RC1015: cannot
open include file 'sal.h'

But what do windows resources have to do with the manifests?

On Tue, May 15, 2012 at 9:53 PM, Denis Shelomovskij <
verylonglogin.reg gmail.com> wrote:

 15.05.2012 20:16, Gor Gyolchanyan =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=

 On Tue, May 15, 2012 at 8:07 PM, Kagamin <spam here.lot
 <mailto:spam here.lot>> wrote:

    Manifests are extensible resources, they are used for various things
    which require storing metadata in executable modules, for example
    they're used to load version 6 of comctl32.dll instead of version 5
    (pre-XP), thus getting different set of common controls, which
    support ux themes.


 Thanks for the reply! How do I include such a manifest to my DMD-built
 executable?

 --
 Bye,
 Gor Gyolchanyan.

An example of my own preferred configuration: http://deoma-cmd.ru/files/**other/DWinResExample.7z<http://deoma-cmd.ru/f=

 Everything in common folder is really common.

 `requestedExecutionLevel` should be also defined in manifest or Windows
 6.x's UAC will use heuristics to choose required privilege level.

 --
 =D0=94=D0=B5=D0=BD=D0=B8=D1=81 =D0=92. =D0=A8=D0=B5=D0=BB=D0=BE=D0=BC=D0=

 Denis V. Shelomovskij

--=20 Bye, Gor Gyolchanyan. --f46d040714c54dd27504c01716d8 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks!<div>It doesn&#39;t compile. After I fixed the path to the Windows S= DK, I got the error:=C2=A0C:\Program Files (x86)\Microsoft SDKs\Windows\v7.= 0A\Include\SpecStrings.h(11) : fatal error RC1015: cannot open include file= &#39;sal.h&#39;</div> <div><br></div><div>But what do windows resources have to do with the manif= ests?<br><br><div class=3D"gmail_quote">On Tue, May 15, 2012 at 9:53 PM, De= nis Shelomovskij <span dir=3D"ltr">&lt;<a href=3D"mailto:verylonglogin.reg = gmail.com" target=3D"_blank">verylonglogin.reg gmail.com</a>&gt;</span> wro= te:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">15.05.2012 20:16, Gor Gyolchanyan =D0=BD=D0= =B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div class=3D"im"> On Tue, May 15, 2012 at 8:07 PM, Kagamin &lt;spam here.lot<br></div><div><d= iv class=3D"h5"> &lt;mailto:<a href=3D"mailto:spam here.lot" target=3D"_blank">spam here.lot= </a>&gt;&gt; wrote:<br> <br> =C2=A0 =C2=A0Manifests are extensible resources, they are used for various= things<br> =C2=A0 =C2=A0which require storing metadata in executable modules, for exa= mple<br> =C2=A0 =C2=A0they&#39;re used to load version 6 of comctl32.dll instead of= version 5<br> =C2=A0 =C2=A0(pre-XP), thus getting different set of common controls, whic= h<br> =C2=A0 =C2=A0support ux themes.<br> <br> <br></div></div><div class=3D"im"> Thanks for the reply! How do I include such a manifest to my DMD-built<br> executable?<br> <br> --<br> Bye,<br> Gor Gyolchanyan.<br> </div></blockquote> <br> An example of my own preferred configuration:<br> <a href=3D"http://deoma-cmd.ru/files/other/DWinResExample.7z" target=3D"_bl= ank">http://deoma-cmd.ru/files/<u></u>other/DWinResExample.7z</a><br> <br> Everything in common folder is really common.<br> <br> `requestedExecutionLevel` should be also defined in manifest or Windows 6.x= &#39;s UAC will use heuristics to choose required privilege level.<span cla= ss=3D"HOEnZb"><font color=3D"#888888"><br> <br> -- <br> =D0=94=D0=B5=D0=BD=D0=B8=D1=81 =D0=92. =D0=A8=D0=B5=D0=BB=D0=BE=D0=BC=D0=BE= =D0=B2=D1=81=D0=BA=D0=B8=D0=B9<br> Denis V. Shelomovskij<br> </font></span></blockquote></div><br><br clear=3D"all"><div><br></div>-- <b= r>Bye,<br>Gor Gyolchanyan.<br> </div> --f46d040714c54dd27504c01716d8--
May 15 2012
prev sibling next sibling parent Andrej Mitrovic <andrej.mitrovich gmail.com> writes:
On 5/15/12, Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> wrote:
 But what do windows resources have to do with the manifests?

You use a resource file to load a manifest into the executable. There are a couple of examples here: https://github.com/AndrejMitrovic/DWinProgramming/tree/master/Samples/Extra/VisualStyles https://github.com/AndrejMitrovic/DWinProgramming/tree/master/Samples/Extra/VisualStyles2 https://github.com/AndrejMitrovic/DWinProgramming/tree/master/Samples/Extra/ThemedSimpleWakeUp https://github.com/AndrejMitrovic/DWinProgramming/tree/master/Samples/Extra/ThemedWakeUp enable-theme.xml is the manifest, and resource.rc just references this xml file. The resource file is compiled into a .res file, and this file is then passed directly to DMD. For your own purposes try to just take the .rc/.res/.xml files, pass .res to dmd when compiling your app and see if the visual styles work for you. The last example loads the manifest dynamically, based on a sample from the DFL library.
May 15 2012
prev sibling next sibling parent Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> writes:
--bcaec554deb223d67e04c01957f6
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

Thanks a lot! I'll look into it!

On Tue, May 15, 2012 at 11:21 PM, Denis Shelomovskij <
verylonglogin.reg gmail.com> wrote:

 15.05.2012 22:08, Gor Gyolchanyan =D0=BD=D0=B0=D0=BF=D0=B8=D1=81=D0=B0=D0=

  Thanks!
 It doesn't compile. After I fixed the path to the Windows SDK, I got the
 error: C:\Program Files (x86)\Microsoft
 SDKs\Windows\v7.0A\Include\**SpecStrings.h(11) : fatal error RC1015:
 cannot open include file 'sal.h'

Looks like you didn't change `/i"%ProgramFiles%\Microsoft Visual Studio 9.0\VC\include"` to your path (sal.h is there) or you hasn't it installed=

 --
 =D0=94=D0=B5=D0=BD=D0=B8=D1=81 =D0=92. =D0=A8=D0=B5=D0=BB=D0=BE=D0=BC=D0=

 Denis V. Shelomovskij

--=20 Bye, Gor Gyolchanyan. --bcaec554deb223d67e04c01957f6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Thanks a lot! I&#39;ll look into it!<div><br><div class=3D"gmail_quote">On = Tue, May 15, 2012 at 11:21 PM, Denis Shelomovskij <span dir=3D"ltr">&lt;<a = href=3D"mailto:verylonglogin.reg gmail.com" target=3D"_blank">verylonglogin= .reg gmail.com</a>&gt;</span> wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex">15.05.2012 22:08, Gor Gyolchanyan =D0=BD=D0= =B0=D0=BF=D0=B8=D1=81=D0=B0=D0=BB:<div class=3D"im"><br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> Thanks!<br> It doesn&#39;t compile. After I fixed the path to the Windows SDK, I got th= e<br> error: C:\Program Files (x86)\Microsoft<br> SDKs\Windows\v7.0A\Include\<u></u>SpecStrings.h(11) : fatal error RC1015:<b= r> cannot open include file &#39;sal.h&#39;<br> </blockquote> <br></div> Looks like you didn&#39;t change `/i&quot;%ProgramFiles%\Microsoft Visual S= tudio 9.0\VC\include&quot;` to your path (sal.h is there) or you hasn&#39;t= it installed.<div class=3D"HOEnZb"><div class=3D"h5"><br> <br> -- <br> =D0=94=D0=B5=D0=BD=D0=B8=D1=81 =D0=92. =D0=A8=D0=B5=D0=BB=D0=BE=D0=BC=D0=BE= =D0=B2=D1=81=D0=BA=D0=B8=D0=B9<br> Denis V. Shelomovskij<br> </div></div></blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>= Bye,<br>Gor Gyolchanyan.<br> </div> --bcaec554deb223d67e04c01957f6--
May 15 2012
prev sibling next sibling parent "Mehrdad" <wfunction hotmail.com> writes:
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. :-)
May 15 2012
prev sibling next sibling parent Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> writes:
--f46d040714c57b6f8504c022eee7
Content-Type: text/plain; charset=UTF-8

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 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. --f46d040714c57b6f8504c022eee7 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable So, this function basically does... uhh.... I have no idea. :-D<div>What ex= actly does it do again?=C2=A0<br><br><div class=3D"gmail_quote">On Wed, May= 16, 2012 at 7:44 AM, Mehrdad <span dir=3D"ltr">&lt;<a href=3D"mailto:wfunc= tion hotmail.com" target=3D"_blank">wfunction hotmail.com</a>&gt;</span> wr= ote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"><div class=3D"im">On Tuesday, 15 May 2012 at= 14:03:47 UTC, Gor Gyolchanyan wrote:<br> <blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1p= x #ccc solid;padding-left:1ex"> 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 butt= ons and how to use them with DMD?<br> </blockquote> <br></div> Just FYI, you don&#39;t actually *need* to include manifests in your execut= able, if you know another DLL already has them.<br> <br> Here&#39;s a hack to show what I mean, for enabling visual styles:<br> <br> void enableVisualStyles()<br> {<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0TCHAR[MAX_PATH] dir;<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0dir[GetSystemDirectory(dir.<u></u>ptr, dir.leng= th)] =3D &#39;\0&#39;;<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0enum<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0{<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ACTCTX_FLAG_ASSEMBL= Y_<u></u>DIRECTORY_VALID =3D 0x00000004,<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ACTCTX_FLAG_RESOURC= E_NAME_<u></u>VALID =3D 0x00000008,<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ACTCTX_FLAG_SET_PRO= CESS_<u></u>DEFAULT =3D 0x00000010,<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0}<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0auto actCtx =3D ACTCTX(ACTCTX.sizeof,<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ACTCTX_FLAG_RESOURC= E_NAME_<u></u>VALID |<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ACTCTX_FLAG_SET_PRO= CESS_<u></u>DEFAULT |<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0ACTCTX_FLAG_ASSEMBL= Y_<u></u>DIRECTORY_VALID,<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0&quot;shell32.dll&q= uot;, PROCESSOR_ARCHITECTURE_INTEL,<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A00, dir.ptr, MAKEINT= RESOURCE(124), null, null);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0auto hActCtx =3D CreateActCtx(actCtx);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0assert(hActCtx !=3D INVALID_HANDLE_VALUE);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0ULONG_PTR ulpActivationCookie;<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0BOOL success =3D ActivateActCtx(hActCtx, ulpAct= ivationCookie);<br> =C2=A0 =C2=A0 =C2=A0 =C2=A0assert(success);<br> }<br> <br> Basically, since shell32.dll already has our manifest, I can just call this= function instead. :-)<br> </blockquote></div><br><br clear=3D"all"><div><br></div>-- <br>Bye,<br>Gor = Gyolchanyan.<br> </div> --f46d040714c57b6f8504c022eee7--
May 16 2012
prev sibling next sibling parent "Mehrdad" <wfunction hotmail.com> writes:
On Wednesday, 16 May 2012 at 08:16:20 UTC, Gor Gyolchanyan wrote:
 So, this function basically does... uhh.... I have no idea. :-D
 What exactly does it do again?

Uh, it enableVisualStyles(). Without a manifest. :P
May 16 2012
prev sibling parent Gor Gyolchanyan <gor.f.gyolchanyan gmail.com> writes:
--bcaec54c52a04fb8d404c02453b3
Content-Type: text/plain; charset=UTF-8

That is beyond cool! Thank you very much!!!

On Wed, May 16, 2012 at 1:39 PM, Mehrdad <wfunction hotmail.com> wrote:

 On Wednesday, 16 May 2012 at 08:16:20 UTC, Gor Gyolchanyan wrote:

 So, this function basically does... uhh.... I have no idea. :-D
 What exactly does it do again?

Uh, it enableVisualStyles(). Without a manifest. :P

-- Bye, Gor Gyolchanyan. --bcaec54c52a04fb8d404c02453b3 Content-Type: text/html; charset=UTF-8 That is beyond cool! Thank you very much!!!<div><br><div class="gmail_quote">On Wed, May 16, 2012 at 1:39 PM, Mehrdad <span dir="ltr">&lt;<a href="mailto:wfunction hotmail.com" target="_blank">wfunction hotmail.com</a>&gt;</span> wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wednesday, 16 May 2012 at 08:16:20 UTC, Gor Gyolchanyan wrote:<br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> So, this function basically does... uhh.... I have no idea. :-D<br> What exactly does it do again?<br> </blockquote> <br> <br></div> Uh, it enableVisualStyles().<br> Without a manifest. :P<br> </blockquote></div><br><br clear="all"><div><br></div>-- <br>Bye,<br>Gor Gyolchanyan.<br> </div> --bcaec54c52a04fb8d404c02453b3--
May 16 2012