日期:2012-09-10  浏览次数:20390 次

< MClientDlg.cpp>
    // MClientDlg.cpp : implementation file
//
#include "stdafx.h"
#include "MClient.h"
#include "MClientDlg.h"
#include "Atlbase.h"

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

/////////////////////////////////////////////////////////////////////////////
// CMClientDlg dialog

CMClientDlg::CMClientDlg(CWnd* pParent /*=NULL*/)
    : CDialog(CMClientDlg::IDD, pParent)
{
    //{{AFX_DATA_INIT(CMClientDlg)
    m_strParameter = _T("");
    m_strURL = _T("");
    //}}AFX_DATA_INIT
    // Note that LoadIcon does not require a subsequent DestroyIcon in Win32
    m_hIcon = AfxGetApp()->LoadIcon(IDR_MAINFRAME);
}

void CMClientDlg::DoDataExchange(CDataExchange* pDX)
{
    CDialog::DoDataExchange(pDX);
    //{{AFX_DATA_MAP(CMClientDlg)
    DDX_Control(pDX, IDC_TREE, m_TreeCtrl);
    DDX_Control(pDX, IDC_LISTPARAM, m_Parameters);
    DDX_Text(pDX, IDC_PARAMETER, m_strParameter);
    DDX_Text(pDX, IDC_URL, m_strURL);
    //}}AFX_DATA_MAP
}

BEGIN_MESSAGE_MAP(CMClientDlg, CDialog)
    //{{AFX_MSG_MAP(CMClientDlg)
    ON_WM_PAINT()
    ON_WM_QUERYDRAGICON()
    ON_BN_CLICKED(IDBROWSE, OnBrowse)
    ON_BN_CLICKED(IDC_CLOSE, OnClose)
    ON_BN_CLICKED(IDC_EDIT, OnEdit)
    ON_BN_CLICKED(IDC_EXECUTE, OnExecute)
    ON_NOTIFY(LVN_DELETEITEM, IDC_LISTPARAM, OnDeleteitemListparam)
    ON_NOTIFY(TVN_DELETEITEM, IDC_TREE, OnDeleteitemTree)
    ON_NOTIFY(TVN_SELCHANGED, IDC_TREE, OnSelchangedTree)
    ON_BN_CLICKED(IDLOAD, OnLoad)
    //}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CMClientDlg message handlers

BOOL CMClientDlg::OnInitDialog()
{
    CDialog::OnInitDialog();


    if (ModifyDialog() == -1)
        return FALSE;

    // Set the icon for this dialog.  The framework does this automatically
    //  when the application's main window is not a dialog
    SetIcon(m_hIcon, TRUE);            // Set big icon
    SetIcon(m_hIcon, FALSE);        // Set small icon
    
    // TODO: Add extra initialization here
    
    return TRUE;  // return TRUE  unless you set the focus to a control
}

// If you add a minimize button to your dialog, you will need the code below
//  to draw the icon.  For MFC applications using the document/view model,
//  this is automatically done for you by the framework.

void CMClientDlg::OnPaint()
{
    if (IsIconic())
    {
        CPaintDC dc(this); // device context for painting

        SendMessage(WM_ICONERASEBKG