Hi
Do I need subclassing for simple Drag&Drop (Drag TreeNode and drop on Textbox)?
Best reg,
Meelis
Simple Drag&Drop
Re: Simple Drag&Drop
Hi,
the drag'n'drop sample uses SubClassing for better Unicode support. The native tree view control sends a WM_NOTIFYFORMAT message to its parent window in order to decide whether to send Unicode notifications or ANSI notifications. Since the parent window is the VB6 form, it responds with "I want ANSI notifications". Since these notifications are handled by the ExplorerTreeView control (via message reflection), the desires of the VB6 form can be ignored. However, the native tree view control will send ANSI notifications because of the VB6 form's response. So the VB6 sample projects subclass the form and make the native tree view send another WM_NOTIFYFORMAT. This message is intercepted and reflected back to the ExplorerTreeView control which will properly decide for Unicode or ANSI notifications.
So, in short, this subclassing has an effect on any notification message that exists in Unicode and ANSI variants. These are:
Regards
TiKu
the drag'n'drop sample uses SubClassing for better Unicode support. The native tree view control sends a WM_NOTIFYFORMAT message to its parent window in order to decide whether to send Unicode notifications or ANSI notifications. Since the parent window is the VB6 form, it responds with "I want ANSI notifications". Since these notifications are handled by the ExplorerTreeView control (via message reflection), the desires of the VB6 form can be ignored. However, the native tree view control will send ANSI notifications because of the VB6 form's response. So the VB6 sample projects subclass the form and make the native tree view send another WM_NOTIFYFORMAT. This message is intercepted and reflected back to the ExplorerTreeView control which will properly decide for Unicode or ANSI notifications.
So, in short, this subclassing has an effect on any notification message that exists in Unicode and ANSI variants. These are:
- TVN_BEGINDRAG (ItemBeginDrag event)
- TVN_BEGINLABELEDIT (StartingLabelEditing event)
- TVN_BEGINRDRAG (ItemBeginRDrag event)
- TVN_DELETEITEM (FreeItemData event)
- TVN_ENDLABELEDIT (RenamingItem event)
- TVN_GETDISPINFO (ItemGetDisplayInfo event)
- TVN_GETINFOTIP (ItemGetInfoTipText event)
- TVN_ITEMCHANGED (ItemSelectionChanged event, ItemStateImageChanged event)
- TVN_ITEMCHANGING (ItemSelectionChanging event, ItemStateImageChanging event)
- TVN_ITEMEXPANDED (CollapsedItem event, ExpandedItem event)
- TVN_ITEMEXPANDING (CollapsingItem event, ExpandingItem event)
- TVN_SELCHANGED (CaretChanged event)
- TVN_SELCHANGING (CaretChanging event)
- TVN_SETDISPINFO (ItemSetText event)
Regards
TiKu
Crunching for Fab36_Folding-Division at Folding@Home. Join Fab36/Fab30! - Folding@Home and BOINC
Boycott DRM! Boycott HDCP!
Boycott DRM! Boycott HDCP!