c# 如何立刻刷新桌面
[DllImport("user32.dll", CharSet = CharSet.Auto)]static public extern IntPtr GetDesktopWindow();
[DllImport("user32.dll", CharSet = CharSet.Auto)]
static public extern bool UpdateWindow(IntPtr hWnd);
private void button1_Click(object sender, EventArgs e)
{
bool bl = UpdateWindow(GetDesktopWindow());
}
上面的代码执行时并不能刷新桌面,应该怎么写?
或者用其他api函数怎么实现? --------------------编程问答-------------------- http://blog.163.com/kunkun0921@126/blog/static/169204332201171392452132/ --------------------编程问答--------------------
[DllImport("user32.dll")]--------------------编程问答--------------------
public static extern bool InvalidateRect(IntPtr hwnd,IntPtr lpRect,bool bErase);
private void button1_Click(object sender, System.EventArgs e)
{
InvalidateRect(IntPtr.Zero ,IntPtr.Zero ,true);
}
这个方法不能立刻刷新桌面的。
补充:.NET技术 , C#