如何禁用双击窗体图标关闭窗体?
Net由于对WindowsAPI的透明度增强,很多Winform开发者都不太了解经典的win32消息方面的知识。
所有窗体上的鼠标反映都可以用WndProc拦截,除了系统菜单、标题栏、系统按纽还包括客户区。
usingSystem;
usingSystem。Windows。Forms;
usingSystem。Runtime。InteropServices;
namespaceWindowsApplication1
{
publicpartialclassForm1:Form
{
publicForm1()
{
InitializeComponent();
}
[DllImport("...全部
Net由于对WindowsAPI的透明度增强,很多Winform开发者都不太了解经典的win32消息方面的知识。
所有窗体上的鼠标反映都可以用WndProc拦截,除了系统菜单、标题栏、系统按纽还包括客户区。
usingSystem;
usingSystem。Windows。Forms;
usingSystem。Runtime。InteropServices;
namespaceWindowsApplication1
{
publicpartialclassForm1:Form
{
publicForm1()
{
InitializeComponent();
}
[DllImport("user32。
dll")]
privatestaticexternIntPtrGetSystemMenu(IntPtrhWnd,boolbRevert);
protectedoverridevoidWndProc(ref Messagem)
{
if(m。
Msg==0x112)
{
if(m。WParam。ToInt32()==61539||m。WParam。ToInt32()==61587)。收起