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
Left.cpp
Package: VC界面编程高级应用技术.rar [view]
Upload User: szcysw
Upload Date: 2013-03-11
Package Size: 6752k
Code Size: 2k
Category:
GUI Develop
Development Platform:
Visual C++
- // Left.cpp : implementation file
- //
- #include "stdafx.h"
- #include "MyExplorer.h"
- #include "Left.h"
- #ifdef _DEBUG
- #define new DEBUG_NEW
- #undef THIS_FILE
- static char THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CLeft
- IMPLEMENT_DYNCREATE(CLeft, CView)
- CLeft::CLeft()
- {
- }
- CLeft::~CLeft()
- {
- }
- BEGIN_MESSAGE_MAP(CLeft, CView)
- //{{AFX_MSG_MAP(CLeft)
- ON_WM_CREATE()
- ON_WM_SIZE()
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CLeft drawing
- void CLeft::OnDraw(CDC* pDC)
- {
- CDocument* pDoc = GetDocument();
- // TODO: add draw code here
- }
- /////////////////////////////////////////////////////////////////////////////
- // CLeft diagnostics
- #ifdef _DEBUG
- void CLeft::AssertValid() const
- {
- CView::AssertValid();
- }
- void CLeft::Dump(CDumpContext& dc) const
- {
- CView::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CLeft message handlers
- int CLeft::OnCreate(LPCREATESTRUCT lpCreateStruct)
- {
- if (CView::OnCreate(lpCreateStruct) == -1)
- return -1;
- m_ImageList.Create( IDB_PUSHPIN, 16, 1, RGB( 255, 0, 255 ));
- // 建立目录树的标题
- if (!m_Caption.Create(this, _T("文件夹")))
- {
- TRACE0(_T("Unable to create caption.n"));
- return -1;
- }
- // 建立目录树的标题按钮
- if (!m_CaptionButton.Create(NULL, WS_VISIBLE|BS_ICON|BS_OWNERDRAW|BS_CENTER|BS_VCENTER,
- CRect(0,0,0,0), this, IDC_CAPT_BUTTON))
- {
- TRACE0(_T("Unable to create caption button.n"));
- return -1;
- }
- // 建立目录树的标题按钮的图标
- m_CaptionButton.SetIcon( m_ImageList.ExtractIcon(2), CSize( 16, 15 ));
- if( !m_ShellTree.Create(WS_VISIBLE, CRect(0,0,0,0), this, IDC_SHELL_TREE))
- {
- TRACE0(_T("Unable to create tree control.n"));
- return -1;
- }
- return 0;
- }
- void CLeft::OnSize(UINT nType, int cx, int cy)
- {
- CView::OnSize(nType, cx, cy);
- //定位目录树的标题
- if( m_Caption.GetSafeHwnd()) {
- m_Caption.MoveWindow( 0, 0, cx, 19 );
- }
- //定位目录树的按钮
- if( m_CaptionButton.GetSafeHwnd()) {
- m_CaptionButton.MoveWindow( cx-18, 2, 16, 15 );
- }
- //定位目录树
- if( m_ShellTree.GetSafeHwnd()) {
- m_ShellTree.MoveWindow( 0, 19, cx, cy-19 );
- }
- }