• Efecto Scroll Screen

 #451815  por Pink
 03 Ago 2014, 01:10
Bueno vi este código hecho en masm y lo porte a fasm porque esta guapo.


;Coded by Osanda
format PE GUI 5.0
entry start

include 'win32ax.inc'



section '.data' data readable writeable

     swid  dd 0
     shgt  dd 0
     dwid  dd 0
     hDC   dd 0
     cDC   dd 0
     hScr  dd 0
     hBmp  dd 0
     hOld  dd 0

section '.code' code readable executable
  start:


    invoke GetDC,[hScr]
    mov [hDC],eax

    invoke GetSystemMetrics,SM_CXSCREEN
    mov [swid],eax
    add eax,eax
    mov [dwid], eax

    invoke GetSystemMetrics,SM_CYSCREEN
    mov [shgt],eax

    invoke CreateCompatibleBitmap,[hDC],[dwid],[shgt]
    mov [hBmp],eax

    invoke CreateCompatibleDC,[hDC]
    mov [cDC],eax

    invoke SelectObject,[cDC],[hBmp]
    mov [hOld],eax

     invoke BitBlt,[cDC],0,0,[swid],[shgt],[hDC],0,0,SRCCOPY
     invoke BitBlt,[cDC],[swid],0,[swid],[shgt],[hDC],0,0,SRCCOPY


    mov ecx, [swid]
    repetir:
    push ecx
    invoke BitBlt,[hDC],0,0,[swid],[shgt],[cDC],ecx,0,SRCCOPY
    invoke Sleep, 40
    pop ecx
    sub ecx,8
    jns  repetir


    invoke SendMessage,0,WM_PAINT,[hDC],0


    ;Limpiar
    invoke DeleteObject,[hBmp]
    invoke SelectObject,[cDC],[hOld]
    invoke DeleteDC,[cDC]
    invoke ReleaseDC,[hScr],[hDC]




salir:
invoke ExitProcess,0


section '.idata' import data readable writeable
  library kernel,'KERNEL32.DLL',\
          user32,  'USER32.DLL',\
          gdi32,   'GDI32.DLL'


  import  kernel,\
          ExitProcess,'ExitProcess',\
          Sleep,'Sleep'

   import user32,\
          GetDC,'GetDC',\
          GetSystemMetrics,'GetSystemMetrics',\
          ReleaseDC,'ReleaseDC',\
          SendMessage,'SendMessageA'

   import gdi32,\
          BitBlt,'BitBlt',\
          CreateCompatibleBitmap,'CreateCompatibleBitmap',\
          CreateCompatibleDC,'CreateCompatibleDC',\
          DeleteDC,'DeleteDC',\
          DeleteObject,'DeleteObject',\
          SelectObject,'SelectObject'

Saludos