rt

解决方案 »

  1.   

    winform?你点个按钮,在按钮事件里面写要刷新的内容.
    web?你点个asp.net自带的按钮就刷新了!
      

  2.   

    是整个windows的桌面,谢谢关注。
      

  3.   

    是整个windows的桌面
    -----------------------------
    是windows的桌面,还是桌面上的所有窗口?
      

  4.   

    查一查C++乍做的 调用系统API
      

  5.   

    用UpdateWindow这个函数来刷新.[DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
    public static extern bool UpdateWindow(IntPtr hWnd);
      

  6.   

    [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
    public static extern IntPtr GetDesktopWindow();
      

  7.   

    感谢hbxtlhx
    我这样调用:
    UpdateWindow(GetDesktopWindow());
    没有反应,不见有刷新。
      

  8.   

    我有一个程序,在windowsXP运行正常,如果在windows2000下运行,当移动窗口时留下一个影子,用右键菜单的"刷新"一次就消失了,我想在程序中进行自动刷新屏幕。
      

  9.   

    你可以调用如下的方法来实现你的要求:
    [DllImport("user32.dll", CharSet = CharSet.Auto, ExactSpelling = true)]
    public static extern bool RedrawWindow(IntPtr hwnd, COMRECT rcUpdate, IntPtr hrgnUpdate, int flags);//调用示例如下:
    RedrawWindow(GetDesktopWindow(), null, IntPtr.Zero, 0x85);
      

  10.   

    或者用:
    [DllImport("user32.dll", CharSet=CharSet.Auto, ExactSpelling=true)]
    public static extern bool InvalidateRect(IntPtr hWnd, COMRECT rect, bool erase);这个方法及上一个方法RedrawWindow中的COMRECT 的声明如下:
    public class COMRECT
    {
    public int left;
    public int top;
    public int right;
    public int bottom;
    public COMRECT()
    {
    }
    public COMRECT(int left, int top, int right, int bottom)
    {
    this.left = left;
    this.top = top;
    this.right = right;
    this.bottom = bottom;
    }
    }
     
      

  11.   

    非常感谢hbxtlhx(平民百姓)!
    用RedrawWindow成功了!