本帖最后由 zhaowenqiang_120 于 2012-08-30 14:51:10 编辑

解决方案 »

  1.   

    SetWindowPos
    x:以客户坐标指定窗口新位置的左边界
    Y:以客户坐标指定窗口新位置的顶边界
      

  2.   


    Specifies the new position of the left side of the window, in client coordinates. 

    Specifies the new position of the top of the window, in client coordinates. If an owned window was created with the WS_OVERLAPPED style, SetWindowPos uses the parent window coordinates to reposition it. If the owned window was created using the WS_POPUP style, it is repositioned using screen coordinates.
      

  3.   

    看你的代码是基于屏幕的左上点rtSubItem.left + x - 2和rtSubItem.top + y - 31
    rtSubItem.left是基于对话框的左坐标
    加上x后 x是对话框在桌面中的左坐标所以结果就是基于屏幕的左上点
      

  4.   


    不对吧,rtSubItem.left是基于列表的左坐标
      

  5.   


    不是列表,是列表中的item在对话框中的位置 
      

  6.   

    If an owned window was created with the WS_OVERLAPPED style, SetWindowPos uses the parent window coordinates to reposition it. If the owned window was created using the WS_POPUP style, it is repositioned using screen coordinates
      

  7.   


    If an owned window was created with the WS_CHILD style,SetWindowPos uses the parent window coordinates to reposition it? or, it is repositioned using screen coordinates?
      

  8.   

    Child windows must have a parent window and are confined to the client area of their parent. This is the major distinction between child windows and overlapped and pop-up windows. Child window parents can be top-level windows or other child windows. Child windows are positioned from their parent window's upper-left corner and not from the upper-left of the screen as are top-level windows. Child windows are clipped to the client area of their parent. Controls in a dialog box are child windows whose parent is the dialog box.A child window must have a parent window. The parent window can be an overlapped window, a pop-up window, or even another child window