flat assembler
Message board for the users of flat assembler.
Index
> Windows > New style windows??? Goto page 1, 2 Next |
Author |
|
sinsi 16 Feb 2008, 02:01
Search for "manifest"
|
|||
16 Feb 2008, 02:01 |
|
itsnobody 16 Feb 2008, 02:19
thanks
I got it working when I place the XML in the same directory, but how do I get it working using a resource file? The MSDN says use: CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "YourApp.exe.manifest" I tried: Code: section '.rsrc' resource data readable directory RT_MANIFEST,manifest resdata manifest file 'YourApp.exe.manifest' endres But it didn't work, although placing the XML in the same directory still works.... |
|||
16 Feb 2008, 02:19 |
|
sinsi 16 Feb 2008, 02:52
You also need to call InitCommonControls, although looking here suggests maybe just importing it is OK.
|
|||
16 Feb 2008, 02:52 |
|
itsnobody 16 Feb 2008, 03:00
sinsi wrote: You also need to call InitCommonControls, although looking here suggests maybe just importing it is OK. I called InitCommonControls and it works perfectly when I put the manifest file in the same directory Thanks I found the problem it was with how I did the resource file |
|||
16 Feb 2008, 03:00 |
|
itsnobody 16 Feb 2008, 03:35
I got everything working with the file, now I'm trying to get it to work without using a file...
Why doesn't this work: Code: section '.rsrc' resource data readable directory 24,manifest resource manifest,\ 1, LANG_NEUTRAL, winxp resdata winxp ; file 'manifest.xml' 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',13,10 db 'version="1.0.0.0"',13,10 db 'processorArchitecture="X86"',13,10 db 'name="CompanyName.ProductName.Application"',13,10 db 'type="win32"',13,10 db '/>',13,10 db '<description>Your application description here.</description>',13,10 db '<dependency>',13,10 db '<dependentAssembly>',13,10 db '<assemblyIdentity',13,10 db 'type="win32"',13,10 db 'name="Microsoft.Windows.Common-Controls"',13,10 db 'version="6.0.0.0"',13,10 db 'processorArchitecture="X86"',13,10 db 'publicKeyToken="6595b64144ccf1df"',13,10 db 'language="*"',13,10 db '/>',13,10 db '</dependentAssembly>',13,10 db '</dependency>',13,10 db '</assembly>',0 endres |
|||
16 Feb 2008, 03:35 |
|
MHajduk 16 Feb 2008, 10:43
itsnobody wrote: Why doesn't this work Code: db '</assembly>',0 Code: db '</assembly>' Code: ; DialogBox example format PE GUI 4.0 include '%fasminc%\win32wx.inc' ID_CAPTION = 101 ID_MESSAGE = 102 ID_ICONERROR = 201 ID_ICONINFORMATION = 202 ID_ICONQUESTION = 203 ID_ICONWARNING = 204 ID_TOPMOST = 301 section '.data' data readable writeable flags dd ? caption rb 40h message rb 100h section '.code' code readable executable start: invoke GetModuleHandle,0 invoke DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc,0 or eax,eax jz exit invoke MessageBox,HWND_DESKTOP,message,caption,[flags] exit: invoke ExitProcess,0 invoke InitCommonControls proc DialogProc hwnddlg,msg,wparam,lparam push ebx esi edi cmp [msg],WM_INITDIALOG je .wminitdialog cmp [msg],WM_COMMAND je .wmcommand cmp [msg],WM_CLOSE je .wmclose xor eax,eax jmp .finish .wminitdialog: invoke CheckRadioButton,[hwnddlg],ID_ICONERROR,ID_ICONWARNING,ID_ICONINFORMATION jmp .processed .wmcommand: cmp [wparam],BN_CLICKED shl 16 + IDCANCEL je .wmclose cmp [wparam],BN_CLICKED shl 16 + IDOK jne .processed invoke GetDlgItemText,[hwnddlg],ID_CAPTION,caption,40h invoke GetDlgItemText,[hwnddlg],ID_MESSAGE,message,100h mov [flags],MB_OK invoke IsDlgButtonChecked,[hwnddlg],ID_ICONERROR cmp eax,BST_CHECKED jne .iconerror_ok or [flags],MB_ICONERROR .iconerror_ok: invoke IsDlgButtonChecked,[hwnddlg],ID_ICONINFORMATION cmp eax,BST_CHECKED jne .iconinformation_ok or [flags],MB_ICONINFORMATION .iconinformation_ok: invoke IsDlgButtonChecked,[hwnddlg],ID_ICONQUESTION cmp eax,BST_CHECKED jne .iconquestion_ok or [flags],MB_ICONQUESTION .iconquestion_ok: invoke IsDlgButtonChecked,[hwnddlg],ID_ICONWARNING cmp eax,BST_CHECKED jne .iconwarning_ok or [flags],MB_ICONWARNING .iconwarning_ok: invoke IsDlgButtonChecked,[hwnddlg],ID_TOPMOST cmp eax,BST_CHECKED jne .topmost_ok or [flags],MB_TOPMOST .topmost_ok: invoke EndDialog,[hwnddlg],1 jmp .processed .wmclose: invoke EndDialog,[hwnddlg],0 .processed: mov eax,1 .finish: pop edi esi ebx ret endp .end start section '.rsrc' resource data readable directory RT_DIALOG,dialogs,\ 24,manifest resource manifest,\ 1, LANG_NEUTRAL, winxp resource dialogs,\ 37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration dialog demonstration,'Create message box',70,70,190,175,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME dialogitem 'STATIC','&Caption:',-1,10,10,70,8,WS_VISIBLE dialogitem 'EDIT','',ID_CAPTION,10,20,170,13,WS_VISIBLE+WS_BORDER+WS_TABSTOP dialogitem 'STATIC','&Message:',-1,10,40,70,8,WS_VISIBLE dialogitem 'EDIT','',ID_MESSAGE,10,50,170,13,WS_VISIBLE+WS_BORDER+WS_TABSTOP+ES_AUTOHSCROLL dialogitem 'BUTTON','&Icon',-1,10,70,80,70,WS_VISIBLE+BS_GROUPBOX dialogitem 'BUTTON','&Error',ID_ICONERROR,20,82,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON+WS_TABSTOP+WS_GROUP dialogitem 'BUTTON','I&nformation',ID_ICONINFORMATION,20,95,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON dialogitem 'BUTTON','&Question',ID_ICONQUESTION,20,108,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON dialogitem 'BUTTON','&Warning',ID_ICONWARNING,20,121,60,13,WS_VISIBLE+BS_AUTORADIOBUTTON dialogitem 'BUTTON','&Style',-1,100,70,80,70,WS_VISIBLE+BS_GROUPBOX dialogitem 'BUTTON','&Top most',ID_TOPMOST,110,82,60,13,WS_VISIBLE+WS_TABSTOP+BS_AUTOCHECKBOX dialogitem 'BUTTON','OK',IDOK,85,150,45,15,WS_VISIBLE+WS_TABSTOP+BS_DEFPUSHBUTTON dialogitem 'BUTTON','C&ancel',IDCANCEL,135,150,45,15,WS_VISIBLE+WS_TABSTOP+BS_PUSHBUTTON enddialog resdata winxp ;file 'manifest.xml' 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',13,10 db 'version="1.0.0.0"',13,10 db 'processorArchitecture="X86"',13,10 db 'name="CompanyName.ProductName.Application"',13,10 db 'type="win32"',13,10 db '/>',13,10 db '<description>Your application description here.</description>',13,10 db '<dependency>',13,10 db '<dependentAssembly>',13,10 db '<assemblyIdentity',13,10 db 'type="win32"',13,10 db 'name="Microsoft.Windows.Common-Controls"',13,10 db 'version="6.0.0.0"',13,10 db 'processorArchitecture="X86"',13,10 db 'publicKeyToken="6595b64144ccf1df"',13,10 db 'language="*"',13,10 db '/>',13,10 db '</dependentAssembly>',13,10 db '</dependency>',13,10 db '</assembly>' endres |
|||
16 Feb 2008, 10:43 |
|
itsnobody 16 Feb 2008, 11:23
MHajduk wrote:
Thanks it works perfectly, it's a lot better than using a file |
|||
16 Feb 2008, 11:23 |
|
revolution 16 Feb 2008, 11:39
Below is what I see on my WinXPSP2 box, what do you see?
|
|||
16 Feb 2008, 11:39 |
|
itsnobody 16 Feb 2008, 11:47
revolution wrote: Below is what I see on my WinXPSP2 box, what do you see? hmm probably because WinXPSP2 requires you to InitCommonControls first. Without the manifest it looks just like yours. on Windows Vista I see:
|
||||||||||
16 Feb 2008, 11:47 |
|
revolution 16 Feb 2008, 11:52
itsnobody wrote: hmm probably because WinXPSP2 requires you to InitCommonControls first. |
|||
16 Feb 2008, 11:52 |
|
itsnobody 16 Feb 2008, 11:58
revolution wrote:
No it supposed to work for XP too, unless you have your theme on XP set to only have classic style buttons (source http://www.vbaccelerator.com/home/vb/code/libraries/XP_Visual_Styles/Using_XP_Visual_Styles_in_VB/article.asp ) Try this: Code: s: init INITCOMMONCONTROLSEX t-s,0xFF+0x200+4000;ICC_WIN95_CLASSES+ICC_USEREX_CLASSES+ICC_STANDARD_CLASSES t: Code:
invoke InitCommonControlsEx,init
Does that change anything? |
|||
16 Feb 2008, 11:58 |
|
revolution 16 Feb 2008, 12:35
I do have my theme as classic style buttons.
The extra "InitCommonControlSex" thing gives no change at all. |
|||
16 Feb 2008, 12:35 |
|
MHajduk 16 Feb 2008, 12:35
revolution
On my Windows XP SP2 it works correct. As itsnobody said, you should check settings of windows display ('classic style' or 'XP style').
|
||||||||||
16 Feb 2008, 12:35 |
|
itsnobody 16 Feb 2008, 12:39
revolution wrote: I do have my theme as classic style buttons. Hmm...then InitCommonControls is pretty useless, unless you need for other controls |
|||
16 Feb 2008, 12:39 |
|
f0dder 16 Feb 2008, 14:13
You ought to call InitCommonControlsEx . Don't think that just because not calling it works on some windows systems, it will work on all.
|
|||
16 Feb 2008, 14:13 |
|
revolution 16 Feb 2008, 14:46
f0dder: That link is true for C/HLLs, because the compiler is trying to be smart and optimise away an unused reference to a DLL. In assembly we can easily force a DLL to be included without really having to call a function.
Code: virtual call InitCommonControls end virtual |
|||
16 Feb 2008, 14:46 |
|
f0dder 16 Feb 2008, 16:31
I think you missed my point, revolution. That just because not calilng InitCommonControls() isn't necessary on your windows version doesn't mean it'll always be that way.
And for the windows versions where it doesn't do anything, what the fuck is the problem of calling it, anyway? You only need it once at startup, and if it just does "ret", you're not really wasting any time. People applying idiotic "optimizations" like this is one of the major reasons that software breaks on, for instance, 64-bit windows versions, or non-admin accounts. |
|||
16 Feb 2008, 16:31 |
|
revolution 16 Feb 2008, 16:55
It is probably just the thought of doing unnecessary things that makes some people want to "stop the nonsense". InitCommonControls only exists because of the HLL optimisation layer. If the HLL did not optimise then things like InitCommonControls would never be needed.
I kind of view assembly as the ultimate level of optimisation, and it is probably habit that has made me mindful of wasted things. But I am not arguing against you, you are correct, one simple call to InitCommonControls shoulld be a no-brainer. |
|||
16 Feb 2008, 16:55 |
|
f0dder 16 Feb 2008, 17:04
revolution wrote: It is probably just the thought of doing unnecessary things that makes some people want to "stop the nonsense". InitCommonControls only exists because of the HLL optimisation layer. If the HLL did not optimise then things like InitCommonControls would never be needed. No, you are inferring that from how windows works today. MSDN/PlatformSDK doesn't say that "you only need to make sure comctl32.dll is loaded, you don't need to call InitCommonControls()". But of course there's a good chance that InitCommonControls will never ever do anything, because so many people have been following foolish advice. |
|||
16 Feb 2008, 17:04 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.