Pages

Sunday, December 30, 2012

Re: NSSharingService on mountain lion without sharing window


Thanks etresoft.


Learning the facebook API and building an app is one way.


I'm trying to find the quickiest way, at first.



The only way I managed that is using a virtuall mouse with this kind of command from an other program



            CGPoint pt;


            pt.x = 1000;


            pt.y = 400;


            CGEventRef moveMouse = CGEventCreateMouseEvent (NULL,kCGEventMouseMoved,pt,NULL);


            CGEventPost (kCGHIDEventTap, moveMouse);



CGEventRef cam move, click, drag, ...like an real mouse.


So, I'm using it to click on the publish button.



It's not a great solution but it works.



I wonder if it's possible in macOS developpement to have a pointer on a window (the front window of an application for example) and sends command to it (like enter-which means public in my case- or cancel).


View the original article here

0 comments:

Post a Comment