main.h 3.52 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
/*
 * 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

23 24 25 26 27
#include <windows.h>
#include <winreg.h>
#include <commctrl.h>
#include <unknwn.h>

28 29 30 31 32 33
#ifdef NONAMELESSUNION
# define U(x)  (x).u
#else
# define U(x)  (x)
#endif

34 35 36
#include "resource.h"

#define MAX_LOAD_STRING 256
Piotr Caban's avatar
Piotr Caban committed
37
#define MAX_WINDOW_WIDTH 30000
38 39
#define MIN_FUNC_ID 0x60000000
#define MIN_VAR_ID 0x40000000
40 41

#define STATUS_WINDOW 2000
42
#define TREE_WINDOW 2001
43
#define TAB_WINDOW 2002
44
#define TYPELIB_TREE 2003
45 46 47 48 49 50

/*ItemInfo flags */
#define REGTOP 1
#define REGPATH 2
#define SHOWALL 4
#define INTERFACE 8
51 52 53 54

typedef struct
{
    HWND hMainWnd;
Piotr Caban's avatar
Piotr Caban committed
55
    HWND hPaneWnd;
56 57
    HWND hStatusBar;
    HWND hToolBar;
58 59
    HWND hTree;
    HWND hDetails;
60
    HWND hTypeLibWnd;
61
    HINSTANCE hMainInst;
62
    BOOL bExpert;
63
    DWORD dwClsCtx;
64
    WCHAR wszMachineName[MAX_LOAD_STRING];
65 66
}GLOBALS;

Piotr Caban's avatar
Piotr Caban committed
67 68 69 70 71 72 73 74 75 76 77
typedef struct
{
    HWND left;
    HWND right;
    INT pos;
    INT size;
    INT width;
    INT height;
    INT last;
}PANE;

78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
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];
96
    WCHAR path[MAX_LOAD_STRING];
97 98 99 100
    BOOL loaded;
    IUnknown *pU;
}ITEM_INFO;

101 102 103 104 105 106 107
typedef struct
{
    HWND hStatic;
    HWND hTab;
    HWND hReg;
}DETAILS;

108 109 110 111 112
typedef struct
{
    HWND hPaneWnd;
    HWND hTree;
    HWND hEdit;
113
    HWND hStatusBar;
114
    WCHAR wszFileName[MAX_LOAD_STRING];
115 116
}TYPELIB;

117 118 119
typedef struct
{
    WCHAR *idl;
120
    WCHAR wszInsertAfter[MAX_LOAD_STRING];
121
    INT idlLen;
122
    BOOL bPredefine;
123 124
}TYPELIB_DATA;

125
extern GLOBALS globals;
126
extern TREE tree;
127
extern TYPELIB typelib;
Piotr Caban's avatar
Piotr Caban committed
128 129

/* Predefinitions: */
130 131 132 133
/* details.c */
HWND CreateDetailsWindow(HINSTANCE hInst);
void RefreshDetails(HTREEITEM item);

134 135 136
/* oleview.c */
void RefreshMenu(HTREEITEM item);

Piotr Caban's avatar
Piotr Caban committed
137 138
/* pane.c */
BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst);
139
BOOL PaneRegisterClass(void);
140 141 142
void SetLeft(HWND hParent, HWND hWnd);
void SetRight(HWND hParent, HWND hWnd);

143
/* tree.c */
144
void EmptyTree(void);
145 146
void AddTreeEx(void);
void AddTree(void);
147
HWND CreateTreeWindow(HINSTANCE hInst);
148
BOOL CreateRegPath(HTREEITEM item, WCHAR *buffer, int bufSize);
149
void CreateInst(HTREEITEM item, WCHAR *wszMachineName);
150
void ReleaseInst(HTREEITEM item);
151

152
/* typelib.c */
153
BOOL CreateTypeLibWindow(HINSTANCE hInst, WCHAR *wszFileName);
154
BOOL TypeLibRegisterClass(void);
155
void UpdateData(HTREEITEM item);
156 157

/* interface.c */
158 159
BOOL IsInterface(HTREEITEM item);
void InterfaceViewer(HTREEITEM item);