A强制性假条
#include <Windows.h>
#include<bits/stdc++.h>
int main() {
system("mode con cols=14 lines=1");
ShowWindow(GetForegroundWindow(),0);//获取最前端窗口的句柄,然后通过ShowWindow隐藏
if(MessageBox(NULL,("给不给放假?"),("假条"),MB_YESNO | MB_ICONWARNING) == IDYES)//判断你点的是不是按钮“是”
{
MessageBox(NULL,("说的没错,你解放了!"),("恭喜"),MB_OK|MB_ICONSTOP);
} else {
MessageBox(NULL,("不,你做错了。即将关机"),("惨"),MB_OK|MB_ICONEXCLAMATION);
system("shutdown /s");
}
return 0;
}
B“闪现”
千万不要自己运行,否则后果很严重!
#include <Windows.h>
#include<bits/stdc++.h>
int main() {
system("mode con cols=1000 lines=1000");
system("color 6D");
while(1){
ShowWindow(GetForegroundWindow(),0);//获取最前端窗口的句柄,然后通过ShowWindow隐藏
ShowWindow(GetForegroundWindow(),1);//获取最前端窗口的句柄,然后通过ShowWindow显示
}
return 0;
}