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 Previous  1, 2, 3  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help
View previous topic :: View next topic  
Author Message
SKAN



Joined: 26 Dec 2005
Posts: 7609

PostPosted: Mon May 14, 2007 2:26 pm    Post subject: Reply with quote

The following code works in AHK Help, RUN Dialog , IE Address Bar etc
However it does not work in multiline Edit control such as notepad.

Code:
~+MButton::
 MouseGetPos,,,,cHwnd, 2
 Control, ExStyle, +0x20, ,ahk_id %cHwnd%
 SendMessage, 0xCC, Asc("*"), 0,, ahk_id %cHwnd%
 ; The following redraws the Control
 Control, Hide,,,ahk_id %cHwnd%
 Control, Show,,,ahk_id %cHwnd%
Return


Rolling Eyes
Back to top
View user's profile Send private message
nick



Joined: 24 Aug 2005
Posts: 550
Location: Berlin / Germany

PostPosted: Mon May 14, 2007 2:29 pm    Post subject: Reply with quote

It works with Win XP Pro SP1, sometimes!

It's strange, but the ClassNN of the Edit fields seems to change when opening and closing the tabs of the helpfile!
_________________
nick Wink
Back to top
View user's profile Send private message
Grumpy
Guest





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

I have the pleasure and surprise to announce that your last script works with Run dialog, IE address bar, WinExplorer address bar, AHK Help edit field in the Search tab... but not in the edit field in the Index tab, where I did my tests... Sad
Ah, I closed the Help, re-opened it, and it works in the later field! My experiments might have put it in some strange state...
Sorry for the noise, thanks for being persistent.
Back to top
SKAN



Joined: 26 Dec 2005
Posts: 7609

PostPosted: Mon May 14, 2007 2:42 pm    Post subject: Reply with quote

Thanks for confirming it. Smile

@Nick:

You wrote:
It works with Win XP Pro SP1, sometimes!
It's strange, but the ClassNN of the Edit fields seems to change when opening and closing the tabs of the helpfile!


So did I find, and I have posted better code which should work : http://www.autohotkey.com/forum/viewtopic.php?p=121607#121607

Regards, Smile
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2296

PostPosted: Mon May 14, 2007 3:11 pm    Post subject: Reply with quote

Hi Skan,

Skan wrote:
Code:
~+MButton::
 MouseGetPos,,,,cHwnd, 2
 Control, ExStyle, +0x20, ,ahk_id %cHwnd%
 SendMessage, 0xCC, Asc("*"), 0,, ahk_id %cHwnd%
 ; The following redraws the Control
 Control, Hide,,,ahk_id %cHwnd%
 Control, Show,,,ahk_id %cHwnd%
Return

Thanks for this vey interesting code.
BTW, ES_PASSWORD is Style, not ExStyle, of the (single-line) edit control.
So, I suppose the ExStyle, +0x20 (:WS_EX_TRANSPARENT) does no effect on the password style.
SendMessage with EM_SETPASSWORDCHAR seems to be the essential one.

Just for fun, please try to type C:\ after executing the following script:

Code:
Gui, Add, Edit, w640 HWNDhMyEdit
SendMessage, 0xCC, Asc("*"), 0,, ahk_id %hMyEdit%   ; Add ES_PASSWORD Style
SHAutoComplete(hMyEdit)
Gui, Show
;Sleep, 10000
;SendMessage, 0xCC, 0, 0,, ahk_id %hMyEdit%   ; Remove ES_PASSWORD Style
Return

~Enter::
ControlGetText, MyText, , ahk_id %hMyEdit%
Run, %MyText%
GuiClose:
ExitApp

SHAutoComplete(hEdit)
{
   DllCall("ole32\CoInitialize", "Uint", 0)
   DllCall("shlwapi\SHAutoComplete", "Uint", hEdit, "Uint", 0)
   DllCall("ole32\CoUninitialize")
}
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7609

PostPosted: Mon May 14, 2007 3:22 pm    Post subject: Reply with quote

