system menu on dialog
-
how to display messagebox when click system menu(X) on dialogbox. Thank to all
Arise Awake Stop Not Till ur Goal is Reached.
-
how to display messagebox when click system menu(X) on dialogbox. Thank to all
Arise Awake Stop Not Till ur Goal is Reached.
-
how to display messagebox when click system menu(X) on dialogbox. Thank to all
Arise Awake Stop Not Till ur Goal is Reached.
Just handle the cancel button click event.
void CYourDlg::OnBnClickedCancel()
{
AfxMessageBox("Don't close!");
}
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
-
Just handle the cancel button click event.
void CYourDlg::OnBnClickedCancel()
{
AfxMessageBox("Don't close!");
}
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
-
in the system-menu, not the Cancel button ... :) Here's the code:
void CYourDlg::OnClose()
{
AfxMessageBox("Don't close!");
}... and don't forget to add the ON_WM_CLOSE() macro in the dialog's message-map.
Hey that still works with System menu's [x]. Did you check that? but yes mentioning "WM_CLOSE" is required! ;)
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
-
Hey that still works with System menu's [x]. Did you check that? but yes mentioning "WM_CLOSE" is required! ;)
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
-
in the system-menu, not the Cancel button ... :) Here's the code:
void CYourDlg::OnClose()
{
AfxMessageBox("Don't close!");
}... and don't forget to add the ON_WM_CLOSE() macro in the dialog's message-map.
Actually I was searching for
OnCancel
but it's not there with 7.1 compiler. VS6.0 displays the cancel event handler as "::OnCancel". but in 7.1 it's generating OnBnClickedCancel.
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
-
Just handle the cancel button click event.
void CYourDlg::OnBnClickedCancel()
{
AfxMessageBox("Don't close!");
}
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
Why would you suggest that? If you write your code in
OnCancel()
, then it would be obviously executed when the Esc key is pressed and also when the cancel button is pressed. HandlingWM_CLOSE
is the right way. -
how to display messagebox when click system menu(X) on dialogbox. Thank to all
Arise Awake Stop Not Till ur Goal is Reached.
Handle
WM_CLOSE
message. -
Hey that still works with System menu's [x]. Did you check that? but yes mentioning "WM_CLOSE" is required! ;)
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
VuNic wrote:
Hey that still works with System menu's [x]. Did you check that? but yes mentioning "WM_CLOSE" is required!
What do you mean by "mentioning WM_CLOSE is required"?
-
VuNic wrote:
Hey that still works with System menu's [x]. Did you check that? but yes mentioning "WM_CLOSE" is required!
What do you mean by "mentioning WM_CLOSE is required"?
-
Why would you suggest that? If you write your code in
OnCancel()
, then it would be obviously executed when the Esc key is pressed and also when the cancel button is pressed. HandlingWM_CLOSE
is the right way.Yeah, nobody would want their application to get closed with an Esc. I really wonder why MFC has it that way :unsure:. So handling WM_CLOSE is the best way. Thanks for stressing that one out. :-D :beer:
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
-
Yeah, nobody would want their application to get closed with an Esc. I really wonder why MFC has it that way :unsure:. So handling WM_CLOSE is the best way. Thanks for stressing that one out. :-D :beer:
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
VuNic wrote:
Yeah, nobody would want their application to get closed with an Esc.
You assume things.
VuNic wrote:
I really wonder why MFC has it that way :unsure:. So handling WM_CLOSE is the best way.
That is by design. Pressing the Esc key in a dialog based app will execute some extremely old windows code. As a developer, you are not supposed to develop complex applications which is dialog based. As a user, he would always expect a dialog to get dismissed when the Esc key is pressed. For instance, if you right click on the desktop and choose properties, you will expect the properties window to get dismissed on pressing Esc. I am working on my first article, and I have elaborated on this dialog box closing glitch issue more clearly.
-
VuNic wrote:
Yeah, nobody would want their application to get closed with an Esc.
You assume things.
VuNic wrote:
I really wonder why MFC has it that way :unsure:. So handling WM_CLOSE is the best way.
That is by design. Pressing the Esc key in a dialog based app will execute some extremely old windows code. As a developer, you are not supposed to develop complex applications which is dialog based. As a user, he would always expect a dialog to get dismissed when the Esc key is pressed. For instance, if you right click on the desktop and choose properties, you will expect the properties window to get dismissed on pressing Esc. I am working on my first article, and I have elaborated on this dialog box closing glitch issue more clearly.
brahmma wrote:
and I have elaborated on this dialog box closing glitch issue more clearly.
Wow.. waiting for it :-D. Bram, do you work with MDI-DOC/View thing?
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
-
brahmma wrote:
and I have elaborated on this dialog box closing glitch issue more clearly.
Wow.. waiting for it :-D. Bram, do you work with MDI-DOC/View thing?
Press: 1500 to 2,200 messages in just 6 days? How's that possible sir? **Dr.Brad :**Well,I just replied to everything Graus did and then argued with Negus for a bit.
I stopped working with MFC quite a long time ago. Currently I am working on Windows Mobile and embedded C (Dynamic C). I have worked with MDI applications too, but for some reason I love dialog based applications and hooking and spying out stuff from within a DLL.
-
I stopped working with MFC quite a long time ago. Currently I am working on Windows Mobile and embedded C (Dynamic C). I have worked with MDI applications too, but for some reason I love dialog based applications and hooking and spying out stuff from within a DLL.
-
how to display messagebox when click system menu(X) on dialogbox. Thank to all
Arise Awake Stop Not Till ur Goal is Reached.
deeps_cute wrote:
how to display messagebox when click system menu(X) on dialogbox.
handle oncancel function
"Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow
cheers, Alok Gupta VC Forum Q&A :- I/ IV Support CRY- Child Relief and You