I got the code from Mika Raento site about capturing the key press in an EXE file and i managed to compile it however there is an error when intilalizing a CApaWindowGroupName object, it just crashes if i add the following :

CApaWindowGroupName* wn=CApaWindowGroupName::NewLC(ws);
wn->SetWindowGroupName(wg); //wg is a RWindowGroup object
when i removed those 3 steps that hide the window the exe file is still on the screen plus it only reads the left keypress and nothing more than that, any help guys would be appreciate it cause i have to deliver a product and this is the only part left for me,thanks.