Pergunta

I am working on a c++ project on windows 7 64-bit. I have a textbox field of type EDITTEXT on my GUI that stores numbers.

Currently every time I double click on it, the numbers are selected but not their signs. I would like to include the sign as well when I double click on it.

Are there any ways I can solve this problem? Is it a configuration problem on windows, or I need to implement a separate event handler (which I currently don't know how) in my project?

Foi útil?

Solução

This is not a solution but a work around for my problem.

I found out my project uses dialog-based windows to handle input data.

From that I can create a static control as a LABEL for my edittext control (http://msdn.microsoft.com/en-us/library/ms997560.aspx) with SS_NOTIFY style (to capture mouse click messages) right before my edittext control.

Then in my custom DialogProc function (http://msdn.microsoft.com/en-us/library/windows/desktop/ms645469(v=vs.85).aspx) I can handle what will happen if the user click/double click the LABEL of my edittext. For my case, I use EM_SETSEL message (msdn.microsoft.com/en-us/library/windows/desktop/bb761661(v=vs.85).aspx) to select everything in the edittext control

Because I cannot figure out how to capture messages sent when user clicking inside an edittext control, I have to implement it on the LABEL instead. This does not solve the root of the problem but at least it works and its not a bad work around.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top