Code:
int  ReqdNumLockState = 0x0001;


if( (GetKeyState( VK_NUMLOCK ) & 0x0001) != ReqdNumLockState )
{
  //Ponemos el NumLock a ON, para que se pueda escribir con el numpad directamente.
  keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY | 0, 0 );
  keybd_event( VK_NUMLOCK, 0x45, KEYEVENTF_EXTENDEDKEY |   KEYEVENTF_KEYUP, 0 );
}
finally I have used this piece of code.
I havent tested it yet, and I will post if it works or not in about 5 minutes (for anyone who wants to know, of course).