⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qidong.cpp

📁 可以实现
💻 CPP
字号:
// qidong.cpp : implementation file
//

#include "stdafx.h"
#include "df.h"
#include "qidong.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// Cqidong dialog


Cqidong::Cqidong(CWnd* pParent /*=NULL*/)
	: CDialog(Cqidong::IDD, pParent)
{
	//{{AFX_DATA_INIT(Cqidong)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	m_hIcon=AfxGetApp()->LoadCursor(IDR_MAINFRAME);
	m_hPro=NULL;
}


void Cqidong::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(Cqidong)
		// NOTE: the ClassWizard will add DDX and DDV calls here
	//}}AFX_DATA_MAP
}


BEGIN_MESSAGE_MAP(Cqidong, CDialog)
	//{{AFX_MSG_MAP(Cqidong)
	ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
	ON_BN_CLICKED(IDC_BUTTON2, OnButton2)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// Cqidong message handlers

void Cqidong::OnButton1() 
{PROCESS_INFORMATION pi;
STARTUPINFO si;
memset(&si,0,sizeof(si)); 
si.cb=sizeof(si);
si.wShowWindow=SW_SHOW;
si.dwFlags=STARTF_USESHOWWINDOW;
BOOL fRct=CreateProcess(NULL,"mspaint.exe",NULL,NULL,FALSE,NORMAL_PRIORITY_CLASS|CREATE_NEW_CONSOLE,
						 NULL,NULL,&si,&pi);
AfxMessageBox("成功建立");
m_hPro=pi.hProcess;
	// TODO: Add your control notification handler code here
	
}

void Cqidong::OnButton2() 
{TerminateProcess(m_hPro,0);
m_hPro=NULL;

	// TODO: Add your control notification handler code here
	
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -