cambalinho 142 Practically a Posting Shark

i advice doing the: Internet Options - Advanced - Reset
try these and tell me if works

cambalinho 142 Practically a Posting Shark

sorry why i get an error with these exemple:

#include <iostream>
#include <string.h>
#include <typeinfo.h>

using namespace std;

class Variant
{
private:
    string result;
public:

    Variant()
    {
    }

    template<typename B>
    Variant(B val)
    {
        result=to_string(val);
    }

    Variant(string val)
    {
        result=val;
    }

    Variant(const char val)
    {
        result=val;
    }

    Variant(const char *val)
    {
        result=string(val);
    }

    Variant(bool val)
    {
        result=to_string(val);
        if (result=="0")
        {
            result="false";
        }
        else
        {
            result="true";
        }
    }

    friend ostream& operator<< (ostream &out, Variant &VResult)
    {
       out <<VResult.result;
       return out;
    }

    friend istream& operator >> (istream &in, Variant &VResult)
    {
        getline(in,VResult.result);
        return in;
    }

    operator int() const
    {
        return atoi(result.c_str());
    }

    operator long() const
    {
        return atol(result.c_str());
    }

    operator double() const
    {
        return atof(result.c_str());
    }

    operator string() const
    {
        return result.c_str();
    }
};

int main()
{
    string b;
    Variant a;
    b="oi";
    a=b;
    a="oi";
    b=a;// error
    cout << b;
    return 0;
}

but not with numbers :(
"error: ambiguous overload for 'operator=' (operand types are 'std::string {aka std::basic_string<char>}' and 'Variant')"

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

using namespace std;

class Variant
{
private:
    string result;
public:

    Variant()
    {
    }

    template<typename B>
    Variant(B val)
    {
        result=to_string(val);
    }

    Variant(string val)
    {
        result=val;
    }

    Variant(const char val)
    {
        result=val;
    }

    Variant(const char *val) //i try these, but seems ignored :(
    {
        result=string(val);
    }

    Variant(bool val)
    {
        result=to_string(val);
        if (result=="0")
        {
            result="false";
        }
        else
        {
            result="true";
        }
    }

    friend ostream& operator<< (ostream &out, Variant &VResult)
    {
       out <<VResult.result;
       return out;
    }

    friend istream& operator >> (istream &in, Variant &VResult)
    {
        getline(in,VResult.result);
        return in;
    }

    operator int() const
    {
        return atoi(result.c_str());
    }

    operator long() const
    {
        return atol(result.c_str());
    }

    operator double() const
    {
        return atof(result.c_str());
    }

    operator string() const
    {
        return result.c_str();
    }

    template <typename B>
    B operator =(Variant &value)
    {
        return atof(value.result.c_str());
    }

    string operator =(Variant &value)
    {
        return value.result;
    }
};

int main()
{
    char *test="hjello";
    Variant a=test[2];//yah... i must fix these too ;)
    cout << a;
    return 0;
}

for now, forget that comments.... if is needed, i do another topic ;)

cambalinho 142 Practically a Posting Shark

you continue with network problems?

cambalinho 142 Practically a Posting Shark

see these 2 functions:

template <typename B>
    B operator =(Variant &value)
    {
        return atof(value.result.c_str());
    }

    string operator =(Variant &value)
    {
        return value.result;
    }

