Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[D7]TWinControl.WMDrawItem fails under WOW64

169 views
Skip to first unread message

Alistair Ward

unread,
Oct 7, 2005, 2:42:17 AM10/7/05
to
I have a subclass of TPageControl that sets ownerdraw to take control of
drawing the tab labels.

This works quite happily on a Win32 machine.

Under Win64 (WOW64) the tabs are not drawn.

I have tracked this down to TWinControl.WMDrawItem():
---------
procedure TWinControl.WMDrawItem(var Message: TWMDrawItem);
begin
if not DoControlMsg(Message.DrawItemStruct^.CtlID, Message) then
inherited;
end;
---------

I think this should read:
---------
procedure TWinControl.WMDrawItem(var Message: TWMDrawItem);
begin
if not DoControlMsg(Message.DrawItemStruct^.hwndItem, Message) then
inherited;
end;
---------

The first parameter of DoControlMsg is declared as an HWnd.
It is passed down to FindControl(), which passes it as a parameter to
GetWindowThreadProcessId().

This function appears to accept the CtlID in place of a windows handle
under Win32, but not under Win64.

I realise this is probably never going to be fixed in D7, but should be
checked in D2005/DeXter...

I have reported this as QC# 19859

Alistair Ward.

0 new messages