Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Changing or hiding the cursor in a background app?



On Thu, 19 Jan 2006 00:44:27, Daniel Jalkut <email@hidden> wrote:

> I have worked around this limitation in FastScripts (although
> sometimes it doesn't seem to work and I haven't yet figured that out)
> by investigating and taking advantage of the "Apple Internal" hook
> that Apple exposes to let their own applications take advantage of
> this valid UI control. Below is an example of some code that you
> might benefit from. It goes without saying that this code is
> completely unsupported and might stop working at any time. Consider
> using it a form of civil disobedience:
> 
> #if EXPLOITBACKGROUNDCURSORHACK
> 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);
> }
> #endif
> 
> Is there a less tweaky way of doing this and I've simply fallen
> behind the times? Please let me (us, the developer community!) know...

Daniel, thanks for the trick. I tried it and it works in most cases.
Though, it doesn't work reliably when cursor is over Finder windows (*).
Does it match your experience?

[(*) presumably because Finder sets cursor after me or some such --
this happens during drag&drop; to extent I was able to workaround
this by setting my cursor in timer.]

Mike


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Carbon-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/carbon-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Changing or hiding the cursor in a background app? (From: Daniel Jalkut <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.