AutoHotkey Community

It is currently May 25th, 2012, 4:55 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: May 14th, 2007, 6:43 am 
Offline

Joined: May 14th, 2007, 6:39 am
Posts: 8
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?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 10:01 am 
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...


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 10:28 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
ES_PASSWORD is 0x20

Do you want to flag notepad's edit control with with +0x20 so that the entire text is asterisked ? :shock: :roll:


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 14th, 2007, 10:42 am 
Offline

Joined: May 14th, 2007, 6:39 am
Posts: 8
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 11:06 am 
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...


Report this post
Top
  
Reply with quote  
 Post subject: so is there other idea?
PostPosted: May 14th, 2007, 12:48 pm 
Offline

Joined: May 14th, 2007, 6:39 am
Posts: 8
it dosnt work , is there other idea?

Thanx
DrCode


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 1:34 pm 
That's what I wrote...
Another idea is to hide the control (Control Hide) or to mask it with a little GUI.


Report this post
Top
  
Reply with quote  
PostPosted: May 14th, 2007, 1:35 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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%


:)

PS: This looks like a candidate for my TipsNTricks


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 1:36 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 1:48 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 1:50 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Oh! :roll: I will check it in XP and post again. :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 1:51 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 1:58 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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.

:roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 2:03 pm 
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.


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 2:08 pm 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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


:roll:

Can anybody else confirm whether this stuff works ( or does not work ) in XP ?


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 34 posts ]  Go to page 1, 2, 3  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Cerberus, patgenn123, poserpro, Yahoo [Bot] and 33 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group