 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
SKAN
Joined: 26 Dec 2005 Posts: 7609
|
Posted: Mon May 14, 2007 2:26 pm Post subject: |
|
|
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 |
 |
|
| Back to top |
|
 |
nick
Joined: 24 Aug 2005 Posts: 550 Location: Berlin / Germany
|
Posted: Mon May 14, 2007 2:29 pm Post subject: |
|
|
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  |
|
| Back to top |
|
 |
Grumpy Guest
|
Posted: Mon May 14, 2007 2:36 pm Post subject: |
|
|
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...
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
|
Posted: Mon May 14, 2007 2:42 pm Post subject: |
|
|
Thanks for confirming it.
@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,  |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2296
|
Posted: Mon May 14, 2007 3:11 pm Post subject: |
|
|
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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7609
|
Posted: Mon May 14, 2007 3:22 pm Post subject: |
|
|
| 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.
| Quote: | | Just for fun, please try to type C:\ after executing the following script: |
Very nice.
You are mimicking IE Address bar .. Is it not ?! Thanks for posting it.

Last edited by SKAN on Fri Sep 21, 2007 11:45 am; edited 1 time in total |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7609
|
Posted: Mon May 14, 2007 5:20 pm Post subject: |
|
|
Sean, Why the shlwapi\SHAutoComplete does not work with a ComboBox control ?  |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2296
|
Posted: Mon May 14, 2007 11:02 pm Post subject: |
|
|
| Skan wrote: | Sean, Why the shlwapi\SHAutoComplete does not work with a ComboBox control ?  |
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 |
|
 |
drcode
Joined: 14 May 2007 Posts: 8
|
Posted: Tue May 15, 2007 3:42 am Post subject: Thanx for the help - I have two more qustions |
|
|
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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7609
|
Posted: Tue May 15, 2007 8:11 am Post subject: |
|
|
| Sean wrote: | | in ComboBox case, first have to find its (child) Edit control. |
Thanks.
This will be useful to start a firefox/opera instance with IE address bar history.  |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7609
|
Posted: Tue May 15, 2007 8:12 am Post subject: Re: Thanx for the help - I have two more qustions |
|
|
@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.
 |
|
| Back to top |
|
 |
dncarac
Joined: 31 Aug 2006 Posts: 64
|
Posted: Mon Jun 04, 2007 2:34 pm Post subject: |
|
|
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 |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7609
|
Posted: Fri Sep 21, 2007 11:58 am Post subject: |
|
|
Dear Sean, I wanted to thank you for SHAutoComplete ...
I cannot find enough words  |
|
| Back to top |
|
 |
ahklerner
Joined: 26 Jun 2006 Posts: 1317 Location: USA
|
Posted: Fri Sep 21, 2007 12:23 pm Post subject: |
|
|
Sean
That is bada$$.  _________________
ʞɔпɟ əɥʇ ʇɐɥʍ |
|
| Back to top |
|
 |
NotLoggedIn-Conquer Guest
|
Posted: Fri Sep 21, 2007 12:51 pm Post subject: |
|
|
| Not working for me on windows XP. :/ |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|