屏蔽窗体标题栏双击和移动事件
protected: virtual void WndProc( Message % m) override
{
__super::WndProc (m);
if(m.Msg == 0x84 && m.Result == (System::IntPtr)2) // 不让拖动标题栏
{
m.Result = (System::IntPtr)1;
}
if (m.Msg == 0xA3) // 双击标题栏无反应
{
m.WParam = System::IntPtr ::Zero ;
}
}
屏蔽ALT+F4键
private: System::Void TestForm_KeyDown(System::Object^ sender, System::Windows::Forms::KeyEventArgs^ e) {
if (e->Alt == true && e->KeyCode == Keys::F4)
{
KeyPreview = true;//此属性在窗体的属性里面也有
e->Handled = true;
}
}
隐藏在任务栏中的图标
this->ShowInTaskbar =false;