青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

我住包子山

this->blog.MoveTo("blog.baozishan.in")

[基礎(chǔ)]Win32 Console Applications - Part 1. of 6

Win32 Console Applications - Part 1.

Hello World

Okay, hands up, who here started out with something like this, possibly in another language, possibly on another OS, but whatever, with something like that. I'm willing to bet there are a good few people who can say "yes, that was me". You don't really want to see the source do you? Oh all right then.

#include <iostream>
using namespace std;

int main()
{
    cout << "Hello World!" << endl;
    return 0;
}

8 lines. Could be less, by why make things harder to read? This is really the great strength of a Windows Console Application, you really do not need to do much in order to make a working program. That is why I use consoles. If I want to test out a bit of non GUI code, and I don't have a suitable application I can use as a framework, I knock together a quick console application, and I'm sure just about every other Windows programmer does as well. The user interface only needs to be sophisticated enough to get the job done.

Some of the other tutorials on the site demostrate powerful techniques, but do it in a Console App because that's all that was needed.

Can you do anything else with a Console App? Of course, the answer is yes, you can, and these tutorials demostrate some of the things that can be done with a console. Believe it or not, a huge number of questions concerning consoles crop up in help forums every week, so people are interested. If you are, read on.

----------

What is a Console? It is a Window, a special kind, yes, but it is a Window. You will frequently hear these things called "DOS boxes" because DOS had a character based UI, but this term is incorrect. There is no DOS under the NT cored WIndows operating systems, (NT, 2000, XP), and yet you can use a console. Why? Because it is a Window. (There are actually DOS emulators for these platforms - but this is a totally unrelated topic.)

