本文介绍了如何覆盖setmodifiedflag?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这篇文章的标题并没有准确地说明我的问题。我想不出一个简洁的标题。



在MFC Doc / View应用程序中,一旦在用户活动发生后调用SetModifiedFlag(),就会生成或调用MFC每当尝试关闭未保存的文档时都会出现消息框。



我希望更改MFC调用或生成消息框的颜色以匹配颜色我的应用程序中的控件和消息框。我该怎么做?



我愿意覆盖一个合适的MFC函数,它可以让我使用自己的自定义消息框,但我真的不知道哪个函数覆盖?有没有人听到知道适当的功能要覆盖?



我尝试过:



我花时间谷歌搜索无效。

The title of this post does not accurately caption my question. I couldn't think of a concise caption.

In an MFC Doc/View application , once SetModifiedFlag() is called after user activity occurs, an MFC generated or called messagebox appears whenever an attempt is made to close an unsaved document.

I wish to change the colour of that MFC called or generated messagebox so as to match the colour of the controls and messageboxes n my application. How do I do this?

I am willing to override an appropriate MFC function that will enable me use my own custom messagebox, but I don't really know which function to override? Does anyone hear know the appropriate function to override?

What I have tried:

I have spent time googling to no avail.

推荐答案

BOOL CMyDocument::SaveModified()
{
    if (!IsModified())
        return TRUE;

    // Show your own message box here.
    // Return TRUE to continue and close the document, and
    //  FALSE if the document should not be closed.
}

您还可以查看MFC源目录中 doccore.cpp 中的默认实现。

You may also look at the default implementation in doccore.cpp in the MFC source directory.


这篇关于如何覆盖setmodifiedflag?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-30 08:36