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
majkinetor



Joined: 24 May 2006
Posts: 3544
Location: Belgrade

PostPosted: Thu May 31, 2007 8:58 pm    Post subject: Reply with quote

LOL

Nothing but the truth. Very Happy
_________________
Back to top
View user's profile Send private message MSN Messenger
corrupt



Joined: 29 Dec 2004
Posts: 2328

PostPosted: Fri Jun 01, 2007 3:09 am    Post subject: Reply with quote

Chris wrote:
For the next release, JGR has written the code to support built-in callbacks. I also hope to work on the mechanism for the standard library and a built-in Extract/InsertInteger.

Chris wrote:
In v1.0.46.17, A_UserName was fixed (it had been broken by v1.0.46.16).

Callbacks Question Razz Wink . Can you tell I'm anxious? Laughing
Back to top
View user's profile Send private message Visit poster's website
olfen



Joined: 04 Jun 2005
Posts: 99
Location: Stuttgart, Germany

PostPosted: Fri Jun 01, 2007 6:30 pm    Post subject: Reply with quote

Thanks a lot for the 1.0.46.16 update and coming callback feature!
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10450

PostPosted: Sun Jun 10, 2007 9:45 pm    Post subject: Reply with quote

In case anyone has time to try it out, here's a test release that contains RegisterCallback():
(Update: The latest release has RegisterCallback.)

Thanks to JGR for developing it.

The documentation is at http://www.autohotkey.com/docs/commands/RegisterCallback.htm
Improvements to the documentation or syntax are welcome.

This sample release also contains NumGet() and NumPut(), as well as minor improvements to OnMessage() and Critical.

The next step is to add the stdlib mechanism, after which 1.0.47 will be released.


Last edited by Chris on Sun Jun 24, 2007 12:37 pm; edited 1 time in total
Back to top
View user's profile Send private message Send e-mail
Tuncay



Joined: 07 Nov 2006
Posts: 379
Location: Berlin

PostPosted: Sun Jun 10, 2007 9:57 pm    Post subject: Reply with quote

Hey that is a good idea giving us the chance to test in beta status. So those who want to can help you.

