1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162
|
/*
* OleView (main.h)
*
* Copyright 2006 Piotr Caban
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library 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
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#define COBJMACROS
#include <windows.h>
#include <winreg.h>
#include <commctrl.h>
#include <commdlg.h>
#include <unknwn.h>
#ifdef NONAMELESSUNION
# define U(x) (x).u
#else
# define U(x) (x)
#endif
#include "resource.h"
#define MAX_LOAD_STRING 256
#define MAX_WINDOW_WIDTH 30000
#define MIN_FUNC_ID 0x60000000
#define MIN_VAR_ID 0x40000000
#define TAB_SIZE 4
#define STATUS_WINDOW 2000
#define TREE_WINDOW 2001
#define TAB_WINDOW 2002
#define TYPELIB_TREE 2003
/*ItemInfo flags */
#define REGTOP 1
#define REGPATH 2
#define SHOWALL 4
#define INTERFACE 8
typedef struct
{
HWND hMainWnd;
HWND hPaneWnd;
HWND hStatusBar;
HWND hToolBar;
HWND hTree;
HWND hDetails;
HWND hTypeLibWnd;
HINSTANCE hMainInst;
BOOL bExpert;
DWORD dwClsCtx;
WCHAR wszMachineName[MAX_LOAD_STRING];
}GLOBALS;
typedef struct
{
HWND left;
HWND right;
INT pos;
INT size;
INT width;
INT height;
INT last;
}PANE;
typedef struct
{
/* Main TreeView entries: */
HTREEITEM hOC; /* Object Classes */
HTREEITEM hGBCC; /* Grouped by Component Category */
HTREEITEM hO1O; /* OLE 1.0 Objects */
HTREEITEM hCLO; /* COM Library Objects */
HTREEITEM hAO; /* All Objects */
HTREEITEM hAID; /* Application IDs */
HTREEITEM hTL; /* Type Libraries */
HTREEITEM hI; /* Interfaces */
}TREE;
typedef struct
{
CHAR cFlag;
WCHAR info[MAX_LOAD_STRING];
WCHAR clsid[MAX_LOAD_STRING];
WCHAR path[MAX_LOAD_STRING];
BOOL loaded;
IUnknown *pU;
}ITEM_INFO;
typedef struct
{
HWND hStatic;
HWND hTab;
HWND hReg;
}DETAILS;
typedef struct
{
HWND hPaneWnd;
HWND hTree;
HWND hEdit;
HWND hStatusBar;
WCHAR wszFileName[MAX_LOAD_STRING];
}TYPELIB;
typedef struct
{
WCHAR *idl;
WCHAR wszInsertAfter[MAX_LOAD_STRING];
INT idlLen;
BOOL bPredefine;
BOOL bHide;
}TYPELIB_DATA;
extern GLOBALS globals;
extern TREE tree;
extern TYPELIB typelib;
/* Predefinitions: */
/* details.c */
HWND CreateDetailsWindow(HINSTANCE hInst);
void RefreshDetails(HTREEITEM item);
/* oleview.c */
void RefreshMenu(HTREEITEM item);
/* pane.c */
BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst);
BOOL PaneRegisterClassW(void);
void SetLeft(HWND hParent, HWND hWnd);
void SetRight(HWND hParent, HWND hWnd);
/* tree.c */
void EmptyTree(void);
void AddTreeEx(void);
void AddTree(void);
HWND CreateTreeWindow(HINSTANCE hInst);
BOOL CreateRegPath(HTREEITEM item, WCHAR *buffer, int bufSize);
void CreateInst(HTREEITEM item, WCHAR *wszMachineName);
void ReleaseInst(HTREEITEM item);
/* typelib.c */
BOOL CreateTypeLibWindow(HINSTANCE hInst, WCHAR *wszFileName);
BOOL TypeLibRegisterClassW(void);
void UpdateData(HTREEITEM item);
/* interface.c */
BOOL IsInterface(HTREEITEM item);
void InterfaceViewer(HTREEITEM item);
|