Hello
I want my dialog as a main window
and it dosent works:

.386
.model flat,stdcall
option casemap:none
include \masm32\include\windows.inc
include \masm32\include\user32.inc
includelib \masm32\lib\user32.lib
include \masm32\include\kernel32.inc
includelib \masm32\lib\kernel32.lib
include \masm32\include\wininet.inc
includelib \masm32\lib\wininet.lib

DlgProc proto :DWORD,:DWORD,:DWORD,:DWORD
.data
ClassName db "DLGCLASS",0
DlgName db "IDD_DLG1",0
.data?
hInstance HINSTANCE ?
CommandLine LPSTR ?
buffer db 512 dup(?)
.const
IDM_EXIT equ 32002
IDC_EXIT equ 3002
IDC_EDIT equ 1001
.code
start:
invoke GetModuleHandle, NULL
mov hInstance,eax

invoke DialogBoxParam, hInstance, ADDR DlgName,NULL, addr DlgProc, NULL
invoke ExitProcess,eax

DlgProc proc hWnd:HWND, uMsg:UINT, wParam:WPARAM, lParam:LPARAM
.IF uMsg==WM_INITDIALOG
invoke GetDlgItem, hWnd,IDC_EDIT
invoke SetFocus,eax
.ELSEIF uMsg==WM_CLOSE
invoke EndDialog, hWnd,NULL
.ELSE
mov eax,FALSE
ret
.ENDIF
mov eax,TRUE
ret
DlgProc endp
end start

i have read Iczelion's Tutorials but i dont get it to work =/
does anyone seen why?
:stupid:
Posted on 2003-08-30 12:56:08 by bj1500
When you create the dialog if you want to use a string as the identifier (ADDR DlgName) of the dialog be sure you set it's ID to zero otherwise use the ID number to identify it. The class name is not necessary, leave it out of both the dialog in the editor and your program, it will default to #32770 (dialog class)
Posted on 2003-08-30 12:59:03 by donkey
god damn you are fast, and it worked!! so simple :tongue:
:stupid:
Posted on 2003-08-30 13:04:32 by bj1500