如何禁用双击窗体图标关闭窗体
来源:互联网 发布:读取大智慧实时数据 编辑:程序博客网 时间:2024/05/22 12:40
这个问题来自论坛提问,.Net由于对WindowsAPI的透明度增强,很多Winform开发者都不太了解经典的win32消息方面的知识。
所有窗体上的鼠标反映都可以用WndProc拦截,除了系统菜单、标题栏、系统按纽还包括客户区。
- using System;
- using System.Windows.Forms;
- using System.Runtime.InteropServices;
- namespace WindowsApplication1
- {
- public partial class Form1 : Form
- {
- public Form1()
- {
- InitializeComponent();
- }
- [DllImport("user32.dll")]
- private static extern IntPtr GetSystemMenu(IntPtr hWnd, bool bRevert);
- protected override void WndProc(ref Message m)
- {
- if (m.Msg == 0x112)
- {
- if (m.WParam.ToInt32() == 61539 || m.WParam.ToInt32() == 61587)
- {
- Console.WriteLine(m.WParam);
- return;
- }
- }
- base.WndProc(ref m);
- }
- }
- }
- 如何禁用双击窗体图标关闭窗体
- WinForm窗体禁用关闭按钮
- WinForm窗体禁用关闭按钮
- VB2005中如何禁用窗体右上角的关闭按钮?
- 禁用CS窗体上的关闭按钮
- 禁用winform窗体上的关闭按钮
- WinForm 中禁用窗体的关闭按钮
- C# Winform 禁用窗体关闭按钮
- IE 如何屏蔽窗体关闭
- c#如何关闭父窗体
- 如何关闭窗体、线程、应用程序?
- Winform 如何防止双击标题栏、移动窗体
- 如何实现“WinForm窗体禁用关闭按钮”方法功能及源代码
- 关闭窗体
- 关闭窗体
- 关闭窗体
- Windows Forms中禁用窗体的关闭按钮
- 在Winform中禁用窗体的关闭按钮
- 动态管理 XMLBeans 应用程序中的 XML 模式变体
- 面试参考网站收藏
- Software Defined Radio for 3G
- 演练:使用 Visual Studio Team Test 进行单元测试
- Ubuntu——Linux在学校上网……娱乐、学习一个都不误!
- 如何禁用双击窗体图标关闭窗体
- Eclipse下ExtJs插件导入
- J2ee中文问题的解决
- 开发 ASP.NET 工作流应用程序
- 批处理For循环
- final在java中的应用
- Network Security Hacks [ILLUSTRATED]
- Integrating Visual Studio Team System 2008 Unit Tests with CruiseControl.NET
- 浅谈兔子是怎样吃掉狼的