33,311
社区成员
发帖
与我相关
我的任务
分享
#pragma comment(lib,"user32")
#pragma comment(lib,"gdi32")
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
HWND WINAPI GetConsoleWindow();
void HideTheCursor() {
CONSOLE_CURSOR_INFO cciCursor;
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
if(GetConsoleCursorInfo(hStdOut, &cciCursor)) {
cciCursor.bVisible = FALSE;
SetConsoleCursorInfo(hStdOut, &cciCursor);
}
}
void ShowTheCursor() {
CONSOLE_CURSOR_INFO cciCursor;
HANDLE hStdOut = GetStdHandle(STD_OUTPUT_HANDLE);
if(GetConsoleCursorInfo(hStdOut, &cciCursor)) {
cciCursor.bVisible = TRUE;
SetConsoleCursorInfo(hStdOut, &cciCursor);
}
}
int main() {
HWND hwnd;
HDC hdc;
HFONT hfont;
system("color F0");
system("cls");
HideTheCursor();
hwnd = GetConsoleWindow();
hdc = GetDC(hwnd);
hfont = CreateFont(48, 0, 0, 0, 0, 0, 0, 0, 0 , 0, 0, 0, 0, "Arial Unicode MS");
SelectObject(hdc,hfont);
TextOutW(hdc,10,10,L"你好",2);
DeleteObject(hfont);
hfont = CreateFont(48, 0, 0, 0, 0, 0, 0, 0, JOHAB_CHARSET , 0, 0, 0, 0, "Arial Unicode MS");
SelectObject(hdc,hfont);
TextOutW(hdc,10,80,L"\xb7f0\xb7f0\xb2dd\xb2dd",4);
DeleteObject(hfont);
ReleaseDC(hwnd,hdc);
getch();
system("color 07");
system("cls");
ShowTheCursor();
return 0;
}
#pragma comment(lib,"user32")
#pragma comment(lib,"gdi32")
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
HWND WINAPI GetConsoleWindow();
int main() {
HWND hwnd;
HDC hdc;
HFONT hfont;
wchar_t ws[11];
SIZE sz;
ws[ 0]=0x00E6;
ws[ 1]=0x028C;
ws[ 2]=0x0259;
ws[ 3]=0x0254;
ws[ 4]=0x03B5;
ws[ 5]=0x0283;
ws[ 6]=0x03B8;
ws[ 7]=0x0292;
ws[ 8]=0x00F0;
ws[ 9]=0x014B;
ws[10]=0;
system("color F0");
system("cls");
hwnd = GetConsoleWindow();
hdc = GetDC(hwnd);
hfont = CreateFont(48, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET , 0, 0, 0, 0, "MS Mincho");
SelectObject(hdc,hfont);
GetTextExtentPoint32W(hdc,ws,10,&sz);
Rectangle(hdc,10-2,80-1,10+sz.cx+2,80+sz.cy+1);
TextOutW(hdc,10,80,ws,10);
DeleteObject(hfont);
ReleaseDC(hwnd,hdc);
getch();
system("color 07");
system("cls");
return 0;
}
#pragma comment(lib,"user32")
#pragma comment(lib,"gdi32")
#include <conio.h>
#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
HWND WINAPI GetConsoleWindow();
int main() {
HWND hwnd;
HDC hdc;
HFONT hfont;
wchar_t ws[11];
ws[ 0]=0x00E6;
ws[ 1]=0x028C;
ws[ 2]=0x0259;
ws[ 3]=0x0254;
ws[ 4]=0x03B5;
ws[ 5]=0x0283;
ws[ 6]=0x03B8;
ws[ 7]=0x0292;
ws[ 8]=0x00F0;
ws[ 9]=0x014B;
ws[10]=0;
system("color F0");
system("cls");
hwnd = GetConsoleWindow();
hdc = GetDC(hwnd);
hfont = CreateFont(48, 0, 0, 0, 0, 0, 0, 0, DEFAULT_CHARSET , 0, 0, 0, 0, "MS Mincho");
SelectObject(hdc,hfont);
TextOutW(hdc,10,80,ws,10);
DeleteObject(hfont);
ReleaseDC(hwnd,hdc);
getch();
system("color 07");
system("cls");
return 0;
}