~
我的程序人生即将开始~~~~~~
[DllImport("USER32.DLL", CharSet=CharSet.Auto)]
private extern static IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
//--------------------------------------------------------------------------------
// 定数の宣言
//--------------------------------------------------------------------------------
private const int SC_CLOSE = 0xF060;
private const int MF_BYCOMMAND = 0x0000;
private void button1_Click(object sender, System.EventArgs e)
{
this.Close();
}
public static void DisableCloseButtom(System.IntPtr argWindowHandle)
{
IntPtr hMenu = GetSystemMenu(argWindowHandle, false);
if ( !hMenu.Equals(IntPtr.Zero))
{
DeleteMenu( hMenu, SC_CLOSE, MF_BYCOMMAND);
// 区切り線を削除
DeleteMenu( hMenu, 0, MF_BYCOMMAND);
}
}
能屏蔽关闭叉叉,并且把它变成灰色,调试过,没问题
[此贴子已经被作者于2006-1-17 9:44:07编辑过]