4/14/10

Assembly පාඩම 11

ඔන්න කොහොමින් හරි අවුරුද්දත් ලබලා ඉවරයි ...:D .කට්ටියට වැඩ අල්ලන වෙලාවට කරන්න පොඩි වැඩක් මෙන්න
.මේක compile කරලා run කලලොත් මගෙ අවුරුදු පනිවිඩය බලා ගන්න පුලුවන්


.486                      ; create 32 bit code
      .model flat, stdcall      ; 32 bit memory model
      option casemap :none      ; case sensitive
 
;     include files
;     ~~~~~~~~~~~~~
      include \masm32\include\windows.inc
      include \masm32\include\masm32.inc
      include \masm32\include\gdi32.inc
      include \masm32\include\user32.inc
      include \masm32\include\kernel32.inc
      include \masm32\include\Comctl32.inc
      include \masm32\include\comdlg32.inc
      include \masm32\include\shell32.inc
      include \masm32\include\oleaut32.inc
      include \masm32\include\msvcrt.inc
      include \masm32\include\dialogs.inc
      include \masm32\macros\macros.asm

;     libraries
;     ~~~~~~~~~
      includelib \masm32\lib\masm32.lib
      includelib \masm32\lib\gdi32.lib
      includelib \masm32\lib\user32.lib
      includelib \masm32\lib\kernel32.lib
      includelib \masm32\lib\Comctl32.lib
      includelib \masm32\lib\comdlg32.lib
      includelib \masm32\lib\shell32.lib
      includelib \masm32\lib\oleaut32.lib
      includelib \masm32\lib\msvcrt.lib


      hout PROTO :DWORD,:DWORD,:DWORD,:DWORD 

    .data?
        hInstance dd ?

    .code

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

start:
 
      mov hInstance, FUNC(GetModuleHandle,NULL)

      call main

      invoke ExitProcess,eax

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««

main proc

    Dialog "Happy New Year", \           ; caption
           "Tahoma",10, \            ; font,pointsize
            WS_OVERLAPPED or \              ; styles for
            WS_SYSMENU or DS_CENTER, \      ; dialog window
            2, \                            ; number of controls
            50,50,150,80, \                 ; x y co-ordinates
            1024                            ; memory buffer size

    DlgButton "OK",WS_TABSTOP,48,40,50,15,IDCANCEL
    DlgStatic "Confiuzd Programmer is Wishing you a very happy New Year !!!", \
              SS_CENTER,2,20,140,9,100

    CallModalDialog hInstance,0,hout,NULL

    ret

main endp

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««
hout proc hWin:DWORD,uMsg:DWORD,wParam:DWORD,lParam:DWORD 


    .if uMsg == WM_INITDIALOG
      invoke SendMessage,hWin,WM_SETICON,1,
                         FUNC(LoadIcon,NULL,IDI_ASTERISK)

    .elseif uMsg == WM_COMMAND
      .if wParam == IDCANCEL
        jmp quit_dialog
      .endif

    .elseif uMsg == WM_CLOSE
      quit_dialog:
       invoke EndDialog,hWin,0

    .endif

    xor eax, eax
    ret

hout endp

; «««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««««


end start

මේකෙ තියෙන ඔක්කොම කොටස් දැනට ආවරණය වෙලා තියෙන්නේ ,ඊලග පොස්ට් 1කෙන් මම පොඩි පැහැදිලි කිරිමක් කරන්නම් මේ ගැන

0 comments:

Post a Comment