Click here to Skip to main content
15,846,571 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: can't run unicode/normalize example Pin
Adam Roderick J2-Apr-10 19:17
Adam Roderick J2-Apr-10 19:17 
QuestionRedefination error [modified] Pin
darc koder2-Apr-10 10:47
darc koder2-Apr-10 10:47 
AnswerRe: Redefination error Pin
Rick York2-Apr-10 11:18
mveRick York2-Apr-10 11:18 
GeneralRe: Redefination error Pin
darc koder2-Apr-10 11:40
darc koder2-Apr-10 11:40 
GeneralRe: Redefination error Pin
Rick York2-Apr-10 11:52
mveRick York2-Apr-10 11:52 
AnswerRe: Redefination error Pin
Tim Craig2-Apr-10 15:09
Tim Craig2-Apr-10 15:09 
AnswerRe: Redefination error Pin
«_Superman_»2-Apr-10 16:27
professional«_Superman_»2-Apr-10 16:27 
QuestionDuplicate Handle to get Real Process Handle Pin
ForNow2-Apr-10 9:29
ForNow2-Apr-10 9:29 
Hi,

I have read Jeffery Richter book On Duplicating Object Handles and am still confused how to get a real process handle

so...

If I am in a Childprocess trying to duplicate its handle for the Parent

I tried the following code in the Child Process

p.s. can some one point to where the documentation is for for using code tags for code snipets

I was sure it was on the menu bar from the Home page .....

<br />
<br />
       snap_shot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0);<br />
<br />
        process32.dwSize = sizeof(PROCESSENTRY32);<br />
<br />
        return_cde =     Process32First(snap_shot,&process32);<br />
<br />
        pid = GetCurrentProcessId();       // Get Current process id<br />
<br />
        while(pid != process32.th32ProcessID)<br />
    {<br />
       return_cde = Process32Next(snap_shot,&process32);<br />
     }<br />
<br />
   parent_process = process32.th32ParentProcessID;<br />
<br />


then DuplicateHandle(GetCurrentProcesId(),GetCurrentProcessId(),parent_process,&child_process_handle_in_context_of_parent,0,FALSE,DUPLICATE_SAME_ACCESS);

no Luck


In Parent process

<br />
<br />
       return_code = CreateProcess(NULL,<br />
                        (LPCSTR) &child_buff[0],<br />
                          NULL,<br />
                          NULL,<br />
                          TRUE,<br />
                           NULL,<br />
                           NULL,<br />
                           NULL,<br />
                           &si,<br />
                           &pi);<br />
<br />
   global_area_handle =   pi.hProcess<br />
<br />
the DuplicateHandle(GetCurrentProcessId(),GetCurrentProcessId(),global_area_handle,&parent_in_context_of_child_handle,0,FALSE,DUPLICATE_SAME_ACCESS);<br />
<br />
no luck<br />
<br />


thankx
AnswerRe: Duplicate Handle to get Real Process Handle Pin
Richard MacCutchan2-Apr-10 10:30
mveRichard MacCutchan2-Apr-10 10:30 
QuestionCComboBox "right allign text" option moves the list box selection arrow to the left (VC 6.0 MFC) Pin
Vaclav_2-Apr-10 9:24
Vaclav_2-Apr-10 9:24 
AnswerRe: CComboBox "right allign text" option moves the list box selection arrow to the left (VC 6.0 MFC) Pin
Richard MacCutchan2-Apr-10 10:32
mveRichard MacCutchan2-Apr-10 10:32 
GeneralRe: CComboBox "right allign text" option moves the list box selection arrow to the left (VC 6.0 MFC) Pin
Vaclav_2-Apr-10 16:41
Vaclav_2-Apr-10 16:41 
Questionlimited user in xp Pin
Boost20102-Apr-10 7:49
Boost20102-Apr-10 7:49 
QuestionRe: limited user in xp Pin
David Crow2-Apr-10 9:01
David Crow2-Apr-10 9:01 
AnswerRe: limited user in xp Pin
Boost20102-Apr-10 9:21
Boost20102-Apr-10 9:21 
GeneralRe: limited user in xp Pin
David Crow2-Apr-10 9:24
David Crow2-Apr-10 9:24 
GeneralRe: limited user in xp Pin
Boost20102-Apr-10 9:37
Boost20102-Apr-10 9:37 
GeneralRe: limited user in xp Pin
David Crow2-Apr-10 9:40
David Crow2-Apr-10 9:40 
GeneralRe: limited user in xp Pin
Boost20102-Apr-10 9:43
Boost20102-Apr-10 9:43 
GeneralRe: limited user in xp Pin
David Crow2-Apr-10 9:46
David Crow2-Apr-10 9:46 
GeneralRe: limited user in xp Pin
Boost20102-Apr-10 9:56
Boost20102-Apr-10 9:56 
QuestionCannot access the ClassView information file, ClassView information will not be available. Pin
includeh102-Apr-10 7:23
includeh102-Apr-10 7:23 
AnswerRe: Cannot access the ClassView information file, ClassView information will not be available. Pin
Maximilien2-Apr-10 7:38
Maximilien2-Apr-10 7:38 
GeneralRe: Cannot access the ClassView information file, ClassView information will not be available. Pin
includeh102-Apr-10 7:51
includeh102-Apr-10 7:51 
AnswerRe: Cannot access the ClassView information file, ClassView information will not be available. Pin
David Crow2-Apr-10 9:02
David Crow2-Apr-10 9:02 

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.