Dear all, I encountered a strange problem when programming with WTL. I've got a treeview control in a window. If the window is put in another window, after editting the treeview control, I can finish editting the control with "return" entered. But if the window is put in a dialog box, I can't finish editting the control with "return" entered. Is there any special attention I should pay with dialog box? Thanks for any hints.
"Kun Niu" wrote: > But if the window is put in a dialog box, I can't finish > editting the control with "return" entered. > Is there any special attention I should pay with dialog box? It happens because Enter key press is handled by dialog `IsDialogMessage' function. You need to subclass tree-view control and handle WM_GETDLGCODE message. KB130691 - "PRB: ESC and ENTER Keys Do Not Work When You Edit Labels in TreeView" http://support.microsoft.com/kb/130691/ KB83302 - "How To Use the WM_GETDLGCODE Message" http://support.microsoft.com/kb/83302/ Also, google for WM_GETDLGCODE message for more info. HTH Alex
Thank you for you useful information. Now I can solve the problem. "Alex Blekhman" wrote: > "Kun Niu" wrote: > > But if the window is put in a dialog box, I can't finish > > editting the control with "return" entered. > > Is there any special attention I should pay with dialog box? > > It happens because Enter key press is handled by dialog > `IsDialogMessage' function. You need to subclass tree-view control > and handle WM_GETDLGCODE message. > > KB130691 - "PRB: ESC and ENTER Keys Do Not Work When You Edit > Labels in TreeView" > http://support.microsoft.com/kb/130691/ > > KB83302 - "How To Use the WM_GETDLGCODE Message" > http://support.microsoft.com/kb/83302/ > > Also, google for WM_GETDLGCODE message for more info. > > HTH > Alex > > > > >