flat assembler
Message board for the users of flat assembler.
![]() |
How do you include resources in your windows app's? | ||||||||||||||
|
||||||||||||||
Total Votes : 18 |
Author |
|
RedGhost 07 Feb 2006, 04:01
i used to just add the .res as i got used to it for nasm, C and etc, but now i try my hardest to not use a resource section and do it all manually but when i 'have' to i just use the fasm-specific stuff now
_________________ redghost.ca |
|||
![]() |
|
vid 07 Feb 2006, 10:24
OzzY wrote: Is there any tutorial on FASM Resources Macros? http://flatassembler.net/docs.php?article=win32#1.6 |
|||
![]() |
|
OzzY 08 Feb 2006, 18:19
If FASM used the same parameter order it would be very easy to include resources in asm code.
![]() Anyway, I'm liking to use FASM resource macros. SAMPLE CODE: Code: include '%fasminc%\win32ax.inc' ;equates MAINDLG = 1 IDOK = 2 IDEDIT = 3 .data ;resources data resource directory RT_DIALOG, dialogs resource dialogs,\ MAINDLG,LANG_NEUTRAL,maindlg dialog maindlg,"My Dialog",6, 18, 258, 34,WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_VISIBLE+DS_CENTER dialogitem "Button","OK", IDOK, 196, 12, 45, 12,WS_TABSTOP+WS_VISIBLE dialogitem "Edit","", IDEDIT, 8, 12, 188, 12, ES_AUTOHSCROLL+WS_BORDER+WS_VISIBLE enddialog end data ;end resources ;data buff rb 80 .code ;begin code ;Not using invoke just to remember the old days FASM RESOURCE MACROS VERSION: Code: directory RT_DIALOG, dialogs resource dialogs,\ MAINDLG,LANG_NEUTRAL,maindlg dialog maindlg,"My Dialog",6, 18, 258, 34,WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_VISIBLE+DS_CENTER dialogitem "Button","OK", IDOK, 196, 12, 45, 12,WS_TABSTOP+WS_VISIBLE dialogitem "Edit","", IDEDIT, 8, 12, 188, 12, ES_AUTOHSCROLL+WS_BORDER+WS_VISIBLE enddialog Resource editor generated version: Code: #include <windows.h> #include <commctrl.h> #include <richedit.h> #define MAINDLG 1 #define IDOK 2 #define IDEDIT 3 MAINDLG DIALOGEX DISCARDABLE 6, 18, 258, 34 STYLE WS_CAPTION+WS_SYSMENU+WS_MINIMIZEBOX+WS_VISIBLE+DS_CENTER CAPTION "My Dialog" BEGIN CONTROL "OK", IDOK, "Button", WS_TABSTOP|WS_VISIBLE, 196, 12, 45, 12 CONTROL "", IDEDIT, "Edit", ES_AUTOHSCROLL+WS_BORDER+WS_VISIBLE, 8, 12, 188, 12 END It wasn't hard to convert rc->fasm macros, but it could automated, especially for big projects. But I think I use this method by now. I design my dialogs in resource editor to get styles, size of controls and position, and then convert by hand to FASM macros. Then I just include in asm source and there's no need for external resource compiler. ![]() What I really like about FASM is: there's no need for a linker, resource compiler, HLL front-end, etc... because FASM macro language is powerful enough for building from low level optimized code to scripting languages. ![]() OFFTOPIC: When I say that I code everything in asm, my teacher at university say "It's impossible. You must use some HLL, because is too hard.", and I say "No! It's not hard! It can be as high level as you want with the help of macros, but you can still keep optimized code. All these, because I use a very good assembler.". Well, I think most teachers are still in the days of TASM, that could code only for DOS and macros were very simple, or worst, they even don't know what macros are. LOL! ![]() He thinks I'm a n00b at programming, and I have to participate at pascal classes. I'm becoming really mad about it. I'm l33t coder! ![]() So, I'm thinking about creating a web page to host my programs made in FASM and C, so I can show it to my teacher and also share with other people who want to learn asm. Could you tell me some good webhost provider that's: free, enough for host programs and simple HTML? Please do not say "here is a big list of them: <link>". I just want one, simple, and good. Thank you very much! |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.