I want to subclass my tabcontrol.
I did this:
string LPFNPROP
LPFNPROP= "Z8TD96"
TabControl win_main,0,5,783,24,@TABSTOP|@TCS_TOOLTIPS|@TCS_HOTTRACK,0,TABCTL
_SetProp(getcontrolhandle(win_main,TABCTL), LPFNPROP, _SetWindowLong(getcontrolhandle(win_main,TABCTL), GWL_WNDPROC, &MyTabProc))
sub MyTabProc(int hwnd,UINT uMsg,int wParam,int lParam),int
int proc
proc = _GetProp(hwnd, LPFNPROP)
select uMsg
case WM_DESTROY
' remove subclass and delete window property
_SetWindowLong(hwnd, GWL_WNDPROC, proc)
_RemoveProp(hwnd, LPFNPROP)
case WM_PAINT
' do default, then redraw sizing tools
_CallWindowProc(proc, hwnd, WM_PAINT, 0, 0)
'do my paint here
return 0
endselect
return _CallWindowProc(proc, hwnd, uMsg,wParam,lParam)
endsub
The tabcontrol initially paints but is totally dead after that.
What'd I do wrong?
Larry
You do need to pass wparam and lparam in the WM_PAINT default call. Otherwise the control won't have a DC to paint into.
So it should be:
return _CallWindowProc(proc, hwnd, WM_PAINT, wparam, lparam)
Changed to what you said; no improvement.
It is causing everything on the parent window client area not to update(not paint)
Larry
Different approach:
Is there a way to subclass the menu bar in a window so that you can put static controls on it?
Larry