NO

Author Topic: Console scroll  (Read 3608 times)

Offline Vortex

  • Member
  • *
  • Posts: 865
    • http://www.vortex.masmcode.com
Console scroll
« on: November 09, 2011, 09:24:53 AM »
Here is scrolling example displayed on a console window :

Code: [Select]

include     ScrollConsole.inc

.data

message     db '          This is a scroll test. ',0

.code

start:

    call    main
    invoke  ExitProcess,0

main PROC uses esi ebx

LOCAL hStd:DWORD
LOCAL csbi:CONSOLE_SCREEN_BUFFER_INFO
LOCAL Coordinates:COORD

    invoke  GetStdHandle,STD_OUTPUT_HANDLE
    mov     hStd,eax

    lea     esi,csbi
    invoke  GetConsoleScreenBufferInfo,eax,esi
    mov     edx,CONSOLE_SCREEN_BUFFER_INFO.dwCursorPosition[esi]
    mov     Coordinates,edx
   
    mov     esi,OFFSET message
    mov     ebx,SIZEOF message
@@:
    invoke  SetConsoleCursorPosition,hStd,Coordinates
    invoke  StdOut,esi
    invoke  Sleep,200
    inc     esi
    dec     ebx
    jnz     @b
    ret

main ENDP

END start
Code it... That's all...