flat assembler
Message board for the users of flat assembler.

Index > Windows > How to set a xp manifest sigh?

Author
Thread Post new topic Reply to topic
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
section '.rsrc' resource from 'res1.res' data readable

directory 24,manifest
resource manifest,\
1,LANG_NEUTRAL,man
resdata man
db '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',13,10
db '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">',13,10
db '<assemblyIdentity name="x.x.x" processorArchitecture="x86" version="5.1.0.0" type="win32"/> ',13,10
db '<description>no</description>',13,10
db '<dependency>',13,10
db '<dependentAssembly>',13,10
db '<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" />',13,10
db '</dependentAssembly>',13,10
db '</dependency>',13,10
db '</assembly>',13,10
endres





This is what I have...I used this


begin:
invoke GetModuleHandle,0
mov [gIst],eax

invoke InitCommonControls
invoke DialogBoxParam,eax,MAINDLG,0,DlgProc,0

invoke ExitProcess,0

It won't set the damn manifest.... Anyone have a example?
Post 06 Nov 2005, 01:40
View user's profile Send private message Reply with quote
Reverend



Joined: 24 Aug 2004
Posts: 408
Location: Poland
Reverend
Post 06 Nov 2005, 17:03
View user's profile Send private message Visit poster's website Reply with quote
BXM



Joined: 03 Nov 2005
Posts: 26
Location: mars
BXM
Here's how to update the example /FASM/EXAMPLES/DIALOG

This code is from an elder update of Thomas Grysztar but today obsolete due to the evolution of FASM syntax http://board.flatassembler.net/topic.php?t=170

Ok here we go. Open the folder /FASM/EXAMPLES/DIALOG
Add a new file called manifest.xml which contains

Code:
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly
   xmlns="urn:schemas-microsoft-com:asm.v1"
   manifestVersion="1.0">
<assemblyIdentity
    processorArchitecture="x86"
    version="5.1.0.0"
    type="win32"
    name="DIALOG.exe"/>
    <description>Mx XP Program</description>
    <dependency>
    <dependentAssembly>
    <assemblyIdentity
         type="win32"
         name="Microsoft.Windows.Common-Controls"
         version="6.0.0.0"
         publicKeyToken="6595b64144ccf1df"
         language="*"
         processorArchitecture="x86"/>
    </dependentAssembly>
    </dependency>
</assembly>    

Now Open DIALOG.ASM it is in /FASM/EXAMPLES/DIALOG
After label "start:" just above "invoke GetModuleHandle,0" add:
Code:
invoke  InitCommonControls    

In section '.idata' add a new library (Dont forget the ,\ to continue the same line):
Code:
comctl,'COMCTL32.DLL'    

To declare the function we want to import (that we invoked at the beginning) add after the imports from user:
Code:
  import comctl,\
         InitCommonControls,'InitCommonControls    

Lastly in the section '.rsrc' add
Code:
RT_MANIFEST = 24    

Modify the line
Code:
directory RT_DIALOG,dialogs    

So that it looks like this:
Code:
  directory RT_DIALOG,dialogs,\
            RT_MANIFEST,manifests    

Then add a new ressource entry:
Code:
  resource manifests,\
           1,LANG_ENGLISH+SUBLANG_DEFAULT,manifest    

At the very end of the file add
Code:
  resdata manifest
    file 'manifest.xml'
  endres    

At this point, the code is ready for compile.
But you can have the same result without an external XML file:
Just modify the latest section "resdata manifest"
to be like this:
Code:
  resdata manifest
   db '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',13,10
   db '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">',13,10
   db '<assemblyIdentity name="DIALOG2.exe" processorArchitecture="x86" version="5.1.0.0" type="win32"/> ',13,10
   db '<description>no</description>',13,10
   db '<dependency>',13,10
   db '<dependentAssembly>',13,10
   db '<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" />',13,10
   db '</dependentAssembly>',13,10
   db '</dependency>',13,10
   db '</assembly>',13,10
  endres    

In both cases you won't need to release the XML file with your application as the XML code is embedded in the exe.
Post 06 Nov 2005, 19:00
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
C:\Documents and Settings\Owner\Desktop\crap\fasmexp\freaker.asm [331]:
directory RT_DIALOG,dialogs,\
C:\WinAsm\Assemblers\fasm\INCLUDE\macro/resource.inc [19] directory [14]:
dd type,80000000h+label-root@resource
error: undefined symbol.



