⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 yaodurantcontrols.h

📁 windows mobile 开发实例wi ndows mobile 开发实例
💻 H
字号:
//--------------------------------------------------------------
// YaoDurantControls.h : Key definitions for event grabber.
//
// Code from _Programming the .NET Compact Framework with C#_
// and _Programming the .NET Compact Framework with VB_
// (c) Copyright 2002-2003 Paul Yao and David Durant. 
// All rights reserved.
//--------------------------------------------------------------

extern "C" int CreateEventGrabber(
   HWND hwndControl, 
   HWND hwndGrabber);
extern "C" int DisposeEventGrabber(
   HWND hwndControl);
extern "C" int SetEventFlags(
   HWND hwndControl, 
   int flags);
extern "C" int GetEventFlags(
   HWND hwndControl);

//--------------------------------------------------------------
// Bit-wise flags for the desired event
//--------------------------------------------------------------
#define EVENT_KEYDOWN    0x0001
#define EVENT_KEYPRESS   0x0002
#define EVENT_KEYUP      0x0004
#define EVENT_MOUSEDOWN  0x0008
#define EVENT_MOUSEMOVE  0x0010
#define EVENT_MOUSEUP    0x0020

//--------------------------------------------------------------
// Structure holding event grabber details.
//--------------------------------------------------------------
typedef struct __EVENTGRABBER
{
   HWND hwndControl;  // Handle to CF control.
   HWND hwndGrabber; // Handle to MessageWindow -- dispatcher.
   int  fEvents;      // Events to handle.
   WNDPROC lpfn;      // Original window procedure.
   struct __EVENTGRABBER * pPrev; // Previous item in list.
   struct __EVENTGRABBER * pNext; // Next item in list.
} EVENTGRABBER, *LPEVENTGRABBER;

//--------------------------------------------------------------
// C++ wrapper class for event grabber list.
//--------------------------------------------------------------
class EventGrabberList
{
private:
   LPEVENTGRABBER m_pegHead;
   LPEVENTGRABBER m_pegTail;
public:
   EventGrabberList();
   BOOL AddEventGrabber(HWND hwndCtrl, HWND hwndGrabber, 
      int flags, WNDPROC lpfn);
   LPEVENTGRABBER WINAPI FindEventGrabber(HWND hwnd);
   LPEVENTGRABBER WINAPI FindFirstEventGrabber();
   BOOL WINAPI RemoveEventGrabber(HWND hwnd);
};

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -