Hide the cursor???

This is a discussion on Hide the cursor??? within the C++ Programming forums, part of the General Programming Boards category; As u can see its not finished yet, i want to put up more levels. Thanx dwks....

  1. #16
    Registered User
    Join Date
    Nov 2005
    Posts
    28
    As u can see its not finished yet, i want to put up more levels. Thanx dwks.

  2. #17
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    You're trying to get that code to hide the cursor? Just stick adrianxw's code near the beginning of main().

    BTW, the preprocessor automatically concatenated strings together:
    Code:
    <<"              LL       EEEEEEE  VV     VV  EEEEEEE  LL         1  \n"
    <<"              LL       EE       VV     VV  EE       LL        111 \n"
    <<"              LL       EEEEE     VV   VV   EEEEE    LL         11 \n"
    <<"              LL       EE         VV VV    EE       LL         11\n" 
    <<"              LLLLLLL  EEEEEEE     VVV     EEEEEEE  LLLLLLL   111\n"
    ->
    Code:
    <<"              LL       EEEEEEE  VV     VV  EEEEEEE  LL         1  \n"
    "              LL       EE       VV     VV  EE       LL        111 \n"
    "              LL       EEEEE     VV   VV   EEEEE    LL         11 \n"
    "              LL       EE         VV VV    EE       LL         11\n" 
    "              LLLLLLL  EEEEEEE     VVV     EEEEEEE  LLLLLLL   111\n"
    Code:
    void gotoxy(int x, int y)  // ky funksion sherben per me shkru ne kordinaten e caktume
    gotoxy() is declared in <conio.h> in Dev-C++.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #18
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    And try to get out of the habit of using goto.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  4. #19
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    I would suggest storing your levels in a file. Then when you change them you don't have to compile your program. It would also mean that other people would be able to create levels. And it would also tidy up your code a bit.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #20
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    Code:
    if (x==45 && y==8 || x==39 && y==10 || x==52 && y==7 || x==43 && y==14 || x==45 && y==8 || x==19 && y==11 || x==21 && y==8 || x==41 && y==8 || x==45 && y==14 || x==32 && y==13 || x==35 && y==4 || x==35 && y==5 || x==35 && y==6 || x==35 && y==7 || x==35 && y==8 || x==35 && y==9 || x==36 && y==9 || x==37 && y==9 || x==38 && y==9 || x==35 && y==10 || x==35 && y==11 || x==35 && y==12 || x==35 && y==14 || x==35 && y==15 || x==35 && y==16 || x==35 && y==17|| x==35 && y==18 || x==35 && y==19 || x==54 && y==6 || x==52 && y==12 || x==51 && y==13 || x==54 && y==9 || x==54 && y==8 ) 
                goto gameover;
    There are better ways of doing this.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  6. #21
    Registered User
    Join Date
    Nov 2005
    Posts
    28
    I know that there are much shorter ways, but for the moment i learnt Functions, Pointers & Arrays. So i came up to the idea that i can make something only with these. So i dont know how to do that with files, and niether do i know how to make it easier and shorter. But i like chalanges. So this cursor thing is killing me. I did as you said it doesnt work. If ur bored with me feel free to say NO TIME PAL. If you want i can send you the library console.h that maybe u dont have try to compile it and you will see the results.

  7. #22
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    I don't see any code in there that even tries to hide the cursor. As I said, add adrianxw's code to the beginning of main.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  8. #23
    Registered User
    Join Date
    Nov 2005
    Posts
    28
    I did. I just sent you the one without it so u can judge where to put it. In the Int Main() ive put it in the very begining. And the result Remains the SAME.

  9. #24
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    And my code works?
    Code:
    #include <windows.h>
    #include <iostream>
    
    int main(void) {
        HANDLE hOut;
        CONSOLE_CURSOR_INFO ConCurInf;
    
        hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    
        ConCurInf.dwSize = 10;
        ConCurInf.bVisible = FALSE;
    
        SetConsoleCursorInfo(hOut, &ConCurInf);
    
        std::cout << "The cursor should be gone.\n";
        std::cin.get();
    
        hOut = GetStdHandle(STD_OUTPUT_HANDLE);
    
        ConCurInf.dwSize = 10;
        ConCurInf.bVisible = TRUE;
    
        SetConsoleCursorInfo(hOut, &ConCurInf);
    
        return 0;
    }
    Wait! I know! Maybe your other functions like gotoxy and fullscreen set the cursor back again.

    Try putting the cursor hiding code after that stuff.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  10. #25
    Registered User
    Join Date
    Nov 2005
    Posts
    28
    I tryed. Still not working. Its interesting, when i make it TRUE and enlarge it it works. It only doest want to dissapear.

  11. #26
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    That's odd. And my programs works?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  12. #27
    Registered User
    Join Date
    Nov 2005
    Posts
    28
    That CODE works that u've sent me anywhere. Just not in this game im making.

  13. #28
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,048
    Well then it might be your other functions. I don't know.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  14. #29
    Registered User
    Join Date
    Nov 2005
    Posts
    28
    dwks thanx man very very much, although it doesnt work. It works on the other codes. Thanx once more for wasting your time with my problems. Im learing intesivly so i hope one day i can contribute to this forum with answers like you.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to Hide Cursor in one of the Splitter Windows?
    By kevin_cat in forum Windows Programming
    Replies: 1
    Last Post: 06-24-2005, 02:57 PM
  2. How to hide cursor in a Linux/Unix console?
    By Aidman in forum Linux Programming
    Replies: 2
    Last Post: 09-01-2004, 03:25 PM
  3. Hide Cursor
    By Akilla in forum C++ Programming
    Replies: 1
    Last Post: 07-18-2002, 01:50 PM
  4. cursor remains in openGL fullscreen
    By Ken Fitlike in forum Game Programming
    Replies: 5
    Last Post: 03-14-2002, 08:52 PM
  5. Mouse in 800x600 24Bit Mode?
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 16
    Last Post: 11-11-2001, 01:38 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21