Board index » delphi » Tracking Parent

Tracking Parent


2003-11-16 02:05:35 PM
delphi187
How can my visual component detect parent form or owner form "close down" ,
"sized" or "moved" without messing with WndProc or CN_Command Notification.
It's already Delphi 7 and it should be easier now isn't it.
Jirayu
 
 

Re:Tracking Parent

Oh, I found it under CM_CancelMode;
procedure CMCancelMode(var Message: TCMCancelMode); message CM_CANCELMODE;
Jirayu
"Jirayu" <XXXX@XXXXX.COM>writes
Quote
How can my visual component detect parent form or owner form "close down"
,
"sized" or "moved" without messing with WndProc or CN_Command
Notification.

It's already Delphi 7 and it should be easier now isn't it.

Jirayu



 

Re:Tracking Parent

In article <XXXX@XXXXX.COM>, Jirayu writes:
Quote
How can my visual component detect parent form or owner form "close down" ,
"sized" or "moved" without messing with WndProc or CN_Command Notification.
Since the control does not get the relevant messages itself there are only
two options:
a) require the host form to actively pass the messages or some kind of
notification to your control.
b) subclass the host form to intercept the messages.
Quote
It's already Delphi 7 and it should be easier now isn't it.
The recommended way for subclassing VCL controls has been the WindowProc
property, for a long time now (since D3 i think). Do not use API-style
subclassing (SetWindowLong) with VCL controls since such a control may
recreate its window handle if certain changes are made to its properties
or even to properties of a control up the parent chain.
Peter Below (TeamB)
Use the newsgroup archives :
www.mers.com/searchsite.html
www.tamaracka.com/search.htm
groups.google.com
www.prolix.be