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 CM_DEACTIVATE in TWinControl (https://www.delphipraxis.net/180506-cm_deactivate-twincontrol.html)

monty.ms 24. Mai 2014 14:52

CM_DEACTIVATE in TWinControl
 
Hallo,

ich habe eine Komponente (abgeleitet von TWinControl) die darauf reagieren soll, wenn die Anwendung nicht mehr im Fokus ist. Leider erhält meine Komponente die Message CM_DEACTIVATE nicht.

Code:
procedure OnAppDeactivate(var Msg: TMsg); message CM_DEACTIVATE;
Muss man da auf was spezielles achten?

Ich weiß, man kann auch einfach Application.OnDeactivate nehmen, aber macht das Sinn eine kleine Komponente daran zu hängen? Eventuell soll später ein zentrales Objekt auf das Ereignis reagieren.

Danke für jede Hilfe.


Gruß

monty

himitsu 24. Mai 2014 19:28

AW: CM_DEACTIVATE in TWinControl
 
Diese Message wird natürlich nicht an jedes einzelne Control versendet, sondern nur an das Top-Level-Windows (und ToolMenüs).

Delphi-Referenz durchsuchenTApplicationEvents oder direkt an Delphi-Referenz durchsuchenApplication wenden oder ans OnMessage der übergeordneten TCustomForm, wobei das ursprünglich MSDN-Library durchsuchenWM_ACTIVATEAPP (im Windows) ist.


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:05 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