Advertisement
Guest User

Untitled

a guest
Jun 3rd, 2010
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .386
  2. .model flat, stdcall  ;32 bit memory model
  3. option casemap :none  ;case sensitive
  4.  
  5. include Moj pierwszy.inc
  6. .data
  7. szMessageHeader db "Krzywy",0
  8. szMessageText db "Zakonczyc?",0
  9. .code
  10.  
  11. start:
  12.     invoke  GetModuleHandle,NULL
  13.     mov hInstance,eax
  14.     invoke  InitCommonControls
  15.     invoke  DialogBoxParam,hInstance,IDD_MAIN,NULL,addr DlgProc,NULL
  16.     invoke  ExitProcess,0
  17.  
  18. ;########################################################################
  19.  
  20. DlgProc proc    hWin:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
  21.     mov eax,uMsg
  22.     .if eax==WM_INITDIALOG
  23.         ;initialization here
  24.     .elseif eax==WM_COMMAND
  25.         mov edx,wParam
  26.         movzx eax,dx
  27.         shr edx,16
  28.         .if edx==BN_CLICKED
  29.             .if eax==IDOK
  30.             jmp Procka
  31.             .elseif eax==IDCANCEL
  32.                 invoke  SendMessage,hWin,WM_CLOSE,NULL,NULL
  33.             .endif
  34.         .endif
  35.     .elseif eax==WM_CLOSE
  36.         invoke  EndDialog,hWin,0
  37.     .else
  38.         mov eax,FALSE
  39.         ret
  40.     .endif
  41.     mov eax,TRUE
  42.     ret
  43. DlgProc endp
  44.  
  45. Procka:
  46. invoke MessageBox, NULL, addr szMessageText, addr szMessageHeader,MB_OKCANCEL
  47.     .if eax==01h
  48.         invoke ExitProcess,NULL
  49.     .endif
  50.     .if eax==02h
  51.         jmp start
  52.     .endif
  53.  
  54. end start
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement