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 

v1.0.43 released: Send keystrokes faster & more reliably
Goto page Previous  1, 2
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Announcements
View previous topic :: View next topic  
Author Message
corrupt



Joined: 29 Dec 2004
Posts: 2328

PostPosted: Mon Apr 10, 2006 1:24 am    Post subject: Reply with quote

Nice. Thanks Smile

Chris wrote:
Added "WinGet ControlListHwnd", which retrieves a list of control HWNDs; 3) Added "ControlGet Hwnd", which retrieves the HWND that corresponds to a control's ClassNN.
Out of curiosity, do these use FindWindowEx internally?
Back to top
View user's profile Send private message Visit poster's website
PhiLho



Joined: 27 Dec 2005
Posts: 6702
Location: France (near Paris)

PostPosted: Mon Apr 10, 2006 6:48 am    Post subject: Reply with quote

Aaah, very nice one, with long waited features!
At least we can get rid of this GetChildHWND we pasted in so many scripts!
I will download it right now!
_________________
vPhiLho := RegExReplace("Philippe Lhoste", "^(\w{3})\w*\s+\b(\w{3})\w*$", "$1$2")
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Mon Apr 10, 2006 2:31 pm    Post subject: Reply with quote

corrupt wrote:
Out of curiosity, do these use FindWindowEx internally?
"WinGet ControlListHwnd" uses EnumChildWindows() to write each child's HWND to the list.

"ControlGet Hwnd" calls the standard ControlExist(ParentWindow, ClassNameAndNum), which is used by almost all of the ClassNN-accepting commands. It calls EnumChildWindows() to locate the specified instance number (NN of the ClassNN) or the specified text (such as the string "OK" on an OK button).
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Wed Apr 12, 2006 7:14 pm    Post subject: Reply with quote

Here are the changes for v1.0.43.07:

Fixed inability of "Menu, Tray, Icon" to load icon #1 from file types cpl/scr/drv/ocx/vbx/acm/bpl (broken by 1.0.43.03). Similarly, all icon-capable features have been improved to support these file types. [thanks Winkie & PhiLho]

Fixed the following legacy commands to accept function-calls containing commas: EnvAdd/Sub, LeftClick(Drag), RightClick(Drag). [thanks Titan]
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Mon Apr 17, 2006 9:25 pm    Post subject: Reply with quote

Here are the changes for v1.0.43.08:

Changed SendInput to use "SetKeyDelay -1, 0" when it reverts to SendEvent mode (unless SendEvent's KeyDelay "-1,-1", in which case "-1,-1" is used).

Added directive #NoEnv, which is recommended for all new scripts because:

1) It significantly improves performance whenever empty variables are used in an expression or command. It also improves DllCall's performance when unquoted parameter types are used (e.g. int vs. "int").

2) It prevents script bugs caused by environment variables whose names unexpectedly match variables used by the script.

3) A future version of AutoHotkey such as 1.1 might force this behavior into effect for all scripts (though such a change is not expected for at least a year).

Added built-in variables ComSpec and ProgramFiles to ease the transition to #NoEnv.

Added command EnvGet, which retrieves an environment variable.
Back to top
View user's profile Send private message Send e-mail
Laszlo



Joined: 14 Feb 2005
Posts: 3877
Location: Pittsburgh

PostPosted: Tue Apr 18, 2006 12:54 am    Post subject: Reply with quote

With #NoEnv the speed relations are changed between the dll calls with quoted parameter types, and unquoted ones.
Code:
#NoEnv

T0 = %A_TickCount%
Loop 1000000
   DllCall("SystemParametersInfo",  UInt ,0x68,  UInt ,0,  UIntP ,X,  UInt ,0)
  ;DllCall("SystemParametersInfo", "UInt",0x68, "UInt",0, "UIntP",X, "UInt",0)
MsgBox % A_TickCount - T0

Quoted -> 44344, 37653, 44015 42813, 43781 ("UInt*" works, too)
Unquoted -> 41735, 32656, 41844, 40375, 34171 (UInt* is not OK, use UIntP)

