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
mbdrop.cpp
Package: shell.rar [view]
Upload User: xhy777
Upload Date: 2007-02-14
Package Size: 24088k
Code Size: 3k
Category:
Windows Kernel
Development Platform:
Visual C++
- //
- // Routines for implementing drop target capability to menubands.
- //
- #include "priv.h"
- #include "mbdrop.h"
- #include "iface.h" // for MBIF_
- #define SUPERCLASS
- //=================================================================
- // Implementation of CMenuBandDropTarget
- //=================================================================
- // Constructor
- CMenuBandDropTarget::CMenuBandDropTarget(HWND hwnd, int idTarget, DWORD dwFlags) :
- _cRef(1), _hwndParent(hwnd), _idTarget(idTarget), _dwFlagsMBIF(dwFlags)
- {
- }
- STDMETHODIMP_(ULONG) CMenuBandDropTarget::AddRef()
- {
- _cRef++;
- return _cRef;
- }
- STDMETHODIMP_(ULONG) CMenuBandDropTarget::Release()
- {
- ASSERT(_cRef > 0);
- _cRef--;
- if (_cRef > 0)
- return _cRef;
- delete this;
- return 0;
- }
- STDMETHODIMP CMenuBandDropTarget::QueryInterface(REFIID riid, void **ppvObj)
- {
- HRESULT hres;
- static const QITAB qit[] = {
- QITABENT(CMenuBandDropTarget, IDropTarget),
- { 0 },
- };
- hres = QISearch(this, (LPCQITAB)qit, riid, ppvObj);
- return hres;
- }
- /*----------------------------------------------------------
- Purpose: IDropTarget::DragEnter method
- */
- STDMETHODIMP CMenuBandDropTarget::DragEnter(IDataObject * pdtobj, DWORD grfKeyState,
- POINTL pt, DWORD * pdwEffect)
- {
- // If this item cascades out, then we want to pop the submenu open
- // after a timer. We don't allow a drop on the cascadable item
- // itself. (We could, but then we'd have to default to a location
- // inside the submenu, and I'm lazy right now.)
- if (*pdwEffect & (DROPEFFECT_MOVE | DROPEFFECT_COPY))
- {
- if (_dwFlagsMBIF & SMIF_SUBMENU)
- {
- // _idTimer = SetTimer(NULL, 0, 2000,
- }
- *pdwEffect &= (DROPEFFECT_MOVE | DROPEFFECT_COPY);
- }
- else
- *pdwEffect = DROPEFFECT_NONE;
- return S_OK;
- }
- /*----------------------------------------------------------
- Purpose: IDropTarget::DragOver method
- */
- STDMETHODIMP CMenuBandDropTarget::DragOver(DWORD grfKeyState, POINTL pt, DWORD * pdwEffect)
- {
- *pdwEffect &= (DROPEFFECT_MOVE | DROPEFFECT_COPY);
- return S_OK;
- }
- /*----------------------------------------------------------
- Purpose: IDropTarget::DragLeave method
- */
- STDMETHODIMP CMenuBandDropTarget::DragLeave(void)
- {
- // Kill timer, release object
- return S_OK;
- }
- /*----------------------------------------------------------
- Purpose: IDropTarget::Drop method
- */
- STDMETHODIMP CMenuBandDropTarget::Drop(IDataObject * pdtobj, DWORD grfKeyState, POINTL pt,
- DWORD * pdwEffect)
- {
- if (*pdwEffect & (DROPEFFECT_MOVE | DROPEFFECT_COPY))
- {
- if (_dwFlagsMBIF & SMIF_SUBMENU)
- {
- // We don't allow drops on submenu items. Must go into
- // cascaded menu.
- *pdwEffect = DROPEFFECT_NONE;
- }
- }
- return S_OK;
- }