h1.post-title { color:orange; font-family:verdana,Arial; font-weight:bold; padding-bottom:5px; text-shadow:#64665b 0px 1px 1px; font-size:32px; } -->

Pages

Disable MessageBox Close button [x] in C#.Net

This is code for disable MessageBox Close button using C#.net
MessageBox.Show("Are you sure, Do you want to Close this Application?","Application Name",MessageBoxButtons.YesNo);
internal const int SC_CLOSE = 0xF060;
internal const int MF_GRAYED = 0x1;
internal const int MF_ENABLED = 0x00000000; //enabled button status
internal const int MF_DISABLED = 0x00000002; //disabled button status
[DllImport("user32.dll")]
private static extern IntPtr GetSystemMenu(IntPtr HWNDValue, bool Revert);
[DllImport("user32.dll")]
private static extern int EnableMenuItem(IntPtr tMenu, int targetItem, int targetStatus);