Need help on ownerdrawn windows in Lister plugin

Discuss and announce Total Commander plugins, addons and other useful tools here, both their usage and their development.

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Need help on ownerdrawn windows in Lister plugin

Post by *Lefteous »

lister sdk help wrote: ListNotificationReceived is called when the parent window receives a notification message from the child window: WM_COMMAND, WM_NOTIFY, WM_MEASUREITEM or WM_DRAWITEM
I can't get it to work. The child control has a valid ownerdraw style. I never receive a WM_DRAWITEM or WM_MEASUREITEM message in ListNotificationReceived.
Standard drawing works fine.
Could someone please help me. A working example would be fine.
User avatar
SCHMaster
Member
Member
Posts: 199
Joined: 2003-02-08, 00:39 UTC
Location: Ukraine
Contact:

Post by *SCHMaster »

It is necessary to substitute wndproc
OldProc := Pointer(GetWindowLong(ListerHandle,GWL_WNDPROC));
SetWindowLong(ListerHandle, GWL_WNDPROC, Longint(@NewWndProc));
and process new wndproc
function NewWndProc(hWindow: HWND; message: UINT; WParam: WPARAM;
LParam: LPARAM): LRESULT; stdcall;
begin
...
end;
See Win32 API Help.
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

2SCHMaster

Thank you for reply!

Are you sure that subclassing is the right way here? As far as I know WM_MEASUREITEM and WM_DRAWITEM are always sent to the parent window of the ownerdrawn control and I thought the lister window handler calls ListNotificationReceived when receiving WM_MEASUREITEM or WM_DRAWITEM.
User avatar
Lefteous
Power Member
Power Member
Posts: 9535
Joined: 2003-02-09, 01:18 UTC
Location: Germany
Contact:

Post by *Lefteous »

Thanks to Mr. Ghisler the problem is solved in TC 6.02. :D
Post Reply