AuthorMessage
Meka][Meka
Unstopable
Posts: 700

just a simple UI (user interface) with a button with event example, any chance any of u can supply one ? ^_~
Lord_Zero
Ametuar
Posts: 122

1. Make a resource file and rename it to have RC extension and write there the following text:
Code:
#include   "\masm32\include\resource.h"
1000 DIALOGEX MOVEABLE IMPURE LOADONCALL DISCARDABLE   10, 10, 186, 74, 0
STYLE DS_MODALFRAME | 0x0004 | WS_CAPTION | WS_SYSMENU | WS_VISIBLE | WS_POPUP
CAPTION "Test"
FONT 8, "MS Sans Serif", 700, 0 /*FALSE*/
BEGIN
    DEFPUSHBUTTON   "Do NOT press this button !!! :P", 2,    27,20,132,34, 0, , 0
END

2. Simple ASM code that displays a dialog box:
Code:
.386
.model   flat,stdcall
option   casemap:none
include   \masm32\include\windows.inc
include   \masm32\include\user32.inc
include   \masm32\include\kernel32.inc
include   \masm32\include\shell32.inc
includelib   \masm32\lib\user32.lib
includelib   \masm32\lib\kernel32.lib
includelib   \masm32\lib\shell32.lib
dlgfunc   PROTO   :DWORD,:DWORD,:DWORD,:DWORD
.data
.data?
.code
start:
   invoke   GetModuleHandle,0
   invoke   DialogBoxParam,eax,1000,0,addr dlgfunc,0
   invoke   ExitProcess,0
dlgfunc   PROC   hDlg:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
   .if uMsg==WM_COMMAND
      mov   eax,wParam
      .if ax==2
         invoke   EndDialog,hDlg,0
      .endif
   .endif
   xor   eax,eax
   ret
dlgfunc   ENDP
end   start

I hope that helps
Meka][Meka
Unstopable
Posts: 700

yup thanks mate will give this a shot, whats the 2nd file named as?
Lord_Zero
Ametuar
Posts: 122

Default extension for assembly programs is ASM.
To compile (with masm) use the following command line :
\masm32\bin\bldall test
The bldall batch file uses RSRC.RC as the default name for the resource file.
Meka][Meka
Unstopable
Posts: 700

Quoted from Lord_Zero
Default extension for assembly programs is ASM.
To compile (with masm) use the following command line :
\masm32\bin\bldall test
The bldall batch file uses RSRC.RC as the default name for the resource file.

thanks