相关文章推荐
憨厚的黄瓜  ·  高雄市立仁武高級中學·  11 月前    · 
坚强的咖啡豆  ·  在Fabric ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

It's been many years since I've looked into this. Maybe when I was just getting into C++. But is it still possible to achieve MS-DOS like graphics on a command line interface? Obviously with some small hacks that you can achieve the color scheme. However I'm looking more into menu options. I.e. radio controls menu select.

And yes I know you can also achieve this probably a little bit easier using SDL. But I was just curious if anyone else has accomplish this and has some details posted on the Internet or can possibly point me in the right direction. If this is not as easy to achieve anymore on windows 10 I'll just go on and find something else to do for fun.

Thanks.

"possible" for sure, newer versions add more features to console. Something ready to use without redoing from scratch? No idea but probably. After all there is Windows Core...it may not be such absurd requirement Adriano Repetti Oct 4, 2016 at 17:07 The default character set used by the Windows command line is still the same after all these years, so the characters needed for things like radio buttons are still there. Mark Ransom Oct 4, 2016 at 17:09 I'm not really looking for a library to do the job. This project is more or less for fun. (Just to see if I can emulate the old days.) But if all I need is some ASCII text, and some basic Win32 api functions, I'm happy. ajm113 Oct 5, 2016 at 7:05

Yes, absolutely. You can either use functions such as Set/GetConsoleScreenBufferInformationEx or you can enable VT-100 escape sequences and use those (you'll remember this as ANSI.sys in DOS).

That's the more portable method, as the only windows-specific part should be enabling VT-100 mode, everything else should be the same on Linux.

  • SetConsoleMode: https://msdn.microsoft.com/en-us/library/windows/desktop/ms686033(v=vs.85).aspx
  • Or to read and write the console buffer directly:

  • Console APIs: https://msdn.microsoft.com/en-us/library/windows/desktop/ms682073(v=vs.85).aspx
  • Thanks for contributing an answer to Stack Overflow!

    • Please be sure to answer the question . Provide details and share your research!

    But avoid

    • Asking for help, clarification, or responding to other answers.
    • Making statements based on opinion; back them up with references or personal experience.

    To learn more, see our tips on writing great answers .