Sean wrote:
Thanks for this vey interesting code.
BTW, ES_PASSWORD is Style, not ExStyle, of the (single-line) edit control.
So, I suppose the ExStyle, +0x20 (:WS_EX_TRANSPARENT) does no effect on the password style.
SendMessage with EM_SETPASSWORDCHAR seems to be the essential one.


Thanks for the clarification. Smile

Quote:
Just for fun, please try to type C:\ after executing the following script:

Very nice. Surprised Very Happy
You are mimicking IE Address bar .. Is it not ?! Thanks for posting it.

Smile


Last edited by SKAN on Fri Sep 21, 2007 11:45 am; edited 1 time in total
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7609

PostPosted: Mon May 14, 2007 5:20 pm    Post subject: Reply with quote

Sean, Why the shlwapi\SHAutoComplete does not work with a ComboBox control ? Rolling Eyes
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2296

PostPosted: Mon May 14, 2007 11:02 pm    Post subject: Reply with quote

Skan wrote:
Sean, Why the shlwapi\SHAutoComplete does not work with a ComboBox control ? Rolling Eyes

SHAutoComplete must be appied to Edit controls.
So, in ComboBox case, first have to find its (child) Edit control. E.g.,

Code:
Gui, Add, ComboBox, w640 HWNDhMyCombo
ControlGet, hMyEdit, hWnd,, Edit1, ahk_id %hMyCombo%
SHAutoComplete(hMyEdit)
Gui, Show
Return
Back to top
View user's profile Send private message
drcode



Joined: 14 May 2007
Posts: 8

PostPosted: Tue May 15, 2007 3:42 am    Post subject: Thanx for the help - I have two more qustions Reply with quote

Hi , Thanx again for the help

I have two more problems:

1. I have program that has menu inside this menu it open other menu, is there a way that I can find this window name. like in notepad (Untitled - NotePad) ?

2. I can also hide some windows inside software?

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



Joined: 26 Dec 2005
Posts: 7609

PostPosted: Tue May 15, 2007 8:11 am    Post subject: Reply with quote

Sean wrote:
in ComboBox case, first have to find its (child) Edit control.


Thanks. Very Happy
This will be useful to start a firefox/opera instance with IE address bar history. Smile
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7609

PostPosted: Tue May 15, 2007 8:12 am    Post subject: Re: Thanx for the help - I have two more qustions Reply with quote

@Drcode: I cannot understand your first question

drcode wrote:
2. I can also hide some windows inside software?


Should be possible. Please give an example.

Smile
Back to top
View user's profile Send private message
dncarac



Joined: 31 Aug 2006
Posts: 64

PostPosted: Mon Jun 04, 2007 2:34 pm    Post subject: Reply with quote

I know I'm late to the game in this thread, but I've become interested in this problem.

I know that the techniques discussed work only on single line edit fields. Is there any way to make them work in multiline fields. I've tried some experiments using one edit field to accept input and sending input to a second edit field with the thoughts that I'd hide the first field, but I ran into trouble with the editing keystrokes (backspace, delete, left and right arrows, mouse clicks in the middle of a field.)

What I need is a multiline edit field which accepts input from a user in the normal way (and I need to see what was typed), but which displays only "*" in place of the characters.

Any suggestions?

Dave
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 7609

PostPosted: Fri Sep 21, 2007 11:58 am    Post subject: Reply with quote

Dear Sean, I wanted to thank you for SHAutoComplete Smile ...
I cannot find enough words Crying or Very sad
Back to top
View user's profile Send private message
ahklerner



Joined: 26 Jun 2006
Posts: 1317
Location: USA

PostPosted: Fri Sep 21, 2007 12:23 pm    Post subject: Reply with quote

Sean

That is bada$$. Very Happy
_________________

ʞɔпɟ əɥʇ ʇɐɥʍ
Back to top
View user's profile Send private message
NotLoggedIn-Conquer
Guest





PostPosted: Fri Sep 21, 2007 12:51 pm    Post subject: Reply with quote

Not working for me on windows XP. :/
Back to top
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Ask for Help All times are GMT
Goto page Previous  1, 2, 3  Next
Page 2 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