先看:怎样创作头文件
在 代码 里面插入:
#ifndef wxn自制的头文件_H
#define wxn自制的头文件_H
#include<windows.h>
#include<bits/stdc++.h>
#define sys system
#define box MessageBox
#define sep(a) Sleep(a)
#define prn printf("\n")
#define cls system("cls")
#define ST SetConsoleTitle
#define st system("time/T")
#define pause system("pause")
#define kd(VK_NONAME) ((GetAsyncKeyState(VK_NONAME) & 0x8000) ? 1:0)
/***制作者:CSDN wxn小学***/
using namespace std;
/***影藏光标***/
void HideCursor()
{
CONSOLE_CURSOR_INFO cursor_info = {1,0};
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE), &cursor_info);
return;
}
/***颜色***/
void yanse(int ForgC, int BackC)
{
WORD wColor=((BackC & 0x0F)<<4)+(ForgC & 0x0F);
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), wColor);
return;
}
/***移除快速编辑模式***/
void noedit()
{
HANDLE hStdin=GetStdHandle(STD_INPUT_HANDLE);
DWORD mode;
GetConsoleMode(hStdin,&mode);
mode&=~ENABLE_QUICK_EDIT_MODE;
mode&=~ENABLE_INSERT_MODE;
mode&=~ENABLE_MOUSE_INPUT;
SetConsoleMode(hStdin,mode);
return;
}
/***使窗口移动到桌面居中位置***/
void centerwindow(RECT &rect, RECT &desktop)
{
int width,height,dtWidth,dtHeight;
bool bSuccess=false;
HWND hwnd = GetDesktopWindow();
GetWindowRect(hwnd,&desktop);
dtWidth=desktop.right-desktop.left;
dtHeight=desktop.bottom-desktop.top;
hwnd = GetForegroundWindow();
GetWindowRect(hwnd,&rect);
width=rect.right-rect.left;
height=rect.bottom-rect.top;
bSuccess=MoveWindow(hwnd,(dtWidth-width)/2,(dtHeight-height)/2,width,height,true);
GetWindowRect(hwnd,&rect);
return ;
}
/***覆盖清屏**/
void gotoxy_0(int x, int y)
{
COORD pos = {x,y};
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOut, pos);
return;
}
/***移动光标***/
void gotoxy(int x,int y)
{
COORD pos;pos.X=y;
pos.Y=x;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE),pos);
return;
}
/***输出***/
void prin(string n,int a,int b)
{
for(int i=0;i<n.size();i++)
{
cout<<n[i];
Sleep(a);
}
Sleep(b);
return;
}
/***加载***/
void jiazai(int a,int b)
{
cls;
//手要断掉啦~~~
ST("加载");
for(int i=1;i<a;i++)
{
gotoxy_0(0,0);
printf(" . \n");
printf(" . \n");
printf(". 加载中 \n");
printf(" \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" . \n");
printf(". 加载中 \n");
printf(" . \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" \n");
printf(". 加载中 \n");
printf(" . \n");
printf(" . \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" \n");
printf(" 加载中 \n");
printf(" . \n");
printf(" .. \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" \n");
printf(" 加载中 \n");
printf(" \n");
printf(" ... \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" \n");
printf(" 加载中 \n");
printf(" \n");
printf(" ... \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" \n");
printf(" 加载中 \n");
printf(" \n");
printf(" ... \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" \n");
printf(" 加载中 \n");
printf(" \n");
printf(" ... \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" \n");
printf(" 加载中 \n");
printf(" . \n");
printf(" .. \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" \n");
printf(" 加载中 .\n");
printf(" . \n");
printf(" . \n");
sep(b);
gotoxy_0(0,0);
printf(" \n");
printf(" . \n");
printf(" 加载中 .\n");
printf(" . \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" . \n");
printf(" . \n");
printf(" 加载中 .\n");
printf(" \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" .. \n");
printf(" . \n");
printf(" 加载中 \n");
printf(" \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" ... \n");
printf(" \n");
printf(" 加载中 \n");
printf(" \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" ... \n");
printf(" \n");
printf(" 加载中 \n");
printf(" \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" ... \n");
printf(" \n");
printf(" 加载中 \n");
printf(" \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" ... \n");
printf(" \n");
printf(" 加载中 \n");
printf(" \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
printf(" .. \n");
printf(" . \n");
printf(" 加载中 \n");
printf(" \n");
printf(" \n");
sep(b);
gotoxy_0(0,0);
}
cls;
return;
}
#endif
标签:info,NONAME,头文件,用到,system,wxn,define
From: https://blog.csdn.net/wxnccc/article/details/142312673