News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

help with masm..

Started by crack-break, October 26, 2007, 06:14:06 AM

Previous topic - Next topic

crack-break

greetz to all the respected members... i am a newbie in programming.. though i know and understand the assembly language codes from dissassembler... plz help me with this..  m actually makin a dialog box... the code is sumthn lyk this...

.386
.model flat, stdcall
option casemap:none

include windows.inc
include user32.inc
include kernel32.inc
includelib user32.lib
includelib kernel32.lib

DlgProc                          proto                      :DWORD, :DWORD, :DWORD, :DWORD

.data
Message                     db                          "HI, THIS IS MY FIRST DIALOGUE BOX PROGRAMMED", 0

.data?
hInstance                    HINSTANCE             ?

.code
start:
invoke GetModuleHandle, NULL
mov hInstance, eax
invoke DialogBoxParam, hInstance, 1001, NULL, addr DlgProc, NULL
invoke ExitProcess, eax

DlgProc    Proc  hWnd: HWND, Umsg: UINT, wParam: WPARAM, lParam: LPARAM
   .if  Umsg==WM_COMMAND
         mov wParam, eax
              .if eax ==1003
                     invoke SetDlgItemText, hWnd, 1002, addr Message
              .elseif  eax == 1004
                      invoke SendMessage, hWnd, WM_CLOSE,0 ,0
              .endif
   .elseif Umsg == WM_CLOSE
                      invoke EndDialog, hWnd, 0
   .endif

    xor eax, eax                                   

    Ret
DlgProc endp

end start

             ------------------x----------------------------


i have already made the dialoge box leading to resource editor....
now the problem is after saving the .wap,.asm,.rc files i get the dialogue box but when i press button for calling the text message, it doesn't appear in the box for aappearin in the text... THE ABOVE IS THE EXACT SOURCE CODE I HAVE MADE... IS EVERYTHING OK..