This is what I have right now..

section '.rsrc' resource from 'res1.res' data readable
RT_MANIFEST = 24

directory RT_DIALOG,dialogs,\
RT_MANIFEST,manifests
resource manifests,\
1,LANG_ENGLISH+SUBLANG_DEFAULT,manifest


resdata manifest
db '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>',13,10
db '<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">',13,10
db '<assemblyIdentity name="DIALOG2.exe" processorArchitecture="x86" version="5.1.0.0" type="win32"/> ',13,10
db '<description>no</description>',13,10
db '<dependency>',13,10
db '<dependentAssembly>',13,10
db '<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="x86" publicKeyToken="6595b64144ccf1df" language="*" />',13,10
db '</dependentAssembly>',13,10
db '</dependency>',13,10
db '</assembly>',13,10
endres
Post 06 Nov 2005, 23:22
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Here is a converted fasmw examlple that uses the WindowsXP '.xml' style sheet.
Post 07 Nov 2005, 06:58
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
App just closes...Doesn't even start

where you do the cmp eax,0
after dialogparama.. eax = FFFFFFFF
Post 07 Nov 2005, 20:38
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
So Im guessing it doesnt work with external resources?
Post 08 Nov 2005, 01:51
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Here's an even simpler example. Run the executable first, and see if this works. Shouldn't try to recompile the code, I modified many things in my include files/macros. Just gave the source so you can have an idea of how to do it.
Post 08 Nov 2005, 08:57
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
Messagebox doesn't appear.. I don't understand why this isn't working damnit.
Post 08 Nov 2005, 21:06
View user's profile Send private message Reply with quote
decard



Joined: 11 Sep 2003
Posts: 1092
Location: Poland
decard
well, it appears on my system
Post 08 Nov 2005, 22:01
View user's profile Send private message Visit poster's website Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
What could make this not appear?
Post 09 Nov 2005, 00:18
View user's profile Send private message Reply with quote
BXM



Joined: 03 Nov 2005
Posts: 26
Location: mars
BXM
Sorry that I followed a certain step by step tutorial to recompile FASMW: it is cool. (By the way the exe is 112Kb, compiled in 0.3 seconds... ;^)

Perhaps you have an older compiler?
Post 09 Nov 2005, 00:30
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
I have the newest one ... I don't understand why it won't execute ... It's very odd.. Does it work for everyone?
Post 09 Nov 2005, 00:42
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Sorry your having so much trouble shism2. Try copying the resource info from my hello example into your hello example that came with fasm. Then recompile using your compiler setup. You can also try turning off your anti-virus software temporarly.
Post 09 Nov 2005, 03:22
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
ya I did try that but the same thing happens. Anyone have any ideas why this is happening?


FIXED :

On sp2 it seems invoke InitCommonControls is not needed

I run sp1 and a call to invoke InitCommonControls is needed before any xp styles can be displayed ( the messagebox)
Post 09 Nov 2005, 03:44
View user's profile Send private message Reply with quote
vbVeryBeginner



Joined: 15 Aug 2004
Posts: 884
Location: \\world\asia\malaysia
vbVeryBeginner
Quote:
I run sp1 and a call to invoke InitCommonControls is needed before any xp styles can be displayed ( the messagebox)


then they are wrong
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/commctls/common/functions/initcommoncontrolsex.asp
msdn wrote:

Windows XP: If a manifest is used, InitCommonControlsEx is not required.
Post 09 Nov 2005, 04:22
View user's profile Send private message Visit poster's website Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
That is a different api Smile and either way I tested it and that's how it works on mine


on sp1 if I don't use initcommoncontrols the messagebox doesn't even pop up. While sp2 I don't have to use the api
Post 09 Nov 2005, 04:39
View user's profile Send private message Reply with quote
madmatt



Joined: 07 Oct 2003
Posts: 1045
Location: Michigan, USA
madmatt
Glad you got it working Very Happy! So I can understand this, sp1 (and earlier?) requires a call to initcommoncontrols so you can see the new features, but in sp2 the function is not needed? Never would have accured to me that this was the problem.
Post 09 Nov 2005, 22:57
View user's profile Send private message Reply with quote
shism2



Joined: 14 Sep 2005
Posts: 248
shism2
You are using sp2?

It was really just luck I figured it out.. I remember someone before told me to use that api and I tried it and WELL it worked !
Post 09 Nov 2005, 23:53
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2020, Tomasz Grysztar.

Powered by rwasa.