flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
AsmGuru62 03 Mar 2025, 12:56
You can just use text for types of dialog items as you do with "Ok":
Code: dialog add_class_dlg, 'New Class', 0, 0, 300, 143, WS_OVERLAPPEDWINDOW + DS_MODALFRAME + DS_CENTER,,,'Verdana',12 dialogitem 'button', 'OK', IDOK, 155, 123, 60, 15, WS_VISIBLE + WS_TABSTOP + BS_DEFPUSHBUTTON dialogitem 'button', 'Cancel', IDCANCEL, 235, 123, 60, 15, WS_VISIBLE + WS_TABSTOP enddialog |
|||
![]() |
|
FoXx 03 Mar 2025, 18:29
The menu is created from several types of windows. Why duplicate byte arrays when you can just use references to them?
|
|||
![]() |
|
AsmGuru62 03 Mar 2025, 23:32
From what we can see in a macro for dialogitem:
Code: macro dialogitem class,title,id,x,y,cx,cy,style,exstyle { dd style or WS_CHILD,exstyle +0 dw x,y,cx,cy,id if class eq 'BUTTON' dw 0FFFFh,80h else if class eq 'EDIT' dw 0FFFFh,81h else if class eq 'STATIC' dw 0FFFFh,82h else if class eq 'LISTBOX' dw 0FFFFh,83h else if class eq 'SCROLLBAR' dw 0FFFFh,84h else if class eq 'COMBOBOX' dw 0FFFFh,85h else du class,0 end if if title eqtype 0 dw 0FFFFh,title else du title,0 end if dw 0 align 4 dialog_items_counter = dialog_items_counter + 1 } The strings for classes of Dialog Controls are turned into 16-bit values (BUTTON turns into 0FFFFh,80h). I am not sure that replacing them (in this case) with text declared with DB will actually work. In the FASM Manual for Windows Programming the dialogitem example shows using 'BUTTON', so that is the way, I guess. Also, I think, LIST should be LISTBOX. What I mean was, that there is no duplicates of BUTTON,EDIT, etc. in the compiled resource. |
|||
![]() |
|
revolution 04 Mar 2025, 01:09
This can also verified by searching the output.
Code: $ grep --count "'BUTTON'" ./source/win32/fasmw/fasmw.asm 24 $ grep --count BUTTON fasmw.exe 0 $ |
|||
![]() |
|
FoXx 04 Mar 2025, 12:50
Thank! I looked at the exe-file in an hex-editor and couldn't find the names of classes.
I thought it was similar to importing libraries. The procedure name is used in the error message. Code: ;------------------------------------------------ ; * * * Import Library Procedures * * * ;------------------------------------------------ section '.idata' import data readable writeable DD 0,0,0, RVA szKernel32, RVA LibraryKernel32 DD 0,0,0, RVA szUser32, RVA LibraryUser32 DD 0,0,0,0,0 ;------------------------------------------------ ; * * * Import Proc Kernel32 * * * ;------------------------------------------------ LibraryKernel32: GetCommandLine DD RVA szGetCommandLine ExitProcess DD RVA szExitProcess end_Kernel32 DD NULL ;------------------------------------------------ ; * * * Import Proc User32 * * * ;------------------------------------------------ LibraryUser32: MessageBox DD RVA szMessageBox end_User32 DD NULL ;------------------------------------------------ ; * * * WinAPI ProcNames ;------------------------------------------------ szKernel32 DB 'KERNEL32.DLL',0 szUser32 DB 'USER32.DLL',0 szGetCommandLine DB 0,0, 'GetCommandLineA',0 szExitProcess DB 0,0, 'ExitProcess',0 szMessageBox DB 0,0, 'MessageBoxA',0 |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.