// SetReadOnlyDialog.cpp : implementation file//#include "stdafx.h"#include "webdatamining.h"#include "SetReadOnlyDialog.h"#ifdef _DEBUG#define new DEBUG_NEW#undef THIS_FILEstatic char THIS_FILE[] = __FILE__;#endif/////////////////////////////////////////////////////////////////////////////// CSetReadOnlyDialog dialogCSetReadOnlyDialog::CSetReadOnlyDialog(BOOL bReadOnly,UINT nIDTemplate,CWnd* pParent /* = NULL */): CDialogEx(nIDTemplate, pParent),m_bReadOnly(bReadOnly){//{{AFX_DATA_INIT(CSetReadOnlyDialog)// NOTE: the ClassWizard will add member initialization here//}}AFX_DATA_INIT}void CSetReadOnlyDialog::DoDataExchange(CDataExchange* pDX){CDialogEx::DoDataExchange(pDX);//{{AFX_DATA_MAP(CSetReadOnlyDialog)// NOTE: the ClassWizard will add DDX and DDV calls here//}}AFX_DATA_MAP}BEGIN_MESSAGE_MAP(CSetReadOnlyDialog, CDialogEx)//{{AFX_MSG_MAP(CSetReadOnlyDialog)//}}AFX_MSG_MAPEND_MESSAGE_MAP()/////////////////////////////////////////////////////////////////////////////// CSetReadOnlyDialog message handlersBOOL CSetReadOnlyDialog::OnInitDialog(){CDialogEx::OnInitDialog();// TODO: Add extra initialization here// - Set the enabled state for each control depending on whether// the control is currently visible or notif(m_bReadOnly){CWnd* pWndControl = this->GetWindow( GW_CHILD );while( pWndControl != NULL ){TCHAR str[255];GetClassName(pWndControl->GetSafeHwnd(),str,255);if(_tcscmp(str,"Edit")==0){static_cast<CEdit*>(pWndControl)->SetReadOnly();}pWndControl = pWndControl->GetWindow( GW_HWNDNEXT );}// - Check if a control still has the focus// (can lose it if the active control becomes disabled)CWnd* pWndActiveControl = CWnd::GetFocus();if( pWndActiveControl == NULL ){// - Set focus to "first" control on dialogCWnd* pWndFirstControl = this->GetNextDlgTabItem( NULL );ASSERT_VALID( pWndFirstControl );ASSERT( pWndFirstControl->IsWindowEnabled() );pWndFirstControl->SetFocus();}}return TRUE; // return TRUE unless you set the focus to a control// EXCEPTION: OCX Property Pages should return FALSE}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。