AutoHotkey Community

It is currently May 25th, 2012, 5:02 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 34 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject:
PostPosted: May 14th, 2007, 2:26 pm 
Offline
User avatar

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


:roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 2:29 pm 
Offline

Joined: August 24th, 2005, 5:29 pm
Posts: 549
Location: Berlin / Germany
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:


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


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

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

Regards, :)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 3:11 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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")
}


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

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
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. :o :D
You are mimicking IE Address bar .. Is it not ?! Thanks for posting it.

:)


Last edited by SKAN on September 21st, 2007, 11:45 am, edited 1 time in total.

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

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Sean, Why the shlwapi\SHAutoComplete does not work with a ComboBox control ? :roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 14th, 2007, 11:02 pm 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
Skan wrote:
Sean, Why the shlwapi\SHAutoComplete does not work with a ComboBox control ? :roll:

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


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

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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: May 15th, 2007, 8:11 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Sean wrote:
in ComboBox case, first have to find its (child) Edit control.


Thanks. :D
This will be useful to start a firefox/opera instance with IE address bar history. :)


Report this post
Top
 Profile  
Reply with quote  
PostPosted: May 15th, 2007, 8:12 am 
Offline
User avatar

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

:)


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 4th, 2007, 2:34 pm 
Offline

Joined: August 31st, 2006, 2:57 pm
Posts: 64
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 21st, 2007, 11:58 am 
Offline
User avatar

Joined: December 26th, 2005, 4:40 pm
Posts: 8775
Dear Sean, I wanted to thank you for SHAutoComplete :) ...
I cannot find enough words :cry:


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 21st, 2007, 12:23 pm 
Offline

Joined: June 26th, 2006, 6:14 pm
Posts: 1379
Location: USA
Sean

That is bada$$. :D

_________________
Image
ʞɔпɟ əɥʇ ʇɐɥʍ


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: September 21st, 2007, 12:51 pm 
Not working for me on windows XP. :/


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: 0x150||ISO, Cerberus, Google [Bot], poserpro, Yahoo [Bot] and 30 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