TWMParentNotify =
record
Msg: Cardinal;
MsgFiller: TDWordFiller;
case Word
of
WM_CREATE, WM_DESTROY: (
Unused1: Word;
ChildID: Word;
EventChildIDFiller: TDWordFiller;
ChildWnd: HWnd);
WM_LBUTTONDOWN, WM_MBUTTONDOWN, WM_RBUTTONDOWN: (
Unused2: Word;
Value: Word;
EventValueFiller: TDWordFiller;
XPos: Smallint;
YPos: Smallint;
XYPosFiller: TDWordFiller);
0: (
Event: Word;
Value1: Word;
EventValue1Filler: TDWordFiller;
Value2: LPARAM;
Result: LRESULT);
end;
...
procedure WMParentNotify(
var Message: TWMParentNotify);
message WM_PARENTNOTIFY;
...
procedure TCustomListView.WMParentNotify(
var Message: TWMParentNotify);
begin
with Message do
if (Event = WM_CREATE)
and (FHeaderHandle = 0)
then
begin
FHeaderHandle := ChildWnd;
FDefHeaderProc := TWindowProcPtr(GetWindowLong(FHeaderHandle, GWL_WNDPROC));
{$IFDEF CLR}
SetWindowLong(FHeaderHandle, GWL_WNDPROC, FLVInstances.FHeaderInstance);
{$ELSE}
SetWindowLong(FHeaderHandle, GWL_WNDPROC,
Winapi.Windows.LPARAM(FHeaderInstance));
{$ENDIF}
end;
inherited;
end;