Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3244628
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:34:26+00:00 2026-05-17T18:34:26+00:00

I want to hide the cursor from a statusbar app and i’ve done some

  • 0

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:

Globally hide mouse cursor in Cocoa/Carbon? 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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T18:34:27+00:00Added an answer on May 17, 2026 at 6:34 pm

    You need to link against the Application Services framework to get rid of the linker errors.

    Here’s a complete example of the hack (updated to use Core Foundation):

    cat >t.c<<EOF
    #include <ApplicationServices/ApplicationServices.h>
    
    int main(void)
    {
        void CGSSetConnectionProperty(int, int, CFStringRef, CFBooleanRef);
        int _CGSDefaultConnection();
        CFStringRef propertyString;
    
        // Hack to make background cursor setting work
        propertyString = CFStringCreateWithCString(NULL, "SetsCursorInBackground", kCFStringEncodingUTF8);
        CGSSetConnectionProperty(_CGSDefaultConnection(), _CGSDefaultConnection(), propertyString, kCFBooleanTrue);
        CFRelease(propertyString);
        // Hide the cursor and wait
        CGDisplayHideCursor(kCGDirectMainDisplay);
        pause();
        return 0;
    }
    EOF
    gcc -framework ApplicationServices t.c
    ./a.out
    

    On Mac OS 10.5 this hides the cursor until the program is interrupted. However, performing any window server or dock tasks shows the cursor.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to hide the titlebar of my app in some of my views.
In my application, In UITextview i want to hide cursor. If this is not
For my fullscreen app, I want to hide the cursor after a few seconds
I want to hide the cursor when showing a webpage that is meant to
I want hide some fields in existed XML and use that XML as Input
I want to hide framelayout dynmically in android, How I can achieve this.
I want hide cursor inside window client area without borders and title bar (it
I want to know if there is a way to hide cursor in Windows
Hey guys I'm working with this forum, I want to hide the categories list,
Hi i have this code sample from This Post. What i want is a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.