The ClearScreen do not clear the screen attribute. A little change for correcting the bug.
code:
ClearScreen proc
; -----------------------------------------------------------
; This procedure reads the column and row count, multiplies
; them together to get the number of characters that will fit
; onto the screen, writes that number of blank spaces to the
; screen, set the screen buffer attributes and reposition
; the prompt at position 0,0.
; -----------------------------------------------------------
LOCAL hOutPut:DWORD
LOCAL noc :DWORD
LOCAL cnt :DWORD
LOCAL sbi :CONSOLE_SCREEN_BUFFER_INFO
invoke GetStdHandle,STD_OUTPUT_HANDLE
mov hOutPut, eax
invoke GetConsoleScreenBufferInfo,hOutPut,ADDR sbi
mov eax, sbi.dwSize ; 2 word values returned for screen size
; -----------------------------------------------
; extract the 2 values and multiply them together
; -----------------------------------------------
mov ecx, eax
shr eax, 16
mul cx
mov cnt, eax
invoke FillConsoleOutputCharacter, hOutPut, 32, cnt, NULL, ADDR noc
movzx ecx,sbi.wAttributes
invoke FillConsoleOutputAttribute, hOutPut, ecx, cnt, NULL, ADDR noc
invoke SetConsoleCursorPosition, hOutPut, NULL
ret
ClearScreen endp
Thanks for the info, it is very useful
It seems to work just fine.
Frank