osx - How do I save data to the clipboard on MacOSX in C -
this question has answer here:
i'm attempting work around nasty problem involves being locked down in cups printing service filter. application unable write outside of it's domain filter program. & wanted give saving string clipboard go, out of program , readable another. exchange happen user won't know occurred.
so way write xdata x clipboard on osx in c?
mike
as far can tell, os x provides interface clipboard functions in objective c, not plain c.
however, can open pipe pbcopy
command line utility follows:
#include <stdio.h> int main() { file *p = popen("/usr/bin/pbcopy","w"); fprintf(p,"hello world"); /* << copy clipboard */ pclose(p); return 0; }
Comments
Post a Comment