|
-
Feb 13th, 2001, 05:54 PM
#1
Thread Starter
PowerPoster
How can I change the fore and background color of a program for DOS? Not console, just plain old DOS? I have searched the forums. but only found out how to do it using windows.h.
I really need to be able to do it in a 16-bit dos program, and can't find out how anywhere.
like with using something like printf, or cout. And then how to change the whole BG color?
Thanks A LOT
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Feb 15th, 2001, 04:59 PM
#2
New Member
#include <conio.h> //borland?
textcolor(); // foreground 1-15
textbackground(); //background 1-15
//you need to clearscreen after setting colors.
clrscr();
-
Feb 15th, 2001, 05:12 PM
#3
Frenzied Member
Yeah, that's for Borland EZWins, not consoles.
Harry.
"From one thing, know ten thousand things."
-
Feb 15th, 2001, 06:37 PM
#4
Thread Starter
PowerPoster
man, it must be really hard to do. I am supriesd that no one knows, because a lot of dos programs do it. Maybe they aren't programmed in C/C++ though.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Feb 15th, 2001, 08:37 PM
#5
Addicted Member
To change the background color for dos it must be done in registry. ( only way I know how )
Key: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor]
Value Name: DefaultColor
Data Type: REG_DWORD (DWORD Value)
Value Data: (0 = default)
change the number to different numbers to get different colors.
Im not sure if this is what you wanted.
-
Feb 15th, 2001, 09:03 PM
#6
Frenzied Member
Sail, that's DOS, not consoles. You don't have the same kind of access to graphics stuff in a Windows console.
Harry.
"From one thing, know ten thousand things."
-
Feb 15th, 2001, 09:14 PM
#7
Thread Starter
PowerPoster
Thanks for the help, Help. But the program i am trying to make is for a bootdisk, so it will have to be able to work without windows installed.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Feb 15th, 2001, 09:34 PM
#8
Frenzied Member
Oh sorry, I too misunderstood (or misread actually) your post. I don't know how to do it in DOS, but it might well depend on the graphics hardware.
I remember Parksie had a way to get a pointer to the video memory in DOS a while ago, I wonder if it's still kicking around somewhere.
Harry.
"From one thing, know ten thousand things."
-
Feb 15th, 2001, 10:43 PM
#9
Thread Starter
PowerPoster
i took a pretty thurough look by searching before i posted, but i guess i'll try a "Super" or manual search to see if i can find it. If you know where it might be, could you point me in the right direction?
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
-
Feb 16th, 2001, 11:44 AM
#10
Hyperactive Member
How to make 16-bit programs in C++
Hi, I have asked this question before but nobody seems to understand it or maybe the way i asked it was wrong. Anyhow how do you write 16-bit programs for dos? I mean just dos so it can be run in dos not dos console?? I really appreciate if some body help me. Although I wanted to know is it possible to do it in MSC++? Some code would be really helpfull
===========================
Kourosh Gonabadi
VB Programmer 
C++ Newbie 
Graphic Designer
===========================
-
Feb 16th, 2001, 11:50 AM
#11
Frenzied Member
You can't do it in MSVC++. You'll need an older compiler, one that was around when DOS was prominent.
Harry.
"From one thing, know ten thousand things."
-
Feb 16th, 2001, 11:57 AM
#12
Hyperactive Member
how can I get it?
How can I get it. By the way is the coding going to be the same?
===========================
Kourosh Gonabadi
VB Programmer 
C++ Newbie 
Graphic Designer
===========================
-
Feb 16th, 2001, 03:40 PM
#13
Originally posted by Help
To change the background color for dos it must be done in registry. ( only way I know how )
That's not the only way; you can do it using the SetConsoleTextAttribute API.
-
Feb 16th, 2001, 05:20 PM
#14
Thread Starter
PowerPoster
I have found a number of 16-bit c/c++ compilers, but the only one that is even worth using is Borland Turbo C++ 3.0. It works great for making DOS programs.
I would love to get my hands on a copy of VC++ for win3.1, because this would be able to compile for 16-bit, and would have a better interface than the dos Turbo C++.
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
USAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSAUSA
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|