I mentioned the exchange of data between the property pages in ON_UPDATE_COMMAND_UI in the previous article attribute page. Here I put the relevant questions and then specifically explain it. If you want to know how to use psm_querysiblings between the Property Sheet's Property Page to exchange data, first look at the function cpropertypage :: querysiblings, implement the following:
LRESULT CPropertyPage :: QuerySiblings (WPARAM wParam, LPARAM lParam) {// first determine whether the parent window is created ASSERT (:: IsWindow (m_hWnd)); ASSERT (! GetParent () = NULL); // send return message to the parent window PSM_QUERYSIBLINGS GetParent () -> SendMessage (PSM_QUERYSIBLINGS, wParam, lParam);} we find that the function is a function of CPropertyPage :: QuerySiblings PSM_QUERYSIBLINGS send a message to the parent window, and the default processing of the Property Sheet PSM_QUERYSIBLINGS message is sent to each Propperty Page PSM_QUERYSIBLINGS So in each Property page, we need to create a message mapping to capture the PSM_QuerySiblings message, and add a message processing function.
Add: // {{AFX_MSG (...) .....//}} AFX_MSGAFX_MSG LRESULT ONQUERYSIBLINGS (WPARAM WPARAM, LPARAM LPARE_MESSAGE_MAP ()
Add: Begin_Message_Map (CMYPROPERTYPAGE, CPROPERTYPAGE) END_MESSAGE_MAP ()
Finally, the implementation of the message function is added: LRESULT CMYPROPERTYPAGE :: ONQUERYSIBLINGS (WPARAM WPARAM, LPARAM LPARAM) {// Add your own additional processing return 0; // The function returns any value, return 0, indicating that this message is no longer transferred. Give other Property Page}
If you want to process this message in the parent window Property Sheet, add the processing of the PSM_QuerySiblings message in the CMYPROPERTYSHEET class. But when the final function returns, it must be a function default (), otherwise the default processing behavior cannot be called. LResult CMYPROPERTYSHEET :: ONQUERYSIBLINGS (WPARAM WPARAM, LPARAM LPARAM) {// Add yours here to additional Return default ();} If you need to modify the parameter wparam and lparam of the PSM_QuerySiblings message, send changes to Property Page Then you have to write your own code to send a PSM_QuerySiblings message to each Property page.