本文介绍了示例 ATL 对话框窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

谁能帮我找到一个最新的、有效的 ATL 项目,它有一个主窗口和一些组件?拜托,看在上帝的份上,不要告诉我使用 WTL/Qt 或其他.我需要 ATL.没有关于它的最新项目.我只需要一个主窗口,仅此而已.我可以弄清楚其余的.

Can anyone help me find an up-to-date, working ATL project which has a main window and some components in it? Please, for the love of god, don't tell me to use WTL/Qt or others. I need ATL. There's no up-to-date project about it. I just need a main window, that's all. I can figure out the rest.

提前致谢.

推荐答案

好的,大神的爱:来自模板 + 对话窗口的 Visual Studio 2010 C++/ATL EXE 项目.

OK, for the love of god: Visual Studio 2010 C++/ATL EXE project from template + dialog window.

来源:

这是您的主要兴趣:

////////////////////////////////////////////////////////////
// CMainDialog

class CMainDialog :
    public CDialogImpl<CMainDialog>
{
public:
    enum { IDD = IDD_MAIN };

BEGIN_MSG_MAP(CMainDialog)
    MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
    COMMAND_ID_HANDLER(IDCANCEL, OnCommand)
    COMMAND_ID_HANDLER(IDOK, OnCommand)
END_MSG_MAP()

public:
// CMainDialog

// Window Message Handlers
    LRESULT OnInitDialog(UINT nMessage, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
    {
        ATLVERIFY(CenterWindow());
        return 0;
    }
    LRESULT OnCommand(UINT, INT nIdentifier, HWND, BOOL& bHandled)
    {
        ATLVERIFY(EndDialog(nIdentifier));
        return 0;
    }
};

VOID RunMessageLoop()
{
    CMainDialog Dialog;
    Dialog.DoModal();
}

这篇关于示例 ATL 对话框窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-15 21:20