I am using memory mapped file to share memory between 2 applications. It does it work, but I want to know if there is a way for Application A receive a notification when Application B have written to the file (and what area of the file was changed).
Basically what I have in the mapped file is an array of 256 strings of exactly 256 bytes each. I want to know when each string have change.
I can think of sending a message to the window of the process, but wonder if there is another way.
WM_COPYDATA is the standard method. You can send it from a console app, too, but of course a console cannot receive it.
By the way, you can also hand over a dword as wParam of a WM_TIMER message... not really documented but it works :bg
Quoteyou can also hand over a dword as wParam of a WM_TIMER message
cool trick :bg
you could also register a custom user-defined message
Pipes? http://msdn.microsoft.com/en-us/library/windows/desktop/aa365781%28v=vs.85%29.aspx
Quote from: dedndave on October 12, 2011, 09:28:51 PM
you could also register a custom user-defined message
or take WM_DROPFILES - works fine for a few kBytes :bg
Actually, on Win XP SP3, the "few kBytes" are exactly 624 - I pasted the complete Windows.inc into a tuned edit control, and sent it via WM_DROPFILES to another app where 638,975 bytes arrived as "first filename" ::)