PDH_STATUS PdhValidatePath(IN LPCTSTR CounterPath);
引数の意味は以下の通り。
CounterPath | 存在の有無を判定するカウンタのカウンタパス。 |
void TestValidatePath() { char buf[1000]; int cnt = 0; for(;;) { wsprintf(buf, "\\Process(notepad#%d)\\%% Processor Time", cnt); if(PdhValidatePath(buf) != ERROR_SUCCESS) break; cnt++; } printf("メモ帳は%d個起動中\n", cnt); }