In Windows I can post custom message to another process and inform it to do an action like:
PostMessage(WindowOfAnyProcess, WM_CUSTOM_MESSAGE, param1, param2)
What is the alternative on Mac OS? Does Carbon Events help me? How?
Thankyou.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Assuming that both of the processes are yours, you can use NSDistributedNotificationCenter to send notifications and data to each process.
To do this do something like:
If you want to include data you can use:
A note should be added that:
Sandboxed apps can send notifications only if they do not contain a dictionary. If the sending application is in an App Sandbox,
notificationInfomust benil. This means that you won’t be able to provide information with the notification if you intend on targeting the Mac AppStore.To make the application receive the notifications do something like:
someNotificationUpdate:would be declared like: