AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Send password to Edit with hide
Goto page 1, 2, 3  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
drcode



Joined: 14 May 2007
Posts: 8

PostPosted: Mon May 14, 2007 5:43 am    Post subject: Send password to Edit with hide Reply with quote

Hi All

I want to send password with hide text, I use :

ControlSend,Edit1,MyPassword,Untitled - Notepad

I want to hide the Text that I send like:

Control, Style,-0x20,

Any idea?
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Grumpy
Guest





PostPosted: Mon May 14, 2007 9:01 am    Post subject: Reply with quote

Sorry, but I don't understand what you want to do exactly. Is Notepad just an example? Are you targetting some other control in an application?
Also I don't understand what the Control Style, -0x20 is supposed to do, pure numbers are not very expressive...
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Mon May 14, 2007 9:28 am    Post subject: Reply with quote

ES_PASSWORD is 0x20

Do you want to flag notepad's edit control with with +0x20 so that the entire text is asterisked ? Shocked Rolling Eyes
Back to top
View user's profile Send private message Send e-mail
drcode



Joined: 14 May 2007
Posts: 8

PostPosted: Mon May 14, 2007 9:42 am    Post subject: I have Edit1 with password Reply with quote

Hi

I don't mean notepad , I took notepad has example, I have software that have Edit1 with password that show up to users, I want to mask this password.

I use controlsend to send the password, is there way to make it mask?

Thanx
drcode
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Grumpy
Guest





PostPosted: Mon May 14, 2007 10:06 am    Post subject: Reply with quote

Thanks Skan, I missed it as there are numerous styles starting with 0x20, that's why I complained.
If you want to set this style, use +0x20, not -0x20

I tried:
Code:
appTitle = AutoHotkey Help
Control Style, +0x20, Edit2, %appTitle%
ControlSetText Edit2, foo,  %appTitle%
but it doesn't work (I see 'foo'), it might be a style needing to be set before creating the control. Maybe for security reasons, it might be annoying to be able to remove this style...
Back to top
drcode



Joined: 14 May 2007
Posts: 8

PostPosted: Mon May 14, 2007 11:48 am    Post subject: so is there other idea? Reply with quote

it dosnt work , is there other idea?

Thanx
DrCode
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Grumpy
Guest





PostPosted: Mon May 14, 2007 12:34 pm    Post subject: Reply with quote

That's what I wrote...
Another idea is to hide the control (Control Hide) or to mask it with a little GUI.
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Mon May 14, 2007 12:35 pm    Post subject: Re: so is there other idea? Reply with quote

drcode wrote:
is there other idea?


Sure.

1) Run Autohotkey help and select the Index tab.
2) Run the following code

Code:
EM_SETPASSWORDCHAR := 0xCC
ES_PASSWORD        := 0x20
PASSWORDCHAR       := "*"

appTitle = AutoHotkey Help

ControlGet, cHwnd, Hwnd,, Edit1, %appTitle%
Control, ExStyle, +0x20, ,ahk_id %cHwnd%
SendMessage, EM_SETPASSWORDCHAR, Asc(PASSWORDCHAR), 0,, ahk_id %cHwnd%


Smile

PS: This looks like a candidate for my TipsNTricks
Back to top
View user's profile Send private message Send e-mail
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Mon May 14, 2007 12:36 pm    Post subject: Reply with quote

Grumpy wrote:
Maybe for security reasons, it might be annoying to be able to remove this style...


It can be done: http://www.nirsoft.net/vb/passrev.html

Smile
Back to top
View user's profile Send private message Send e-mail
Grumpy
Guest





PostPosted: Mon May 14, 2007 12:48 pm    Post subject: Reply with quote

It doesn't work for me, neither your code (with Edit1, Search tab, or Edit2, Index tab) nor the simplified:
Code:
appTitle = AutoHotkey Help
Control ExStyle, +0x20, Edit2, %appTitle%
SendMessage 0xCC, Asc("*"), 0, Edit2, %appTitle%
msgbox %errorlevel%
ControlSetText Edit2, foo,  %appTitle%
Return
For some reason, on my system (WinXP Pro SP2), I get a FAIL on SendMessage. In your code, the cHwnd looks OK.
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Mon May 14, 2007 12:50 pm    Post subject: Reply with quote

Oh! Rolling Eyes I will check it in XP and post again. Smile
Back to top
View user's profile Send private message Send e-mail
Grumpy
Guest





PostPosted: Mon May 14, 2007 12:51 pm    Post subject: Reply with quote

Skan wrote:
Grumpy wrote:
Maybe for security reasons, it might be annoying to be able to remove this style...


It can be done: http://www.nirsoft.net/vb/passrev.html
Not really, ie. it doesn't change the style but it resets the password char.
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Mon May 14, 2007 12:58 pm    Post subject: Reply with quote

The following works for me in Win XP SP2

Code:
EM_SETPASSWORDCHAR := 0xCC
ES_PASSWORD        := 0x20
PASSWORDCHAR       := "*"

appTitle = AutoHotkey Help

ControlGet, cHwnd, Hwnd,, Edit2, %appTitle%
Control, ExStyle, +0x20, ,ahk_id %cHwnd%
SendMessage, EM_SETPASSWORDCHAR, Asc(PASSWORDCHAR), 0,, ahk_id %cHwnd%


The only change in code is Edit2 for Index which was Edit1 for me in Win 2000.

After running the code, minimize and maximize the CHM once.
I guess there must be drawing problems.

Rolling Eyes
Back to top
View user's profile Send private message Send e-mail
Grumpy
Guest





PostPosted: Mon May 14, 2007 1:03 pm    Post subject: Reply with quote

That's what I tried, and even with your hidding trick, it doesn't work (FAIL on SendMessage). Note that's what is done in the link you gave: the InvalidateRect refreshes the control.
Did you tried with a SP2 XP? It might be a new security thingy.
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Mon May 14, 2007 1:08 pm    Post subject: Reply with quote

Grumpy wrote:
Did you tried with a SP2 XP? It might be a new security thingy.


The system properties read as:

Microsoft Windows XP
Professional
Version 2002
Service Pack 2


Rolling Eyes

Can anybody else confirm whether this stuff works ( or does not work ) in XP ?
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group