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.46 released: SubStr() and more expression operators
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Announcements
View previous topic :: View next topic  
Author Message
Sean



Joined: 12 Feb 2007
Posts: 1141

PostPosted: Tue Jun 12, 2007 1:00 am    Post subject: Reply with quote

engunneer wrote:
I think this answers a common Ask for Help question: "Can I detect another program making a sound?" Please correct me if I'm wrong.

I suppose so, with EVENT_SYSTEM_SOUND (:0x1), at least if the sound is among the system ones.
However, I can't test it as all my frequently used apps don't make a sound.
Back to top
View user's profile Send private message
BoBoĻ
Guest





PostPosted: Tue Jun 12, 2007 7:34 am    Post subject: Reply with quote

Quote:
I can't test it as all my frequently used apps don't make a sound
Wouldn't be AHKs SoundBeep exactly such an event (for testing)?
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Tue Jun 12, 2007 12:53 pm    Post subject: Reply with quote

What do you all think, should fast-mode be the default for RegisterCallback? Perhaps the answer depends on how often callbacks will be used for subclassing controls/windows and other situations that are triggered by incoming messages.

If revised the docs to read, "the fast mode inherits global settings from whichever thread happens to be running at the time the function is called. Furthermore, any changes the function makes to global settings (including ErrorLevel and the last-found window) will go into effect for the current thread. Consequently, the fast mode should be used only when it is known exactly which thread(s) the function will be called from."
Back to top
View user's profile Send private message Send e-mail
JGR



Joined: 15 Jun 2006
Posts: 52
Location: Unavailable until ~30th August

PostPosted: Tue Jun 12, 2007 3:29 pm    Post subject: Reply with quote

I would advise that the safe, conservative behaviour (slow) be the default, the existing syntax also implies this.

Consider the following:

hook:=RegisterCallback("somefunction","Fast")
hHook1:= SetWinEventHook(0x8000, 0x800D, hook)

...

FileCopy x, y

if ErrorLevel
blah...

If the hook is triggered between the FileCopy, and if ErrorLevel lines (a possibility, which cannot be ignored), then ErrorLevel may be changed by the function, and weird logic errors will result...
Realistically, Fast mode can only be used if the callback is called within the context of a single dllcall/function/small block of code.
As some people will inevitably miss this subtle point when writing code, having a default option which produces unpredictable thread interruption issues in many cases, seems a bad idea.
These sorts of in-between-line thread collisions are the type that cause rare seemingly random crashes in many multithreaded programs...

This is unless callback functions are changed in such a way that they save and restore certain variables automatically (such as ErrorLevel), which seems more work than it is worth...

JGR
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3877
Location: Pittsburgh

PostPosted: Tue Jun 12, 2007 3:40 pm    Post subject: Reply with quote

I agree with making the slow mode the default.

The beta version does not seem to support negative time values in SetTimer. Is it intentional?
Back to top
View user's profile Send private message Visit poster's website
SKAN



Joined: 26 Dec 2005
Posts: 5298

PostPosted: Tue Jun 12, 2007 3:45 pm    Post subject: Reply with quote

Laszlo wrote:
The beta version does not seem to support negative time values in SetTimer.


It does. Smile
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3877
Location: Pittsburgh

PostPosted: Tue Jun 12, 2007 3:57 pm    Post subject: Reply with quote

(sorry, it was a negative timer typo in my script)
Back to top
View user's profile Send private message Visit poster's website
Tuncay



Joined: 07 Nov 2006
Posts: 379
Location: Berlin

PostPosted: Tue Jun 12, 2007 8:04 pm    Post subject: Reply with quote

Chris wrote:

Tuncay wrote:
Why don`t you release beta versions on every big change, which would be a critical update?
It's a good practice, though sometimes the timing is such that it would significantly delay a release. Fortunately there are other tools such as polls that can help make the right design decisions.


The release delay would be true only to that release versions (say from 1.0.46.15 to 1.0.47) where are many big changes which should definitely tested out, not only by the author. Thats the meaning of open source (at least to me).

Is it not safer to delay a critical release? That day when introduced RegEx, some problems could be catched earlier and not after public release.
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Tue Jun 12, 2007 8:52 pm    Post subject: Reply with quote

No, I prefer to avoid beta releases. There are many advantages and disadvantages to it, but I think the good outweighs the harm. Also, whenever a release is considered high-risk for production environments, it is explicitly marked as such so that those who are concerned can wait a few weeks or months before adopting it.

Maybe it's the wrong decision, but it's worked pretty well so far. It also encourages a high level of quality assurance prior to each release.
Back to top
View user's profile Send private message Send e-mail
Laszlo



Joined: 14 Feb 2005
Posts: 3877
Location: Pittsburgh

PostPosted: Tue Jun 12, 2007 11:48 pm    Post subject: Reply with quote

Another successful test: High resolution timer II passed with flying colors. The callback mechanism seems to be rock solid!
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: Wed Jun 13, 2007 11:21 am    Post subject: Reply with quote

I don't mind bugs in AutoHotkey. They are often minor, because Chris usually do lot of testing before a release. And Chris is very reactive on bug fixing.
Another way of looking at it is to say that AHK is always in beta state, like Google softwares: rock solid, but hey! Very Happy
_________________
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
Titan



Joined: 11 Aug 2004
Posts: 5007
Location: imaginationland

PostPosted: Wed Jun 13, 2007 2:29 pm    Post subject: Reply with quote

What about non-standard data sizes, could Type accept a number for that?
_________________

RegExReplace("irc.freenode.net/autohotkey", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2")
Back to top
View user's profile Send private message Visit poster's website
foom



Joined: 19 Apr 2006
Posts: 386

PostPosted: Wed Jun 13, 2007 2:58 pm    Post subject: Reply with quote

Titan wrote:
What about non-standard data sizes, could Type accept a number for that?
I was wondering that too.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Wed Jun 13, 2007 3:50 pm    Post subject: Reply with quote

I think it would be too rarely used to have built into NumGet/NumPut. Currently, the only sizes supported are 1, 2, 4, and 8; but those seem to be enough to support 99.99% of cases.
Back to top
View user's profile Send private message Send e-mail
foom



Joined: 19 Apr 2006
Posts: 386

PostPosted: Wed Jun 13, 2007 6:39 pm    Post subject: Reply with quote

I doubt it would be hard to implement or bloat the code. So why the heck not implement it? Well i just guess you don't like the idea and that's why. See for me personally its easier to specify the size of a type then to remember what the Type was called that's is 8 or 4 or 2 bytes long plus its less to type. Further what if you got a buffer(from a file with an exotic format) and need to change an arbitrary block of it by replacing it with another buffer(a struct consisting of a long and a byte). This would require the Number param of NumSet() to behave similar to the VarOrAddress param (blank varname = copy a number, expression = copy buffer pointed by). But this shouldn't be a big problem to code.

Last edited by foom on Thu Jun 14, 2007 5:58 pm; edited 2 times in total
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Announcements All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8  Next
Page 7 of 8

 
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