title: Most barebones example of parent/child process in windows on code::blocks (C++)
body: <p>1) I'm looking for a very barebones example of two functions (Parent, Child) respectively that would create a child process, then connect the child to the parent (where the parent can access the variables in the child process). Please keep the example as simple as possible as I am pretty sure windows code is purposefully designed to be as complicated and confusing as possible.</p>
  
  <p>2) Alternatively, I am also willing to consider alternates to the WINAPI calls for creating parent/child processes (so long as it's compatible with windows). </p>
  
  <p>The compiler is code::blocks, OS is Vista. Compatibility with other OS is greatly preferred, if at all possible (I know WINAPI isn't, but it's the only method I am aware of). It would be really nice if the functions had similarities to the unix functions (fork, for example).</p>
  
  <p>3) For a harder alternative, how could I suspend a function in such a way I can do other things (then return back to it)? The function is already defined and can't be altered.</p>
  
  <p><strong>Updated:</strong></p>
  
  <p>Context:
  In a sense, there's a graphical front end (parent) and a function that creates physical [.png] images (child). The problem is, the physical image rendering is a blocking process, and I want a graphical loading screen during the time it runs (creating someimage.png loading bar sorta thing). There's only two ways to do that - parent-child or a interrupt call.</p>
  
  <p>The child can run the function until completion where the parent just reads an updated variable to display (from the child), or the process just temporarily pauses the functions, draws the loading image to the screen, then re-resumes.</p>