cambalinho 142 Practically a Posting Shark

i'm using the WM_EXITSIZEMOVE, but seems freeze the window :(

cambalinho 142 Practically a Posting Shark

thanks for correct me ;)
let me ask anotherthing: how can i detect the MouseStoped and WindowStoped messages?

cambalinho 142 Practically a Posting Shark

sorry what means "Congrats! You've received an endorsement!‏"?

cambalinho 142 Practically a Posting Shark

thanks.. let me ask:
1 - why the mouse works for client size and not window size?
2 - the mouse hover it's confuse me:( the mouse hover is the time that mouse stoped, right?

cambalinho 142 Practically a Posting Shark

see my windows procedure:

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    bool blnMouseEnter=false;
    switch(msg)
    {
        case WM_CLOSE:
            DestroyWindow(hwnd);
        break;
        case WM_KEYUP:
            if (wParam ==VK_ESCAPE)
                DestroyWindow(hwnd);
            else
            {
                char strDataToSend[32];
                sprintf(strDataToSend, "%c", wParam);
                MessageBox(NULL,strDataToSend, "keyselected",MB_OK);
            }
        break;

        case WM_MOUSEMOVE:
            SetWindowText(hwnd,"hi");
            break;
        case WM_MOUSELEAVE://is ignored :(
            SetWindowText(hwnd,"bye");
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
        default:
            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

i'm trying testing the Mouse Enter and Mouse Leave, but the mouse leave isn't activated and the Mouse Move isn't activated with window border :(
what isn't right?

cambalinho 142 Practically a Posting Shark
#define events(eventname, ... )     event<__VA_ARGS__> eventname{[](__VA_ARGS__ ) { ; }};

what isn't right with these macro?

cambalinho 142 Practically a Posting Shark

some persons don't advice use macros.... please someone tell me why.
but heres a nice code that i did with some help:

#include <iostream>
#include <functional>

#define event(eventname, ... ) std::function<void(__VA_ARGS__ )> eventname

using namespace std;

class test
{
    public:
    event(moved,(int a,int b)) ;
    event (created) ;
    event(hello);

    void write(string a)
    {
        cout << a;
        moved(2,3);
        created();
    }
};

void a_hello()
{
    cout << "\nhello mother\n";
}

int main()
{
    test a;
    a.moved=[](int a, int b)
    {
        cout << "\nmoved\n" << a+b << "\n";
    };
    a.hello=&a_hello;
    a.created=[]()
    {
        cout << "\nbye\n";
    };
    a.write("oi\n");
    a.hello();
    return 0;
}

i love these way for put the parameters, very cool.
and see the way that i create the macro, can be realy dificulty at 1st, but it's very nice.
readers imagine the a_hello have some parameters, so we must declare it like the move and when we call it, we use arguments.
heres a nice link about Variadic Macros: http://gcc.gnu.org/onlinedocs/cpp/Variadic-Macros.html

anotherthing: if you need a create event with a class, declare it in construtor parameter.
i hope everyon enjoy with these nice code;)

cambalinho 142 Practically a Posting Shark

continue just with std::function:
if these is legal: std::function<void(...)> create(int a, int b);, why i can't do: create(2,3);???
errors messages:

"C:\Users\Joaquim\Documents\CodeBlocks\events13\main.cpp||In member function 'void test::write(std::string)':|
C:\Users\Joaquim\Documents\CodeBlocks\events13\main.cpp|14|error: invalid use of incomplete type 'class std::function<void(...)>'|
c:\program files\codeblocks\mingw32\lib\gcc\i686-w64-mingw32\4.8.1\include\c++\functional|1866|error: declaration of 'class std::function<void(...)>'|
||=== Build finished: 2 errors, 0 warnings (0 minutes, 1 seconds) ===|"

cambalinho 142 Practically a Posting Shark

with your code i did:

struct event
{
    void operator()(...)  { };
};



#include <iostream>
#include <string>
#include "events.h" //wehre is the structure

using namespace std;

class test
{
    public:
    event Soma(int a, int b);
    void write(string a)
    {
        cout << a;

        Soma(4,5);
    }
};

test a;


int main()
{
    a.Soma(int a, int b)
    {
        cout<<"\nMessage Printed\n" ;
    };
    a.write("hello world");
    cin.get();
    return 0;
}

