Hello, can you help me with this problem:
I'm extending the TListView to enable notifying me about the column resize. I've found the code written in Delphi, but I needed to use it in C++, so I decided to rewrite this code to C++. But first problem occurs when I overload this function:
virtual void __fastcall CreateWnd(void);
In Delphi, this code was required to enable functionality of column resize notification:
procedure TListViewEx.CreateWnd;
var
wnd: HWND;
begin
inherited;
wnd := GetWindow(handle, GW_CHILD);
SetWindowLong(wnd, GWL_STYLE, GetWindowLong(wnd, GWL_STYLE) and not HDS_FULLDRAG);
end;
I have rewritten Delphi code to this:
virtual void __fastcall CreateWnd(void)
{
TListView::CreateWnd();
HWND wnd = GetWindow(Handle, GW_CHILD);
SetWindowLongA(wnd, GWL_STYLE, GetWindowLong(wnd, GWL_STYLE) & !HDS_FULLDRAG);
}
The problem comes with calling to this function. GetWindow(Handle, GW_CHILD) returns NULL. Why?