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
PaintManager.cpp
Package: solidgraph_sources.zip [view]
Upload User: kairuinn
Upload Date: 2009-02-07
Package Size: 2922k
Code Size: 86k
Category:
Graph program
Development Platform:
Visual C++
- #include "StdAfx.h"
- #include "PaintManager.h"
- #include "NewMenu.h"
- // If you don't want to see extra TRACE diagnostics,
- // modify the line below to: #define CCM_TRACE
- #define CCM_TRACE TRACE
- #define CCM_TIMER_VAL 100 // 100 ms timer period seems to be good enough...
- #define MAX_CLASSNAME 64 // Length of buffer for retrieving the class name
- ////////////////////////////////////////////////////////////////////////
- // CCMControl static members initialization
- // skins {
- CBitmap32 CPaintManager::m_bmpButtonSkin;
- CBitmap32 CPaintManager::m_bmpCheckSkin;
- CBitmap32 CPaintManager::m_bmpRadioSkin;
- CBitmap32 CPaintManager::m_bmpSpinDownSkin;
- CBitmap32 CPaintManager::m_bmpSpinUpSkin;
- CBitmap32 CPaintManager::m_bmpSpinLeftSkin;
- CBitmap32 CPaintManager::m_bmpSpinRightSkin;
- CBitmap32 CPaintManager::m_bmpSpinDownGlyphSkin;
- CBitmap32 CPaintManager::m_bmpSpinUpGlyphSkin;
- CBitmap32 CPaintManager::m_bmpSpinLeftGlyphSkin;
- CBitmap32 CPaintManager::m_bmpSpinRightGlyphSkin;
- // } skins
- HWND CPaintManager::CCMControl::m_hWndOld = NULL;
- CMapPtrToPtr CPaintManager::m_ctrlMap = 10;
- CMapPtrToPtr CPaintManager::m_dlgMap = 10;
- BOOL CPaintManager::m_bEnabled = TRUE;
- // Changed 02.03.1999 Mike Walter
- CMapWordToPtr CPaintManager::m_threadMap = 10;
- ///////////////////////////////////////////////////////////////////////
- // Here is the one and only CPaintManager object
- static CPaintManager g_ctrlManager;
- CPaintManager& GetPaintManager()
- {
- return g_ctrlManager;
- }
- ////////////////////////////////////////////////////////////////////////
- // WH_CALLWNDPROC hook procedure
- LRESULT CALLBACK CCM_CallWndProc( int nCode, WPARAM wParam, LPARAM lParam )
- {
- HOOKPROC hHookProc;
- if ( g_ctrlManager.m_threadMap.Lookup( (WORD)GetCurrentThreadId(), (void*&)hHookProc ) == FALSE )
- {
- TRACE( "CPaintManager: No hook for this thread installed!n" );
- return 0;
- }
- if ( nCode == HC_ACTION )
- {
- CWPSTRUCT* pwp = (CWPSTRUCT*)lParam;
- if ( g_ctrlManager.IsEnabled() )
- {
- if ( g_ctrlManager.m_bDialogOnly == TRUE )
- {
- if ( pwp->message == WM_INITDIALOG )
- g_ctrlManager.Install( pwp->hwnd );
- }
- else if ( pwp->message == WM_CREATE && g_ctrlManager.IsEnabled() )
- {
- TCHAR szBuf[MAX_CLASSNAME];
- if ( GetWindowLong( pwp->hwnd, GWL_STYLE ) & WS_CHILD )
- {
- GetClassName( pwp->hwnd, szBuf, MAX_CLASSNAME );
- if ( lstrcmp( szBuf, _T( "ScrollBar" ) ) ) // Don't add scrollbars
- g_ctrlManager.AddControl( pwp->hwnd );
- }
- }
- }
- }
- // Changed 02.03.1999 Mike Walter
- return CallNextHookEx( (HHOOK)hHookProc, nCode, wParam, lParam );
- }
- // Install a hook for the current thread only
- void CPaintManager::InstallHook( TCHAR* lpszFilename, DWORD dwThreadID, BOOL bDialogOnly )
- {
- //_tcsncpy( m_szSkinLibrary, lpszFilename, MAX_PATH );
- // 卿羼