1) 使用SetWindowsHookEx(),注册keyboard hook和mouse hook;注意,在hook中扰败,一定要调用码冲之前返缓模颤回的函数
3)定时器超时,则调用LockWorkStation()锁屏
在Win_TC里运行 #include<stdio.h>#include<stdlib.h>
#include<graphics.h>
char a[100]="zhangyafei"
char b[100]
char str[100]=""
int p=1
int i
void main()
{
int gdriver=DETECT, gmode
initgraph(&gdriver, &gmode, " ")
randomize()
do
{
while(!kbhit())
{
i++
if(i==300)
{
i=0
cleardevice()
}setcolor(rand()%16)
circle(rand()%600,rand()%450,rand()%50)
setcolor(rand()%16)
moveto(rand()%getmaxx(),rand()%getmaxy())
lineto(rand()%getmaxx(),rand()%getmaxy())
/*
setbkcolor(rand()%16)
sleep(1)
*/setcolor(rand()%16)
arc(rand()%getmaxx(),rand()%getmaxy(),rand()%getmaxx(),rand()%360,rand()%360) }
cleardevice()
setcolor(6)
settextstyle(0,0,3)
outtextxy(80,getmaxy()/2,"Please Input Password!")
scanf("%s",&b)
cleardevice()
if(strcmp(a,b))
{
p=1
outtextxy(100,getmaxy()/2,"Password is Wrong!")
sleep(1)
}
else
{
p=0
outtextxy(100,getmaxy()/2,"Password is Correct")
sleep(1)
}
}
while(p)
closegraph()
return 0
}
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)