home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Hutch / DOWNLOAD / Example1.exe / RESDLG2 / RESDLG2.ASM < prev    next >
Encoding:
Assembly Source File  |  1999-05-21  |  3.8 KB  |  145 lines

  1. ; #########################################################################
  2.  
  3.       .386
  4.       .model flat, stdcall
  5.       option casemap :none   ; case sensitive
  6.  
  7. ; #########################################################################
  8.  
  9.       include \masm32\include\windows.inc
  10.       include \masm32\include\user32.inc
  11.       include \masm32\include\kernel32.inc
  12.       include \masm32\include\gdi32.inc
  13.       include \masm32\include\masm32.inc
  14.  
  15.       includelib \masm32\lib\user32.lib
  16.       includelib \masm32\lib\kernel32.lib
  17.       includelib \masm32\lib\gdi32.lib
  18.       includelib \masm32\lib\masm32.lib
  19.  
  20. ; #########################################################################
  21.  
  22.         ;=============
  23.         ; Local macros
  24.         ;=============
  25.   
  26.         szText MACRO Name, Text:VARARG
  27.           LOCAL lbl
  28.             jmp lbl
  29.               Name db Text,0
  30.             lbl:
  31.           ENDM
  32.           
  33.         ;=================
  34.         ; Local prototypes
  35.         ;=================
  36.         WndProc PROTO :DWORD,:DWORD,:DWORD,:DWORD
  37.         
  38.     .data
  39.         hEdit1      dd 0
  40.         hEdit2      dd 0
  41.         hEdit3      dd 0
  42.         hEdit4      dd 0
  43.         hButn1      dd 0
  44.         hButn2      dd 0
  45.         hInstance   dd 0
  46.         hIconImage  dd 0
  47.         hIcon       dd 0
  48.         dlgname     db "TESTWIN",0
  49.  
  50. ; #########################################################################
  51.  
  52.     .code
  53.  
  54. start:
  55.  
  56.       invoke GetModuleHandle, NULL
  57.       mov hInstance, eax
  58.       
  59.       ; -------------------------------------------
  60.       ; Call the dialog box stored in resource file
  61.       ; -------------------------------------------
  62.       invoke DialogBoxParam,hInstance,ADDR dlgname,0,ADDR WndProc,0
  63.  
  64.       invoke ExitProcess,eax
  65.  
  66. ; #########################################################################
  67.  
  68. WndProc proc hWin   :DWORD,
  69.              uMsg   :DWORD,
  70.              wParam :DWORD,
  71.              lParam :DWORD
  72.  
  73.       LOCAL Ps :PAINTSTRUCT
  74.  
  75.       .if uMsg == WM_INITDIALOG
  76.       
  77.         szText dlgTitle," Demo dialog box"
  78.         invoke SendMessage,hWin,WM_SETTEXT,0,ADDR dlgTitle
  79.  
  80.         invoke LoadIcon,hInstance,200
  81.         mov hIcon, eax
  82.  
  83.         invoke SendMessage,hWin,WM_SETICON,1,hIcon
  84.  
  85.         invoke GetDlgItem,hWin,100
  86.         mov hEdit1, eax
  87.  
  88.         invoke GetDlgItem,hWin,101
  89.         mov hEdit2, eax
  90.  
  91.         invoke GetDlgItem,hWin,102
  92.         mov hEdit3, eax
  93.  
  94.         invoke GetDlgItem,hWin,103
  95.         mov hEdit4, eax
  96.  
  97.         invoke GetDlgItem,hWin,1000
  98.         mov hButn1, eax
  99.  
  100.         invoke GetDlgItem,hWin,1001
  101.         mov hButn2, eax
  102.  
  103.         xor eax, eax
  104.         ret
  105.  
  106.       .elseif uMsg == WM_COMMAND
  107.         .if wParam == 1000
  108.             szText calcMsg,"Calculate Button"
  109.             invoke MessageBox,hWin,ADDR calcMsg,
  110.                               ADDR dlgTitle,MB_OK
  111.         .elseif wParam == 1001
  112.             szText clearMsg,"Clear Button"
  113.             invoke MessageBox,hWin,ADDR clearMsg,
  114.                               ADDR dlgTitle,MB_OK
  115.         .endif
  116.  
  117.       .elseif uMsg == WM_CLOSE
  118.         invoke EndDialog,hWin,0
  119.  
  120.       .elseif uMsg == WM_PAINT
  121.         invoke BeginPaint,hWin,ADDR Ps
  122.       ; ----------------------------------------
  123.       ; The following function are in MASM32.LIB
  124.       ; ----------------------------------------
  125.         invoke FrameGrp,hButn1,hButn2,6,1,0
  126.         invoke FrameGrp,hEdit1,hEdit3,4,1,0
  127.         invoke FrameCtrl,hEdit4,4,1,0
  128.         invoke FrameWindow,hWin,0,1,1
  129.         invoke FrameWindow,hWin,1,1,0
  130.  
  131.         invoke EndPaint,hWin,ADDR Ps
  132.         xor eax, eax
  133.         ret
  134.  
  135.       .endif
  136.  
  137.     xor eax, eax    ; this must be here in NT4
  138.     ret
  139.  
  140. WndProc endp
  141.  
  142. ; ########################################################################
  143.  
  144. end start
  145.