Click here to Skip to main content
15,881,882 members
Home / Discussions / C#
   

C#

 
AnswerRe: Use of java script in asp.net pages Pin
Mohamad Al Husseiny23-Sep-05 15:29
Mohamad Al Husseiny23-Sep-05 15:29 
QuestionC# Sucks! Pin
Stober23-Sep-05 11:26
Stober23-Sep-05 11:26 
AnswerRe: C# Sucks! Pin
Anonymous23-Sep-05 11:39
Anonymous23-Sep-05 11:39 
GeneralRe: C# Sucks! Pin
Stober23-Sep-05 11:46
Stober23-Sep-05 11:46 
GeneralRe: C# Sucks! Pin
Luis Alonso Ramos23-Sep-05 15:26
Luis Alonso Ramos23-Sep-05 15:26 
AnswerRe: C# Sucks! Pin
Mohamad Al Husseiny23-Sep-05 13:56
Mohamad Al Husseiny23-Sep-05 13:56 
QuestionWhat message is called when the X in the upper right of a dialog is closed Pin
Dan Neely23-Sep-05 10:04
Dan Neely23-Sep-05 10:04 
AnswerRe: What message is called when the X in the upper right of a dialog is closed Pin
Mohamad Al Husseiny23-Sep-05 12:52
Mohamad Al Husseiny23-Sep-05 12:52 
The Windows recive WM_SYSCOMMAND Notification when you close minimize or maximize the window or you choose any command from the system menu
So overrid your form WndProc function and handle it
const int WM_SYSCOMMAND  = 0x0112;
const int SC_CLOSE    =    0xF060;

protected override void WndProc(ref Message m)
{
	if(m.Msg==WM_SYSCOMMAND)
	{
		if(m.WParam.ToInt32()==SC_CLOSE)
		{
		      MessageBox.Show("Application will be close");
                       // call the default after you handle it			
                       base.WndProc(ref m);
		}
	}
	else
	{
		base.WndProc (ref m);
	}
}

if you don not handle other Message you can write it like
protected override void WndProc(ref Message m)
{
	if(m.Msg==WM_SYSCOMMAND)
	{
		if(m.WParam.ToInt32()==SC_CLOSE)
		{
		      MessageBox.Show("Application will be close");
                }
			
	}
        base.WndProc (ref m);
}

for more information look at WM_SYSCOMMAND Notification[^]


MCAD

-- modified at 18:53 Friday 23rd September, 2005
AnswerRe: What message is called when the X in the upper right of a dialog is closed Pin
mav.northwind23-Sep-05 19:18
mav.northwind23-Sep-05 19:18 
GeneralRe: What message is called when the X in the upper right of a dialog is closed Pin
Dan Neely26-Sep-05 3:13
Dan Neely26-Sep-05 3:13 
Questionmscorlib::Not enough storage is available to complete this operation. Pin
Kant23-Sep-05 8:15
Kant23-Sep-05 8:15 
AnswerRe: mscorlib::Not enough storage is available to complete this operation. Pin
Dave Kreskowiak23-Sep-05 9:14
mveDave Kreskowiak23-Sep-05 9:14 
GeneralRe: mscorlib::Not enough storage is available to complete this operation. Pin
Kant23-Sep-05 10:33
Kant23-Sep-05 10:33 
QuestionSharePoint Customization - Possible? Pin
stan2823-Sep-05 7:32
stan2823-Sep-05 7:32 
Questioncontextmenu Pin
PHDENG8123-Sep-05 7:29
PHDENG8123-Sep-05 7:29 
AnswerRe: contextmenu Pin
Judah Gabriel Himango23-Sep-05 8:05
sponsorJudah Gabriel Himango23-Sep-05 8:05 
GeneralRe: contextmenu Pin
PHDENG8126-Sep-05 1:57
PHDENG8126-Sep-05 1:57 
GeneralRe: contextmenu Pin
Judah Gabriel Himango26-Sep-05 4:11
sponsorJudah Gabriel Himango26-Sep-05 4:11 
QuestionListing Database Names Pin
Member 205875323-Sep-05 7:28
Member 205875323-Sep-05 7:28 
AnswerRe: Listing Database Names Pin
Mohamad Al Husseiny23-Sep-05 14:09
Mohamad Al Husseiny23-Sep-05 14:09 
GeneralRe: Listing Database Names Pin
Member 205875326-Sep-05 7:23
Member 205875326-Sep-05 7:23 
Questionneed to understand once and for all.... Pin
...---...23-Sep-05 5:49
...---...23-Sep-05 5:49 
AnswerRe: need to understand once and for all.... Pin
Robert Rohde23-Sep-05 6:21
Robert Rohde23-Sep-05 6:21 
GeneralRe: need to understand once and for all.... Pin
...---...23-Sep-05 6:56
...---...23-Sep-05 6:56 
GeneralRe: need to understand once and for all.... Pin
Dan Neely23-Sep-05 7:05
Dan Neely23-Sep-05 7:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.