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