代码直接抬上---
记得点赞喔!!!
#include <Windows.h>
#include <cstdio>
#include <cstdlib>
#include <iostream>
#define ESC 27
#define Order1 VK_LBUTTON
#define Order2 VK_RBUTTON
using namespace std;
void clean()
{
system("cls");
}
bool DC(int key)//点击
{
return (GetKeyState(key) < 0) ? (true) : (false);
}
int MouseX()//鼠标位置X
{
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
HWND h = GetForegroundWindow();
CONSOLE_FONT_INFO consoleCurrentFont;
POINT MousePosition;
GetCursorPos(&MousePosition);
ScreenToClient(h, &MousePosition);
GetCurrentConsoleFont(hOutput, FALSE, &consoleCurrentFont);
MousePosition.x /= consoleCurrentFont.dwFontSize.X;
return MousePosition.x + 1;
}
int MouseY()//鼠标位置Y
{
HANDLE hOutput = GetStdHandle(STD_OUTPUT_HANDLE);
HWND h = GetForegroundWindow();
CONSOLE_FONT_INFO consoleCurrentFont;
POINT MousePosition;
GetCursorPos(&MousePosition);
ScreenToClient(h, &MousePosition);
GetCurrentConsoleFont(hOutput, FALSE, &consoleCurrentFont);
MousePosition.y /= consoleCurrentFont.dwFontSize.Y;
return MousePosition.y + 1;
}
void color(int n)//颜色
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), n);//140灰红
return;
}
void gotoxy(int x, int y)
{
COORD c;
c.X = x - 1;
c.Y = y - 1;
SetConsoleCursorPosition(GetStdHandle(STD_OUTPUT_HANDLE), c);
}
void Loading()
{
system("mode con cols=56 lines=5");
HANDLE hStdin = GetStdHandle(STD_INPUT_HANDLE);
DWORD mode;
GetConsoleMode(hStdin, &mode);
mode &= ~ENABLE_QUICK_EDIT_MODE;
SetConsoleMode(hStdin, mode);
CONSOLE_CURSOR_INFO cursor;
cursor.bVisible = FALSE;
cursor.dwSize = sizeof(cursor);
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorInfo(handle, &cursor);
}
int main()
{
int a;
Loading();
int start = 1, end = 8;
for(int i = 1; i <= 250; i++,start >= 28 ? start = 1 : start ++, end >= 28 ? end = 1 : end ++) {
gotoxy(1,1);
printf("Loading...");
gotoxy(1,3);
if(start < end){
for(int j = 1; j < start; j ++) {
printf("□");//重新改一下方块(复制粘贴)
}
for(int j = start; j <= end; j ++) {
printf("■");//一样的
}
for(int j = end + 1; j <= 28; j ++) {
printf("□");//重新改一下方块(复制粘贴)
}
puts("");
}
if(start > end){
for(int j = 1; j < end; j ++) {
printf("■");//重新改一下方块(复制粘贴)
}
for(int j = end; j < start; j ++) {
printf("□");//一样的
}
for(int j = start + 1; j <= 26; j ++) {
printf("■");//重新改一下方块(复制粘贴)
}
puts("");
}
Sleep(20);
}
system("cls");
while(1)
{
gotoxy(1,1);
system("date /t");
system("time /t");
cout<<"-------------------------速登---------------------------"<<endl;
cout<<"1.抖音 2.优快云 3.GitHub 4.稀土掘金 5.翻译"<<endl;
cin>>a;
if(a==1)
{
system("start https://www.douyin.com/discover");
}
if(a==2)
{
system("start https://www.youkuaiyun.com/");
}
if(a==3)
{
system("start https://www.githubs.cn/");
}
if(a==4)
{
system("start https://juejin.cn/");
}
if(a==5)
{
system("start https://fanyi.baidu.com/?fr=pcPinzhuan");
}
system("cls");
}
return 0;
}
编译条件:VS2022或DVE C++