[RESOLVED] about WriteConsoleOutput() and WriteConsoleOutputAttribute() functions - Page 2
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Page 2 of 2 FirstFirst 12
Results 16 to 17 of 17

Thread: [RESOLVED] about WriteConsoleOutput() and WriteConsoleOutputAttribute() functions

  1. #16
    Join Date
    Apr 2009
    Posts
    686

    Re: about WriteConsoleOutput() and WriteConsoleOutputAttribute() functions

    Quote Originally Posted by 2kaud View Post
    See http://msdn.microsoft.com/en-us/libr...ter_attributes

    You need to be able to find your way around microsoft's msdn web site. There are loads of stuff on there re development. It would often be quicker to try searching there rather than posting a question here.

    I use these extra definitions

    Code:
    #define FOREGROUND_WHITE		(FOREGROUND_RED | FOREGROUND_BLUE | FOREGROUND_GREEN)
    #define FOREGROUND_YELLOW		(FOREGROUND_RED | FOREGROUND_GREEN)
    #define FOREGROUND_CYAN			(FOREGROUND_BLUE | FOREGROUND_GREEN)
    #define FOREGROUND_MAGENTA		(FOREGROUND_RED | FOREGROUND_BLUE)
    #define FOREGROUND_BLACK		0
    
    #define FOREGROUND_INTENSE_RED	        (FOREGROUND_RED | FOREGROUND_INTENSITY)
    #define FOREGROUND_INTENSE_GREEN	(FOREGROUND_GREEN | FOREGROUND_INTENSITY)
    #define FOREGROUND_INTENSE_BLUE	        (FOREGROUND_BLUE | FOREGROUND_INTENSITY)
    #define FOREGROUND_INTENSE_WHITE	(FOREGROUND_WHITE | FOREGROUND_INTENSITY)
    #define FOREGROUND_INTENSE_YELLOW	(FOREGROUND_YELLOW | FOREGROUND_INTENSITY)
    #define FOREGROUND_INTENSE_CYAN	        (FOREGROUND_CYAN | FOREGROUND_INTENSITY)
    #define FOREGROUND_INTENSE_MAGENTA	(FOREGROUND_MAGENTA | FOREGROUND_INTENSITY)
    
    #define BACKGROUND_WHITE		(BACKGROUND_RED | BACKGROUND_BLUE | BACKGROUND_GREEN)
    #define BACKGROUND_YELLOW		(BACKGROUND_RED | BACKGROUND_GREEN)
    #define BACKGROUND_CYAN	        	(BACKGROUND_BLUE | BACKGROUND_GREEN)
    #define BACKGROUND_MAGENTA		(BACKGROUND_RED | BACKGROUND_BLUE)
    #define BACKGROUND_BLACK		0
    
    #define BACKGROUND_INTENSE_RED   	(BACKGROUND_RED | BACKGROUND_INTENSITY)
    #define BACKGROUND_INTENSE_GREEN	(BACKGROUND_GREEN | BACKGROUND_INTENSITY)
    #define BACKGROUND_INTENSE_BLUE	        (BACKGROUND_BLUE | BACKGROUND_INTENSITY)
    #define BACKGROUND_INTENSE_WHITE	(BACKGROUND_WHITE | BACKGROUND_INTENSITY)
    #define BACKGROUND_INTENSE_YELLOW	(BACKGROUND_YELLOW | BACKGROUND_INTENSITY)
    #define BACKGROUND_INTENSE_CYAN	        (BACKGROUND_CYAN | BACKGROUND_INTENSITY)
    #define BACKGROUND_INTENSE_MAGENTA	(BACKGROUND_MAGENTA | BACKGROUND_INTENSITY)
    i can find the functions(sometimes are dificulty to understand them) but the rest is more complicated.
    thanks for all.
    see these line:
    SMALL_RECT c={x,y,x+tlen,y+(SHORT)1};
    strange.. i get 2 warning about types and i don't understand why

    "warning: narrowing conversion of '(((int)x) + ((int)tlen))' from 'int' to 'SHORT {aka short int}' inside { } [-Wnarrowing]|"
    but tlen is SHORT: SHORT tlen = (SHORT)p->Text.length();

  2. #17
    Join Date
    Apr 2009
    Posts
    686

    Re: about WriteConsoleOutput() and WriteConsoleOutputAttribute() functions

    resolved:

    SMALL_RECT c={x, y,SHORT(x+tlen),SHORT(y+1)};

    seems the '+' operator put them to 'int', that's why i must use SHORT like a function(the casting don't works)
    thanks for all

Page 2 of 2 FirstFirst 12

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center