AutoHotkey Community

It is currently May 25th, 2012, 7:58 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 113 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8  Next
Author Message
 Post subject:
PostPosted: May 31st, 2007, 8:58 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
LOL

Nothing but the truth. :D

_________________
Image


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2007, 3:09 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2541
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 :?: :P :wink: . Can you tell I'm anxious? :lol:


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 1st, 2007, 6:30 pm 
Offline

Joined: June 4th, 2005, 1:30 am
Posts: 113
Location: Stuttgart, Germany
Thanks a lot for the 1.0.46.16 update and coming callback feature!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2007, 9:45 pm 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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 ... llback.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 June 24th, 2007, 12:37 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 10th, 2007, 9:57 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1933
Location: Germany
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)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 12:51 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2541
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?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 1:13 am 
Offline

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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 2:53 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 3:41 am 
Offline

Joined: March 2nd, 2004, 3:36 pm
Posts: 10720
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).


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 4:04 am 
Offline
User avatar

Joined: December 29th, 2004, 1:28 pm
Posts: 2541
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.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 6:08 am 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
I also tested Sean's keyboard hook script, with low level keyboard handler callback function. It also works perfectly.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 8:28 am 
Offline

Joined: February 12th, 2007, 7:54 am
Posts: 2462
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
*/


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 5:04 pm 
Offline

Joined: February 14th, 2005, 4:05 pm
Posts: 4710
Location: Boulder, CO
This works flawlessly, too. Does it mean that we don't need wineventhook.dll any more?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 6:08 pm 
Offline

Joined: June 15th, 2006, 6:29 am
Posts: 59
Location: Oriel College
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


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: June 11th, 2007, 7:25 pm 
Offline
User avatar

Joined: August 30th, 2005, 8:43 pm
Posts: 8647
Location: Salem, MA
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.

_________________
Image
(Common Answers) - New Tutorials Forum - Humongous FAQ


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 113 posts ]  Go to page Previous  1 ... 3, 4, 5, 6, 7, 8  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot 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