dll 1
To share bitmaps between window’s processes, one needs to use CreateDIBSection, which takes a handle to a file apping created using CreateFileMapping (originally) or OpenFileMapping (thereafter) and mapped into memory using MapViewOfFile.
Appsharing has a little problem in that the target application can change rapidly in follow-focus mode. We can’t really map a segment for each application, but we do need to insure that the mapped segment is big enough for whatever is to be shared, so the plan is to have a single mmap shared by all targets and the dll, which is allocated at the maximum size, but only mapped at the required size, to prevent gratuitous paging.
This means that the granularity of the method structure in the object wrapping will be such that the CreateFileMapping/OpenFileMapping operation is distinct from the MapViewOfFile operation, in the WindowMap manager.
Nah, I won’t optimize prematurely. Instead, I’ll just map the whole thing.