Thread: mouse cursors and clear screen

  1. #1
    Registered User JTtheCPPgod's Avatar
    Join Date
    Dec 2001
    Posts
    44

    mouse cursors and clear screen

    Whenever I clear the screen in C++, a mouse cursor pops up. Now there's nothing especially wrong with this, but theres also nothing especially right either. It doesn't do anything but be there and is really quite and annoyance. Can anyone tell me how to get rid of it? Email me the answer please...

  2. #2
    the hat of redundancy hat nvoigt's Avatar
    Join Date
    Aug 2001
    Location
    Hannover, Germany
    Posts
    3,130
    Probably depends on your operating system and compiler. If you are using Windows and a Windows compiler, I think SetCursor is the function to look up. If you use anything else, please post the version.

    If you check the box at the bottom saying you want an email notification, you will get email when someone posts. Sending you an email is more work for me, and is also not fair, because only you will get the answer. Other readers are left clueless.
    hth
    -nv

    She was so Blonde, she spent 20 minutes looking at the orange juice can because it said "Concentrate."

    When in doubt, read the FAQ.
    Then ask a smart question.

  3. #3
    Hamster without a wheel iain's Avatar
    Join Date
    Aug 2001
    Posts
    1,385
    include <windows.h>
    _setcursortype(_NOCURSOR)

    you may have to check the syntax case, but thats the call to use to disable the cursor.
    Monday - what a way to spend a seventh of your life

  4. #4
    Registered User JTtheCPPgod's Avatar
    Join Date
    Dec 2001
    Posts
    44
    Originally posted by iain
    include <windows.h>
    _setcursortype(_NOCURSOR)

    you may have to check the syntax case, but thats the call to use to disable the cursor.
    Hmmm, you'll have to understand that I am only an aspiring C++ god. What's syntax case?

  5. #5
    Guest Sebastiani's Avatar
    Join Date
    Aug 2001
    Location
    Waterloo, Texas
    Posts
    5,708
    No that's conio.c. Actually, the Windows version, SetConsoleCursorInfo(int) is wrapped inside _setcursortype!

    See:

    void _setcursortype(int _type) {
    CONSOLE_CURSOR_INFO Info;
    Info.bVisible = TRUE;
    if (_type == _NOCURSOR)
    Info.bVisible = FALSE;
    else if (_type == _SOLIDCURSOR)
    Info.dwSize = 100;
    else if (_type == _NORMALCURSOR)
    Info.dwSize = 1;
    SetConsoleCursorInfo (GetStdHandle (STD_OUTPUT_HANDLE), &Info);
    }
    Code:
    #include <cmath>
    #include <complex>
    bool euler_flip(bool value)
    {
        return std::pow
        (
            std::complex<float>(std::exp(1.0)), 
            std::complex<float>(0, 1) 
            * std::complex<float>(std::atan(1.0)
            *(1 << (value + 2)))
        ).real() < 0;
    }

Popular pages Recent additions subscribe to a feed