View Single Post
  #30  
Old 10-08-2007, 12:38 AM
_dave_ _dave_ is offline
Senior Member
 
Join Date: Feb 2005
Location: UK
Posts: 2,628
Default Re: PokerPad - AHK hotkey script

Awesome, TYVM [img]/images/graemlins/smile.gif[/img]

SendMessage / PostMessage are probably one of the most fantastic features of AHK - If you are unfamiliar with them (I am at best noob myself) they are well worth spending a few days learning.

Basically you can use SendMessage to communicate / call functions in other scripts / processes. PostMessage is similar, but only in the outgoing direction.

An axample would be as above - I run a #persistent script containing your OCR functions, with an OnMessage function, that returns the value from the OCR function.

The script wanting to OCR something fires a SendMessage to the OCR script, and recieves response from OCR script.


That is probably not very clear [img]/images/graemlins/frown.gif[/img]

A decent example is the way BetPot can SendMessage TableNavigator for the ahk_id of the currently highlighted table - that is done with the TableNav function in BetPot and the OnMessage 0x5555(I think) function in tableNavigator.

Very useful feature, allows AHKs to communicate with other AHKs / probably any other app [img]/images/graemlins/smile.gif[/img]

EDIT: Sendmessage is pretty much the only method for inter-script communication - and relies upon the existance of an OnMessage handler function in the receiving script - unless the sent message is low-numbered enough to be a standard Windows message.

dave.
Reply With Quote