IPC Equivalent of ObjectiveC postNotification and addObserver in Win32API

蹲街弑〆低调 提交于 2019-12-12 01:50:23

问题


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.

来源:https://stackoverflow.com/questions/29206555/ipc-equivalent-of-objectivec-postnotification-and-addobserver-in-win32api

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!