First button of toolbar control get activated after another button get executed
-
Hi Friends, I am trying to set focus on the first button in a toolbar control if a key combination like ALT + SHIFT + A is pressed. I am using preTranslate Message, like this if ( pMsg->message == WM_SYSCHAR && (GetKeyState(VK_SHIFT) & 0x8000) && (pMsg->wParam == 'a' || pMsg->wParam == 'A') ) { m_wndToolBar.SetFocus(); } Now. I am getting focus on first button of toolbar. I clicked SPACEBAR and this button get pressed. It open a dialog , after my operation I closed it. After that, Unfortunately second button get activated. I pressed spacebar again.It will pressed that button and called related function , which will open another dialog. After my operation, I closed it . Now the focus went to First button. According to project requirement the focus must retain to the last clicked button. I checked in project code, nowhere first button getting activated explicitly. Please help me out. Regasrd, Amrit Agrawal