AutoHotkey Community

It is currently May 26th, 2012, 3:33 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 59 posts ]  Go to page Previous  1, 2, 3, 4  Next
Author Message
 Post subject:
PostPosted: January 31st, 2008, 7:09 pm 
Thanks majkinetor for this example. But I was very interested when you said :
majkinetor wrote:
He can also use CreateWindowEx to create hidden control and subclass it, in which case it will not receive large number of messages. Then it can receive IPC messages.
So I'd like to have an example of a script with no (at least visible) window which receive an IPC message from an other script with no (at least visible) window. Thanks by advance


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2008, 8:15 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
Just don't use Gui, Show then :!:

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 31st, 2008, 8:43 pm 
OK. Sorry I'm a noob. So there is no problem using IPC_OnMessage and IPC_Send without any window.
Thanks for all your marvelous work (IPC, MMenu, etc)


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2009, 4:46 am 
Offline

Joined: March 27th, 2008, 2:14 pm
Posts: 700
Cool!

Now that 1.0.48 is out, you could use IsFunc() and allow specifying a function instead of only a label. Or maybe both. I guess I personally just have issues with global variables. :P

Btw, I noticed that the static id var isn't used in the receiving function.

Thanks, majkinetor!

:)

_________________
Scripts - License


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: March 16th, 2009, 3:12 pm 
Offline

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

About your suggestion, yes, sure, most recent modules use functions regeardless of IsFunc, plus, there are other improvementes which makes them better candidates for APIs.

Ill do it if I return to AHK programming.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: April 6th, 2009, 3:36 pm 
Offline

Joined: February 11th, 2007, 4:10 pm
Posts: 185
Is it possible to communicate between local process and remote?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: July 9th, 2009, 10:44 am 
Offline

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

- Removed all globals
- Label switched to function
- API changed a bit to support sending binary data.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2009, 2:17 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
majkinetor, currently the Hwnd parameter of the Handler function is always your "security ID" 951753, despite being documented as "Handle of the window passing data". I think it woud be best to either remove this parameter or discard the "security ID" feature (i.e. pass an actual hwnd and let the script rely on port numbers or some other mechnism for "security").


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2009, 3:43 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
*** version 2.01 ***

- Bugfixes.
- Security ID removed.
- Docs updated.


Ty Lex.

PS: The point of sec ID was for script to make less likely that other app will send COPYDATA (i.e. for module to know its own messages). I removed it nevertheless.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 5th, 2009, 11:48 pm 
Offline

Joined: November 1st, 2007, 10:03 pm
Posts: 885
Can you post an example for say, shutting down a script from another?


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2009, 8:27 am 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
That would probably be a bad example since it can be done more easily by simply closing the 'ahk_class AutoHotkey' window. (It has been covered many times before on the forums.) There isn't much to the IPC module; the example included in the download should be sufficient.


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2009, 10:27 am 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
I am constantly using IPC for situations in which I have some kind of console that sets up execution of some independent scripts that notify console about execution details.

For instance, my latest project was involving Task Scheduler in AHK that instantiates dozen of scripts as scheduled tasks. Tasks send execution details to log control kept by the scheduler script.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 6th, 2009, 12:51 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
*** version 2.5 ***

+ Added DotNet library in IPC.cs (classes IPC, IPCEventArgs). The API is the same as with IPC.ahk (minus obvious AHK vs C# differences)
+ IPC_Test.exe sample for DotNet <-> AHK communication.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 8th, 2009, 2:09 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
It seems that DotNet part doesnt work correctly on 64bit systems.

Ill see more about it, but If somebody can test on 32 and 64bit on their own, it could help.

Ty.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: August 8th, 2009, 3:02 pm 
Offline

Joined: October 17th, 2006, 4:15 pm
Posts: 7502
Location: Australia
majkinetor, the first and last fields of COPYDATASTRUCT are pointer-sized, i.e. 64-bit in 64-bit applications:
Code:
typedef struct tagCOPYDATASTRUCT {
    ULONG_PTR dwData;
    DWORD cbData;
    PVOID lpData;
} COPYDATASTRUCT, *PCOPYDATASTRUCT;

Code:
   [StructLayout(LayoutKind.Sequential)]
   struct COPYDATASTRUCT
   {
      public int dwData;
      public int cbData;
      public int lpData;
   }
I suppose IntPtr is the appropriate managed type to use for these two fields.

Edit: After correcting that, the rest is mostly straight-forward as long as you don't do this:
Code:
ea.Port = CD.dwData.ToInt32();
What we want to be -100 is treated as 0xFFFFFF9C. Since that's outside the range of an int, OverflowException is thrown and the WndProc silently fails. Very annoying and IMO rediculous, but the following works:
Code:
ea.Port = (int)CD.dwData.ToInt64();

(Also edit: "i.e. 64-bit on 64-bit Windows" was inaccurate.)


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 59 posts ]  Go to page Previous  1, 2, 3, 4  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Google Feedfetcher, tank and 17 guests


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