#include "stdafx.h" #include "afxwin.h" #include <wtsapi32.h> #include <iostream> #include <iphlpapi.h> #pragma comment(lib,"wtsapi32.lib") using namespace std; int main() { DWORD pCount = 0; PWTS_PROCESS_INFO ppProcessInfo,pProcess; WTSEnumerateProcesses(WTS_CURRENT_SERVER_HANDLE,0,1,&ppProcessInfo,&pCount); pProcess = ppProcessInfo; CString internet = "iexplore.exe"; for(int i = 0; i < int(pCount); i++) { pProcess->pProcessName; if (internet.CompareNoCase ( pProcess->pProcessName) == 0) { cout<< "iexplore running"; } pProcess++; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)