Rafpast

Prosty program

Jul 12th, 2023
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.15 KB | None | 0 0
  1. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  2.  
  3. .486 ; create 32 bit code
  4. .model flat, stdcall ; 32 bit memory model
  5. option casemap :none ; case sensitive
  6.  
  7. include \masm32\include\dialogs.inc
  8. include simple.inc
  9.  
  10. dlgproc PROTO :DWORD,:DWORD,:DWORD,:DWORD
  11.  
  12. .code
  13.  
  14. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  15.  
  16. start:
  17.  
  18. mov hInstance, FUNC(GetModuleHandle,NULL)
  19.  
  20. call main
  21.  
  22. invoke ExitProcess,eax
  23.  
  24. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  25.  
  26. main proc
  27.  
  28. Dialog "Simple Dialog","MS Sans Serif",10, \ ; caption,font,pointsize
  29. WS_OVERLAPPED or WS_SYSMENU or DS_CENTER, \ ; style
  30. 2, \ ; control count
  31. 50,50,150,80, \ ; x y co-ordinates
  32. 1024 ; memory buffer size
  33.  
  34. DlgButton "&OK",WS_TABSTOP,48,40,50,15,IDCANCEL
  35. DlgStatic "Simple Dialog Written In MASM32",SS_CENTER,2,20,140,9,100
  36.  
  37. CallModalDialog hInstance,0,dlgproc,NULL
  38.  
  39. ret
  40.  
  41. main endp
  42.  
  43. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  44.  
  45. dlgproc proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD
  46.  
  47. .if uMsg == WM_INITDIALOG
  48. invoke SendMessage,hWin,WM_SETICON,1,FUNC(LoadIcon,NULL,IDI_ASTERISK)
  49.  
  50. .elseif uMsg == WM_COMMAND
  51. .if wParam == IDCANCEL
  52. jmp quit_dialog
  53. .endif
  54.  
  55. .elseif uMsg == WM_CLOSE
  56. quit_dialog:
  57. invoke EndDialog,hWin,0
  58.  
  59. .endif
  60.  
  61. xor eax, eax
  62. ret
  63.  
  64. dlgproc endp
  65.  
  66. ; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
  67.  
  68. end start
Advertisement
Add Comment
Please, Sign In to add comment