flat assembler
Message board for the users of flat assembler.
![]() Goto page 1, 2 Next |
Author |
|
revolution 09 Jun 2022, 13:18
You need a manifest in your exe to enable the newer window styles.
There are some old topics about it on this board. |
|||
![]() |
|
revolution 09 Jun 2022, 13:24
|
|||
![]() |
|
FlierMate1 09 Jun 2022, 13:45
Thank you!
Code: format PE GUI 4.0 entry start include 'win32a.inc' section '.data' readable writable title db 'FASM',0 message db 'Thank you Tomasz and revolution for making this possible!',0 section '.code' code readable writable executable start: push 0x40 push title push message push 0 call [MessageBox] push eax call [ExitProcess] section '.idata' import readable writable library kernel,'KERNEL32.DLL',\ user,'USER32.DLL' import kernel,\ ExitProcess,'ExitProcess' import user,\ MessageBox,'MessageBoxA' 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>' endres
|
||||||||||
![]() |
|
Mat-Quasar 10 Apr 2025, 04:00
To my surprise, explicitly stating "PE GUI 4.0" or "PE GUI" has different UI layout for Win32 dialog.
"PE GUI 4.0" is Win95 look, while "PE GUI" is all white. Does anyone know what does the "4.0" mean? All white is Win3.11?
|
|||||||||||||||||||
![]() |
|
revolution 10 Apr 2025, 04:46
IIRC "4.0" means you declare your application is capable of using Win95 APIs.
Naturally "5.0" means your application knows about younger versions of Windows APIs for GUI controls. And so on for higher numbers. Try some other values and see what happens. 0.0? 9.9? 57.57 |
|||
![]() |
|
Mat-Quasar 10 Apr 2025, 05:00
revolution wrote: IIRC "4.0" means you declare your application is capable of using Win95 APIs. Thanks for your reply. I tried, the only valid ranges are PE GUI 4.0, PE GUI 5.0 and PE GUI 6.0 and all are 95-look. PE GUI 0.0 to PE GUI 3.0 don't run. If I use PE GUI 0 to PE GUI 3 (without decimal places) then FASMW complains invalid value. Value higher than 6.0, e.g. PE GUI 7.0 to PE GUI 10.0 are having error message (see screenshot below). So only Windows 3.11-look (?) and Windows 95 look.
|
||||||||||
![]() |
|
Mat-Quasar 10 Apr 2025, 05:01
I think it is OS major version and minor version?
|
|||
![]() |
|
revolution 10 Apr 2025, 05:06
It's GUI version, not OS version.
See the second post above if you want other styles enabled by versions higher than 4.0. |
|||
![]() |
|
Mat-Quasar 10 Apr 2025, 06:58
revolution wrote:
Yes, I included the manifest and now it has a XP-look.
|
||||||||||
![]() |
|
Mat-Quasar 10 Apr 2025, 07:08
Found an old thread, Roman asked a similar question before:
https://board.flatassembler.net/topic.php?t=21290 |
|||
![]() |
|
Tomasz Grysztar 10 Apr 2025, 07:12
Mat-Quasar wrote: I tried, the only valid ranges are PE GUI 4.0, PE GUI 5.0 and PE GUI 6.0 and all are 95-look. For this reason, the first Win32 PE executables that existed had subsystem version 3.1 - interestingly, marked with byte values 3 and 10 (see my PE tutorial). With the introduction of the new "Chicago" interface in Windows 95 and Windows NT 4.0 the windows got a new look, which was the first such substantial change in their appearance. Only the executables created specifically for new systems, marked with subsystem version 4.0, were allowed to have this appearance, therefore old programs would keep looking similar to what they looked in the past. Windows XP (5.0) introduced the manifest file/resource, and it became the preferred way for executables to specify their compatibility. That's why the subsystem versions 5.0 and higher have no further effect on the appearance. |
|||
![]() |
|
Mat-Quasar 10 Apr 2025, 07:33
Ooh, now I understand, "format PE GUI 3.1" is actually "format PE GUI".
I also understand subsystem higher than 4.0 use manifest file/resource. All is clear now. Thank you Tomasz for your helpful explanation. |
|||
![]() |
|
Tomasz Grysztar 10 Apr 2025, 07:57
Wait, Windows XP was actually 5.1, 5.0 was Windows 2000.
|
|||
![]() |
|
Ali.Z 10 Apr 2025, 09:32
keep in mind you can use any valid version combo even without manifest file, it does affect visual styes for dialog boxes, and message box is dialog box.
the system does not manage visuals for normal window controls, that is, parent of a control that do not belong to dialog box class atom. edit: also for completeness, here is a list of valid Major/Minor subsystem versions in Optional header: - 3.10 - 3.51 - 4.0 - 5.0 - 5.1 - 6.0 - 6.1 - 6.2 depending on version, you may get different visuals for your dialogs without a manifest; with a manifest you can get more stuff. _________________ Asm For Wise Humans |
|||
![]() |
|
Mat-Quasar 10 Apr 2025, 11:55
Tomasz Grysztar wrote: Wait, Windows XP was actually 5.1, 5.0 was Windows 2000. Just now I edit the formatter syntax for my program (without XP manifest) in Windows XP Pro SP3 to "PE GUI 5.1", it cannot run, and showed an error message (see screenshot). But if I set to "PE GUI 5.0" then it is okay.
Last edited by Mat-Quasar on 10 Apr 2025, 12:04; edited 2 times in total |
||||||||||
![]() |
|
Mat-Quasar 10 Apr 2025, 11:58
Ali.Z wrote:
Thanks! Useful info. I get only three styles in Windows 10, 95-look for PE GUI 4.0, 5.0, 5.1 and 6.0. PE GUI 6.1 and 6.2 are not supported in this laptop. And also Windows 3.1 style for PE GUI 3.1 and 3.51 (or even 3.52 also work). And lastly XP style using manifest resource.
|
||||||||||
![]() |
|
Ali.Z 10 Apr 2025, 12:12
Mat-Quasar wrote: (without XP manifest) in Windows XP Pro SP3 to "PE GUI 5.1", it cannot run, and showed an error message (see screenshot). that is weird, for me it runs fine under xp pro sp3. _________________ Asm For Wise Humans |
|||
![]() |
|
Mat-Quasar 10 Apr 2025, 12:28
Ali.Z wrote:
Strange indeed, I only managed to get "PE GUI 5.1" to run for once only, after I mess it with PE GUI 6.0 and PE GUI 5.0 back and forth, the PE GUI 5.1 was not working anymore. As I check from "winver", this copy of Windows XP is indeed 5.1.
|
||||||||||
![]() |
|
Ali.Z 10 Apr 2025, 12:57
perhaps you want to validate your PE.
![]() _________________ Asm For Wise Humans |
|||
![]() |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.