//toggle shift key.
bytKeyBuff[VK_SHIFT] |= 0x80 ;//set the high bit to 1
SetKeyboardState((PBYTE)&bytKeyBuff) ;
//let the pretranslate do it's default thing
BOOL bReturn = CFormView::PreTranslateMessage(pMsg) ;
//toggle back to the original state
bytKeyBuff[VK_SHIFT] &= 0x7F ;//set the high bit to 0
SetKeyboardState((PBYTE)&bytKeyBuff) ;
return bReturn ;
}
}
return CFormView::PreTranslateMessage(pMsg) ;
}
Pointer to the previous (or next) control that has the WS_TABSTOP style, if the member function is successful.
The returned pointer may be temporary and should not be stored for later use.
Parameters
pWndCtl
Identifies the control to be used as the starting point for the search.
bPrevious
Specifies how the function is to search the dialog box. If TRUE, the function searches for the previous control in the dialog box; if FALSE, it searches for the next control.
Remarks
Retrieves a pointer to the first control that was created with the WS_TABSTOP style and that precedes (or follows) the specified control.
ie to move to next
GetNextDlgItem(GetFocus(), false)->SetFocus();//swap false for true to move to prev
0
Question has a verified solution.
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
BOOL CFormTestView::PreTranslat
{
if(pMsg->message == WM_KEYDOWN)
{
if(pMsg->wParam == VK_RIGHT)
pMsg->wParam = VK_TAB ;
else if(pMsg->wParam == VK_LEFT)
{
pMsg->wParam = VK_TAB ;
//Set the shift key state
static BYTE bytKeyBuff[256] ;
GetKeyboardState((PBYTE)&b
//toggle shift key.
bytKeyBuff[VK_SHIFT] |= 0x80 ;//set the high bit to 1
SetKeyboardState((PBYTE)&b
//let the pretranslate do it's default thing
BOOL bReturn = CFormView::PreTranslateMes
//toggle back to the original state
bytKeyBuff[VK_SHIFT] &= 0x7F ;//set the high bit to 0
SetKeyboardState((PBYTE)&b
return bReturn ;
}
}
return CFormView::PreTranslateMes
}
HTH