如何禁止窗体的重绘???

spring_2011 2011-07-08 09:53:23

下面是C++代码,但是不知道如何在c#下使用。。。

禁止窗体重绘:
SendMessage(hWnd, WM_SETREDRAW, FALSE, 0L);
允许窗体重绘:
SendMessage(hWnd, WM_SETREDRAW, TRUE, 0L);
...全文
598 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
artilleries 2012-03-15
  • 打赏
  • 举报
回复
学习一下,看看效果
spring_2011 2011-07-08
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 liuwei2500 的回复:]
C# code

[DllImport( "USER32.DLL ", CharSet=CharSet.Auto, SetLastError=true)]
public static extern bool SendMessage(
IntPtr hWnd, // handle to destination window
int Msg, // message
int ……
[/Quote]
=================
谢谢, 我试下看看...
xuexiaodong2009 2011-07-08
  • 打赏
  • 举报
回复
牛人啊
嘴哥臭鼬 2011-07-08
  • 打赏
  • 举报
回复
学习 学习
liuwei2500 2011-07-08
  • 打赏
  • 举报
回复

[DllImport( "USER32.DLL ", CharSet=CharSet.Auto, SetLastError=true)]
public static extern bool SendMessage(
IntPtr hWnd, // handle to destination window
int Msg, // message
int wParam, // first message parameter
int lParam
);
const int WM_GETTEXT =0x000B;
const int FALSE = 0x0000;
const int TRUE = 0x0001;
SendMessage((IntPtr)this.Handle,WM_SETREDRAW,FALSE,0);


liuwei2500 2011-07-08
  • 打赏
  • 举报
回复

[DllImport( "USER32.DLL ", CharSet=CharSet.Auto, SetLastError=true)]
public static extern bool SendMessage(
IntPtr hWnd, // handle to destination window
int Msg, // message
int wParam // first message parameter
);
const int WM_GETTEXT =0x000B;
const int FALSE = 0x0000;
const int TRUE = 0x0001;
SendMessage((IntPtr)this.Handle,WM_SETREDRAW,FALSE,0);

liuwei2500 2011-07-08
  • 打赏
  • 举报
回复
[DllImport( "USER32.DLL ", CharSet=CharSet.Auto, SetLastError=true)]
public static extern bool SendMessage(
IntPtr hWnd, // handle to destination window
int Msg, // message
int wParam, // first message parameter
[MarshalAs(UnmanagedType.LPTStr)]StringBuilder lParam // second message parameter
);
const int WM_GETTEXT =0x000B;
const int FALSE = 0x0000;
const int TRUE = 0x0001;
SendMessage((IntPtr)this.Handle,WM_SETREDRAW,FALSE,0);
threenewbee 2011-07-08
  • 打赏
  • 举报
回复
一样的。

C#申明下API函数。然后就可以用了。

111,119

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