but i get errors when i change the Soma()

"C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|24|error: expected primary-expression before 'int'|"

cambalinho 142 Practically a Posting Shark

i just have 1 question: the foo structure accept parameters?
how can i change the funtion?

cambalinho 142 Practically a Posting Shark

i belive theres another way.
see my code:

#ifndef events_H_INCLUDED
#define events_H_INCLUDED
#include <functional>
#include <vector>

template <typename ... b>
class event
{
public:
    typedef std::function<void(b...argx )> OnSomethingHandler;

    event(OnSomethingHandler Handler)
    {
        handlers_=Handler;
    }

    void operator ()(b... args)
    {
        handlers_(args...);
    }

    event& operator = (OnSomethingHandler Handler)
    {
        handlers_ = Handler;
        return *this;
    }
private:
    OnSomethingHandler handlers_;
};
#endif // events_H_INCLUDED

how i use it:

event<int,int> Soma{[](int a, int b) { ; }};

someone tell me that i can change the my template for not repeat the same type, can you advice me?

cambalinho 142 Practically a Posting Shark

1 thing: a functor is a variable that we can use lambda or call another function, right?

cambalinho 142 Practically a Posting Shark

thanks for that.. . thanks

cambalinho 142 Practically a Posting Shark

i'm building a class with std::function for recive several parameters or none:

class event2
{
public:
    typedef std::function<void(...)> OnSomethingHandler;


    void operator() (...)
    {
        eventwithoutarg (...);
    }

    event & operator = (OnSomethingHandler Handler(...))
    {
        eventwithoutarg(...) = Handler(...);
        return *this;
    }

private:
    OnSomethingHandler eventwithoutarg(...);
};

what i'm doing wrong with '...'?

cambalinho 142 Practically a Posting Shark

having test more and i found it.
when we create a window, we must choose what we need. theres some standard const's too ;)
when we need change it: we use the SetWindowLong() function very cool.
readers don't forget use GWL_STYLE for normal styles and GWL_EX_STYLE for EX styles;)

cambalinho 142 Practically a Posting Shark

just tell me more 1 thing: what is the const for no border?

cambalinho 142 Practically a Posting Shark

when we create the window, we can choose some styles. but i see 2 problems:
- how can i hide the border?(i have seen the msdn styles, but theres no const for that)
- how can i change the styles after create the window?

cambalinho 142 Practically a Posting Shark
int Foo::bar = 42; // <- 'definition'

you used the class name. can i use the instance\object name?

cambalinho 142 Practically a Posting Shark

i'm sorry.. someone correct me 1 thing: i can change the static members at the global scope, right?

cambalinho 142 Practically a Posting Shark

ok..thanks for all

cambalinho 142 Practically a Posting Shark

you even can use the '::' operator(well we can't overload it).
but i must give up on these thot :(
what you think about the Labdabeta code? he tell us that it's possible
thanks for all

cambalinho 142 Practically a Posting Shark
//events.h
#ifndef events_H_INCLUDED
#define events_H_INCLUDED

#include <functional>
#include <vector>


template <class ... b>
class events
{
public:
    typedef std::function<void(b...argx )> OnSomethingHandler;

    events(OnSomethingHandler Handler)
    {
        handlers_=Handler;
    }

    void operator() (b&&... args)
    {
        handlers_ (std::forward<b> (args)...);
    }

    events& operator = (OnSomethingHandler Handler)
    {
        handlers_ = Handler;
        return *this;
    }

private:
    OnSomethingHandler handlers_;

};

#endif // events_H_INCLUDED

i'm sorry, if i'm overloading '()' operator, why i can't use it, outside of main?
(sorry, but my objective is do it ouside of the main)

cambalinho 142 Practically a Posting Shark
cambalinho 142 Practically a Posting Shark
#include <iostream>
#include <string>
#include "events.h"

using namespace std;

class test
{
    public:
    events<>(*Printed)();
    void write(string a)
    {
        cout << a;
        Printed=[]{;};
    }

};

test a;
a.Printed=[]{cout<<"\nMessage Printed\n";})

int main()
{

    a.write("hello world");
    cin.get();
    return 0;
}

sorry i'm getting errors:(

"C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp||In member function 'void test::write(std::string)':|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|14|error: invalid user-defined conversion from 'test::write(std::string)::__lambda0' to 'events<> ()()' [-fpermissive]|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|14|note: candidate is: test::write(std::string)::__lambda0::operator void (
)()() const <near match>|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|14|note: no known conversion for implicit 'this' parameter from 'void ()()' to 'events<> ()()'|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|20|error: 'a' does not name a type|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|20|error: expected unqualified-id before ')' token|
||=== Build finished: 3 errors, 0 warnings (0 minutes, 1 seconds) ===|"

