Just as a test does the snippet I provide produce the same result? The reason I ask, is because the syntax you are using to access the struct member variable via its pointer is correct and you should therefore get the actual value of the 'vkCode' and not the garbage you're reporting (you may just be getting the rubbish that 'buffer' contains).
I don't get garbage. If I use meep->vkCode, lets say I get 2200340, when I use meep->scanCode, I get 2200344 and when I use meep->flags, I get 2200348.
I am not at my home computer at the moment, but my program looks something like this:
DLL file, LowLevelKeyboardProc, case HC_ACTION:
Code:
PostMessage(guiapplication,WM_KEYBDHOOK,wParam,lParam);
GUI application, WindowProcedure, case WM_KEYBDHOOK:
Code:
KBDLLHOOKSTRUCT *meep = (KBDLLHOOKSTRUCT *) lParam;
NewItem(meep->vkCode,0,0,0);
NewItem function (ints):
Code:
counter++;
data[counter].a=paramone;
data[counter].b=paramtwo;
data[counter].c=paramthree;
data[counter].d=paramfour;
And then, an other function shows the whole data array in a list view control. Uses itoa() to convert the integer to a string.