2006-06-14 19:50:28 +02:00
|
|
|
/*
|
|
|
|
* 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
|
|
|
|
|
2006-10-15 17:07:00 +02:00
|
|
|
#include <windows.h>
|
|
|
|
#include <winreg.h>
|
|
|
|
#include <commctrl.h>
|
|
|
|
#include <unknwn.h>
|
|
|
|
|
2006-06-24 13:19:12 +02:00
|
|
|
#ifdef NONAMELESSUNION
|
|
|
|
# define U(x) (x).u
|
|
|
|
#else
|
|
|
|
# define U(x) (x)
|
|
|
|
#endif
|
|
|
|
|
2006-06-14 19:50:28 +02:00
|
|
|
#include "resource.h"
|
|
|
|
|
|
|
|
#define MAX_LOAD_STRING 256
|
2006-06-14 19:51:27 +02:00
|
|
|
#define MAX_WINDOW_WIDTH 30000
|
2006-08-21 22:21:09 +02:00
|
|
|
#define MIN_FUNC_ID 0x60000000
|
|
|
|
#define MIN_VAR_ID 0x40000000
|
2008-04-11 01:11:45 +02:00
|
|
|
#define TAB_SIZE 4
|
2006-06-14 19:50:28 +02:00
|
|
|
|
|
|
|
#define STATUS_WINDOW 2000
|
2006-06-14 19:52:26 +02:00
|
|
|
#define TREE_WINDOW 2001
|
2006-06-14 19:55:46 +02:00
|
|
|
#define TAB_WINDOW 2002
|
2006-07-18 12:53:19 +02:00
|
|
|
#define TYPELIB_TREE 2003
|
2006-06-14 19:52:26 +02:00
|
|
|
|
|
|
|
/*ItemInfo flags */
|
|
|
|
#define REGTOP 1
|
|
|
|
#define REGPATH 2
|
|
|
|
#define SHOWALL 4
|
|
|
|
#define INTERFACE 8
|
2006-06-14 19:50:28 +02:00
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
HWND hMainWnd;
|
2006-06-14 19:51:27 +02:00
|
|
|
HWND hPaneWnd;
|
2006-06-14 19:50:28 +02:00
|
|
|
HWND hStatusBar;
|
|
|
|
HWND hToolBar;
|
2006-06-14 19:55:46 +02:00
|
|
|
HWND hTree;
|
|
|
|
HWND hDetails;
|
2006-06-30 17:29:56 +02:00
|
|
|
HWND hTypeLibWnd;
|
2006-06-14 19:50:28 +02:00
|
|
|
HINSTANCE hMainInst;
|
2006-06-14 19:55:08 +02:00
|
|
|
BOOL bExpert;
|
2006-06-14 19:53:47 +02:00
|
|
|
DWORD dwClsCtx;
|
2006-06-22 19:58:37 +02:00
|
|
|
WCHAR wszMachineName[MAX_LOAD_STRING];
|
2006-06-14 19:50:28 +02:00
|
|
|
}GLOBALS;
|
|
|
|
|
2006-06-14 19:51:27 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
HWND left;
|
|
|
|
HWND right;
|
|
|
|
INT pos;
|
|
|
|
INT size;
|
|
|
|
INT width;
|
|
|
|
INT height;
|
|
|
|
INT last;
|
|
|
|
}PANE;
|
|
|
|
|
2006-06-14 19:52:26 +02:00
|
|
|
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];
|
2006-06-30 17:29:56 +02:00
|
|
|
WCHAR path[MAX_LOAD_STRING];
|
2006-06-14 19:52:26 +02:00
|
|
|
BOOL loaded;
|
|
|
|
IUnknown *pU;
|
|
|
|
}ITEM_INFO;
|
|
|
|
|
2006-06-14 19:55:46 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
HWND hStatic;
|
|
|
|
HWND hTab;
|
|
|
|
HWND hReg;
|
|
|
|
}DETAILS;
|
|
|
|
|
2006-06-30 17:29:56 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
HWND hPaneWnd;
|
|
|
|
HWND hTree;
|
|
|
|
HWND hEdit;
|
2006-06-30 18:42:14 +02:00
|
|
|
HWND hStatusBar;
|
2006-07-02 13:04:26 +02:00
|
|
|
WCHAR wszFileName[MAX_LOAD_STRING];
|
2006-06-30 17:29:56 +02:00
|
|
|
}TYPELIB;
|
|
|
|
|
2006-07-18 12:53:19 +02:00
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
WCHAR *idl;
|
2006-07-18 12:54:30 +02:00
|
|
|
WCHAR wszInsertAfter[MAX_LOAD_STRING];
|
2006-07-18 12:53:19 +02:00
|
|
|
INT idlLen;
|
2006-08-20 18:48:29 +02:00
|
|
|
BOOL bPredefine;
|
2008-04-09 21:25:36 +02:00
|
|
|
BOOL bHide;
|
2006-07-18 12:53:19 +02:00
|
|
|
}TYPELIB_DATA;
|
|
|
|
|
2006-06-14 19:50:28 +02:00
|
|
|
extern GLOBALS globals;
|
2006-06-14 19:52:26 +02:00
|
|
|
extern TREE tree;
|
2006-06-30 17:29:56 +02:00
|
|
|
extern TYPELIB typelib;
|
2006-06-14 19:51:27 +02:00
|
|
|
|
|
|
|
/* Predefinitions: */
|
2006-06-14 19:55:46 +02:00
|
|
|
/* details.c */
|
|
|
|
HWND CreateDetailsWindow(HINSTANCE hInst);
|
|
|
|
void RefreshDetails(HTREEITEM item);
|
|
|
|
|
2006-06-14 19:55:08 +02:00
|
|
|
/* oleview.c */
|
|
|
|
void RefreshMenu(HTREEITEM item);
|
|
|
|
|
2006-06-14 19:51:27 +02:00
|
|
|
/* pane.c */
|
|
|
|
BOOL CreatePanedWindow(HWND hWnd, HWND *hWndCreated, HINSTANCE hInst);
|
2006-06-30 17:29:56 +02:00
|
|
|
BOOL PaneRegisterClass(void);
|
2006-06-14 19:52:26 +02:00
|
|
|
void SetLeft(HWND hParent, HWND hWnd);
|
|
|
|
void SetRight(HWND hParent, HWND hWnd);
|
|
|
|
|
2006-06-30 17:29:56 +02:00
|
|
|
/* tree.c */
|
2006-06-14 19:52:26 +02:00
|
|
|
void EmptyTree(void);
|
2006-06-14 19:55:08 +02:00
|
|
|
void AddTreeEx(void);
|
|
|
|
void AddTree(void);
|
2006-06-14 19:52:26 +02:00
|
|
|
HWND CreateTreeWindow(HINSTANCE hInst);
|
2006-06-14 19:55:46 +02:00
|
|
|
BOOL CreateRegPath(HTREEITEM item, WCHAR *buffer, int bufSize);
|
2006-06-22 19:58:37 +02:00
|
|
|
void CreateInst(HTREEITEM item, WCHAR *wszMachineName);
|
2006-06-14 19:55:08 +02:00
|
|
|
void ReleaseInst(HTREEITEM item);
|
2006-06-24 10:33:29 +02:00
|
|
|
|
2006-06-30 17:29:56 +02:00
|
|
|
/* typelib.c */
|
2006-07-02 13:04:26 +02:00
|
|
|
BOOL CreateTypeLibWindow(HINSTANCE hInst, WCHAR *wszFileName);
|
2006-06-30 17:29:56 +02:00
|
|
|
BOOL TypeLibRegisterClass(void);
|
2006-07-18 12:53:19 +02:00
|
|
|
void UpdateData(HTREEITEM item);
|
2006-06-30 17:29:56 +02:00
|
|
|
|
|
|
|
/* interface.c */
|
2006-06-24 10:33:29 +02:00
|
|
|
BOOL IsInterface(HTREEITEM item);
|
|
|
|
void InterfaceViewer(HTREEITEM item);
|