cambalinho 142 Practically a Posting Shark

please someone see these code(again):

#ifndef events_H_INCLUDED
#define events_H_INCLUDED

#include <functional>
#include <vector>


template <class ... b>
class events
{
public:
    typedef std::function<void(b...argx )> OnSomethingHandler;

    events(OnSomethingHandler Handler)
    {
        handlers_=Handler;
    }

    void operator ()(b... args)
    {
        handlers_(args...);
    }
    events& operator = (OnSomethingHandler Handler)
    {
        handlers_ = Handler;
        return *this;
    }

private:
    OnSomethingHandler handlers_;

};

#endif // events_H_INCLUDED

can i overload the '()' operator for use it ouside of main()?

cambalinho 142 Practically a Posting Shark

not that.. i know that.
i need change 1 function, using the object name, outside of functions\class's\namespaces.
just see these code:

#include <iostream>
#include <string>
#include "events.h"

using namespace std;

class test
{
    public:
    events<> Printed{[]() { ; }};
    void write(string a)
    {
        cout << a;
        Printed();
    }

};

test a;

void a.Printed=[]()
{
    cout << "\nMessage printed\n";
};

int main()
{
    a.write("hello world");
    cin.get();
    return 0;
}

i'm trying change the Printed value outside of main. but i get these error:
"error: expected initializer before '.' token"
so what i need overloading for use it without errors?
(seems that i can't overloading '::')

cambalinho 142 Practically a Posting Shark

can we do object Polymorphism?

cambalinho 142 Practically a Posting Shark

finaly i found my problem 'typename A' if i don't use it, i can't put it, or the compiler stays confuse...
so heres the correct code:

void write()
    {
        setlocale(LC_ALL, "en_US.UTF-8");
        cout <<"";

    }


    template <typename ...B>
    void write(string argHead, B... argTail)
    {
        setlocale(LC_ALL, "en_US.UTF-8");
        if (blnBlink==true)
        {
            CONSOLE_SCREEN_BUFFER_INFO csbi;

            GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
            string a;
            a=argHead;
            TextBlink(a, csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,csbi.wAttributes);
            COORD Position;
            Position.X=csbi.dwCursorPosition.X+strlen(a.c_str());
            Position.Y=csbi.dwCursorPosition.Y;
            SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Position);
        }

        else
            cout << argHead;
        write(argTail...);
    }


    template <typename ...B>
    void write(char *argHead, B... argTail)
    {
        setlocale(LC_ALL, "en_US.UTF-8");
        if (blnBlink==true)
        {
            CONSOLE_SCREEN_BUFFER_INFO csbi;

            GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
            string a;
            a=argHead;
            TextBlink(a, csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,csbi.wAttributes);
            COORD Position;
            Position.X=csbi.dwCursorPosition.X+strlen(a.c_str());
            Position.Y=csbi.dwCursorPosition.Y;
            SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Position);
        }

        else
            cout << argHead;
        write(argTail...);
    }

    template <typename A, typename ...B>
    void write(A argHead, B... argTail)
    {
        setlocale(LC_ALL, "en_US.UTF-8");
        if (blnBlink==true)
        {
            CONSOLE_SCREEN_BUFFER_INFO csbi;

            GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
            string a;
            a=to_string(argHead);
            TextBlink(a, csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,csbi.wAttributes);
            COORD Position;
            Position.X=csbi.dwCursorPosition.X+strlen(a.c_str());
            Position.Y=csbi.dwCursorPosition.Y;
            SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Position);
        }

        else
            cout << argHead;
        write(argTail...);
    }

thanks for all

cambalinho 142 Practically a Posting Shark

