IPC Equivalent of ObjectiveC postNotification and

2019-09-07 06:11发布

I am coming from a bit of Mac background. I am trying to do some simple IPC.

I am making a script for an application which always scripts to run ctypes during runtime. Thus I am able to use the C libs like Objective-C and Win32API.

This application which I am writing script for has two individual processes. Users of my script run it in both instances as a "hook"/"module" so to speak. It is not an injection, it is ctypes-like run during run time. Pretty cool.

I need to send a string from Process 1 to Process 2. In Mac I accomplished this feat by running the script from Process 2 which set up an observer for a notification with name blahBlahBlah. I did this in Objective-C ctypes by running the script of addObserver:selector:name:object in Process 2. Then in Process 1 I sent the string by running script postNotification:notificationName:object:userInfo:deliverImmediatey.

Is there such a way in Win32API?

I read this example here: https://msdn.microsoft.com/en-us/library/windows/desktop/ms649009%28v=vs.85%29.aspx and thought to make a hidden window win WinAPI and set up that code but I can only run code during runtime so this may not be possible.

0条回答
登录 后发表回答