What makes a Console window special is that it is character based rather than pixel based. A normal window, like this browser window for example, (unless you're using a REALLY basic browser), is measured in pixels, each pixel is individually addressable and modifiable. With a character based medium, that is not the case, the smallest unit that can be addressed and thus modified is a character cell.

A console's display area consist of rows and columns of character cells. It is a grid or two dimensional array or matrix of cells, all these terms are in use - they amount ot the same thing. Traditionally, the character cell at the top left is the origin or "home" position, and is designated (0,0) in an imaginary (x,y) grid. The character cell to it's immediate right is (1,0), the next (2,0) and so on. The cell just below (0,0) is (0,1), the one below that (0,2) and so on. On a typical console there are 80 cell positions across the screen, and 25 down, thus on such a console, the bottom right cell will be (79,24) remembering the grid is zero based. The little picture below shows graphically the cell numbers of the upper left portion of a larger screen or the entire grid of a 4x4 console of course.

CellGrid

Incidently, the reason for chosing 80x25 is historical. In the days before graphical terminals were widely available, people used character based terminals called "Visual Display Units", or VDU's. These typically had an 80x25 screen layout. I was one of those who used these beasts.

----------

Each character cell can contain one and only one character. I'll illustrate an artifact of this below. I type 5 "w" characters, then on the line below, 5 "i" characters...

wwwww
iiiii

... notice the length of the lines. Assuming you are using a modern browser, you should see that the upper line is longer than the lower. Now I'll write a console app which does the same, here is the output...

FixedFont

... as you see, since each cell can only hold a single character, the last "i" character is directly below the last "w". There can be no proportional spacing in a console with the default font, (it is possible to simulate a very crude form of proportional spacing if only a few letters are used - but forget it - it's not worth the hassle).

Okay, so we've got a grid of cells, what is in a cell? Simply, a cell is another grid, each cell being 8 pixels wide and 12 high. The characters that make up the font must be represented within this grid including any spacing - that's right, the pixels of one cell lie directly adjacent to the pixels of the next. This is somewhat limiting, and accounts for the rather poor quality of the console font, but as we will see later, it does have some advantages. The pictures below show how the "w" and "i" characters are encoded into a cell.

w Grid i Grid

Notice the blank column on the right of the "w", this ensures that two adjacent "w" characters will have at least a single pixel space between them. If you look at the last picture, you will see that is the case. Also notice, the dot over the "i" does not go to the top of the cell, this ensures that any character on the line above an "i" that has a descender, an extension below the normal line, "y" for example, will still have at least a one pixel gap between the descender and a "high" character. Thus, normal characters are represented by 7x11 grids with a blank row at the top and a blank column on the right side.

The pixels marked with a "X" in the pictures above are rendered in the foreground colour, those in the empty pixels positions, in the background colour. By default, the foreground is white, the background black. Later on in the tutorial, I will show you how to change these colours, within limits.

----------

There is a one pixel wide gap around the outside edge of the consoles display area. This prevents the top, bottom and edge characters merging with the frame. You cannot write into this gap. Thus a console's display area is 2+(8x) pixels wide, where x is the number of character cells in a row, and 2+(12y) pixels high where y is the number of visible rows, (there may be more rows above or below the current view as determined by the position of the scroll bar).

I'm afraid this first page has really been rather a lot of dry theory. A lot of what you can do with consoles assumes you understand this material though, so read it through, and if later on in this tutorial, you find something that sounds weird, try reading this page again!

In the next part, I'll show you how to name your Console, obtain the consoles standard handles, move the cursor about, write blocks of characters and clear the screen.

posted on 2006-07-20 22:39 Gohan 閱讀(474) 評論(1)  編輯 收藏 引用 所屬分類: C++

Feedback

# re: [基礎(chǔ)]Win32 Console Applications - Part 1. of 6 2006-07-20 22:40 Gohan

來源于http://www.adrianxw.dk  回復(fù)  更多評論   

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            香蕉成人啪国产精品视频综合网| 午夜精品久久久久| 9久草视频在线视频精品| 久久免费国产精品| 一本色道久久综合亚洲精品高清| 欧美激情一区二区三区在线视频| 久久激情视频| 久久久久国产精品麻豆ai换脸| 久久成人资源| 久久久久久一区二区| 久久久夜色精品亚洲| 欧美99久久| 亚洲精品欧洲精品| 99re6这里只有精品视频在线观看| 99re6热在线精品视频播放速度| 一本到12不卡视频在线dvd| 欧美大片一区二区| 亚洲视频二区| 午夜伦欧美伦电影理论片| 亚洲欧美日韩中文播放| 午夜久久久久久久久久一区二区| 欧美亚洲综合另类| 久久精品国产69国产精品亚洲| 久久久www成人免费精品| 久久中文字幕导航| 欧美日韩国产色站一区二区三区| 欧美理论电影网| 欧美午夜免费| 国产日韩综合| 亚洲国产精品久久久久婷婷老年| 亚洲日本视频| 午夜精品视频网站| 亚洲第一偷拍| 亚洲精品在线观| 午夜精品久久久久影视| 毛片精品免费在线观看| 欧美日韩视频在线观看一区二区三区| 国产精品你懂得| 亚洲国产视频直播| 新狼窝色av性久久久久久| 蜜桃av一区二区三区| 亚洲免费观看在线视频| 欧美一区二区三区四区在线观看地址| 欧美va亚洲va国产综合| 国产毛片精品视频| 亚洲麻豆国产自偷在线| 午夜精品久久99蜜桃的功能介绍| 麻豆av福利av久久av| 亚洲午夜在线观看| 欧美高清在线一区二区| 国产有码一区二区| 亚洲综合电影| 亚洲第一在线| 久久精品国产视频| 国产精品免费在线| 一本久久青青| 亚洲国产第一页| 欧美日精品一区视频| 国内精品免费在线观看| 欧美亚男人的天堂| 亚洲一区欧美一区| 91久久久久| 亚洲小说欧美另类社区| 国产综合久久久久久鬼色| 理论片一区二区在线| 欧美日韩精品综合| 久久精品最新地址| 欧美日产一区二区三区在线观看| 性色av一区二区三区红粉影视| 久久久噜久噜久久综合| 欧美高清视频| 国产精品美女视频网站| 在线亚洲+欧美+日本专区| 亚洲国产日韩在线| 欧美黄色小视频| 99精品99| 亚洲区国产区| 亚洲欧洲精品一区| 欧美激情网友自拍| 一区二区免费在线播放| 亚洲高清成人| 欧美日韩国产大片| 亚洲午夜视频| 亚洲综合日韩| 国产伦精品一区二区三区四区免费| 亚洲欧美日韩精品久久亚洲区| 一区二区电影免费在线观看| 国产精品久久久久久av福利软件| 午夜视频久久久久久| 久久精品水蜜桃av综合天堂| 伊人影院久久| 亚洲精品视频啊美女在线直播| 国产精品成人一区二区三区夜夜夜 | 国产精品亚洲成人| 欧美中文字幕第一页| 欧美一区二视频在线免费观看| 在线电影院国产精品| 亚洲人成毛片在线播放| 欧美午夜a级限制福利片| 国内精品久久久久影院色 | 国产精品国内视频| 久久久久综合| 欧美另类一区二区三区| 亚洲黄色免费电影| 夜夜嗨网站十八久久| 国产一区二区三区高清播放| 免费在线亚洲欧美| 欧美视频三区在线播放| 久久免费少妇高潮久久精品99| 欧美丰满高潮xxxx喷水动漫| 亚洲综合丁香| 亚洲国产精品va在看黑人| 亚洲与欧洲av电影| 国产中文一区| 欧美一区1区三区3区公司| 欧美一级网站| 一区二区欧美视频| 国产视频一区在线| 日韩视频精品在线观看| 激情久久五月天| 亚洲视频一区| 一区二区久久久久久| 久久综合九色欧美综合狠狠| 亚洲欧美日韩另类| 欧美极品一区| 欧美高清视频| 在线观看亚洲精品| 欧美综合77777色婷婷| 亚洲欧美另类国产| 欧美日韩精品在线观看| 亚洲激情视频在线| 亚洲黄色成人| 麻豆九一精品爱看视频在线观看免费| 欧美亚洲一区| 国产精品视频一二三| 亚洲视频www| 亚洲午夜精品网| 欧美激情网站在线观看| 欧美黄在线观看| 亚洲韩国精品一区| 免费观看在线综合| 欧美刺激性大交免费视频| 伊人天天综合| 欧美激情欧美激情在线五月| 在线精品视频免费观看| 午夜在线视频一区二区区别| 午夜视频久久久久久| 国产毛片一区二区| 亚洲欧美日韩电影| 久久精品亚洲热| 国产综合欧美| 老司机午夜精品视频| 欧美激情成人在线视频| 日韩午夜在线播放| 欧美无乱码久久久免费午夜一区 | 亚洲网站视频福利| 午夜一区二区三视频在线观看| 欧美午夜a级限制福利片| 中文欧美在线视频| 欧美在线看片| 国产专区欧美专区| 久久综合给合| 亚洲人体1000| 欧美一级视频精品观看| 国产一区二区三区在线观看精品 | 亚洲激情综合| 欧美高清在线播放| 欧美国产高潮xxxx1819| 欧美激情1区2区| 91久久国产综合久久| 欧美日韩一区二区视频在线观看| 一本色道久久加勒比精品| 亚洲免费视频网站| 国产一区二区三区久久| 久久在线观看视频| 亚洲美女精品久久| 欧美一区二区三区视频免费| 在线观看亚洲精品视频| 欧美日韩精品免费观看视一区二区| 蘑菇福利视频一区播放| 妖精视频成人观看www| 国产日韩精品一区二区三区在线| 久久久夜精品| 一本色道久久综合亚洲精品小说| 欧美在线观看天堂一区二区三区| 尹人成人综合网| 欧美日韩在线一区二区| 久久久国产精品一区| 99国产精品久久久久老师| 久久婷婷国产综合精品青草| 一区二区三区视频观看| 狠狠色噜噜狠狠色综合久| 欧美日韩一区二区三区在线视频| 久久国产黑丝| 亚洲午夜精品| 91久久精品国产91久久性色| 久久精品视频免费观看| 亚洲图片欧洲图片日韩av| 亚洲福利视频二区| 激情亚洲成人|