Code:
#include "stdafx.h"
#include <windows.h>
#include <psapi.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <TCHAR.h>
#include <stdio.h>
#include <pdh.h>
#include <pdhmsg.h>
#include <ctime>
#pragma comment(lib, "pdh.lib")
#pragma comment(linker, "/DEFAULTLIB:psapi.lib")
#pragma comment(lib, "user32.lib")
int _tmain(int argc, _TCHAR* argv[])
{
PDH_STATUS pdhStatus = ERROR_SUCCESS;
LPTSTR szCounterListBuffer = NULL;
DWORD dwCounterListSize = 0;
LPTSTR szInstanceListBuffer = NULL;
DWORD dwInstanceListSize = 0;
LPTSTR szThisInstance = NULL;
HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, TEXT( "MyEvent" ) );
pdhStatus = PdhEnumObjectItems (
NULL,
NULL,
TEXT("Processor"),
szCounterListBuffer,
&dwCounterListSize,
szInstanceListBuffer,
&dwInstanceListSize,
PERF_DETAIL_WIZARD,
0);
#include "stdafx.h"
#include <windows.h>
#include <psapi.h>
#include <stdio.h>
#include <iostream>
#include <fstream>
#include <TCHAR.h>
#include <stdio.h>
#include <pdh.h>
#include <pdhmsg.h>
#include <ctime>
#pragma comment(lib, "pdh.lib")
#pragma comment(linker, "/DEFAULTLIB:psapi.lib")
#pragma comment(lib, "user32.lib")
int _tmain(int argc, _TCHAR* argv[])
{
PDH_STATUS pdhStatus = ERROR_SUCCESS;
LPTSTR szCounterListBuffer = NULL;
DWORD dwCounterListSize = 0;
LPTSTR szInstanceListBuffer = NULL;
DWORD dwInstanceListSize = 0;
LPTSTR szThisInstance = NULL;
HANDLE hEvent = CreateEvent(NULL, FALSE, FALSE, TEXT( "MyEvent" ) );
pdhStatus = PdhEnumObjectItems (
NULL,
NULL,
TEXT("Processor"),
szCounterListBuffer,
&dwCounterListSize,
szInstanceListBuffer,
&dwInstanceListSize,
PERF_DETAIL_WIZARD,
0);