Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Win32/Win64 API (native code) (https://www.delphipraxis.net/17-win32-win64-api-native-code/)
-   -   Delphi [nonVCL] Subclassing eines Editfeldes - Problem (https://www.delphipraxis.net/65107-%5Bnonvcl%5D-subclassing-eines-editfeldes-problem.html)

turboPASCAL 12. Mär 2006 14:25


[nonVCL] Subclassing eines Editfeldes - Problem
 
Liste der Anhänge anzeigen (Anzahl: 1)
Moin,

ich habe ein Problem mit dem subclasing eines Editfeldes. Ich würde gern einem Editfeld ein neuen Caret unm. verpassen. Soweit ok. Wenn ich in der neuen EditProc die Message WM_KILLFOCUS abfange kan ich im Editfeld nichts mer eingeben.?
Die zweite Sache ist das "Zurückstellen" zur alten/org. EditWndProc.

Im Anhang mal ein Versuchsproject, in ihm sind die Stellen markiert wo ich im Moment die Probleme habe.

Wäre nett wenn sich das mal jemand anschaut.

[edit=SirThornberry] Mfg, SirThornberry[/edit]

turboPASCAL 13. Mär 2006 15:41

Re: [nonVLC] Subclassing eines Editfeldes - Problem
 
Moin, auch....

Ich mach hier mal ein: *Push Pop Mov* and or *SetFocus* :mrgreen:

sniper_w 13. Mär 2006 16:48

Re: [nonVLC] Subclassing eines Editfeldes - Problem
 
Zitat:

Die zweite Sache ist das "Zurückstellen" zur alten/org. EditWndProc.
Delphi-Quellcode:
var
  OldProc:Pointer;
begin
  OldProc := SetWindowLong( myEdit_HWND, GWL_WNDPROC, @MyEditWinProc );
  // oder nur ablesen -> OldProc := GetWindowLong( myEdit_HWND, GWL_WNDPROC );

  // zurückstellen
  SetWindowLong( myEdit_HWND, GWL_WNDPROC, OldProc );
EDIT:
Zitat:

Wenn ich in der neuen EditProc die Message WM_KILLFOCUS abfange kan ich im Editfeld nichts mer eingeben.?
Das ist auch gut so.
Zitat:

The WM_KILLFOCUS message is sent to a window immediately before it loses the keyboard focus.

turboPASCAL 13. Mär 2006 20:58

Re: [nonVLC] Subclassing eines Editfeldes - Problem
 
Ah ja, danke.

Wegem dem KillFocus, das brauche ich ja um das Caret zurückzusetzen. Da ist doch nichts falsches daran oder ?
Nun ist die Frage wie es angestllt werden muss ? :gruebel:

sniper_w 14. Mär 2006 16:18

Re: [nonVLC] Subclassing eines Editfeldes - Problem
 
Zitat:

When a window loses the keyboard focus, the system sends the WM_KILLFOCUS message to the window. Your application should destroy the caret while processing this message by using the DestroyCaret function. The following code shows how to destroy a caret in a window that no longer has the keyboard focus.

case WM_KILLFOCUS:

// The window is losing the keyboard focus, so destroy the caret.

DestroyCaret();

break;

turboPASCAL 14. Mär 2006 19:00

Re: [nonVLC] Subclassing eines Editfeldes - Problem
 
Tschuldigung, kann mal jemand das übersetzen ? Das reicht bei mir nicht dazu ? :gruebel:

:duck:

Thorben77 14. Mär 2006 19:08

Re: [nonVLC] Subclassing eines Editfeldes - Problem
 
Kein Problem (ich hoffe, es stimmt :stupid: ):
Zitat:

Wenn ein Fenster den Eingabefokus verliert, schickt das System die WM_KILLFOCUS-Nachricht an das Fenster. Ihre Applikation sollte, während/wenn sie diese Nachricht verarbeitet, das Caret zerstören indem sie die DestroyCaret-Funktion aufruft. Der Folgende Kode zeigt, wie man ein Caret in einem Fenster zerstört, dass nicht mehr den Eingabefokus hat.

case WM_KILLFOCUS:

// The window is losing the keyboard focus, so destroy the caret.

DestroyCaret();

break;
So in etwa... :wink:

MfG

turboPASCAL 14. Mär 2006 19:20

Re: [nonVLC] Subclassing eines Editfeldes - Problem
 
Thx.

Hm, ja so stimmt das schon. Nur im meinem Prg. nicht. Warum auch immer, ich bekomme es noch nicht hinn.

Luckie 28. Mär 2006 13:11

Re: [nonVCL] Subclassing eines Editfeldes - Problem
 
Gerade gefunden beim stöbern und an dich gedacht ;) : http://blogs.msdn.com/oldnewthing/ar...19/115912.aspx
Vielleicht hilft es ja.

turboPASCAL 28. Mär 2006 16:16

Re: [nonVCL] Subclassing eines Editfeldes - Problem
 
Nette Sache das. Danke.


Alle Zeitangaben in WEZ +1. Es ist jetzt 16:22 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz