When the user clicks the check box of a TreeView item, an NM_CLICK notification is sent to the parent window. When this occurs, the TVM_HITTEST message returns TVHT_ONITEMSTATEICON. The TreeView control uses this same condition to toggle the state of the check box. Unfortunately, the TreeView control toggles the state after the NM_CLICK notification is sent. 因此你setcheck被treeview自己覆盖掉了。 你可以Post个message,使得父窗口在treeview处理完后再setcheck。相当于延迟调用。
因此你setcheck被treeview自己覆盖掉了。
你可以Post个message,使得父窗口在treeview处理完后再setcheck。相当于延迟调用。