If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register or Login
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

See if you can trace through your code to see where the problem resides. Try just creating one label etc to see if you can pin down the problem. If you can't, post the whole of your program so that I can compile it. I'll try it on MSVC 2012 and if it'll compile I'll have a look at it.

All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
C, C++ Compiler: Microsoft VS2015

Re: [win32] - creating controls using class's

when you have the time, please test the code.
the code works, but i'm seen 1 bug or my system is crazy.
the main window and the 2 labels have the same bug, but the mouse give them the focus.
i have the mouse stoped on label 1(or other control... it's the same), after some milliseconds(in cyle way and the same time) the label text it's changed automatic, why these behavior? i have seen these bug in console too. it's only with mouse move.
is these a code problem or the system?

Re: [win32] - creating controls using class's

For my test code, every time a WM_MOUSEMOVE message is received, the text in the appropriate window/conrol is changed to the next text in the cycle. If the text is changing then it's because a WM_MOUSEMOVE message has been received. Even if you don't think you have moved the mouse, the system thinks its positon has been changed so issues the message.

All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
C, C++ Compiler: Microsoft VS2015

Re: [win32] - creating controls using class's

Originally Posted by 2kaud

For my test code, every time a WM_MOUSEMOVE message is received, the text in the appropriate window/conrol is changed to the next text in the cycle. If the text is changing then it's because a WM_MOUSEMOVE message has been received. Even if you don't think you have moved the mouse, the system thinks its positon has been changed so issues the message.

Re: [win32] - creating controls using class's

You can 'desentitise' the mouse movement by only doing an action if the mouse has moved by say more than 2 pixels. The WM_MOUSEMOVE code for the label control could be changed to something like the below.

Note that it would probably be better if oldx and oldy are part of the class. I've just made them static here for ease of an example. The issue of having them static like this is that the same values are shared across all the label controls.

All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.
C, C++ Compiler: Microsoft VS2015

Re: [win32] - creating controls using class's

Originally Posted by 2kaud

You can 'desentitise' the mouse movement by only doing an action if the mouse has moved by say more than 2 pixels. The WM_MOUSEMOVE code for the label control could be changed to something like the below.

Note that it would probably be better if oldx and oldy are part of the class. I've just made them static here for ease of an example. The issue of having them static like this is that the same values are shared across all the label controls.

so these 'problem' is like the mouse be so precise, that we don't notice, but can 'move' and do the effect, right?