怎样由窗口句丙得到窗口名称?

解决方案 »

  1.   

    int GetWindowText(
      HWND hWnd,        // handle to window or control with text
      LPTSTR lpString,  // address of buffer for text
      int nMaxCount     // maximum number of characters to copy
    );
     
    比如: 
    TCHAR pName[64];
    GetWindowText(hwnd,pName,63);
      

  2.   

    使用API函数中得::GetWindowText();
      

  3.   

    GetWindowText(HWND hWnd,  LPTSTR lpString, int nMaxCount);
      

  4.   

    char szTemp[255];
    memset(szTemp, '\0' sizeof(szTemp));
    ::GetWindowText(hWnd, szTemp);