imagine that i need, too, return a char*.... if i do a 3rd function, the compiler give me an error :(

cambalinho 142 Practically a Posting Shark

when we overloading a function: what matters is only the argument list(inclued the types) or the return type too?
i'm overloading the assigment operator, but seems that i can't use with diferent return types:(
please someone explain to me

cambalinho 142 Practically a Posting Shark

i mean like these:

template<typename T>
class variant2
{
private:
    void *Vvariant=NULL;
    T typ;
public:

    template<typename b>
    variant2 (b &value)
    {
        Vvariant=&value ;
        typ=b;

    }

    template<typename b>
    variant2 & operator = (b &value)
    {
        typ=b;
        Vvariant=&value ;

        return *this;
    }

    friend ostream& operator <<(ostream &os,const variant2 &obj)
    {
        os <<*static_cast<typ*>( obj.Vvariant) ;//see the typ
        return os;
    }
};

int main()
{
   variant2 d;
   d=100;
   cout << d;
}

but i get several errors :(

cambalinho 142 Practically a Posting Shark

yes

cambalinho 142 Practically a Posting Shark

can i create 1 template that i use inside the class and not when i create the class object?

cambalinho 142 Practically a Posting Shark

see these:

class variant2
    {
    private:
        void *Vvariant=NULL;
    public:

        template<typename b>
        variant2 & operator = (b &value)
        {
            Vvariant=&value ;   
            cout<< typeid(value).name();
            return *this;
        }

        friend ostream& operator <<(ostream &os,const variant2 &obj)
        {
            //os <<*static_cast<int*> (obj.Vvariant);
            return os;
        }
    };

if is string prints 'Ss' if is int, prints 'i' and so on...
but can i create a variable like these:

typeid f;//the type isn't correct, but tell me if i can do that
f=typeid(value);

????

cambalinho 142 Practically a Posting Shark

sorry can i create a variable for recive the variable type?

cambalinho 142 Practically a Posting Shark

:( sorry.. seems that i'm having communications problems :(

cout << *static_cast<string*>(test);

i know these line isn't corrected, but i want like these.
the type is int, but i want like a string("12").

cambalinho 142 Practically a Posting Shark

imagine that int is 200, i want print 200, but in a string way.. that's why the 'char *', but only prints 1 character :(

cambalinho 142 Practically a Posting Shark
cout << *static_cast<int*>(test);

test is a void pointer pointed to an int variable.
if i use:

cout << *static_cast<char*>(test);

i get just 1 character.
so how can i print the value directly to string?
if i use the string i get an memory error

cambalinho 142 Practically a Posting Shark

yah.. thanks for all
(seems that when i'm logined, i don't recive the mail notifications)

cambalinho 142 Practically a Posting Shark

without typecasting, can i get the adressed values?
seems that i can't see what it is the type

cambalinho 142 Practically a Posting Shark

i know:
- &varname is the adress of varname;
- *varname is the value of adressed variable.
but:

void *Vvariant=NULL;

friend ostream& operator <<(ostream &os,const variant2 &obj)
{
    os << obj.Vvariant; //how can i get the value of adressed variable?
    return os;
}

how can i get the value of adressed variable?

cambalinho 142 Practically a Posting Shark

i found the problem... but i don't know fix it :(
the problem can be the class, but using the cout works fine... but see my write function:
if blink is true, instead print the text, print '0000.000'(or even more 0's)

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(const 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...);
    }

but if the blink is false, the text it's printed normaly.
what you can advice me?

cambalinho 142 Practically a Posting Shark

do me a favor and see these:

variant (string value)
        {
            a=value;
        }


        variant & operator = (string const &b)
        {
            a=b;
            return *this;
        }

    friend ostream& operator <<(ostream &os,const variant &obj)
    {
        os << obj.a;
        return os;
    }

why the string value isn't saved to 'a'?

cambalinho 142 Practically a Posting Shark

i think theres anotherway if you don't mine explain to me:
void *b;
with static_cast, what you can tell me, please?

cambalinho 142 Practically a Posting Shark

understood.. thanks to all

cambalinho 142 Practically a Posting Shark

so i can do:

class test
    {
      public:
          int a;
    };

 int main()
{
    VARIANT vt;
    VariantInit(&vt); // initialize the VARIANT
    vt.vt = test;
    vt.a = 123; 
}

not tested... but can i do these?

cambalinho 142 Practically a Posting Shark

i'm sorry can you give me a exemple for use it?

cambalinho 142 Practically a Posting Shark

heres my variant class:

// *** ADDED BY HEADER FIXUP ***
#include <cstdlib>
#include <iostream>
#include <string>
// *** END ***
#ifndef VARIANT_H_INCLUDED
#define VARIANT_H_INCLUDED

class variant
{
    string a="";
 public:

    variant (string value="")
    {
        a=value;
    }

    variant (double value)
    {
        a=to_string(value);
    }

    friend istream& operator >>(istream &is,variant &obj)
    {
        is>>obj.a;
        return is;
    }

    friend ostream& operator <<(ostream &os,const variant &obj)
    {
        os<<obj.a;
        return os;
    }

    friend istream &getline(istream &in, variant &s1)
    {
        getline(in, s1.a);
        return in;
    }


    variant & operator = (int const & b)
    {
        a=to_string(b);
       return *this;
    }

    variant & operator = (string const & b)
    {
        a=b;
        return *this;
    }

    variant & operator = (double const & b)
    {
        a=to_string(b);
        return *this;
    }

    variant & operator = (float const & b)
    {
        a=to_string(b);
        return *this;
    }

    bool operator == (string const & b)
    {

        return  (a==b);
    }

    operator string() const
    {
        return a; // return string member
    }

    operator double() const
    {
        return atof(a.c_str()) ;
    }

};

#endif // VARIANT_H_INCLUDED

how can i update my class for accept struct's\class's\enum's and others?
why i don't use the template? because i must define the type before use it and then i can't use another type.

cambalinho 142 Practically a Posting Shark

now works, because i used the const keyword... i know the const is for avoid the the variable been changed, but i don't understand these situation:

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

    template <typename ...B>
    void write(const 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(const 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(const 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...);
    }

can anyone explain to me why?

cambalinho 142 Practically a Posting Shark

i'm confused.. realy
if the code worked before, why i get again the errors?

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);//error
            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...);
    }

the exemple:

Console.write("\nhello mother\n");

error message:
"error: call of overloaded 'to_string(const char*&)' is ambiguous"

sorry but these don't make sence to me :(
plase can anyone advice me?

cambalinho 142 Practically a Posting Shark

see these exemple:

#include <iostream>
#include <functional>

using namespace std;

class test
{
    public:
    function<void(void)> Message;
};

class a: public test
{
}a;

void a::Message=[]()
{
    cout << "hello world";
}

int main()
{
    a.Message();
    return 0;
}

error: "variable or field 'Message' declared void"
why these error?

cambalinho 142 Practically a Posting Shark

i'm confuse the 'void' isn't the return type?

cambalinho 142 Practically a Posting Shark

the function is a std::function<void(string a) write;
ok.... it's void.... but why the error about it???
what means these error?

cambalinho 142 Practically a Posting Shark

can anyone tell me all the macro consts?

cambalinho 142 Practically a Posting Shark

thanks...
for finish: can i do object polymorphism and use '::' operator?

cambalinho 142 Practically a Posting Shark

the same for functions, right?

cambalinho 142 Practically a Posting Shark

some day ago i read something, so please correct me.
i understand that i can't use a varname outside the functions\class's with '::' operator, but seems that i can use with static functions, can you explain please?

cambalinho 142 Practically a Posting Shark

thanks for the warning ;)

cambalinho 142 Practically a Posting Shark

i need understand better about combinations styles for don't give me problems... but seems the msdn link isn't the best :(

cambalinho 142 Practically a Posting Shark

i don't understand why not only 1 parameter for styles. but i have seen(i have tested now) they do a combination of the both styles(extend windows styles with windows styles). that's why i never get the borderless style ;)
hey i learned more than i thot today ;)
thanks for all

