SHARE
TWEET

Untitled

a guest Dec 10th, 2019 64 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. .386
  2. .model flat, stdcall
  3. option casemap:none
  4.  
  5. include \masm32\include\windows.inc
  6. include \masm32\include\user32.inc
  7. include \masm32\include\kernel32.inc
  8. includelib \masm32\lib\user32.lib
  9. includelib \masm32\lib\kernel32.lib
  10.  
  11. .data
  12.     Klasa db "WinClass",0
  13.     TytulOkna db "Moje pierwsze okno",0
  14.  
  15. .data?
  16.     hInstance HINSTANCE ?
  17.  
  18. .code
  19.  
  20. start:
  21.     invoke GetModuleHandle,0
  22.     mov hInstance,eax
  23.  
  24.     call WinMain
  25.  
  26.     WinMain proc
  27.     LOCAL KlasaOkna:WNDCLASSEX
  28.  
  29.     LOCAL msgKomunikat:MSG
  30.  
  31.     mov KlasaOkna.cbSize,sizeof(WNDCLASSEX)
  32.     mov KlasaOkna.style,CS_HREDRAW or CS_VREDRAW
  33.  
  34.     mov KlasaOkna.lpfnWndProc,offset WndProc
  35.  
  36.     push hInstance
  37.     pop KlasaOkna.hInstance
  38.    
  39.     mov KlasaOkna.hbrBackground,COLOR_WINDOW+1
  40.     mov KlasaOkna.lpszClassName,offset Klasa
  41.  
  42.     invoke LoadIcon,0,IDI_APPLICATION
  43.     mov KlasaOkna.hIcon,eax
  44.     mov KlasaOkna.hIconSm,eax
  45.  
  46.     invoke LoadCursor,0,IDC_ARROW
  47.     mov KlasaOkna.hCursor,eax
  48.  
  49.     invoke RegisterClassEx,addr KlasaOkna
  50.  
  51.     invoke CreateWindowEx,0,addr Klasa,addr TytulOkna,WS_OVERLAPPEDWINDOW or WS_VISIBLE,100,
  52.                             100,320,200,0,0,hInstance,0
  53.  
  54.  
  55.     .WHILE TRUE
  56.           invoke GetMessage,addr msgKomunikat,0,0,0
  57.           .BREAK .IF(!eax)
  58.           invoke TranslateMessage,addr msgKomunikat
  59.           invoke DispatchMessage,addr msgKomunikat
  60.     .ENDW
  61.     ret
  62.  
  63.     WinMain endp
  64.  
  65.     WndProc proc hWnd:HWND,uMsg:UINT,wParam:WPARAM,lParam:LPARAM
  66.  
  67.     .IF uMsg==WM_DESTROY
  68.         invoke PostQuitMessage,0
  69.     .ELSE
  70.         invoke DefWindowProc,hWnd,uMsg,wParam,lParam
  71.         ret
  72.     .ENDIF
  73.  
  74.     WndProc endp
  75.    
  76. invoke ExitProcess,0
  77. end start
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top