WM_COPYDATA inter-process communication scheme
In two consecutive companies, WM_COPYDATA is used to implement inter-process communication. The specific steps are as follows: 1. process A starts process B through ShellExecute, and transmits the window handle hWndA (which has been converted into an int value) for communication to process B through command line parameters, and B saves hWndA. II. process B assembles the message COPYDATASTRUCT copyData, contains the hWndB handle used for communication, and sends the WM_COPYDATA message to hWndA: SendMessage (hWndA, WM_COPYDATA, 0, (LPARAM) & copyData ); when process A receives the WM_COPYDATA message, it stores hWndB. this mode is also used when process A needs to send A message to process B: SendMessage (hWndB, WM_COPYDATA, 0, (LPARAM) & copyData); Process Communication path is complete. the dwData in COPYDATASTRUCT is used to store the message type. note: When WM_COPYDATA is received, Post a custom message number to yourself, immediately return the message, and perform other operations based on the custom message number.