头 文 件 (会用到)

先看:怎样创作头文件

在 代码 里面插入:

#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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值