How to get WM_SYSKEYDOWN in the Class wizard of a window - Programmers Heaven

Howdy, Stranger!

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

Categories

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.