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

📄 obexsquirt.h

📁 這是 OEBX 使用在 Windows CE 上的範例程式 可以正確的模擬與執行
💻 H
字号:
//======================================================================
// Header file
//
// Written for the book Programming Windows CE
// Copyright (C) 2001 Douglas Boling
//======================================================================
// Returns number of elements
#define dim(x) (sizeof(x) / sizeof(x[0]))

// Windows CE Specific defines
#define LPCMDLINE LPWSTR
//----------------------------------------------------------------------
// Generic defines and data types
//
struct decodeUINT {                            // Structure associates
    UINT Code;                                 // messages
                                               // with a function.
    LRESULT (*Fxn)(HWND, UINT, WPARAM, LPARAM);
};
struct decodeCMD {                             // Structure associates
    UINT Code;                                 // menu IDs with a
    LRESULT (*Fxn)(HWND, WORD, HWND, WORD);    // function.
};

//----------------------------------------------------------------------
// Defines used by application

#define ID_ICON               1

#define IDD_INTEXT            10               // Control IDs
#define IDD_SENDFILE          11
#define IDD_OUTTEXT           12
#define IDD_SCAN              13
#define IDD_DEVICES           14

#define MYMSG_OBEXEVENT       (WM_USER+1000)
#define MYMSG_PRINTF          (WM_USER+1001)

#define DEV_FLAG_ADDRESS      0x00000001
#define DEV_FLAG_NAME         0x00000002
#define DEV_FLAG_TRANSPORT    0x00000004
#define DEV_FLAG_PORT         0x00000008
#define DEV_FLAG_UUID         0x00000010
#define DEV_FLAG_DEVBOUND     0x00000100

#define DEV_TRANS_IRDA        0x00010000
#define DEV_TRANS_BTOOTH      0x00020000

#define DEV_SERVICE_OBJPUSH   0x01000000
#define DEV_SERVICE_FTP       0x02000000
#define DEV_SERVICE_IRMCSYNC  0x04000000

typedef struct {
    DWORD dwFlags;
    TCHAR szName[256];
    TCHAR szAddr[32];
    DWORD dwTransport;
    DWORD dwPort;
    GUID guidService;
    IPropertyBag* pDevBag;
} MYOBEXDEVICEINFO, *PMYOBEXDEVICEINFO;

#define MAX_DEVS              16
#define BUFFSIZE              8192
//----------------------------------------------------------------------
// Function prototypes
//
HWND InitInstance (HINSTANCE, LPCMDLINE, int);
int TermInstance (HINSTANCE, int);
void Add2List (HWND hWnd, LPTSTR lpszFormat, ...);
int InitObex (HWND hWnd);
int SendFile (HWND hWnd, IObexDevice *pDevice, LPTSTR pszFileName, 
              DWORD dwFlags);
BOOL MyYield ();

// Window procedures
LRESULT CALLBACK MainWndProc (HWND, UINT, WPARAM, LPARAM);

// Message handlers
LRESULT DoCreateMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoSizeMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoCommandMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoPocketPCShell (HWND, UINT, WPARAM, LPARAM);
LRESULT DoDestroyMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoObexEventMain (HWND, UINT, WPARAM, LPARAM);
LRESULT DoPrintfNotifyMain (HWND, UINT, WPARAM, LPARAM);

// Command functions
LPARAM DoMainCommandSend (HWND, WORD, HWND, WORD);
LPARAM DoMainCommandDevList (HWND, WORD, HWND, WORD);
LPARAM DoMainCommandExit (HWND, WORD, HWND, WORD);

⌨️ 快捷键说明

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