Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
MfcSaverDlg.cpp
Package: 第二章 屏幕保护程序的开发.rar [view]
Upload User: szxyd1688
Upload Date: 2007-06-08
Package Size: 1440k
Code Size: 2k
Category:
Screen Saver
Development Platform:
Visual C++
- // MfcSaverDlg.cpp : implementation file
- //
- #include "StdAfx.h"
- #include "MfcSaver.h"
- #include "MfcSaverDlg.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- BEGIN_MESSAGE_MAP(CMfcSaverDlg, CB14Dlg)
- //{{AFX_MSG_MAP(CMfcSaverDlg)
- ON_WM_PAINT()
- ON_WM_QUERYDRAGICON()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- CMfcSaverDlg::CMfcSaverDlg()
- {
- //{{AFX_DATA_INIT(CMfcSaverDlg)
- //}}AFX_DATA_INIT
- }
- BOOL CMfcSaverDlg::OnInitDialog()
- {
- CB14Dlg::OnInitDialog();
- return TRUE;
- }
- /////////////////////////////////////////////////////////////////////////////
- //
- // As with most MFC dialog boxes, the DoDataExchange() is where all the work
- // happens. There's no easy DDX_Trackbar thing to set up the control, so
- // we do it ourselves. See how the SaveOptions() and RestoreOptions() are
- // called on the CMfcSaver to keep those options persistent.
- //
- void CMfcSaverDlg::DoDataExchange(CDataExchange* pDX)
- {
- CB14Dlg::DoDataExchange(pDX);
- //{{AFX_DATA_MAP(CMfcSaverDlg)
- //}}AFX_DATA_MAP
- CMfcSaver* pSaver = (CMfcSaver*)AfxGetScreenSaverWnd();
- if (!pSaver)
- return;
- CSliderCtrl* pSlider;
- if (!pDX->m_bSaveAndValidate)
- {
- pSaver->RestoreOptions();
- pSlider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER1);
- pSlider->SetRange(1, 50);
- pSlider->SetPos(pSaver->GetIconCount());
- pSlider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER2);
- pSlider->SetRange(1, 50);
- pSlider->SetPos(pSaver->GetIconSpeed());
- }
- else
- {
- pSlider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER1);
- pSaver->SetIconCount(pSlider->GetPos());
- pSlider = (CSliderCtrl*)GetDlgItem(IDC_SLIDER2);
- pSaver->SetIconSpeed(pSlider->GetPos());
- pSaver->SaveOptions();
- }
- }