Hello,

I'm trying to subclass SysListView32 in the client area in the following way:
Foo proc

local wc:WNDCLASSEX
invoke [color=blue]GetClassInfoEx[/color], 0, addr ListViewClassName, addr wc ; original SysListView32
;mov esi, eax ; here is SysListView32 atom
mov wc.cbSize, sizeof(WNDCLASSEX)
m2m wc.hInstance, hInstance
mov wc.style, CS_DBLCLKS
mov wc.hbrBackground, COLOR_BACKGROUND + COLOR_WINDOW
m2m m_OldListViewProc, wc.lpfnWndProc
mov wc.lpfnWndProc,offset Client_WndProc
lea eax, ClientClass ; here is new class name
mov wc.lpszClassName, eax
invoke [color=blue]RegisterClassEx[/color], ADDR wc
xor ebx, ebx
stc
rcr ebx, 1
invoke [color=blue]CreateWindowEx[/color], WS_EX_CLIENTEDGE,\
eax,0, WS_CHILD + WS_VISIBLE + WS_CLIPSIBLINGS + WS_CLIPCHILDREN+9,\
ebx,ebx,ebx,ebx,m_hWnd,0,hInstance,0
test eax, eax
jz @@end
mov m_hWndClient, eax
@@end:
ret
Foo endp


This code was borrowed from WTL application with non significant changes. After this code executed I've expected to see SysHeader32 as it shows in WTL apps. But it don't in my case. Actually I can subclass it with SetWindowLong(Ptr) (as usually) but I'm just curious what I'm doing wrong :confused:
Any suggestions?
Posted on 2003-09-10 01:53:56 by masquer
Problem solved - just forgot to add ICC_LISTVIEW_CLASSES as a dwICC for InitCommonControlsEx :cool:
Posted on 2003-09-10 03:49:37 by masquer