thanks for all

cambalinho 142 Practically a Posting Shark

so the functions have there own way for choose the bits.... understood
can you, please, give me a link for read more about that magic numbers?

cambalinho 142 Practically a Posting Shark

i don't know these calculations(someone did them for help me)... i need to understand them because seems to be used in very situations.
thanks for all, but please give more information about these type of calculations.
thanks

cambalinho 142 Practically a Posting Shark

the csbi.wAttributes are combinations of '|' operators,...

DWORD textcolor = csbi.wAttributes & 0xff0f;
DWORD backcolor = (csbi.wAttributes & 0xfff0) >> 4;

i understand the 0xff0f is a hexadecimal value(i don't know in decimal), but why these number and not other?
can anyone explain to me these 2 calculations?
(they are changed with SetConsoleTextAttribute() function)

cambalinho 142 Practically a Posting Shark

with another help, i fix the code:

//clear the Console
    void Clear(int BackColor=-1)
    {
         // home for the cursor
        COORD coordScreen = {0, 0};
        DWORD cCharsWritten;
        CONSOLE_SCREEN_BUFFER_INFO csbi;
        DWORD dwConSize;

        // Get the number of character cells in the current buffer
        if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
            return;
        dwConSize = csbi.dwSize.X * csbi.dwSize.Y;

        // Fill the entire screen with blanks
        if(!FillConsoleOutputCharacter(GetStdHandle(STD_OUTPUT_HANDLE), (WCHAR)' ', dwConSize, coordScreen, &cCharsWritten))
            return;

        // Get the current text attribute.
        if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
            return;
        if (BackColor!=-1)
        {
            DWORD textcolor = csbi.wAttributes & 0xff0f;
            //DWORD backcolor = (csbi.wAttributes & 0xfff0) >> 4;
            csbi.wAttributes=textcolor | BackColor ;//here we change the backcolor
        }
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), csbi.wAttributes );
        // Set the buffer's attributes accordingly.
        if(!FillConsoleOutputAttribute(GetStdHandle(STD_OUTPUT_HANDLE), csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten))
            return;
        // Put the cursor at its home coordinates.
        SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coordScreen);
    }

now, when i clear the screen i can use the last colors(backcolor=-1) or change the backcolor.
thanks for all

cambalinho 142 Practically a Posting Shark

thanks for correct me... sorry if i fail in some things of the forum.. isn't by bad, but i want learn

cambalinho 142 Practically a Posting Shark

thanks for tell me that(i didn't knew that) ~s.o.s~. and thanks for change the title pritaeas

cambalinho 142 Practically a Posting Shark
 //write
    void write()
    {
        setlocale(LC_ALL, "en_US.UTF-8");
        cout <<"";

    }


    template <typename A, typename ...B>
    void write(string argHead, B... argTail)
    {
        setlocale(LC_ALL, "en_US.UTF-8");
        if (blnBlink==true)
        {
            CONSOLE_SCREEN_BUFFER_INFO csbi;

            GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
            string a;
            a=argHead;
            TextBlink(a, csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,csbi.wAttributes);
            COORD Position;
            Position.X=csbi.dwCursorPosition.X+strlen(a.c_str());
            Position.Y=csbi.dwCursorPosition.Y;
            SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Position);
        }

        else
            cout << argHead;
        write(argTail...);
    }


    template <typename A, typename ...B>
    void write(char *argHead, B... argTail)
    {
        setlocale(LC_ALL, "en_US.UTF-8");
        if (blnBlink==true)
        {
            CONSOLE_SCREEN_BUFFER_INFO csbi;

            GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
            string a;
            a=argHead;
            TextBlink(a, csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,csbi.wAttributes);
            COORD Position;
            Position.X=csbi.dwCursorPosition.X+strlen(a.c_str());
            Position.Y=csbi.dwCursorPosition.Y;
            SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Position);
        }

        else
            cout << argHead;
        write(argTail...);
    }

    template <typename A, typename ...B>
    void write(A argHead, B... argTail)
    {
        setlocale(LC_ALL, "en_US.UTF-8");
        if (blnBlink==true)
        {
            CONSOLE_SCREEN_BUFFER_INFO csbi;

            GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi);
            string a;
            //next 2 lines give me an error
            a=to_string(argHead);
            TextBlink(a, csbi.dwCursorPosition.X, csbi.dwCursorPosition.Y,csbi.wAttributes);
            COORD Position;
            Position.X=csbi.dwCursorPosition.X+strlen(a.c_str());
            Position.Y=csbi.dwCursorPosition.Y;
            SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),Position);
        }

        else
            cout << argHead;
        write(argTail...);
    }

