AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Sonstige Fragen zu Delphi Delphi Delphi 12: Fehler mit Action := caFree
Thema durchsuchen
Ansicht
Themen-Optionen

Delphi 12: Fehler mit Action := caFree

Ein Thema von WiWo · begonnen am 1. Dez 2023 · letzter Beitrag vom 5. Dez 2023
 
peterbelow

Registriert seit: 12. Jan 2019
Ort: Hessen
715 Beiträge
 
Delphi 12 Athens
 
#21

AW: Delphi 12: Fehler mit Action := caFree

  Alt 5. Dez 2023, 12:53
Can you please confirm if a button click go though TApllication.ProcessMessage ? or an event triggered like TForm.OnShow went through that ? because it doesn't,
ProcessMessage in TApllication ..
Well, as you said i am lacking understanding of stack working and VCL design, who knows may be there are, i must simply don't know.

So please forgive me for wasting your time.
The mouse button down and up messages are posted messages (by the OS), are retrieved (GetMessage/PeekMessage API) and processed (DispatchMessage API) by ProcessMessage. TButton is a wrapper aound the Windows BUTTON control and that reacts to the dispatched mouse messages by sending (not posting) a BN_CLICKED notification to its parent. The VCL reflects that back to the TButton control and there it fires the OnClick event. So if you examine the call stack from a breakpoint in the OnClick event handler you do not see ProcessMessage on it since there is a heap of OS stuff in between. It is similar for a form's OnShow, the message triggering it is send (by the OS), not posted, so it does not go through ProcessMessage.

Most posted messages are created by user action (mouse, keyboard), timers, or OS activities that do not require immediate response, e.g. paint requests. Those are retrieved and distributed by ProcessMessage. But there are a lot of other messages that are directly send to the window/control they are for, and those do not go through ProcessMessage.

Messages are the fuel that drives the Windows UI layer and a lot of other parts of the OS. To get a basic understanding of this stuff you need to work your way through one of the older "Programming Windows" books by Charles Petzold (not the newer ones targeted at .NET/C# programmers). If you survive you will have a much deeper appreciation for what the VCL shields us from.

To get a feeling for the message processing in the VCL you may want to read an old article on key processing I wrote an eon ago: A Key's Odyssey.
Peter Below
  Mit Zitat antworten Zitat
 

 

Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 16:52 Uhr.
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