见到了一个例子是InvalidateRect(hwnd,NULL,1);
hwnd明白,NULL和1分别代表了什么

解决方案 »

  1.   

    NULL就是NULL,C语言没有学过吗?
    1不是0,代表True。
      

  2.   

    这个知道,我的意思是为什么是NULL和1,他们分别代表什么?如果不用NULL,还可以用什么别的吗?如果是0,是不是就表示不刷新,或者说最后一个参数可以是表达式?如果成立就刷新?我的意思是想知道那些参数代表什么
      

  3.   

    InvalidateRect
    The InvalidateRect function adds a rectangle to the specified window's update region. The update region represents the portion of the window's client area that must be redrawn. BOOL InvalidateRect(
      HWND hWnd,           // handle to window
      CONST RECT* lpRect,  // rectangle coordinates
      BOOL bErase          // erase state
    );
    Parameters
    hWnd 
    [in] Handle to the window whose update region has changed. If this parameter is NULL, the system invalidates and redraws all windows, and sends the WM_ERASEBKGND and WM_NCPAINT messages to the window procedure before the function returns. 
    lpRect 
    [in] Pointer to a RECT structure that contains the client coordinates of the rectangle to be added to the update region. If this parameter is NULL, the entire client area is added to the update region. 
    bErase 
    [in] Specifies whether the background within the update region is to be erased when the update region is processed. If this parameter is TRUE, the background is erased when the BeginPaint function is called. If this parameter is FALSE, the background remains unchanged. 
    Return Values
    If the function succeeds, the return value is nonzero.If the function fails, the return value is zero. Windows NT/2000/XP: To get extended error information, call GetLastError.
      

  4.   

    如果第二个参数不是null,那就用一个crect指针来表示,表示要刷新的矩形,如果四null,表示刷新整个客户区
      

  5.   

    第二个参数不是null,重画的区域一般为
    CRect m_rect;
    ClientToScreen(&rect)
    然后InvalidateRect(hwnd,&rect,1);