cambalinho 142 Practically a Posting Shark

finally i did ;)

// Step 2: Creating the Window
    hwnd = CreateWindowEx(
        WS_EX_APPWINDOW, //see here
        g_szClassName,
        "The title of my window",
         WS_OVERLAPPED|WS_POPUP , //see here
        CW_USEDEFAULT, CW_USEDEFAULT, 500, 500,
        NULL, NULL, hInstance, NULL);

explain to me what i'm confuse: the 1st and 4th arguments are for styles(they are both styles). can you explain better to me the diference?
and if i click 2 times(on task bar) the window isn't minimized.. it's a normal thing or i can activate that?

cambalinho 142 Practically a Posting Shark

thanks for the right term ;)
yes it is

cambalinho 142 Practically a Posting Shark

if i use NULL(no style) the window stays with textbox style :(

cambalinho 142 Practically a Posting Shark

imagine that i need a window without any border(just the rectangule backcolor). what combination styles i can use?

cambalinho 142 Practically a Posting Shark

i see.. if i need more than that switch, i continue with my code. if not, i can use your code.. .thanks for all
(that tutorial don't explain that)

cambalinho 142 Practically a Posting Shark

i'm learning win32 from: http://www.winprog.org/tutorial/start.html

but tell me(because i ear several persons) is these function correct?

LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    switch(msg)
    {
        case WM_CLOSE:
            DestroyWindow(hwnd);
        break;
        case WM_DESTROY:
            PostQuitMessage(0);
        break;
        default:
            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

the DefWindowProc() is on right place or must be outside of switch?
pleace anyone correct me

cambalinho 142 Practically a Posting Shark

owenransen thanks but read these:
"wParam

The high-order word indicates the distance the wheel is rotated, expressed in multiples or factors of WHEEL_DELTA, which is set to 120. A positive value indicates that the wheel was rotated to the right; a negative value indicates that the wheel was rotated to the left.

The low-order word indicates whether various virtual keys are down. This parameter can be one or more of the following values."

like you see theres another way ;)
but thanks for all

cambalinho 142 Practically a Posting Shark

ok.. i was seen better: is that Visual C++?

cambalinho 142 Practically a Posting Shark

thanks for all
i have read better and i found the answer here: http://msdn.microsoft.com/en-us/library/windows/desktop/ms645614%28v=vs.85%29.aspx
the 'The high-order word' is the HIWORD() function?
the 'The low-order word' is the LOWORD() function?

cambalinho 142 Practically a Posting Shark

thanks for all

cambalinho 142 Practically a Posting Shark

is like give me a 'good points'?
(sorry my english is limited)

cambalinho 142 Practically a Posting Shark

how can i test if the wheel move was negative or positive?
i belive these detect the mouse position:

xPos = GET_X_LPARAM(lParam); 
yPos = GET_Y_LPARAM(lParam);

but how can i test if any key(like alt\control\shift) was pressed?
(i'm talking in same message)

cambalinho 142 Practically a Posting Shark

i found 2 errors on your code;)
heres the entire windproc:

void TrackMouse(HWND hwnd)
{
    TRACKMOUSEEVENT tme;
    tme.cbSize = sizeof(TRACKMOUSEEVENT);
    tme.dwFlags = TME_HOVER | TME_LEAVE; //Type of events to track & trigger.
    tme.dwHoverTime = 5000; //How long the mouse has to be in the window to trigger a hover event.
    tme.hwndTrack = hwnd;
    TrackMouseEvent(&tme);
}
// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    static bool TrackingMouse = false;
    static bool WindowStopMoving = NULL;
    static bool WindowStopResize = NULL;
    static const UINT_PTR MouseStopTimerID = 1;

    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:
            if (!TrackingMouse)
            {
                TrackMouse(hwnd);
                TrackingMouse = true;
                SetWindowText(hwnd,"MOUSE Entered");
            }
            KillTimer(hwnd, MouseStopTimerID);
            SetTimer(hwnd, MouseStopTimerID, 100, NULL);
            break;
        case WM_MOUSEHOVER:
            SetWindowText(hwnd,"MOUSE hover");
            break;
        case WM_MOUSELEAVE :
            SetWindowText(hwnd,"MOUSE LEFT");
            TrackingMouse = false;
            break;
        case WM_MOVE:
            SetWindowText(hwnd,"window move");
            WindowStopMoving=false;
            WindowStopResize=true;
            break;
        case WM_SIZE :
            SetWindowText(hwnd,"Resized");
            WindowStopResize=false;
            WindowStopMoving=true;
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
        case WM_EXITSIZEMOVE:
            if(WindowStopResize==false)
            {
                SetWindowText(hwnd,"stop Resized");
                WindowStopResize=true;
            }
            else if (WindowStopMoving==false)
            {
                SetWindowText(hwnd,"stop MOve");
                WindowStopMoving=true;
            }
            break;
        case WM_TIMER:
            switch(wParam)
            {
                case MouseStopTimerID:
                {
                    SetWindowText(hwnd,"mouse stoped");
                    KillTimer(hwnd, MouseStopTimerID); //Kill the timer after processing it.
                }
                return 0; //This procedure must immediately return 0 if it processes a timer event.
            }
            break;

        default:

            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

yes.. i change the timer time for 100(but you can advice);)

cambalinho 142 Practically a Posting Shark

sorry i did a mistake: i said WM_EXITSIZEMOVE but used WM_EXITSIZEMOVEMODE(but don't exists).
now i can track the window stoped size and move:

void TrackMouse(HWND hwnd)
{
    TRACKMOUSEEVENT tme;
    tme.cbSize = sizeof(TRACKMOUSEEVENT);
    tme.dwFlags = TME_HOVER | TME_LEAVE; //Type of events to track & trigger.
    tme.dwHoverTime = 5000; //How long the mouse has to be in the window to trigger a hover event.
    tme.hwndTrack = hwnd;
    TrackMouseEvent(&tme);
}
// Step 4: the Window Procedure
LRESULT CALLBACK WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
    static bool TrackingMouse = false;
    static bool WindowStopMoving = NULL;
    static bool WindowStopResize = NULL;

    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:
            if (!TrackingMouse)
            {
                TrackMouse(hwnd);
                TrackingMouse = true;
                SetWindowText(hwnd,"MOUSE Entered");
            }
            break;
        case WM_MOUSEHOVER:
            SetWindowText(hwnd,"MOUSE hover");
            break;
        case WM_MOUSELEAVE :
            SetWindowText(hwnd,"MOUSE LEFT");
            TrackingMouse = false;
            break;
        case WM_MOVE:
            SetWindowText(hwnd,"window move");
            WindowStopMoving=false;
            WindowStopResize=true;
            break;
        case WM_SIZE :
            SetWindowText(hwnd,"Resized");
            WindowStopResize=false;
            WindowStopMoving=true;
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            break;
        case WM_EXITSIZEMOVE:
            if(WindowStopResize==false)
            {
                SetWindowText(hwnd,"stop Resized");
                WindowStopResize=true;
            }
            else if (WindowStopMoving==false)
            {
                SetWindowText(hwnd,"stop MOve");
                WindowStopMoving=true;
            }
            break;
        default:

            return DefWindowProc(hwnd, msg, wParam, lParam);
    }
    return 0;
}

these code works fine, but how can i track the mouse stoped?