how i disable ALT+F4 key
-
hi how can i disable alt+f4 key please give me some clue if possible please send some sample code in c#.
-
hi how can i disable alt+f4 key please give me some clue if possible please send some sample code in c#.
You might be able to with a system wide keyboard hook. Also, doesn't that close a program ? The onclosing event might be useful, you could write code to refuse to close, unless some condition is met ( such as, ALT is not held down )
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
-
You might be able to with a system wide keyboard hook. Also, doesn't that close a program ? The onclosing event might be useful, you could write code to refuse to close, unless some condition is met ( such as, ALT is not held down )
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Have a look at http://www.thescripts.com/forum/thread227955.html
-
You might be able to with a system wide keyboard hook. Also, doesn't that close a program ? The onclosing event might be useful, you could write code to refuse to close, unless some condition is met ( such as, ALT is not held down )
Christian Graus - Microsoft MVP - C++ Metal Musings - Rex and my new metal blog "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
Yeah, that's what I'd suggest.
private bool closeok = false ; private void button1\_Click ( object sender , System.EventArgs e ) { this.closeok = true ; this.Close() ; } private void Form1\_FormClosing ( object sender , System.Windows.Forms.FormClosingEventArgs e ) { e.Cancel = !closeok ; }
The form will only close due to a click of button1. (In addition, if you haven't already, set the form's
ControlBox = false;
)