刘华世的官方博客
摘要: Login dlg; if(dlg.DoModal()!=IDOK) { OnOK(); }void Login::OnOK() { // TODO: Add extra validation here //CEdit *pEdit1 = (CEdit *)GetDlgItem(IDC_EDIT1); //CEdit *pEdit2 = (CEdit *)GetDlgItem(IDC_EDIT2); //CString e1, e2; //pEdit1->GetWindowText(e1); //pEdit2->Get... 阅读全文
posted @ 2012-11-15 10:41 pythonschool 阅读(1270) 评论(0) 推荐(0) 编辑
摘要: BOOL CBeginDlg::OnInitDialog(){ SetTimer(1, 100, NULL); //触发定时器}void CBeginDlg::OnTimer(UINT_PTR nIDEvent){ // TODO: 在此添加消息处理程序代码和/或调用默认值 //MessageBox(L"hello"); CRect rc; CRect rect; GetWindowRect(&rect); rc.CopyRect(&rect); CPoint pOint; GetCursorPos(&pOint); CString ... 阅读全文
posted @ 2012-11-15 10:41 pythonschool 阅读(274) 评论(0) 推荐(0) 编辑
摘要: BOOL CWelcomeDlg::PreTranslateMessage(MSG* pMsg) //Called to filter messages before they are dispatched{ // TODO: Add your specialized code here and/or call the base class if(pMsg->message == WM_KEYDOWN && pMsg->wParam == 27) { CString s; s.Format("The wParam= %d The message =... 阅读全文
posted @ 2012-11-15 10:41 pythonschool 阅读(354) 评论(0) 推荐(0) 编辑
摘要: CBegin dlg; if(dlg.DoModal()!=IDCANCEL) { OnOK(); }BOOL CBegin::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here SetTimer(1, 2000, NULL); //1:Specifies a nonzero timeridentifier //2000:Specifies the time-out... 阅读全文
posted @ 2012-11-14 15:39 pythonschool 阅读(597) 评论(0) 推荐(0) 编辑
摘要: CWnd* pWnd = GetTopWindow(); while(pWnd!=NULL) { int i = pWnd->GetDlgCtrlID(); CString str; str.Format("ID是:%d", i); //pWnd->SetWindowText(str); if(i!=-1) MessageBox(str); pWnd = pWnd->GetNextWindow(); } 阅读全文
posted @ 2012-11-13 17:46 pythonschool 阅读(955) 评论(0) 推荐(0) 编辑
摘要: BOOL CMfcDlg::OnInitDialog(){ CDialog::OnInitDialog(); this->SetWindowText("蟒蛇软件站"); return TRUE; }void CCalcDlg::OnCalc(){ CString strText = _T(""); GetWindowText(strText); SetDlgItemText(IDC_EDIT1, strText); SetWindowText("pythonschool.com");}void CDemoDlg::OnTest1 阅读全文
posted @ 2012-11-13 17:27 pythonschool 阅读(2142) 评论(0) 推荐(0) 编辑
摘要: //创建一个基于对话框的工程,向对话框中添加静态文本,编辑框和组合框控件CComboBox m_Symbo;CEdit m_SecOpt;CEdit m_Result;CEdit m_FirstOpt;enum Symbo {PLUS, SUB, MUL,DIV};template <class Type>class CCalc{public: Type Calc(Type &refFirstOpt, Type &refSecOpt, Symbo Opt) { switch (Opt) { case PLUS: ret... 阅读全文
posted @ 2012-11-13 16:03 pythonschool 阅读(517) 评论(0) 推荐(0) 编辑
摘要: #include "Book.h"//模式对话框的创建CBook book; //定义CBook对象book.DoModal(); //调用DoModal方法显示模态对话框CBook *pbook;pbook = new CBook();pbook->DoModal();delete pbook;//非模式对话框的创建if(!IsWindow(m_book.m_hWnd)){ m_book.Create(IDD_Book, NULL);}m_book.ShowWindow(SW_SHOW);//在创建模式对话框时,定义的是局部变量,而创建非模式对话框时创建的是成员变量 阅读全文
posted @ 2012-11-12 14:56 pythonschool 阅读(1726) 评论(0) 推荐(0) 编辑
摘要: //C++语言 实现类对象的单模式创建//对于单例模式而言,既然要保证类有且仅有一个实例,就需要其他的类不能实例化该类.//因此,需要将构造方法设置成私有的,即使用private关键字修饰.//同时,在类中提供一个静态方法,该方法的返回值是该类的一个实例.#include "stdafx.h"#include "iostream.h"class Emperor{private: static Emperor *pEmperor; static int count; Emperor() { count++; }public: static Em... 阅读全文
posted @ 2012-11-12 14:24 pythonschool 阅读(237) 评论(0) 推荐(0) 编辑
摘要: ////////////////////////////////////////////////////////////////// File: getfileversion.cpp// Description: 获取EXE文件的属性详细信息// Created: 2012-10-18// Author:pythonschool.com/////////////////////////////////////////////////////////////////*The following code shows how to get FILEINFO value from resource 阅读全文
posted @ 2012-11-10 22:09 pythonschool 阅读(5531) 评论(0) 推荐(0) 编辑
刘华世的官方博客