Solved

How to Get Parent process's Handle ??

Posted on 1998-06-04
1
1,078 Views
Last Modified: 2013-12-03
Hi All,

I am developing multithreaded / multiprocess application. I am invoking couple of processes  from my primary thread. I want to pass Handle of my parent process to my child process(Not as parameter). I am usaing CreatProcess() function to create a new process. So is there anyway through which I can pass parent's process handle to this new process.???
0
Comment
Question by:dipesh042997
1 Comment
 
LVL 2

Accepted Solution

by:
kinkajou earned 20 total points
ID: 1406932
dipesh,

There are several ways to send a parent process handle to a child process. The easiest way that comes to mind is to save the parent handle and pass it as a command line parameter to the child process. Then, in the child process,  parse the command line for your handle. Another way includes making the handle an environment variable; the child inherits the parents environment vars. And finally, you could make a shared file or memory region that both could access and put the handle there.

Good Luck!

Kinkajou
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I will show how to use the Ribbon IDs Tool Window to assign the built-in Office icons to a ribbon button.  This tool will help us to find the OfficeImageId that corresponds to our desired built-in Office icon. The tool is part of…
This article surveys and compares options for encoding and decoding base64 data.  It includes source code in C++ as well as examples of how to use standard Windows API functions for these tasks. We'll look at the algorithms — how encoding and decodi…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question