I’m thinking of Chrome & IE8 as examples of applications which have multiple processes each associated with separate windows (and other things too). How does this work? Specifically focusing on the GUI side – one question I have is does Windows treat a HWND as belonging to a process or can one process arbitrarily interact with any HWND?
I’m thinking of Chrome & IE8 as examples of applications which have multiple processes
Share
This is a great question. I’m going to throw out what I think to be a possible solution.
The primary application is responsible for spinning up additional processes (tabs) as necessary. This is very similar to spinning up additional threads.
It will use some type of inter-process commuications, such as named pipes, for transferring commands from the primary application to the additional processes and retrieving the results. For example, telling the new tab to go to a specific URL. Also, it could be used to pass some type of handle for the child process’s drawing surface.
Or even just allow the parent process to set exactly where the display view point is for the child paint areas. This way you could appear to have a fully integrated app while maintaining nearly complete separation.
The key here is to define the communication point well enough. Of course, the benefit is tremendous as a dead sub process will not kill the primary application UNLESS the communications between the two are very badly written.
Further, as long as the communication points are well guarded you can effectively sandbox child processes preventing them from screwing with the host application. And, for bonus points, you could even run the child processes under limited user accounts which would further limit what damage they could do.
You might look at these sites for some examples of data sharing: http://www.catch22.net/tuts/tips#ShareData
http://msdn.microsoft.com/en-us/magazine/bb985041.aspx