wlmplugin.h
上传用户:kittypts
上传日期:2018-02-11
资源大小:241k
文件大小:5k
- /*****************************************************************************
- Windows Live Messenger Plugin Demo
- Copyright (C) 2008 Hern醤 Di Pietro
- This program is free software: you can redistribute it and/or modify
- it under the terms of the GNU General Public License as published by
- the Free Software Foundation, either version 3 of the License, or
- (at your option) any later version.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- GNU General Public License for more details.
- You should have received a copy of the GNU General Public License
- along with this program. If not, see <http://www.gnu.org/licenses/>.
- /*****************************************************************************/
- #ifndef MSNHACKLIB_H
- #define MSNHACKLIB_H
- #define WIN32_LEAN_AND_MEAN
- // Target Windows Messenger version of this library
- //
- #define WLM_VERSION_MAJOR 8
- #define WLM_VERSION_MINOR 5
- /*#define WLM_VERSION_BUILD 0
- #define WLM_VERSION_REV 0*/
- #include <windows.h>
- #include <list>
- #include <map>
- #include "utility.h"
- #include "hooking.h"
- #include "resmgr.h"
- #include "acdisp.h"
- // Messenger API Typelib
- #import "../tlbs/MSNMessengerAPI.tlb" named_guids
- // Global instance handle for the injected DLL
- extern HINSTANCE hDllInst;
- // Resource DLL name
- const WCHAR wszResourceDll[] = L"resdll.dll";
- // Exports
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- void InitDLL (void);
- #ifdef __cplusplus
- }
- #endif // __cplusplus
- // ---------------------------------------------------------------------------
- // Declarations for WLM
- // ---------------------------------------------------------------------------
- const WCHAR wszWlmMainWndClass[] = L"MSBLWindowClass";
- const WCHAR wszWlmMainWndName[] = L"Windows Live Messenger";
- const WCHAR wszWlmDUIWndClass[] = L"DirectUIHWND";
- // WLM top level window struct
- typedef struct
- {
- const WCHAR* szWndClass;
- const WCHAR* szWndName;
- WNDPROC pfnOldWndProc;
- HWND hwnd;
- bool fCreated;
- BOOL fEnableInfoWnd;
- HWINEVENTHOOK hwevh;
- } WLM_TOPWINDOW;
- // WLM "DirectUI" Window
- typedef struct
- {
- const WCHAR* szWndClass;
- HWND hwnd;
- } WLM_DIRECTUIWINDOW;
- // Contact Info Window
- typedef struct
- {
- HWND hwnd;
- LONG lTop, lLeft;
- COLORREF crBase;
- WCHAR* wszContactID;
- WCHAR* wszFriendlyName;
- MSNMessenger::MISTATUS msStatus;
- VARIANT_BOOL fBlocked;
- VARIANT_BOOL fCanPage;
- WCHAR* wszMobilePhone;
- WCHAR* wszHomePhone;
- WCHAR* wszWorkPhone;
- } WLM_CONTACTINFOWINDOW;
- // WLM interface pointers
- typedef struct
- {
- MSNMessenger::IMSNMessenger* pIMsn;
- } WLM_IFACES;
- // Toolbar button properties structure
- typedef struct tagWLMTOOLBARBUTTON
- {
- BOOL fExtBitmap; // TRUE if bitmap comes from external DLL,
- // FALSE if bitmap comes from WLM Res Type #4000
- HMODULE hModule; // Module if bitmap loaded from resource DLL
- WCHAR wszResType[MAXSTRL]; // Resource type in resource DLL (e.g "PNG")
- UINT uResID; // Resource ID from resource DLL, or image ID from
- // WLM Resource #4000
- UINT uPosition; // Insert button in front or back of toolbar
- char szButtonId[MAXSTRL]; // Unique Button ID
- WCHAR wszButtonId[MAXSTRL]; // WCHAR string of szButtonID (for action)
- char szTButtonId[MAXSTRL]; // Unique toolbar button ID (different from szButtonId)
- char szTooltip[MAXSTRL]; // Tooltip String
- PFNBTNPROC pfnAct; // Pointer to function when button is pressed
- } WLM_TOOLBARBUTTON;
- // Position of added WLM toolbar buttons
- #define TB_INSERT_FIRST 0
- #define TB_INSERT_LAST 1
- #if ((WLM_VERSION_MAJOR == 0x8) && (WLM_VERSION_MINOR == 0x5))
- #define TB_INSERT_FIRST_BYTE 0x1524
- /*#define TB_INSERT_LAST_BYTE 0x1e05*/
- #define WLMRES_STYLE_INSERT_POS 23
- #endif
- //
- // IDs for resource hooking
- // "DirectUI" resources (see resids.txt on project root)
- //
- #define WLMRES_XMLUI 4004
- #define WLMRES_XMLSTYLE 4005
- #define WLMRES_BITMAPS 4000
- #define WLMRES_CONTACT_LIST 923
- // Standard Win32 Resources
- #define ID_MENU_DEMO_ABOUT 60000
- #define ID_MENU_MSNHACK_IAC1 60001
- #define ID_MENU_DISPLAY_CONTACTINFO 60002
- // starting number for new resources
- #define RESOURCE_ID_BASE 63000
- // forward declarations for globals
- extern WLM_TOPWINDOW g_wlmTopWindow;
- extern WLM_DIRECTUIWINDOW g_DUIWindow;
- extern WLM_CONTACTINFOWINDOW g_wlmContactInfoWindow;
- extern WLM_IFACES g_wlmIfaces;
- extern HookList g_hookList;
- extern CResourceManager g_resMgr;
- extern CActionDispatcher g_actDisp;
- extern HMODULE hResLib;
- //
- // function prototypes
- //
- LRESULT CALLBACK WlmWndProc(HWND, UINT, WPARAM, LPARAM);
- void CALLBACK HandleWinEvent(HWINEVENTHOOK, DWORD , HWND, LONG, LONG, DWORD, DWORD );
- void AddToolbarButtons (WLM_TOOLBARBUTTON*, UINT, char*, char*, size_t, size_t );
- #endif // MSNHACKLIB_H