flat assembler
Message board for the users of flat assembler.
Index
> Windows > How to add CLASS to a dialog box |
Author |
|
alonso 06 Dec 2003, 23:32
After several hours of searching on the net and playing arround with the macro called dialog in the file called Resource.inc in the fasm\include\macro folder I finally found it, this is the code:
macro dialog label,clase,title,x,y,cx,cy,style,menu,exstyle,fontname,fontsize { local data,size,items label dd RVA data,size,0,0 data dd style or DS_SETFONT,exstyle +0 dw items,x,y,cx,cy if menu+0 <> 0 dw 0FFFFh end if du menu+0 du clase,0 du title,0 if fontname eq du 8,'MS Sans Serif',0 else du fontsize+0,fontname,0 end if align 4 dialog_size equ size = $ - data dialog_items equ items = dialog_items_counter dialog_items_counter = 0 } And the way to call it would be like this: section '.rsrc' resource data readable directory RT_DIALOG,dialogs resource dialogs,\ 37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration dialog demonstration,'My Class','Our First Dialog Box',10,10,205,60,0x0004+DS_CENTER+WS_CAPTION+WS_MINIMIZEBOX+WS_SYSMENU+WS_VISIBLE+WS_OVERLAPPED+DS_MODALFRAME+DS_3DLOOK dialogitem 'EDIT','',ID_CAPTION,15,17,111,13,WS_VISIBLE+ES_AUTOHSCROLL+ES_LEFT+WS_TABSTOP dialogitem 'BUTTON','Say Hello',ID_ICONINFORMATION,141,10,52,13,WS_VISIBLE+WS_TABSTOP dialogitem 'BUTTON','E&xit',ID_CANCEL,141,26,52,13,WS_VISIBLE+WS_TABSTOP enddialog |
|||
06 Dec 2003, 23:32 |
|
silkodyssey 07 Dec 2003, 05:12
alonso,
Nice work with the macro. I haven't tested it as yet but if it works for you I don't see why it won't for me. I've had this problem before but with fasm's new feature to include binary resources we won't need the resource macros anymore . _________________ silkodyssey |
|||
07 Dec 2003, 05:12 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.