Disabling Alt+F4 in a Powershell form
问题 I've written a powershell script which displays a form using System.Windows.Forms . I've already disabled the control box and all other ways that this form can be closed via the mouse. But I can't find a way of preventing the form closing by pressing Alt + F4 . i.e. Code snippet looks like this: [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") [void] [System.Reflection.Assembly]::LoadWithPartialName("System.Drawing") $objForm = New-Object System.Windows.Forms