ERLEDIGT
NEIN
NEIN
ANTWORTEN
0
0
ZUGRIFFE
1030
1030
EMPFEHLEN
-
Ich hab da ein CTreeCtrl und wenn der benutzer gerade ein Item editiert und [enter]
drückt würde ich dem nun gerne sagen wollen, das es aufhören soll.
Wenn man jedoch "einfach so" [enter] drückt, wird der Standard Button ausgelöst.
Deshalb fange ich das schon in PreTranslateMessage(..) ab:
Die Nachricht wird dann aber nicht von dem CTreeCtrl sondern von dem CEdit in den CTreeCtrl abgefeuert - die abzufangen und soweit kein problem :
Code :1 2 3 4 5 6 7 8 9
if (pMsg->hwnd == ((CTreeCtrl*)GetDlgItem(IDC_IMG_TREE))->GetEditControl()->GetSafeHwnd() && pMsg->message == WM_KEYDOWN) { if (pMsg->wParam == VK_RETURN) { //--- hier Nachricht senden und Editieren beenden - T_T return TRUE; } }
Aber wie sende ich jetzt die Nachrich und wo bekomme ich die Parameter her ?!
Die Enstprechende Nachricht heist : TVN_ENDLABELEDIT
Die MSDN sagt folgendes dazu aber ich werd nicht schlau draus :
(wieso kann eigentlich der CODE nicht so lang sein wie das ZITAT ?!)TVN_ENDLABELEDIT
ptvdi = (LPNMTVDISPINFO) lParam
Notifies a tree view control's parent window about the end of label editing for an item. This notification message is sent in the form of a WM_NOTIFY message.
If the pszText member is non-NULL, return TRUE to set the item's label to the edited text. Return FALSE to reject the edited text and revert to the original label.
ptvdi
Address of an NMTVDISPINFOstructure. The item member of this structure is a TVITEM structure whose hItem, lParam, and pszText members contain valid information about the item that was edited.
If label editing was canceled, the pszText member of the TVITEM structure is NULL; otherwise, pszText is the address of the edited text.
If the pszText member is NULL, the return value is ignored.
If you specified the LPSTR_TEXTCALLBACK value for this item and the pszText member is non-NULL, your TVN_ENDLABELEDIT handler should copy the text from pszText to your local storage.
Hab schon ein bischen mit SendMessage(..) rumgebastetl aber ohne Erfolg.
Kann mir jemand helfen ?!
M.f.G: ErikGeändert von EriFo (19.02.05 um 02:09 Uhr)
Dieses Schreiben wurde maschinell
erstellt und bedarf keiner Unterschrift
Ähnliche Themen
-
mousup-event erzeugt vorher paint-event.Wie abstellen?
Von Cheesygecko im Forum .NET Windows FormsAntworten: 0Letzter Beitrag: 09.01.09, 14:04 -
textarea: per POST Text eingeben und wieder senden => senden funktioniert nicht
Von acquire im Forum PHPAntworten: 2Letzter Beitrag: 02.05.08, 08:46 -
Event in Event aufrufen
Von warcraft9105 im Forum .NET Windows FormsAntworten: 6Letzter Beitrag: 24.04.08, 10:00 -
MySQL-Event nach außen senden
Von KartoffelKiffer im Forum Relationale DatenbanksystemeAntworten: 2Letzter Beitrag: 15.04.08, 18:33 -
Pfeiltaste runter event an CListCtrl senden
Von tutorobsch im Forum VisualStudio & MFCAntworten: 4Letzter Beitrag: 29.10.07, 17:10





Zitieren
Login






