Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

How to get WM_SYSKEYDOWN in the Class wizard of a window

sujaa3sujaa3 Posts: 4Member
helo,
I have a requirement in which i need the hexadecimal code of any key that is pressed from the key board. Now i have the following code which gives me the hexa decimal code when a single key is pressed.

void cD5shortcutKey_UI::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags)
{
CHAR buff[10];


if (GetKeyState(VK_SHIFT) < 0) nChar = nChar + 256;
if (GetKeyState(VK_CONTROL) < 0) nChar = nChar + 512;
if (GetKeyState(VK_MENU) < 0) nChar = nChar + 1024;

_stprintf(buff, _T("%c"), nChar);
AfxMessageBox(buff);


CDialog::OnKeyDown(nChar, nRepCnt, nFlags);
}

Now i want the same hexa decimal code when two or more keys like Ctrl-A, Shift-F12, and Alt-Shift-K are pressed simultaneously.
Also, when there any window components like a radio buttons or a text box present the window thats invoked for the above appication i am not able get the focus to the above OnKeyDown function. Can anyone help me fix these!
Sign In or Register to comment.