I want to hide the cursor from a statusbar app and i've done some research. It seems as though the solution to this problem was found a while ago:
http://stackoverflow.com/questions/1412084 or http://lists.apple.com/archives/carbon-dev/2006/Jan/msg00555.html
But the code that is referred to will not compile. Do any of you guys know either how to make the code compile (by importing some old API or something) or another way of achieving this (some kind of hack)?
(I know it is generally a bad idea to hide the cursor from a background app, but i making an app where this functionality is pretty essential)
Edit:
Here's the old hack, that doesn't work anymore.
long sysVers = GetSystemVersion();
// This trick doesn't work on 10.1
if (sysVers >= 0x1020)
{
void CGSSetConnectionProperty(int, int, int, int);
int CGSCreateCString(char *);
int CGSCreateBoolean(BOOL);
int _CGSDefaultConnection();
void CGSReleaseObj(int);
int propertyString, boolVal;
// Hack to make background cursor setting work
propertyString = CGSCreateCString("SetsCursorInBackground");
boolVal = CGSCreateBoolean(TRUE);
CGSSetConnectionProperty(_CGSDefaultConnection(), _CGSDefaultConnection(), propertyString, boolVal);
CGSReleaseObj(propertyString);
CGSReleaseObj(boolVal);
}
It gives me 4 errors:
"_CGSCreateBoolean", referenced from: -[MyClass myMethod] in MyClass.o
"_GetSystemVersion", referenced from: -[MyClass myMethod] in MyClass.o
"_CGSCreateCString", referenced from: -[MyClass myMethod] in MyClass.o
"_CGSReleaseObj", referenced from: -[MyClass myMethod] in MyClass.o