Click here to Skip to main content
15,914,071 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
Questionunusual problem Please help me Pin
Rahul Vaishnav25-Oct-07 0:57
Rahul Vaishnav25-Oct-07 0:57 
AnswerRe: unusual problem Please help me Pin
ThatsAlok25-Oct-07 2:17
ThatsAlok25-Oct-07 2:17 
QuestionAbout waveinopen Pin
minihotto25-Oct-07 0:29
minihotto25-Oct-07 0:29 
AnswerRe: About waveinopen Pin
Nishad S25-Oct-07 0:36
Nishad S25-Oct-07 0:36 
GeneralRe: About waveinopen Pin
minihotto25-Oct-07 0:40
minihotto25-Oct-07 0:40 
QuestionRe: About waveinopen Pin
Nishad S25-Oct-07 0:49
Nishad S25-Oct-07 0:49 
AnswerRe: About waveinopen Pin
minihotto25-Oct-07 0:56
minihotto25-Oct-07 0:56 
GeneralRe: About waveinopen Pin
Nishad S25-Oct-07 1:01
Nishad S25-Oct-07 1:01 
GeneralRe: About waveinopen Pin
minihotto25-Oct-07 1:18
minihotto25-Oct-07 1:18 
GeneralRe: About waveinopen Pin
Nishad S25-Oct-07 1:26
Nishad S25-Oct-07 1:26 
GeneralRe: About waveinopen Pin
David Crow25-Oct-07 2:58
David Crow25-Oct-07 2:58 
GeneralRe: About waveinopen Pin
Nishad S25-Oct-07 17:09
Nishad S25-Oct-07 17:09 
GeneralRe: About waveinopen Pin
minihotto25-Oct-07 3:13
minihotto25-Oct-07 3:13 
GeneralYou're riding the wrong train, it seems. Pin
jhwurmbach25-Oct-07 4:53
jhwurmbach25-Oct-07 4:53 
GeneralRe: You're riding the wrong train, it seems. Pin
Hamid_RT25-Oct-07 5:14
Hamid_RT25-Oct-07 5:14 
GeneralRe: About waveinopen Pin
Nishad S25-Oct-07 17:08
Nishad S25-Oct-07 17:08 
QuestionWhere I heve to set thread In my application?? Pin
ashishbhatt25-Oct-07 0:21
ashishbhatt25-Oct-07 0:21 
AnswerRe: Where I heve to set thread In my application?? Pin
Mattias G25-Oct-07 3:56
Mattias G25-Oct-07 3:56 
AnswerRe: Where I heve to set thread In my application?? Pin
led mike25-Oct-07 4:17
led mike25-Oct-07 4:17 
QuestionProblem in retriving drivers fully qualified file name using Win32 API Pin
manish_c24-Oct-07 23:57
manish_c24-Oct-07 23:57 
AnswerRe: Problem in retriving drivers fully qualified file name using Win32 API Pin
JudyL_MD25-Oct-07 2:56
JudyL_MD25-Oct-07 2:56 
QuestionCRichEditCtrl mystery - selection, streaming and formatting Pin
Mattias G24-Oct-07 23:51
Mattias G24-Oct-07 23:51 
QuestionOpenProcess API returns NULL for pid 0 and 4. Pin
manish_c24-Oct-07 23:20
manish_c24-Oct-07 23:20 
Hi All,

I am writing a Win32 application to retrieve the information of all process running on the user’s system. To do the same following steps are used:-
Create the process handle Using Win32 API OpenProcess(,,), on passing process id as a parameter
Handle returned by OpenProcess(,,) is further used to retrieve the other information of the process like process name, associated modules etc.
OpenProcess API fails to create the handle for process id 0(system idle process) and 4 (system). API always returns NULL for process id 0 and 4 and hence I am not able to retrieve the associated information.

dwPID = 0 ;//or 4

HANDLE hProcess = OpenProcess( PROCESS_QUERY_INFORMATION | PROCESS_VM_READ, false, dwPID ) ;
if ( NULL != hProcess )
{
if ( EnumProcessModules(hProcess, &hModule, sizeof(hModule), &dwTotalModulesSize) )

}
else
{
cout<< “Unable to open handle “<<endl ;
}

Please let me know if there any way to get desired information for pid 0 and 4.
Thanks in advance
Manish c

AnswerRe: OpenProcess API returns NULL for pid 0 and 4. Pin
ThatsAlok25-Oct-07 0:58
ThatsAlok25-Oct-07 0:58 
QuestionRe: OpenProcess API returns NULL for pid 0 and 4. Pin
David Crow25-Oct-07 3:01
David Crow25-Oct-07 3:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.