Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

[H] ahkBridge() - ahk Process Bridge


  • Please log in to reply
6 replies to this topic
Larctic
  • Members
  • 303 posts
  • Last active: May 10 2016 04:56 PM
  • Joined: 21 Jul 2012
ahkBridge()
 
 
  • 进程间传递数据与交互控制;Passing data between processes with interactive control
  • 像 ahkdll 一样调用 ahkexe;similar ahkdll, Use ahkexe
 
General Example 普通示例:
 
 

; a.ahk

ahkBridge_Set("ahk1")
Return
a:
MsgBox a

; b.ahk

b:=ahkBridge("ahk1")
b.ahkLabel("a")
b.ahkterminate()
ExitApp

 

 

 

Similar ahkdll  类似 ahkdll:(All ahkdll commands can be used.)

AhkThread := ahkBridge()
AhkThread.ahktextdll()
AhkThread.addScript("Sub:`nMsgbox Sub`nReturn",0)
AhkThread.ahkLabel("Sub")
AhkThread.ahkterminate()
ExitApp
为了和ahkdll混合使用,使用了dll的函数名称。
目标是dll线程时,无法使用dll命令。因其无法获得自身句柄。
In order to mix ahkdll use, so direct use of the dll function name.
If the target thread is dll, dll command can not be used. dll can not obtain  own handle.

 

 

 

 

.

  • Thank HotKeyIt help.
  • Applicable AHKH, AHKL not tested.
  • 需要 BinRun(),AhkExported()
  • ahk-h  >= 1.1.13 

 

 

 

 

 
 


hd0202
  • Members
  • 709 posts
  • Last active: Feb 14 2016 08:05 PM
  • Joined: 13 Aug 2006

Thank you for the good work!

 

Sorry, if I now sound like "Larctic", but please can you give examples for 'more-way' communications, if these are possible with your tool?

 

one process of type "b.ahk" communicates with two processes of type "a.ahk"

two processes of type "b.ahk" communicate with one process of type "a.ahk"

 

Thank you in advance.

 

Hubert



Larctic
  • Members
  • 303 posts
  • Last active: May 10 2016 04:56 PM
  • Joined: 21 Jul 2012

I have updated the sample.



Larctic
  • Members
  • 303 posts
  • Last active: May 10 2016 04:56 PM
  • Joined: 21 Jul 2012

更新



guest3456
  • Members
  • 1704 posts
  • Last active: Nov 19 2015 11:58 AM
  • Joined: 10 Mar 2011
very interesting

RobertL
  • Members
  • 15 posts
  • Last active: Sep 25 2014 08:48 AM
  • Joined: 08 Oct 2013

Nice work!

Does it work on AHK_V2A? (Some lib may be adjusted/optimized for V2)

之前在HotKeyIt的帖子,我还不确定你讲中文。

向你学习啊,我还得大量借助翻译去看~

不知道论坛、群里哪个是你,也多回去推广呗~



Larctic
  • Members
  • 303 posts
  • Last active: May 10 2016 04:56 PM
  • Joined: 21 Jul 2012

我是汐潮。

中文论坛用H版的人少,所以没发在那里。

有V2的版本,修改的话只要在函数参数那里加上几个冒号就可以了。

因为现在ahkdll无法获取自身句柄,所以我想等实现获取之后,再写一个完全版本。