?? zz.zip.txt
字號:
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
#include <windows.h>#include <commdlg.h>#include <commctrl.h>#include "resource.h"#include <Tlhelp32.h>#include <stdio.h>#include "psapi.h"BOOL Init( HWND );void RefreshProcess(HWND );BOOL EndProcess(HWND);LRESULT CALLBACK Test(HWND , UINT , WPARAM , LPARAM);int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow){ // TODO: Place code here. InitCommonControls();
DialogBox(NULL , (LPCTSTR)IDD_DIALOG , NULL ,(DLGPROC)Test);
return 1;}
LRESULT CALLBACK Test(HWND hDlg , UINT message , WPARAM wParam , LPARAM lParam){ switch(message) { case WM_INITDIALOG: Init(hDlg); return TRUE; case WM_COMMAND: switch(LOWORD(wParam)) {case IDCANCEL: EndDialog(hDlg,0); KillTimer(hDlg,1000); return TRUE; break; case IDOK: return(EndProcess(hDlg)); break; case IDREFRESH: RefreshProcess(hDlg); return TRUE; break;
} } return FALSE;}
/************************************************************************//* 刷新進程 入口參數 對話框句柄 */ /* *//************************************************************************/
void RefreshProcess(HWND hDlg){ HANDLE hSnapshot,h_Process; PROCESSENTRY32 pe; char lpszAdd[255]; int nIndex; DWORD Memory; LVITEM Lv; PROCESS_MEMORY_COUNTERS PMC; pe.dwSize = sizeof(pe); hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); Process32First( hSnapshot, &pe); sprintf(lpszAdd,"%s",pe.szExeFile); Lv.mask = LVIF_TEXT; Lv.iItem = 0; Lv.iSubItem = 0; Lv.pszText = lpszAdd; SendDlgItemMessage(hDlg , IDC_LISTVIEW , LVM_DELETEALLITEMS, 0 , 0); SendDlgItemMessage(hDlg, IDC_LISTVIEW, LVM_INSERTITEM , 0, (LPARAM)&Lv); sprintf(lpszAdd,"%i",pe.th32ProcessID); Lv.iSubItem = 1; SendDlgItemMessage(hDlg, IDC_LISTVIEW, LVM_SETITEM , 0, (LPARAM)&Lv); sprintf(lpszAdd,"%i",pe.pcPriClassBase); Lv.iSubItem = 2; SendDlgItemMessage(hDlg, IDC_LISTVIEW, LVM_SETITEM , 0, (LPARAM)&Lv); //system process 的內存始終是20K Memory = 20; sprintf(lpszAdd,"%2i K",Memory); Lv.iSubItem = 3; SendDlgItemMessage(hDlg, IDC_LISTVIEW, LVM_SETITEM , 0, (LPARAM)&Lv); while( Process32Next(hSnapshot, &pe)) { sprintf(lpszAdd,"%s",pe.szExeFile); Lv.iSubItem = 0; nIndex = SendDlgItemMessage(hDlg, IDC_LISTVIEW, LVM_INSERTITEM , 0, (LPARAM) &Lv); if( nIndex != -1) { Lv.iItem = nIndex; Lv.iSubItem = 1; sprintf(lpszAdd,"%i",pe.th32ProcessID); SendDlgItemMessage(hDlg, IDC_LISTVIEW, LVM_SETITEM , 0, (LPARAM)&Lv); Lv.iSubItem = 2; sprintf(lpszAdd,"%i",pe.pcPriClassBase); SendDlgItemMessage(hDlg, IDC_LISTVIEW, LVM_SETITEM , 0, (LPARAM)&Lv); h_Process = OpenProcess(PROCESS_QUERY_INFORMATION | PROCESS_VM_READ , FALSE , pe.th32ProcessID); //得到進程內存大小 GetProcessMemoryInfo(h_Process , &PMC , sizeof(PMC)); Memory = PMC.WorkingSetSize/1024; sprintf(lpszAdd,"%i K",Memory); Lv.iSubItem = 3; SendDlgItemMessage(hDlg, IDC_LISTVIEW, LVM_SETITEM , 0, (LPARAM)&Lv); } } }
/*/************************************************************************//* 初始化函數,主要用來添加列表控件的列頭 *//************************************************************************/
BOOL Init(HWND hDlg){ LVCOLUMN lv; static char *szText[]={"映像名稱","PID","優先級","內存使用"}; static int cx[]={100,100,80,120}; int i = 0; for(i=0 ; i< 4 ;i++) { lv.mask = LVCF_TEXT|LVCF_WIDTH; if(i<2) lv.fmt = LVCFMT_LEFT; else lv.fmt = LVCFMT_RIGHT; lv.cx = cx[i]; lv.pszText = szText[i]; SendDlgItemMessage(hDlg,IDC_LISTVIEW,LVM_INSERTCOLUMN,(WPARAM)i,(LPARAM)&lv); } SendDlgItemMessage(hDlg,IDC_LISTVIEW , LVM_SETEXTENDEDLISTVIEWSTYLE , (WPARAM)LVS_EX_FULLROWSELECT,(LPARAM)LVS_EX_FULLROWSELECT); RefreshProcess(hDlg); return TRUE;}
/************************************************************************//* 結束進程函數 ,用來結束列表視圖中選定的進程 *//************************************************************************/
BOOL EndProcess(HWND hDlg){ int hProcess = SendDlgItemMessage(hDlg, IDC_LISTVIEW , LVM_GETNEXTITEM , -1, (LPARAM)MAKELPARAM((UINT)LVNI_SELECTED, 0)); if (hProcess != -1) { LVITEM Lv; char Buffer[256]; HANDLE h_process; DWORD ProcessId; BOOL iRet; memset(Buffer,0,sizeof(Buffer)); Lv.iSubItem = 1; Lv.pszText = Buffer; Lv.cchTextMax = sizeof(Buffer); SendDlgItemMessage(hDlg , IDC_LISTVIEW , LVM_GETITEMTEXT , (WPARAM)hProcess , (LPARAM)&Lv); ProcessId = atol(Buffer); h_process = OpenProcess(PROCESS_TERMINATE , NULL , ProcessId); if (h_process == NULL) {MessageBox(hDlg , "進程無法訪問","錯誤",MB_OK); return FALSE; } else { if(MessageBox(hDlg ,"結束這個進程嗎?","警告",MB_OKCANCEL)==IDOK) { iRet = TerminateProcess(h_process,0); if (!iRet) {MessageBox(hDlg,"結束進程失敗","錯誤",MB_OK); return TRUE; } else {MessageBox(hDlg,"結束進程成功","成功",MB_OK); return FALSE; } } else return FALSE;
} } else {return FALSE; }}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}
# include"dos.h"
int a,b,c;
main{
if {a==b;
c=a;}
}v
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -