I am working on windows and i chose the c++ as language. My application is a win32 application and I am not using MFC classes, but only the native API.
My main window contain a Tab control in which there is a Listview control. I tried to Subclass both the control, but it is not working even though i follow the msdn guide.
The function I used are:
so I changed the child's procedures but it seems the main window catches every messages that controls send ( through WM_NOTIFY ) and every WM messages. I thought that it may concern focus but I do not have any idea on how implement this kind of situation: a child control which is the parent of an another child control.
I have created the Tab control in this way.
hwndTab = CreateWindow(WC_TABCONTROL, "",
WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE,
0, 0, rcClient.right, rcClient.bottom,
winHandle, NULL, hInst, NULL);
OldUserTabProc = (WNDPROC)GetWindowLong(hwndTab, GWL_WNDPROC);
SetWindowLong(hwndTab, GWL_WNDPROC, (LONG_PTR)UserTabProc);
Here The Tab control procedure
LRESULT CALLBACK UserTabProc( HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam )
switch ( message )
userCurrentTab = TabCtrl_GetCurSel( userTab );
return CallWindowProc( OldUserTabProc, hWnd, message, wParam, lParam );
The listview has as parent the Tab control.