The MASM Forum

General => The Campus => Topic started by: ragdog on March 17, 2013, 02:21:53 AM

Title: EditControl
Post by: ragdog on March 17, 2013, 02:21:53 AM
Hi

I need for my app a masked editcontrol

How i can get the current curser pos and by WM_Keyup set the Curser pos ?
I have try with EM_SCROLLCARET without any result.

Title: Re: EditControl
Post by: dedndave on March 17, 2013, 03:15:13 AM
have you tried ES_PASSWORD style ?

http://msdn.microsoft.com/en-us/library/windows/desktop/bb775464%28v=vs.85%29.aspx (http://msdn.microsoft.com/en-us/library/windows/desktop/bb775464%28v=vs.85%29.aspx)

if you use comctrls v6 (manifest file and InitCommonControlsEx),
you can change the char from "*" to whatever you like with EM_SETPASSWORDCHAR
Title: Re: EditControl
Post by: ragdog on March 17, 2013, 06:03:06 AM
No dave

I have a editcontrol with subclass to allow chars

Now need i a function to get the current caret (cursel)

this can i use
invoke    SendMessage,hWnd,EM_EXGETSEL,0,addr chrg

I need a funktion to set the caret (cursel)
invoke    SendMessage,hWnd,EM_EXSETSEL,0,addr chrg

this set every the caret of end of line
Title: Re: EditControl
Post by: dedndave on March 17, 2013, 06:09:19 AM
is it a richedit control ?
or edit control ?
Title: Re: EditControl
Post by: jj2007 on March 17, 2013, 06:13:21 AM
Quote from: ragdog on March 17, 2013, 06:03:06 AM

I need a funktion to set the caret (cursel)
invoke    SendMessage,hWnd,EM_EXSETSEL,0,addr chrg

Use EM_SETSEL instead.
Title: Re: EditControl
Post by: ragdog on March 17, 2013, 06:44:40 AM
It is a edit control but i think i use a riched have i more Scope.

EM_SETSEL have i the same problem

I must get the caret  (cursel) modify my text and set the caret to the last current caret  (cursel)