在一个WndProc中:...
case VK_DOWN:
     MessageBox(hwnd,GetKeyNameText(lParam,sBuffer,32),TEXT("KEY"),MB_OK);
     return 0;
...为什么在返回时,什么都没有?????????????

解决方案 »

  1.   

    老兄,我不笑,可你的确是用错了吧?GetKeyNameText(lParam,sBuffer,32);
    MessageBox(hwnd,szBuffer,TEXT("KEY"),MB_OK);
      

  2.   

    GetKeyNameText
    The GetKeyNameText function retrieves a string that represents the name of a key. int GetKeyNameText(
      LONG lParam,      // second parameter of keyboard message
      LPTSTR lpString,  // buffer for key name
      int nSize         // maximum length of key name
    );Return Values
    If the function succeeds, a null-terminated string is copied into the specified buffer, and the return value is the length of the string, in TCHARs, not counting the terminating null character. If the function fails, the return value is zero. To get extended error information, call GetLastError