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
cwndproc.h
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 2k
Category:
Windows Kernel
Development Platform:
Visual C++
- #ifndef _CWNDPROC_H_
- #define _CWNDPROC_H_
- // CImpWndProc
- //
- // Use this class when you want to associate a window with
- // an object using a virtual wndproc.
- //
- // NOTE: The window's lifetime must be encompassed by the object.
- // I.E. NO REFCOUNT IS HELD ON THE OBJECT!
- //
- // Messages after WM_NCCREATE up to and including WM_DESTROY
- // are forwarded to v_WndProc.
- //
- // _hwnd is non-NULL from WM_NCCREATE up to but not during WM_DESTROY.
- // (Not during because the final release may be tied to WM_DESTROY
- // so we cannot reference member variables after forwarding thie message.)
- //
- class CImpWndProc
- {
- public:
- virtual ULONG __stdcall AddRef() = 0;
- virtual ULONG __stdcall Release() = 0;
- protected:
- virtual LRESULT v_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) PURE;
- static LRESULT CALLBACK s_WndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
- HWND _hwnd;
- } ;
- // CNotifySubclassWndProc
- //
- // This class subclasses an HWND, registers for SHChangeNotify events,
- // and forwards them to the inheritor's IShellChangeNotify implementation.
- //
- // You need one instance of this class per window you want to subclass
- // and register for events against. (So if you need >1 window hooked up
- // in this matter, you need to have member implementations that inherit
- // from this class.)
- //
- class CNotifySubclassWndProc
- {
- public:
- virtual STDMETHODIMP OnChange(LONG lEvent, LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2) PURE;
- protected:
- BOOL _SubclassWindow(HWND hwnd);
- void _UnsubclassWindow(HWND hwnd);
- void _RegisterWindow(HWND hwnd, LPCITEMIDLIST pidl, long lEvents,
- UINT uFlags = (SHCNRF_ShellLevel | SHCNRF_InterruptLevel));
- void _UnregisterWindow(HWND hwnd);
- virtual LRESULT _DefWindowProc(HWND hwnd, UINT uMessage, WPARAM wParam, LPARAM lParam);
- void _FlushNotifyMessages(HWND hwnd);
- private:
- static LRESULT CALLBACK _SubclassWndProc(
- HWND hwnd, UINT uMessage,
- WPARAM wParam, LPARAM lParam,
- UINT_PTR uIdSubclass, DWORD_PTR dwRefData);
- UINT _uRegister; // SHChangeNotify id
- #ifdef DEBUG
- HWND _hwndSubclassed;
- #endif
- } ;
- #endif _CWNDPROC_H_