i am subclassing my button controls so on tab they SetFocus to the next button control.
but there is a slight problem with how i am doing it.which is like this
Code:
LRESULT APIENTRY ButtonHost(HWND hwnd , UINT message , WPARAM wParam , LPARAM lParam)
{
switch(message)
{
case WM_CHAR:
if(wParam == VK_TAB)
{
SetFocus(hwndButtonOptionsH);
}
if(wParam != VK_TAB)
{
return CallWindowProc(wpButtonHost , hwnd , message , wParam , lParam);
}break;
case WM_SETFOCUS:
SetWindowLong(hwnd, GWL_STYLE, WS_VISIBLE | WS_CHILD | BS_DEFPUSHBUTTON);
return 0;
case WM_KILLFOCUS:
SetWindowLong(hwnd, GWL_STYLE, WS_VISIBLE | WS_CHILD | BS_PUSHBUTTON);
ShowWindow(hwnd, SW_HIDE);
ShowWindow(hwnd, SW_SHOW);
return 0;
default:
return CallWindowProc(wpButtonHost , hwnd , message , wParam , lParam);
}
return 0;
}
now the problem is it is setting the focus to the other button control but it seems like it is not receiving the WM_SETFOCUS message because all the button controls have the effect of taking out the seletection rect and making it defpushbutton instead.
i have tried using sendmessage and WM_SETFOCUS but that seems to not be working right.
does any one know away around this as to where my buttons that is getting selected with SetFocus uses the effect they get when they get WM_SETFOCUS,
thanks