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

📄 fileoperationdialog.cpp

📁 teamviewer source code vc++
💻 CPP
字号:
#include "stdhdrs.h"
#include "../../vncviewer/vncviewer.h"
#include "FileOperationDialog.h"

extern HINSTANCE hAppInstance;


int FileOperationDialog::DoDialog()
{
	//strcpy(m_title, title);
	//strcpy(m_szFTConfirmTitle, szTitle);
	//strcpy(m_comment, title);

	return DialogBoxParam(hAppInstance, DIALOG_MAKEINTRESOURCE(IDD_FILE_OPERATION), NULL, (DLGPROC) FileOperationDialog::DialogProcedure, (LONG) this);
}


BOOL CALLBACK FileOperationDialog::DialogProcedure(  HWND hwnd,  UINT uMsg, WPARAM wParam, LPARAM lParam )
{
	FileOperationDialog *_this = (FileOperationDialog *) GetWindowLong(hwnd, GWL_USERDATA);

	switch (uMsg)
	{
	case WM_INITDIALOG:
		{
			SetWindowLong(hwnd, GWL_USERDATA, lParam);
			_this = (FileOperationDialog *) lParam;
			CentreWindow(hwnd);

			// Set Title
			//SetWindowText(hwnd, _this->m_title);
			// Set Comment
			SetDlgItemText(hwnd, IDC_COMMENT, _this->m_comment.c_str());

			// Todo: Init buttons labels with corrsponding culture (En, Fr, De...)
			return TRUE;
		}

	case WM_COMMAND:
		switch (LOWORD(wParam))
		{
		case IDC_YES_B:
				//_this->m_nConfirmAnswer = CONFIRM_YES;
				EndDialog(hwnd, Yes);
				return TRUE;

		case IDC_YESALL_B:
				//_this->m_nConfirmAnswer = CONFIRM_YESALL;
				EndDialog(hwnd, YesForAll);
				return TRUE;

		case IDC_NO_B:
				//_this->m_nConfirmAnswer = CONFIRM_NO;
				EndDialog(hwnd, No);
				return TRUE;

		//case IDC_NOALL_B:
		//		_this->m_nConfirmAnswer = CONFIRM_NOALL;
		//		EndDialog(hwnd, TRUE);
		//		return TRUE;

		case IDOK:
				EndDialog(hwnd, No);
				return TRUE;

		case IDCANCEL:
			EndDialog(hwnd, No);
			return TRUE;
		}
		break;

	case WM_DESTROY:
		EndDialog(hwnd, No);
		return TRUE;
	case WM_ERASEBKGND:
		return EraseBkgnd(hwnd, wParam);
	case WM_CTLCOLORBTN:
		return CtlColorBtn(wParam);
	case WM_CTLCOLORSTATIC:
		return CtlColorStatic(hwnd, wParam, lParam);

	}
	return 0;
}

FileOperationDialog::FileOperationDialog(string comment)
{
	m_comment=comment;
	//m_title=new char[strlen(title)+1];
	//m_comment=new char[strlen(comment)+1];
	//strcpy(m_title,title);
	//strcpy(m_comment,comment);
}
//FileOperationDialog::~FileOperationDialog()
//{
//	//delete m_title;
//	//delete m_comment;
//}

⌨️ 快捷键说明

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