質問編集履歴
1
文章とタイトルを編集しました。
title
CHANGED
@@ -1,1 +1,1 @@
|
|
1
|
-
|
1
|
+
WriteConsoleOutput();関数で改行するにはどうすればいいのか?
|
body
CHANGED
@@ -1,27 +1,31 @@
|
|
1
|
-
|
1
|
+
WriteCosoleOutput();関数ですがどうすれば改行できるのでしょうか?mWindowBuffer変数に改行コードを代入しましたが反応しません。どうすればいいのでしょうか? ためしに二行書いてみましたができませんでした。
|
2
|
-
1 * 255 * 1と指定して色が出ましたが本来のやり方とは違うと思いますどうすればいいのでしょうか?
|
3
2
|
|
4
3
|
|
5
4
|
|
5
|
+
```cpp
|
6
6
|
|
7
|
+
// 描画するテキストを入力してバッファーに登録
|
8
|
+
void ScreenBuffer::InputTextDraw(char attrib,const wchar_t* format, ... )
|
9
|
+
{
|
10
|
+
mWindowBuffer[0][0].Char.UnicodeChar = L'A';
|
11
|
+
mWindowBuffer[0][0].Attributes = FOREGROUND_GREEN;
|
7
12
|
|
8
|
-
```cpp
|
9
13
|
|
10
|
-
|
14
|
+
mWindowBuffer[1][0].Char.UnicodeChar = L'b';
|
15
|
+
mWindowBuffer[1][0].Attributes = FOREGROUND_GREEN;
|
16
|
+
}
|
17
|
+
|
18
|
+
// 描画更新
|
11
|
-
void
|
19
|
+
void ScreenBuffer::GenerateBufferDraw()
|
12
20
|
{
|
21
|
+
WriteConsoleOutput(mhScreen, mWindowBuffer[0], mDraw_size, mDraw_start, &mRect); //現在のカーソル位置から始まる文字列をコンソール画面バッファーに書き込み
|
22
|
+
WriteConsoleOutput(mhScreen, mWindowBuffer[1], mDraw_size, mDraw_start, &mRect); //現在のカーソル位置から始まる文字列をコンソール画面バッファーに書き込み
|
23
|
+
FlushConsoleInputBuffer(mhScreen); //コンソールの入力バッファーをフラッシュする
|
24
|
+
|
13
25
|
|
14
|
-
wchar_t ws[] = L"あ";
|
15
|
-
|
16
|
-
|
26
|
+
Sleep(30000);
|
17
|
-
|
27
|
+
}
|
18
28
|
|
19
|
-
WindowConsole[1].Char.UnicodeChar = ws[1];
|
20
|
-
WindowConsole[1].Attributes = (WORD) 1 | 255 | 1;
|
21
29
|
|
22
30
|
|
23
|
-
|
24
|
-
WriteConsoleOutput(hScreen, WindowConsole, coord_size, coord_start, &Rect); //現在のカーソル位置から始まる文字列をコンソール画面バッファーに書き込み
|
25
|
-
// FlushConsoleInputBuffer(hScreen); //コンソールの入力バッファーをフラッシュする
|
26
|
-
}
|
27
31
|
```
|