Mombu the Microsoft Forum

Go Back   Mombu the Microsoft Forum > Microsoft > Controls, and Tips for Console Application?
User Name
Password
REGISTER NOW! Mark Forums Read




Reply
1 8th November 03:23
larry lindstrom
External User
 
Posts: 1
Default Controls, and Tips for Console Application?



Hi Folks:

I'd like to do a console application.

Will I have access to edit boxes, combo boxes, check
boxes and other controls I've been using in my Windows
code for the last year?

Of course, I also need something like TextOut to put
text on the display where I want. References that show
what characters can be used for drawing lines and boxes
on the display would also be nice. I'll also need to
set colors for the text.

Tips and resources on the net would be appreciated.

Thanks
Larry
  Reply With Quote


 


2 8th November 03:23
tc
External User
 
Posts: 1
Default Controls, and Tips for Console Application?



(snip)

There's a recent post: "Using stdout in Win32 application" in this
newsgroup which might be relevant.

HTH,
TC
  Reply With Quote
3 8th November 03:23
alex blekhman
External User
 
Posts: 1
Default Controls, and Tips for Console Application?


You can crerate windows in consoe app. However, why do you need
console app then? If you need sort of GUI in console, then you'll need
to do everything yourself: draw elements of GUI, listen to
mouse/keyboard input, move things on console, etc. It's likely that
there are libraries for Win32 console pseudo-GUI programming (do you
remember TurboVision library of Borland?). The comprehensive console
reference can be found here:

"Character-Mode Applications"
http://msdn.microsoft.com/library/en...racter_mode_ap
plications.asp
  Reply With Quote
4 8th November 03:23
jason s
External User
 
Posts: 1
Default Controls, and Tips for Console Application?


I've done this before, it's not too bad. The reason for doing it is to
get the features of console apps: (a) you can start them at the console
& use shell features like pipes and redirection; (b) you get a text
window with a history that things can be typed into; (c) you can call
blocking functions like Sleep or Wait___ without worrying about
threading or any of that stuff.

My program was a small debugger shell for a piece of test equipment, &
I wanted a "monitor" window which would query the test equipment every
so often, even if the user didn't. The "monitor" window was run by a
2nd thread which just called CreateDialogParam() and ran a message
loop. You can add resources (e.g. dialog boxes in an .rc file) to a
console app just like a regular windows app. Worked nicely.

The difficult part is synchronization. I didn't need any except on the
(shared) serial port, so I used a mutex for that. If you want the
console to share info with the GUI window, you'll have to figure out
how to do that w/o causing the GUI window to block. (PostMessage comes
to mind for getting info from console to GUI; the other direction is
harder.)
  Reply With Quote
5 8th November 03:23
jason s
External User
 
Posts: 1
Default Controls, and Tips for Console Application?


sorry, misread & didn't realize you meant GUI confined to the
characters in a console window.
  Reply With Quote
Reply


Thread Tools
Display Modes




666