Click here to Skip to main content
15,881,882 members
Articles / Desktop Programming / MFC

Get Process Info with NtQueryInformationProcess

Rate me:
Please Sign up or sign in to vote.
4.70/5 (13 votes)
21 Jul 2007CPOL6 min read 188.1K   13.1K   71  
Get process parent ID, command-line, etc.
//***********************************************************************/
// Demo Header to Display process via ListView in Win32
//
// Copyright � 2007 Steven Moore (OrionScorpion).  All Rights Reserved.
//
//***********************************************************************/
#pragma once

#include "resource.h"

#define MAX_PI				50	// Max processes to get for demo
#define LVC_COLCOUNT		10	// Column Count for ListView
#define	LISTVIEW_CWND_ID	1	// Used as HMENU in CreateWindowEx for ListView Child Wnd ID

#include "NTProcessInfo.h"

void InitDemoListView(IN HWND hWndLv);
DWORD EnumProcesses2Array(OUT smPROCESSINFO lpi[MAX_PI]);
void SetTextCallbackFlag(IN HWND hWndLv, IN const DWORD dwMaxItems);

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Steven Moore is a self-taught programmer on and off over the last 20+ years. He programmed in BASIC, Microsoft Visual Basic for Applications (VBA), Wang COBOL, a little Wang ASM, JavaScript, a little in C++ with inline ASM and Python 3.x. First article was GetNtProcessInfo on this site.

Comments and Discussions