C/C++

推荐列表 站点导航

当前位置:首页 > 脚本编程 > C/C++ >

C++_C++基于对话框的程序的框架实例,本文实例讲述了C++基于对话框

来源:网络整理  作者:  发布时间:2020-12-21 03:32
C++基于对话框的程序的框架实例,本文实例讲述了C++基于对话框的程序的框架。分享给大家供大家参考。具体如下:...
    dlg.DoModal(); 
}

resource.h头文件如下:



 
 

ON_BN_CLICKED(IDC_STOP, OnStop) 

END_MESSAGE_MAP() 
    return 0; 
    return FALSE; //不进入消息循环 
    CMainDialog dlg; 
BEGIN_MESSAGE_MAP(CMainDialog, CDialog) 
CMyApp theApp; 

    return TRUE; 
//CMainDialog 

public: 
#define  WM_CUTTERSTART WM_USER+100 
    DECLARE_MESSAGE_MAP() 
}; 
 

复制代码 代码如下:

ON_MESSAGE(WM_CUTTERSTART, OnCutterStart) //自定义消息 
class CMyApp:public CWinApp 
 
CMainDialog::CMainDialog(CWnd* pParentWnd):CDialog(IDD_MAIN, pParentWnd) 
    MessageBox("OnCutterStart"); 

#include <afxwin.h> 
long CMainDialog::OnCutterStart(WPARAM wParam, LPARAM lParam)   //处理自定义消息 
 

    m_pMainWnd = &dlg;   //给m_pMainWnd 主窗口 

    BOOL InitInstance(); 
    virtual BOOL OnInitDialog( ); 
 
void CMainDialog::OnStop() 
    CDialog::OnInitDialog(); 
};

    afx_msg long OnCutterStart(WPARAM wParam, LPARAM lParam);  //处理自定义消息的声明 
BOOL CMainDialog::OnInitDialog( ) 

复制代码 代码如下:

//CMyDialog 
class CMainDialog:public CDialog 

//CMyApp 

resource.cpp源文件如下:

 
 

BOOL CMyApp::InitInstance() 
    CMainDialog(CWnd* pParentWnd = NULL); 
public: 
protected: 
    MessageBox("OnStop"); 

#include "resource.h" 
    afx_msg void OnStop(); 

相关热词: C++ 实例

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供用于网络技术学习参考,学习中请遵循相关法律法规!

本文地址: https://v30.fanwenzhu.com/jiaob/cjj/6467.shtml

最新文章
只需要在调用Ctrl+B编译后 只需要在调用Ctrl+B编译后

时间:2021-01-13

OpenGL超级宝典visual studio OpenGL超级宝典visual studio

时间:2021-01-04

Directx11 教程(2) 基本的wi Directx11 教程(2) 基本的wi

时间:2021-01-04

LeetCode11ContainerWithMostWate LeetCode11ContainerWithMostWate

时间:2021-01-04

C语言简单IT之家速成 C语言简单IT之家速成

时间:2020-12-27

三分钟了解Activity工作流 三分钟了解Activity工作流

时间:2020-12-27

编译器是如何实现32位整型 编译器是如何实现32位整型

时间:2020-12-27

C++中lower_bound函数和upper C++中lower_bound函数和upper

时间:2020-12-27

Copyright © www.juheyunku.com      关于 | 合作 | 声明 | 联系 | 更新 | 地图 | Tags

C++_C++基于对话框的程序的框架实例,本文实例讲述了C++基于对话框

2020-12-21 编辑:

    dlg.DoModal(); 
}

resource.h头文件如下:



 
 

ON_BN_CLICKED(IDC_STOP, OnStop) 

END_MESSAGE_MAP() 
    return 0; 
    return FALSE; //不进入消息循环 
    CMainDialog dlg; 
BEGIN_MESSAGE_MAP(CMainDialog, CDialog) 
CMyApp theApp; 

    return TRUE; 
//CMainDialog 

public: 
#define  WM_CUTTERSTART WM_USER+100 
    DECLARE_MESSAGE_MAP() 
}; 
 

复制代码 代码如下:

ON_MESSAGE(WM_CUTTERSTART, OnCutterStart) //自定义消息 
class CMyApp:public CWinApp 
 
CMainDialog::CMainDialog(CWnd* pParentWnd):CDialog(IDD_MAIN, pParentWnd) 
    MessageBox("OnCutterStart"); 

#include <afxwin.h> 
long CMainDialog::OnCutterStart(WPARAM wParam, LPARAM lParam)   //处理自定义消息 
 

    m_pMainWnd = &dlg;   //给m_pMainWnd 主窗口 

    BOOL InitInstance(); 
    virtual BOOL OnInitDialog( ); 
 
void CMainDialog::OnStop() 
    CDialog::OnInitDialog(); 
};

    afx_msg long OnCutterStart(WPARAM wParam, LPARAM lParam);  //处理自定义消息的声明 
BOOL CMainDialog::OnInitDialog( ) 

复制代码 代码如下:

//CMyDialog 
class CMainDialog:public CDialog 

//CMyApp 

resource.cpp源文件如下:

 
 

BOOL CMyApp::InitInstance() 
    CMainDialog(CWnd* pParentWnd = NULL); 
public: 
protected: 
    MessageBox("OnStop"); 

#include "resource.h" 
    afx_msg void OnStop(); 

本站内容来源于网络,如有侵权请与我们联系,我们会及时删除,我们深感抱歉!
注:本站所有信息仅供学习参考!
本文地址为 https://v30.fanwenzhu.com/jiaob/cjj/6467.shtml

相关文章

风云图片

推荐阅读

返回C/C++频道首页