Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi direktive "message" (https://www.delphipraxis.net/39587-direktive-message.html)

WM_CLOSE 22. Mär 2011 06:23

AW: direktive "message"
 
Im grunde ist es ein zusätzlicher Eintrag in der WndProc des jeweiligen Fensters.

Neutral General 22. Mär 2011 09:01

AW: direktive "message"
 
Hallo,

Wenn es nur um 1 einzelnes Richedit oder so geht, dann ginge auch folgendes:

Delphi-Quellcode:
TForm1 = class(TForm)
  Richedit1: TRichedit;
private
  FOldWndProc: TWndMethod;
  procedure NewWndProc(var Msg: TMessage);
public
  { Public-Deklarationen }
end;


procedure TForm1.FormCreate(Sender: TObject);
begin
  FOldWndProc := Richedit1.WndProc;
  Richedit1.WndProc := NewWndProc;
end;

procedure TForm1.NewWndProc(var Msg: TMessage);
begin
  FOldWndProc(Msg); // => "inherited"
  if Msg.Msg = WM_SETFOCUS then
    ShowMessage('SetFocus!');
end;
(Habs jetzt ausm Kopf getippt. Hoffe mal dass ich keine Fehler drin hab)

Gruß
Neutral General


Alle Zeitangaben in WEZ +1. Es ist jetzt 10:13 Uhr.
Seite 2 von 2     12   

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