I have a ContextualMenuPlugin and an application. When user clicks the option from context menu i need to send a message to my app. In windows i achieved this using sendmessage() function. But i'm new to MAC OS X. Can any one please help me, by giving some api's or functions which will enlighten this situation?
2 Answers
You have plenty of choices on how to get messages into an application on your Macintosh.
The ways I'm thinking of include Apple Events or sockets or kqueues, but there's other stuff I've never even worked with that might even be more useful & appropriate (such as Distributed Objects). Check out this duplicate and/or related question and maybe you'll see a useful answer in there for you that you can build upon.
B.T.W.: how did you construct your Contextual Menu Plugin? Is it in Carbon or Objective C or is it some codeless plugin or plist or? The answer to that question probably will dictate a lot towards how you will be able to talk from your plugin to your app.

- 1
- 1

- 88,797
- 17
- 166
- 215
-
It is in Carbon, got a sample code from apple's developer site and figured out how it works then modified it for my choice. – surendran Dec 14 '11 at 09:40
-
1Be careful with Carbon! Your plugin is likely to not run on any machines running the OS in 64-bit mode. Anyways, I hope my answer helps you out and points you in the right direction. – Michael Dautermann Dec 14 '11 at 09:42
-
Oh! i see. Thanx for the valuable intel. – surendran Dec 14 '11 at 09:49
If you want to control just your application you might want to look into AppleScript. Using that solution has the added benefit that your users could also use it to automate things via scripting.

- 90,870
- 19
- 190
- 224