Hiding DOS

This is a discussion on Hiding DOS within the C++ Programming forums, part of the General Programming Boards category; I started learning C++ and after a couple of text programs I decided to jump right into mouse programming, anyways ...

  1. #1
    Registered User
    Join Date
    Jan 2007
    Location
    TX
    Posts
    3

    Hiding DOS

    I started learning C++ and after a couple of text programs I decided to jump right into mouse programming, anyways I wrote this program that makes the mouse move

    Code:
    #include <windows.h>
    int main(){
        POINT pt; int x, y;
         while (1)
         { 
               Sleep(6);
               GetCursorPos(&pt);; x = pt.x; y = pt.y;
               SetCursorPos(x-5,y-5);
               if(GetAsyncKeyState(VK_ESCAPE)<0){break;}
         }
         return 0;
    }
    now my problem is: the DOS(dont know the real name of the black box that pops out, would be nice if anyone could tell me the tech term) window is bothering me, how can I hide it?

    I'm using Dev-C++ and Windows XP

  2. #2
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    Ummm...what?
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  3. #3
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Location
    Northern Virginia/Washington DC Metropolitan Area
    Posts
    3,806
    Quote Originally Posted by Mike Hawk
    now my problem is: the DOS(dont know the real name of the black box that pops out, would be nice if anyone could tell me the tech term) window is bothering me
    The term I believe is "console window".
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  4. #4
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Portugal
    Posts
    7,577
    You are developing a console application. The console window is showing because of that. IF that is not what you want, and instead want a windows application, check http://www.foosyerdoos.fsnet.co.uk/ for a tutorial. There's plenty others on the web too.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  5. #5
    Registered User
    Join Date
    Jan 2007
    Location
    TX
    Posts
    3
    console window sounds more catchy than DOS, thanks.

    well i'll check on FoosYerDoos thank for all the help guys.

  6. #6
    The larch
    Join Date
    May 2006
    Posts
    3,573
    In Dev-C++ there's a linker option (under compiler options), Do not create a console window. (Answer "No" to see the console window !! ) The tool you are using should have something to the same effect. Otherwise you can pass an additional command to the linker (which I don't know, but you can look it up at a reference site to your compiler).

  7. #7
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    /subsystem:windows for Microsoft compilers. But that requires you to provide WinMain instead of main.
    All the buzzt!
    CornedBee

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

  8. #8
    Registered User
    Join Date
    Jan 2007
    Location
    TX
    Posts
    3
    Quote Originally Posted by anon
    In Dev-C++ there's a linker option (under compiler options), Do not create a console window. (Answer "No" to see the console window !! ) The tool you are using should have something to the same effect. Otherwise you can pass an additional command to the linker (which I don't know, but you can look it up at a reference site to your compiler).
    this worked perfectly thinks anon!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. File systems?? (Winxp -> DOS)
    By Shadow in forum Tech Board
    Replies: 4
    Last Post: 01-06-2003, 09:08 PM
  2. winver, winminor, winmajor can it be found from dos?
    By ronin in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 10-02-2002, 11:32 AM
  3. real mode dos & win dos
    By scott27349 in forum A Brief History of Cprogramming.com
    Replies: 26
    Last Post: 08-19-2002, 07:15 AM
  4. DOS program versus DOS console program
    By scromer in forum A Brief History of Cprogramming.com
    Replies: 4
    Last Post: 01-10-2002, 01:42 PM
  5. Shut off DOS screen automatically to Windows
    By Unregistered in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 11-08-2001, 07:14 PM

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