• C

GUI in dos

I want to make a windows like program under DOS,
does anyone know what are the simple operations which windows do?
example: MouseDrag, Click, DblClick, Dragable..... etc.
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Sorry, I do not understand your question.

KuosterAuthor Commented:
I meant what would I need to know in order to make a windows-like GUI under DOS(with mouse)??
Takin a risk here ;) Why would one try to do so? Wiuldn't it be easier to use Windows (or its equivalents on Mac, Unix etc)? And if it must be DOS, isn't a character based windowing system more appropriate (at least it would be fast)?
Hey MSSPs! What's your total cost of ownership?

WEBINAR: Managed security service providers often deploy & manage products from a variety of solution vendors. But is this really the best approach when it comes to saving time AND money? Join us on Aug. 15th to learn how you can improve your total cost of ownership today!

Basically, you need to decide what behaviors of Windows you want to duplicate.

If all you care about is the appearance of Windows/MacOS then you'll be spending a lot of time make a 2D graphics API.  Primitives like draw rectangle, draw border, draw text, and so on.  You'll also need to write a window/rectangle manager.  For an example see: http://www.pobox.com/~qed/gui.zip

Regarding the mouse, keyboard and any other input devices, I suggest each have an ISR with a state-machine to know the immediate mode in which they are in (mouse is dragging with button down, user has shift key down, etc), and the resultant inputs (double click, Alt-F4 was pressed etc.) should be entered into a queue for each.  You'll need Ralph Brown's interrupt list to get started here if you don't already have it.  See http://www.pobox.com/~ralf

If you would like to actually execute MS Windows programs under DOS, that's not something I think that you can just DO.  However, http://wotsit.org might be a good place to start to figure out how the Windows .EXE and .DLL format works.  I would not recommend doing this.

Good luck
KuosterAuthor Commented:
Sorry to reject it... but I don't think those links work. The file 'gui.zip' isn't there.
Sorry, its was a case error.  Try again.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Will a dos like environment do?  That is everything you do e.g. mouse functions, dialog boxes, buttons, menu bars.............. will have a feel of text environment.  It won't be as flashy as windows but workable.  also there is some disadv. of havin' it for free isn't it!! Tell me if u're interested.
You can use color text mode, which is not that hard to do, but there is a lot that goes into GUI programming than just what you see on the screen.  If you plan on doing any multi-tasking, threads, clipboard, etc. your in for a nice 5 year project at least!!  

Personally I would just write whatever your going to write using the Windows API.  Windows can be a little intimidating from a DOS programmer's point of view, but its well worth the aquired knowledge.  Come to think of it, The Windows OS is really quite easy to program for all the capabilties it gives you.  

However, if you just want to simulate some moveable windows and it must be in DOS, you might be able to do it using libraries such as "curses" which is used in Unix.  I think, its ported to many character based platforms including DOS.  In any case you should check into a pre-written library for such a purpose.  I once wrote a color text mode pseudo-GUI for a DOS based chess game using c++ with embedded assembly language and it was not pretty to code.  

Try to avoid assembly if possible!  Also check into Borland's BGI library for DOS.  It comes with all the Borland Turbo C++ compilers I think.

Good Luck,
KuosterAuthor Commented:
I'm using TC++ in DOS is because I have to learn it for my IT.
I want to create a GUI in dos and using graphics mode is because I want to find a faster way of drawing under dos, and to  gain some mark for my IT this year. The only problem I have now is the GUI. I know how to detect MouseClick, Double Click, Drag...etc. But I don't know what to do when they're detected...
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.