like you see, i'm overloading the write function for diferent types. but i get several errors on last write(). can anyone advice me?

"C:\Users\Joaquim\Documents\CodeBlocks\My Class\console.h|218|error: call of overloaded 'to_string(char*&)' is ambiguous|"

cambalinho 142 Practically a Posting Shark

why these thread??? because i have 1 thread that the title need be changed:http://www.daniweb.com/software-development/cpp/threads/466667/how-use-writeconsoleoutputattribute
to "how use WriteConsoleOutputAttribute() and WriteConsoleOutput()?"
please someone change it
thanks

cambalinho 142 Practically a Posting Shark

but you can change the thread title?

cambalinho 142 Practically a Posting Shark

seems that i don't fix it:(
from here:

csbi.wAttributes

how can i calculate the Backcolor and textcolor?

cambalinho 142 Practically a Posting Shark

why i can't change the thread title?

cambalinho 142 Practically a Posting Shark

sorry... don't forget that i add '| 2000', that's why i don't recive the correct results.
so i can't use SetConsoleTextAttribute() for add extra data. but i did in a diferent way and works fine ;)
in time, i will share the Console class... you will love it ;)
thanks for all

cambalinho 142 Practically a Posting Shark

finally i fix it:

//clear the Console
    void Clear(int BackColor=0)
    {
         // home for the cursor
        COORD coordScreen = {0, 0};
        DWORD cCharsWritten;
        CONSOLE_SCREEN_BUFFER_INFO csbi;
        DWORD dwConSize;

        // Get the number of character cells in the current buffer
        if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
            return;
        dwConSize = csbi.dwSize.X * csbi.dwSize.Y;

        // Fill the entire screen with blanks
        if(!FillConsoleOutputCharacter(GetStdHandle(STD_OUTPUT_HANDLE), (WCHAR)' ', dwConSize, coordScreen, &cCharsWritten))
            return;

        // Get the current text attribute.
        if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
            return;
        csbi.wAttributes=csbi.wAttributes | BackColor; //heres i change the backcolor
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), csbi.wAttributes );
        // Set the buffer's attributes accordingly.
        if(!FillConsoleOutputAttribute(GetStdHandle(STD_OUTPUT_HANDLE), csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten))
            return;
        // Put the cursor at its home coordinates.
        SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coordScreen);
    }

if these line isn't correct:

csbi.wAttributes=csbi.wAttributes | BackColor; //heres i change the backcolor

please tell me.
thanks for all

Note: i change my write() function for accept the blink... very cool and works fine ;)

cambalinho 142 Practically a Posting Shark

i have these code for clear the screen:

//clear the Console
    void Clear(int BackColor=0)
    {
         // home for the cursor
        COORD coordScreen = {0, 0};
        DWORD cCharsWritten;
        CONSOLE_SCREEN_BUFFER_INFO csbi;
        DWORD dwConSize;

        // Get the number of character cells in the current buffer
        if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
            return;
        dwConSize = csbi.dwSize.X * csbi.dwSize.Y;

        // Fill the entire screen with blanks
        if(!FillConsoleOutputCharacter(GetStdHandle(STD_OUTPUT_HANDLE), (WCHAR)' ', dwConSize, coordScreen, &cCharsWritten))
            return;
        SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), 15|BackColor<<4 );
        // Get the current text attribute.
        if(!GetConsoleScreenBufferInfo(GetStdHandle(STD_OUTPUT_HANDLE), &csbi))
            return;
        // Set the buffer's attributes accordingly.
        if(!FillConsoleOutputAttribute(GetStdHandle(STD_OUTPUT_HANDLE), csbi.wAttributes, dwConSize, coordScreen, &cCharsWritten))
            return;
        // Put the cursor at its home coordinates.
        SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), coordScreen);
    }

