9

For certain programs nothing beats the command line. Unfortunately, I have never seen good documentation or examples on how to write console applications that go beyond "Hello World". I'm interested in making console apps like Vim or Emacs. Well not exactly like Vim or Emacs but one that takes over the entire command prompt while it is in use and then after you exit it leaves no trace behind. I know that on Unix there is the curses library but for Windows? ...

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
minty
  • 22,235
  • 40
  • 89
  • 106

10 Answers10

2

PDCurses works on Win32.

Brad Wilson
  • 67,914
  • 9
  • 74
  • 83
2

I found List of Console Functions on msdn, PDCurses, and The Console Module.

Eugene Yokota
  • 94,654
  • 45
  • 215
  • 319
1

There is a small but good tutorial on using C++ for the Windows console at www.benryves.com/tutorials/?t=winconsole&c=all going as far as coding a simple painting program.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Rob Kam
  • 10,063
  • 14
  • 55
  • 65
1

In Windows or DOS, I used the conio library from Borland. It's very old but fine enough for a beginner like me.

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
domlao
  • 15,663
  • 34
  • 95
  • 134
  • +1 to CONIO, in my week of research trying to come up with something, IBM's "conio" comes up a lot. With your mention of Borland, googling finds me this: http://conio.sourceforge.net/ How did that not happen a week ago? – Krista K Sep 15 '13 at 00:19
1

You can certainly write that kind of application with Delphi, which has reasonable commandline support. People often overlook that Delphi can build any kind of Windows executable, not just GUI apps.

I don't know off-hand if the free 'Turbo' edition of Delphi has anything cobbled into it to PREVENT you from using it to build console apps - I would have thought it would be fine for this kind of thing.

robsoft
  • 5,525
  • 4
  • 35
  • 47
1

You could also try Free Pascal. It is a free ((L)GPL) Object Pascal compiler which is compatible with the Delphi-compiler. It has an console-based IDE, which proves that you can make very good console-applications with it, and which you can use as an example.

If you want to use a graphical IDE to build your console-application, you can download the Lazarus IDE.

As a bonus your application will run on Windows (32/64 bit), Linux, Mac OS X, FreeBSD, Solaris etc...

Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
Loesje
  • 312
  • 1
  • 7
0

For ncurses-like library/framework on Windows, I'll highly suggest to get your hand dirty with PDCurses.

If you trying/using C#, there's Curses-Sharp.

0

As Robsoft says Delphi would be a good start. There is Turbo Delphi (Pascal based) or Turbo C++ both free editions.

web site here.

http://www.turboexplorer.com/

dcraggs
  • 758
  • 4
  • 10
0

Check out some of the mono libs. They have a great one to parse command line arguments but can't remember the namespace.
Miguel just posted some terminal code as well.

jason saldo
  • 9,804
  • 5
  • 34
  • 41
-1

This is the best tool for it I've ever seen!!
1) Create any application using VB6 IDE
2) Convert it to Console Application, using THIS!

Searush
  • 628
  • 1
  • 5
  • 18