用FindWindow获得句柄后用什么函数获得窗体的位置和大小?
查询了老半天也查询不到
郁闷

解决方案 »

  1.   

    BOOL GetWindowRect(          HWND hWnd,
        LPRECT lpRect
    );
      

  2.   

    GetWindowRect
    This function retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the upper-left corner of the screen. BOOL GetWindowRect( 
    HWND hWnd, 
    LPRECT lpRect ); 
      

  3.   

    HWND hWnd = ::FindWindow(NULL, "MSN Messenger");//比如要查MSN窗口
    if (NULL != hwnd)
    {
        CRect rect;
       ::GetWindowRect(hWnd, rect); //rect中的top.left.right.bottom中保存的就是MSN窗口的位置和大小信息
    }