But how we can obtain shiftkey's keystrock.In my shiftkey's button i have written the code as follows
// declare bool value as a member variable
//BOOL bShift;
//BOOL bCaps;
// initialize it
//bShift = FALSE;
//bCaps = FALSE;
void CKeyBoardDlg::OnBnClickedButton45()
{
if(m_nFirst==1)
{
m_nFirst=0;
bShift = FALSE;
keybd_event(0x10,0,0x002,0);
}
else if(m_nFirst==0)
{
bShift = TRUE;
keybd_event(0x10,0,0,0);
m_nFirst=1;
}
}
For a char say 'a' my code as follows
void CKeyBoardDlg::OnBnClickedButton33()
{
if(bShift)
{
keybd_event(0x41,0,0,0);
keybd_event(0x41,0,KEYEVENTF_KEYUP,0);
}
else
{
}
DestroyWindow();
}
Dear shilpi without using getkeystate i could send caps.but again clicking on the button45 button click event is not working.that is i cant written caps to small letter.