flat assembler
Message board for the users of flat assembler.
Index
> Windows > DialogBoxParam+Menus |
Author |
|
senolc_eht 14 Jun 2005, 17:18
hi..
I don't know what you mean but try look this code, this work well for me Code: include 'win32ax.inc' .data hinstance dd ? .code start: invoke GetModuleHandle,0 mov [hinstance],eax invoke DialogBoxParam,eax,37,HWND_DESKTOP,DialogProc,0 invoke ExitProcess,0 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: jmp processed wmcommand: mov eax, [wparam] cmp ax,102 je wmclose jmp processed wmclose: invoke EndDialog,[hwnddlg],0 processed: mov eax,1 finish: pop edi esi ebx return endp .end start section '.rsrc' resource data readable directory RT_DIALOG,dialogs,RT_MENU,menus resource dialogs,\ 37,LANG_ENGLISH+SUBLANG_DEFAULT,demonstration resource menus,\ 2,LANG_ENGLISH+SUBLANG_DEFAULT,main_menu menu main_menu menuitem '&File',0,MFR_POPUP menuitem '&New',101,0 menuseparator menuitem 'E&xit',102,MFR_END menuitem '&Help',0,MFR_POPUP + MFR_END menuitem '&About...',103,MFR_END dialog demonstration,'Create message box',70,70,190,175,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME,2 enddialog my regard Senolc_eht _________________ sorry if i always asking..... |
|||
14 Jun 2005, 17:18 |
|
OzzY 14 Jun 2005, 17:34
For me works too. But what I said was with external resource editor. I put the dialog, add the menu, write the code. The code is ok, and it assembles, but the dialog isn't shown when I run the program.
But now after I tried more, I saw that it works ok with RADASM+FASM, but not with my C compiler (mingw). o.O Thanks! |
|||
14 Jun 2005, 17:34 |
|
senolc_eht 14 Jun 2005, 17:56
Im sorry for my lacking, but i never uses external resource editor yet for my application, cause for me fasm is enough for now.
i'm sorry can't help you, but i have suggestion, why you not use hexedit or debuger and find the defference between compiled with fasm (directly)and using c compiler, maybe you will find something. my regard, senolc_eht |
|||
14 Jun 2005, 17:56 |
|
JohnnyReb 29 Jun 2006, 23:21
I found that the example given didn't work for me. I had to change:
dialog demonstration,'Create message box',70,70,190,175,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME,2 to dialog demonstration,'Create message box',70,70,190,175,WS_CAPTION+WS_POPUP+WS_SYSMENU+DS_MODALFRAME,0,2 Then it worked fine! Hope this helps someone. _________________ JohnnyReb Win if you can, Lose if you must, but always cheat! |
|||
29 Jun 2006, 23:21 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.