i see at least 1 problem: after clear, the text color is, always, white and not the last color. can anyone advice me?

cambalinho 142 Practically a Posting Shark

i have tested now:

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), FOREGROUND_GREEN | BACKGROUND_BLUE | 2000 );

the backcolor isn't blue

cambalinho 142 Practically a Posting Shark

thanks for correct me. i can try and test if theres an error. but then how can i test if the Blink is there?

cambalinho 142 Practically a Posting Shark

i know use SetConsoleTextAttribute():

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), ForgC|(BackC<<4) );

(too be honest: i don't have sure if i can avoid the '<<4')
i need ask these: can i add it more data and then use it?
like:
Blink=128

SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), ForgC|(BackC<<4) | Blink);

and then test if these value is there?

cambalinho 142 Practically a Posting Shark

for change the functions(with diferente objects) outside of functions\class and others.

(in my case) the problem of class direved from other class is that i must re-declare the functions

cambalinho 142 Practically a Posting Shark

see these class:

class test
{
   public:
       void Created(){};
       test()
       {
           Created();
       }
};

now we can create objects from it. ok.
but can i overloading the scope-resolution ('::') for the object accept and change the Created() function?

cambalinho 142 Practically a Posting Shark

thanks for the comment..thank you.
sometimes my brain come with something ;)
i accept sugestions for timer loop and feedbacks;)

cambalinho 142 Practically a Posting Shark

now i have a new version of the blink text:

//blinktext.h
#include <windows.h>
#include <process.h>

#include <string>
#include <iostream>
using namespace std;

//ForeColor
const int ForeColorBlack        = 0;
const int ForeColorBlue         = FOREGROUND_BLUE;
const int ForeColorGreen        = FOREGROUND_GREEN;
const int ForeColorCyan         = FOREGROUND_BLUE | FOREGROUND_GREEN;
const int ForeColorRed          = FOREGROUND_RED;
const int ForeColorMagenta      = FOREGROUND_BLUE | FOREGROUND_RED;
const int ForeColorBrown        = FOREGROUND_GREEN | FOREGROUND_RED;
const int ForeColorLightGray    = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED;
const int ForeColorDarkGray     = FOREGROUND_INTENSITY;
const int ForeColorLightBlue    = FOREGROUND_BLUE | FOREGROUND_INTENSITY;
const int ForeColorLightGreen   = FOREGROUND_GREEN | FOREGROUND_INTENSITY;
const int ForeColorLightCyan    = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_INTENSITY;
const int ForeColorLightRed     = FOREGROUND_RED |  FOREGROUND_INTENSITY;
const int ForeColorLightMagenta = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_INTENSITY;
const int ForeColorYellow       = FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY;
const int ForeColorWhite        = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED | FOREGROUND_INTENSITY;

//BackColor
const int BackColorBlack        = 0;
const int BackColorBlue         = BACKGROUND_BLUE;
const int BackColorGreen        = BACKGROUND_GREEN;
const int BackColorCyan         = BACKGROUND_BLUE | BACKGROUND_GREEN;
const int BackColorRed          = BACKGROUND_RED;
const int BackColorMagenta      = BACKGROUND_BLUE | BACKGROUND_RED;
const int BackColorBrown        = BACKGROUND_GREEN | BACKGROUND_RED;
const int BackColorLightGray    = BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_RED;
const int BackColorDarkGray     = BACKGROUND_INTENSITY;
const int BackColorLightBlue    = BACKGROUND_BLUE | BACKGROUND_INTENSITY;
const int BackColorLightGreen   = BACKGROUND_GREEN | BACKGROUND_INTENSITY;
const int BackColorLightCyan    = BACKGROUND_BLUE | BACKGROUND_GREEN | BACKGROUND_INTENSITY;
const int BackColorLightRed     = BACKGROUND_RED |  BACKGROUND_INTENSITY;
const int BackColorLightMagenta = BACKGROUND_BLUE | BACKGROUND_RED | BACKGROUND_INTENSITY;
const int BackColorYellow       = BACKGROUND_GREEN | BACKGROUND_RED | BACKGROUND_INTENSITY;
const int BackColorWhite        = BACKGROUND_BLUE | BACKGROUND_GREEN | …