main.h 3.6 KB

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