I have an Editbox in a dialog, when the dialog is created I send a text to the editbox, but this makes the text in the editbox to be marked (chosen).
How can I avoid it?
thanks.
I have an Editbox in a dialog, when the dialog is created I send a text to the editbox, but this makes the text in the editbox to be marked (chosen).
How can I avoid it?
thanks.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
According the off-line MSDN:
According the link you gave me:Code:SendMessage(GetDlgItem(hDlg, IDD_PREVIEW_PORT), EM_SETSEL, -1, 0);
They both don't work, why?Code:SendMessage(GetDlgItem(hDlg, IDD_PREVIEW_PORT), EM_SETSEL, 1, 0);
Last edited by Devil Panther; 07-26-2003 at 02:17 PM.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
I agree with Devil Panther. Something is up here. MSDN says:
That is entirely untrue. Every "1" should be replaced with "-1" for it to be true. What's with the emoticon adrian? Care to explain yourself?If the start is 0 and the end is 1, all the text in the edit control is selected. If the start is 1, any current selection is deselected.
Devil Panther, the following line works for me:
Code:SendMessage(hEdit,EM_SETSEL,-1,0);
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
The MSDN library says...
>>>
If the start is 0 and the end is 1, all the text in the edit control is selected. If the start is 1, any current selection is deselected.
<<<
... however, the cd's say...
>>>
If the nStart parameter is 0 and the nEnd parameter is –1, all the text in the edit control is selected. If nStart is –1, any current selection is removed.
<<<
... which is a little odd since I had always assumed one was created from the other.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
So the online MSDN is incorrect? It appears that way to me.
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials
Would seem so. The -1 is what I've always used and never had any trouble with.
Wave upon wave of demented avengers march cheerfully out of obscurity unto the dream.
I think it just checks for a non-zero value, so 1 and -1 are the same.
"I don't suffer from insanity but enjoy every minute of it" - Edgar Allen Poe
http://www.Bloodware.net - Developing free software for the community.
Actually DevilPanther, that's untrue. Doing what MSDN says will NOT give you the desired results. specifying 0,1 will select the first character. Specifying 1,0 will select the first character also. I advise that you use -1.
EDIT: Typo
Last edited by bennyandthejets; 07-27-2003 at 04:15 PM.
[email protected]
Microsoft Visual Studio .NET 2003 Enterprise Architect
Windows XP Pro
Code Tags
Programming FAQ
Tutorials