Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Command-Line on a GUI form

Status
Not open for further replies.

Glenn9999

Programmer
Jun 19, 2004
2,312
US
I'm not quite sure if this should be a FAQ, but thought I might share this anyway. It's a (relatively) full command-line prompt running on a form using a TMemo, TCombobox, and TButton. The form is rigged to let the controls work much like a real command-line prompt. But you will find a few little glitches relating to the change of place (TMemo doesn't work like a console).

The big draw (of course) is that it's a demo of the use of named pipes in a program. I tested it against everything I could think of, but that doesn't mean that there isn't something wrong with it that I don't already know about.

Things to Know If you Don't read the source before playing with this:
1) I added a couple of commands which address the TMemo directly. These are "CLR" - clears the memo and "savelog" which saves the TMemo to a text file.
2) Again, some things might look funny because of how they draw to the console. This will be because TMemo works different and there's no formatting done in this code.
3) The attempt was made to not let you exit out of the command-line prompt without exiting the program. The problem comes in having the user shell to another command-line prompt - the method used isn't precise.

Here's the download, hope it's useful to someone!
MemoCommand.zip

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
I thought about it some more and thought of three instances when the question was asked that this answers, so I made it into a FAQ

faq102-7402

It is not possible for anyone to acknowledge truth when their salary depends on them not doing it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top