It looks like, referencing a special variable (UInt) is faster, than parsing a literal string. Taking the idea one step further, the fastest version is
Code:
#NoEnv

func = SystemParametersInfo
T0 = %A_TickCount%
Loop 1000000
   DllCall(func, UInt,0x68, UInt,0, UIntP,X, UInt,0)
MsgBox % A_TickCount - T0

Func -> 38031, 39328, 33469, 30812, 33594

It is interesting how much the execution time fluctuates. The loop runs a million times, still there is more than 20% variation in the measured time.
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Tue Apr 18, 2006 2:49 am    Post subject: Reply with quote

Interesting results; thanks for posting them. I tested a variant of the above but didn't get such a big deviation. Here are the changes I made:
- Half as many iterations.
- SetBatchLines -1
- Only three trials

My results for the script below (trial1/trial2/trial3):
4115/4106/4096 quoted param types
4166/4126/4156 unquoted param types (slightly slower than above for some reason)
3866/3856/3855 unquoted param types & function name (~8% faster for some reason)

With #NoEnv omitted, the last two rows above took over 4 times as long.
Code:
#NoEnv
SetBatchLines -1

T0 = %A_TickCount%
Loop 500000
   DllCall("SystemParametersInfo", "UInt",0x68, "UInt",0, "UIntP",X, "UInt",0)
Elapsed1 := A_TickCount - t0

T0 = %A_TickCount%
Loop 500000
   DllCall("SystemParametersInfo",  UInt ,0x68,  UInt ,0,  UIntP ,X,  UInt ,0)
Elapsed2 := A_TickCount - t0

func = SystemParametersInfo
T0 = %A_TickCount%
Loop 500000
   DllCall(func, UInt,0x68, UInt,0, UIntP,X, UInt,0)
Elapsed3 := A_TickCount - t0

MsgBox %Elapsed1%`n%Elapsed2%`n%Elapsed3%
Back to top
View user's profile Send private message Send e-mail
Lemming



Joined: 20 Dec 2005
Posts: 150
Location: Malaysia

PostPosted: Tue Apr 18, 2006 5:48 pm    Post subject: #NoEnv is good idea Reply with quote

Great idea, #NoEnv.

This will help prevent mysterious results for users who like to use variable names like TEMP, TMP, USERNAME, and PATH.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Tue Apr 25, 2006 5:01 pm    Post subject: Reply with quote

Here are the changes for v1.0.43.09:

Fixed SendInput not to revert to SendEvent merely because another script has a mouse hook. Only another keyboard hook should do that. [thanks baby-luck]

Fixed LV_GetCount() to work even if the "C" in its name is lowercase.

Changed FileSelectFile to follow/navigate shortcuts (.lnk files) rather than selecting them. There is also a new option to override this. [thanks Veovis & PhiLho]

Added "Gui +LastFoundExist" to detect the existence of a GUI window. [thanks Tekl & Evl]

Added built-in variables A_AppData, A_AppDataCommon, and A_Temp (A_Temp is the path to the folder designated to hold temporary files).
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Fri Apr 28, 2006 4:03 pm    Post subject: Reply with quote

Here are the changes for v1.0.43.10:

Improved PixelGetColor with two alternate modes that work in a broader variety of windows and full-screen apps. [thanks TDMedia]

Improved StringMid to allow "Count" to be omitted to retrieve all characters. [thanks kapege.de]

Improved FileSelectFile to support special folders such as My Computer via CLSID strings (FileSelectFolder and Run already support them).
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Mon May 01, 2006 3:30 pm    Post subject: Reply with quote

Here are the changes for v1.0.43.11:

Fixed %A_WorkingDir% on Windows 9x, which was sometimes blank. [thanks Points]

Improved BlockInput with a new mode that blocks only physical movement of the mouse, not keystrokes or mouse clicks.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Announcements All times are GMT
Goto page Previous  1, 2
Page 2 of 2

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


Powered by phpBB © 2001, 2005 phpBB Group