Why don`t you release beta versions on every big change, which would be a critical update?

I will download and test/play some around with that new feature. (can`t wait longer `till stdlib capability)
Back to top
View user's profile Send private message Send e-mail
corrupt



Joined: 29 Dec 2004
Posts: 2328

PostPosted: Mon Jun 11, 2007 12:51 am    Post subject: Reply with quote

Thanks for the opportunity to test drive the test version. I'll understand if it isn't but thought I'd ask anyway... Is the source available for the test version?
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 1141

PostPosted: Mon Jun 11, 2007 1:13 am    Post subject: Reply with quote

Chris wrote:
In case anyone has time to try it out, here's a test release that contains RegisterCallback():

Thanks for the test build. It works fine so far.
BTW, would Fast mode better be the default?
I suppose most callback functions would work that way.

Code:
DetectHiddenWindows, On
DllCall("EnumWindows", "Uint", RegisterCallback("Window", "Fast"), "Uint", 1)

Window(hWnd, lParam)
{
   WinGetTitle, sTitle, ahk_id %hWnd%
   WinGetClass, sClass, ahk_id %hWnd%
   OutputDebug, % "hWnd: ". hWnd . "`tTitle: " . sTitle . "`tClass: " . sClass . (lParam ? "----------" : "")
   If lParam
   DllCall("EnumChildWindows", "Uint", hWnd, "Uint", A_EventInfo, "Uint", 0)
   Return 1
}
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3877
Location: Pittsburgh

PostPosted: Mon Jun 11, 2007 2:53 am    Post subject: Reply with quote

Fantastic! Callbacks work perfectly in the TCClib script (which call the dll version of the Tiny C Compiler, with a C program in an AHK variable.) Error messages and warnings are returned via callbacks. A MsgBox in an AHK function shows now the TCC messages, if they are any.
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 Jun 11, 2007 3:41 am    Post subject: Reply with quote

Thanks for the feedback.

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.

corrupt wrote:
Is the source available for the test version?
It hasn't been packaged because there may be some polishing done. Also, JGR hasn't had a chance to review and approve the recent syntax changes, nor has the stdlib mechanism been added. 1.0.47 should be out within a week, but if you need it sooner I can put it together and e-mail it to you.

Sean wrote:
would Fast mode better be the default?
I suppose most callback functions would work that way.
Originally it was the default but I intentionally reversed it to make its use a conscious/deliberate decision. If it becomes the default and is ever used by mistake, the script might begin displaying unpredictable behavior that would be very difficult to track down and isolate.

On the other hand, if it's felt that fast mode will be used more than 80% of the time, perhaps the convenience outweighs the risk of accidents.

Also, don't forget that every call to RegisterCallback() creates a new callback address -- even when the target function is the same as that of a previous call. Therefore, scripts should generally avoid calling RegisterCallback() more than once for a particular function (otherwise, it's usually a memory leak).
Back to top
View user's profile Send private message Send e-mail
corrupt



Joined: 29 Dec 2004
Posts: 2328

PostPosted: Mon Jun 11, 2007 4:04 am    Post subject: Reply with quote

Chris wrote:
corrupt wrote:
Is the source available for the test version?
It hasn't been packaged because there may be some polishing done. Also, JGR hasn't had a chance to review and approve the recent syntax changes, nor has the stdlib mechanism been added. 1.0.47 should be out within a week, but if you need it sooner I can put it together and e-mail it to you.
If it's not too much trouble I'd appreciate it. If it would take a considerable amount of time to put together then I'll wait.
Back to top
View user's profile Send private message Visit poster's website
Laszlo



Joined: 14 Feb 2005
Posts: 3877
Location: Pittsburgh

PostPosted: Mon Jun 11, 2007 6:08 am    Post subject: Reply with quote

I also tested Sean's keyboard hook script, with low level keyboard handler callback function. It also works perfectly.
Back to top
View user's profile Send private message Visit poster's website
Sean



Joined: 12 Feb 2007
Posts: 1141

PostPosted: Mon Jun 11, 2007 8:28 am    Post subject: Reply with quote

It also worked well with SetWinEventHook.
The omission of EVENT_OBJECT_VALUECHANGE (:0x800E) was intentional, as it made DbgView.exe irresponsive.

Code:
hHook := SetWinEventHook(3, 3, pfn := RegisterCallback("WinEvent", "Fast"))
hHook1:= SetWinEventHook(0x8000, 0x800D, pfn)
hHook2:= SetWinEventHook(0x800F, 0x8012, pfn)

DetectHiddenWindows, On
OnExit, Unhook
#Esc::
Unhook:
OnExit
UnhookWinEvent(hHook)
UnhookWinEvent(hHook1)
UnhookWinEvent(hHook2)
ExitApp


WinEvent(hHook, nEvent, hWnd, idObject, idChild, nEventThread, nEventTime)
{
   Critical
   WinGetTitle, sTitle, ahk_id %hWnd%
   WinGetClass, sClass, ahk_id %hWnd%
   OutputDebug, % nEvent . "|" . "`thWnd: ". hWnd . "`tTitle: " . sTitle . "`tClass: " . sClass . "`tidObject: " . idObject . " idChild: " . idChild
}

SetWinEventHook(eventMin, eventMax, pfn)
{
   Return DllCall("SetWinEventHook", "Uint", eventMin, "Uint", eventMax, "Uint", 0, "Uint", pfn, "Uint", 0, "Uint", 0, "Uint", 0)
}

UnhookWinEvent(hHook)
{
   Return DllCall("UnhookWinEvent", "Uint", hHook)
}

/*
EVENT_MIN         = 0x00000001
EVENT_SYSTEM_SOUND      = 0x00000001
EVENT_SYSTEM_ALERT      = 0x00000002
EVENT_SYSTEM_FOREGROUND      = 0x00000003
EVENT_SYSTEM_MENUSTART      = 0x00000004
EVENT_SYSTEM_MENUEND      = 0x00000005
EVENT_SYSTEM_MENUPOPUPSTART   = 0x00000006
EVENT_SYSTEM_MENUPOPUPEND   = 0x00000007
EVENT_SYSTEM_CAPTURESTAR   = 0x00000008
EVENT_SYSTEM_CAPTUREEND      = 0x00000009
EVENT_SYSTEM_MOVESIZESTART   = 0x0000000A
EVENT_SYSTEM_MOVESIZEEND   = 0x0000000B
EVENT_SYSTEM_CONTEXTHELPSTART   = 0x0000000C
EVENT_SYSTEM_CONTEXTHELPEND   = 0x0000000D
EVENT_SYSTEM_DRAGDROPSTART   = 0x0000000E
EVENT_SYSTEM_DRAGDROPEND   = 0x0000000F
EVENT_SYSTEM_DIALOGSTART   = 0x00000010
EVENT_SYSTEM_DIALOGEND      = 0x00000011
EVENT_SYSTEM_SCROLLINGSTART   = 0x00000012
EVENT_SYSTEM_SCROLLINGEND   = 0x00000013
EVENT_SYSTEM_SWITCHSTART   = 0x00000014
EVENT_SYSTEM_SWITCHEND      = 0x00000015
EVENT_SYSTEM_MINIMIZESTART   = 0x00000016
EVENT_SYSTEM_MINIMIZEEND   = 0x00000017
EVENT_OBJECT_CREATE      = 0x00008000
EVENT_OBJECT_DESTROY      = 0x00008001
EVENT_OBJECT_SHOW      = 0x00008002
EVENT_OBJECT_HIDE      = 0x00008003
EVENT_OBJECT_REORDER      = 0x00008004
EVENT_OBJECT_FOCUS      = 0x00008005
EVENT_OBJECT_SELECTION      = 0x00008006
EVENT_OBJECT_SELECTIONADD   = 0x00008007
EVENT_OBJECT_SELECTIONREMOVE   = 0x00008008
EVENT_OBJECT_SELECTIONWITHIN   = 0x00008009
EVENT_OBJECT_STATECHANGE   = 0x0000800A
EVENT_OBJECT_LOCATIONCHANGE   = 0x0000800B
EVENT_OBJECT_NAMECHANGE      = 0x0000800C
EVENT_OBJECT_DESCRIPTIONCHANGE   = 0x0000800D
EVENT_OBJECT_VALUECHANGE   = 0x0000800E
EVENT_OBJECT_PARENTCHANGE   = 0x0000800F
EVENT_OBJECT_HELPCHANGE      = 0x00008010
EVENT_OBJECT_DEFACTIONCHANGE   = 0x00008011
EVENT_OBJECT_ACCELERATORCHANGE   = 0x00008012
EVENT_CONSOLE_CARET      = 0x00004001
CONSOLE_CARET_SELECTION      = 0x00000001
CONSOLE_CARET_VISIBLE      = 0x00000002
EVENT_CONSOLE_UPDATE_REGION   = 0x00004002
EVENT_CONSOLE_UPDATE_SIMPLE   = 0x00004003
EVENT_CONSOLE_UPDATE_SCROLL   = 0x00004004
EVENT_CONSOLE_LAYOUT      = 0x00004005
EVENT_CONSOLE_START_APPLICATION   = 0x00004006
CONSOLE_APPLICATION_16BIT   = 0x00000001
EVENT_CONSOLE_END_APPLICATION   = 0x00004007
EVENT_MAX         = 0x7FFFFFFF
*/
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 3877
Location: Pittsburgh

PostPosted: Mon Jun 11, 2007 5:04 pm    Post subject: Reply with quote

This works flawlessly, too. Does it mean that we don't need wineventhook.dll any more?
Back to top
View user's profile Send private message Visit poster's website
JGR



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

PostPosted: Mon Jun 11, 2007 6:08 pm    Post subject: Reply with quote

callback.dll,wineventhook.dll & wineventhookq.dll are all superfluous with built in callbacks.
However cbthook.dll still necessary for CBT hooks, as they require dll injection...

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



Joined: 30 Aug 2005
Posts: 5957
Location: Pacific Northwest, US

PostPosted: Mon Jun 11, 2007 7:25 pm    Post subject: Reply with quote

Sean wrote:
It also worked well with SetWinEventHook.
The omission of EVENT_OBJECT_VALUECHANGE (:0x800E) was intentional, as it made DbgView.exe irresponsive.

Code:
hHook := SetWinEventHook(3, 3, pfn := RegisterCallback("WinEvent", "Fast"))
hHook1:= SetWinEventHook(0x8000, 0x800D, pfn)
hHook2:= SetWinEventHook(0x800F, 0x8012, pfn)
...

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.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
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 6 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