News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

display masm32

Started by imadhx30, March 02, 2014, 11:45:51 PM

Previous topic - Next topic

imadhx30

how to change background color screen to display masm32 !! :icon_exclaim:

hutch--

I am not sure what you mean but if its the editor colour, go to the settings on the edit menu and change the colours to what you find OK.

imadhx30

not color masm32 editor
but color window to display results (of after run program) :icon_exclaim:

qWord

Quote from: imadhx30 on March 04, 2014, 06:53:22 AMbut color window to display results (of after run program) :icon_exclaim:
GUI or console window? More details please!! :icon_exclaim:
MREAL macros - when you need floating point arithmetic while assembling!

KeepingRealBusy

If I understand you correctly, you execute a program created by masm32. If this is a Console App, then right click in the Title bar, and select Properties, then select Colors. Someone else (Hutch?) will have to explain what to do if this is a windows App.

Dave.

dedndave

it can be done programatically in the console by using FillConsoleOutputAttribute

this is a console clear screen routine - it uses the current colors
but, i commented the line where DX holds a word with attributes
you can set that to whatever foreground/background combination you like

;***********************************************************************************************

ConCls  PROC USES EBX

;Console Clear-Screen
;Version 1.0, David R. Sheldon, 10-2013

;-----------------------------------

;Call With: Nothing
;
;  Returns: EAX = hStdOut, console output handle
;           ECX = total number of characters in screen buffer
;           EDX = buffer character attributes used to clear screen
;
;Also Uses: EBX, ESI, EDI, EBP are preserved

;-----------------------------------

        LOCAL   _csbi   :CONSOLE_SCREEN_BUFFER_INFO
        LOCAL   _nChars :DWORD

;-----------------------------------

    INVOKE  GetStdHandle,STD_OUTPUT_HANDLE
    xchg    eax,ebx                                    ;EBX = hConsole
    INVOKE  GetConsoleScreenBufferInfo,ebx,addr _csbi
    movzx   eax,word ptr _csbi.dwSize.x
    movzx   edx,word ptr _csbi.dwSize.y
    lea     ecx,_nChars
    mul     edx
    INVOKE  FillConsoleOutputCharacter,ebx,32,eax,0,ecx
    movzx   edx,word ptr _csbi.wAttributes                             ;DX = current attributes
    push    edx
    INVOKE  FillConsoleOutputAttribute,ebx,edx,_nChars,0,addr _nChars
    INVOKE  SetConsoleCursorPosition,ebx,0
    xchg    eax,ebx
    mov     ecx,_nChars
    pop     edx
    ret

ConCls  ENDP

;***********************************************************************************************


http://msdn.microsoft.com/en-us/library/windows/desktop/ms682662%28v=vs.85%29.aspx

http://msdn.microsoft.com/en-us/library/windows/desktop/ms682088%28v=vs.85%29.aspx#_win32_character_attributes

dedndave

ok - slight problem
the above code sets the attributes in the buffer
however, any new text displayed uses the current console attributes

by calling both FillConsoleOutputAttribute and SetConsoleTextAttribute, you set both
see the attached...

imadhx30


dedndave