Commit 68f590cf authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

oleview: Added initial version.

parent 6601e8ee
......@@ -1803,6 +1803,7 @@ programs/icinfo/Makefile
programs/iexplore/Makefile
programs/msiexec/Makefile
programs/notepad/Makefile
programs/oleview/Makefile
programs/progman/Makefile
programs/regedit/Makefile
programs/regsvr32/Makefile
......
......@@ -17,6 +17,7 @@ SUBDIRS = \
iexplore \
msiexec \
notepad \
oleview \
progman \
regedit \
regsvr32 \
......@@ -54,6 +55,7 @@ INSTALLSUBDIRS = \
iexplore \
msiexec \
notepad \
oleview \
progman \
regedit \
regsvr32 \
......
Makefile
rsrc.res
toolbar.bmp
/*
* OleView (En.rc)
* English Language Support
*
* 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
*/
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
IDM_MENU MENU
{
POPUP "&File"
{
MENUITEM "&Bind to file...", IDM_BIND
MENUITEM "&View TypeLib...", IDM_TYPELIB
MENUITEM SEPARATOR
MENUITEM "&System Configuration", IDM_SYSCONF
MENUITEM "&Run the Registry Editor", IDM_REGEDIT
MENUITEM SEPARATOR
MENUITEM "E&xit", IDM_EXIT
}
POPUP "&Object"
{
POPUP "&CoCreateInstance Flag"
{
MENUITEM "CLSCTX_&INPROC_SERVER", IDM_FLAG_INSERV,CHECKED
MENUITEM "CLSCTX_INPROC_&HANDLER", IDM_FLAG_INHANDL
MENUITEM "CLSCTX_&LOCAL_SERVER", IDM_FLAG_LOCSERV,CHECKED
MENUITEM "CLSCTX_&REMOTE_SERVER", IDM_FLAG_REMSERV
}
MENUITEM SEPARATOR
MENUITEM "View &Type information", IDM_TYPEINFO, GRAYED
MENUITEM SEPARATOR
MENUITEM "Create &Instance", IDM_CREATEINST, GRAYED
MENUITEM "Create Instance &On", IDM_CREATEINSTON, GRAYED
MENUITEM "&Release Instance", IDM_RELEASEINST, GRAYED
MENUITEM SEPARATOR
MENUITEM "Copy &CLSID to clipboard", IDM_COPYCLSID, GRAYED
MENUITEM "Copy &HTML object Tag to clipboard", IDM_HTMLTAG, GRAYED
MENUITEM SEPARATOR
MENUITEM "&View...", IDM_VIEW, GRAYED
}
POPUP "&View"
{
MENUITEM "&Expert mode", IDM_EXPERT,CHECKED
MENUITEM SEPARATOR
MENUITEM "&Hidden component cattegories", IDM_HIDDEN, GRAYED
MENUITEM SEPARATOR
MENUITEM "&Toolbar", IDM_TOOLBAR,CHECKED
MENUITEM "&Status Bar", IDM_STATUSBAR,CHECKED
MENUITEM SEPARATOR
MENUITEM "&Refresh\tF5", IDM_REFRESH
}
POPUP "&Help"
{
MENUITEM "&About OleView", IDM_ABOUT
}
}
STRINGTABLE
{
IDS_APPNAME "OleView"
IDS_APPTITLE "Wine OleView"
IDS_READY "Ready"
IDM_BIND, "Bind to file via a File Moniker"
IDM_TYPELIB, "Open a TypeLib file and view the contents"
IDM_SYSCONF, "Change machine wide Distributed COM settings"
IDM_REGEDIT, "Run the Wine registry editor"
IDM_EXIT, "Quit the application. Prompts to save changes"
IDM_CREATEINST, "Create an instance of the selected object"
IDM_CREATEINSTON, "Create an instance of the selected object on a specyfic machine"
IDM_RELEASEINST, "Release the currently selected object instance"
IDM_COPYCLSID, "Copy the GUID of the currently selected item to the clipboard"
IDM_VIEW, "Display the viewer for the selected item"
IDM_FLAG_INSERV, "Use CLSCTX_INPROC_SERVER when calling CoGetClassObject"
IDM_FLAG_INHANDL, "Use CLSCTX_INPROC_HANDLER when calling CoGetClassObject"
IDM_FLAG_LOCSERV, "Use CLSCTX_LOCAL_SERVER when calling CoGetClassObject"
IDM_FLAG_REMSERV, "Use CLSCTX_REMOTE_SERVER when calling CoGetClassObject"
IDM_EXPERT, "Toggle between expert and novice display mode"
IDM_HIDDEN, "Toggle the display of component categories that are not meant to be visible"
IDM_TOOLBAR, "Show or hide the toolbar"
IDM_STATUSBAR, "Show or hide the status bar"
IDM_REFRESH, "Refresh all lists"
IDM_ABOUT, "Display program information, version namber and copyright"
}
TOPSRCDIR = @top_srcdir@
TOPOBJDIR = ../..
SRCDIR = @srcdir@
VPATH = @srcdir@
MODULE = oleview.exe
APPMODE = -mwindows -municode
IMPORTS = comctl32 shell32 oleaut32 ole32 user32 advapi32 kernel32
EXTRALIBS = -luuid
EXTRADEFS = -DUNICODE
C_SRCS = \
oleview.c
RC_SRCS = rsrc.rc
RC_BINSRC = rsrc.rc
RC_BINARIES = toolbar.bmp
@MAKE_PROG_RULES@
### Dependencies:
/*
* 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 <unknwn.h>
#include <wine/unicode.h>
#include "resource.h"
#define MAX_LOAD_STRING 256
#define STATUS_WINDOW 2000
typedef struct
{
HWND hMainWnd;
HWND hStatusBar;
HWND hToolBar;
HINSTANCE hMainInst;
}GLOBALS;
extern GLOBALS globals;
../../tools/winewrapper
\ No newline at end of file
/*
* OleView (oleview.c)
*
* 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
*/
#include "main.h"
GLOBALS globals;
void ResizeChild(void)
{
RECT stat, tool;
MoveWindow(globals.hStatusBar, 0, 0, 0, 0, TRUE);
MoveWindow(globals.hToolBar, 0, 0, 0, 0, TRUE);
if(IsWindowVisible(globals.hStatusBar))
GetClientRect(globals.hStatusBar, &stat);
else stat.bottom = 0;
if(IsWindowVisible(globals.hToolBar))
{
GetClientRect(globals.hToolBar, &tool);
tool.bottom += 2;
}
else tool.bottom = 0;
}
void UpdateStatusBar(int itemID)
{
WCHAR info[MAX_LOAD_STRING];
if(!LoadString(globals.hMainInst, itemID, info, sizeof(WCHAR[MAX_LOAD_STRING])))
LoadString(globals.hMainInst, IDS_READY, info, sizeof(WCHAR[MAX_LOAD_STRING]));
SendMessage(globals.hStatusBar, SB_SETTEXT, 0, (LPARAM)info);
}
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
case WM_CREATE:
OleInitialize(NULL);
break;
case WM_DESTROY:
OleUninitialize();
PostQuitMessage(0);
break;
case WM_MENUSELECT:
UpdateStatusBar(LOWORD(wParam));
break;
case WM_SIZE:
if(wParam == SIZE_MINIMIZED) break;
ResizeChild();
break;
default:
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
return 0;
}
BOOL InitApplication(HINSTANCE hInst)
{
WNDCLASS wc;
WCHAR wszAppName[MAX_LOAD_STRING];
LoadString(hInst, IDS_APPNAME, wszAppName, sizeof(WCHAR[MAX_LOAD_STRING]));
memset(&wc, 0, sizeof(WNDCLASS));
wc.lpfnWndProc = WndProc;
wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
wc.lpszMenuName = MAKEINTRESOURCE(IDM_MENU);
wc.lpszClassName = wszAppName;
if(!RegisterClass(&wc))
return FALSE;
return TRUE;
}
BOOL InitInstance(HINSTANCE hInst, int nCmdShow)
{
HWND hWnd;
WCHAR wszAppName[MAX_LOAD_STRING];
WCHAR wszTitle[MAX_LOAD_STRING];
TBBUTTON tB[] = {
{0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
{0, IDM_BIND, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
{1, IDM_TYPELIB, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
{0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
{2, IDM_REGEDIT, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
{0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
{3, IDM_CREATEINST, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
{4, IDM_RELEASEINST, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0},
{0, 0, 0, BTNS_SEP, {0, 0}, 0, 0},
{5, IDM_VIEW, TBSTATE_ENABLED, BTNS_BUTTON, {0, 0}, 0, 0}
};
LoadString(hInst, IDS_APPNAME, wszAppName, sizeof(WCHAR[MAX_LOAD_STRING]));
LoadString(hInst, IDS_APPTITLE, wszTitle, sizeof(WCHAR[MAX_LOAD_STRING]));
hWnd = CreateWindow(wszAppName, wszTitle, WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, NULL, NULL, hInst, NULL);
if(!hWnd) return FALSE;
globals.hStatusBar = CreateStatusWindow(WS_VISIBLE|WS_CHILD,
(LPWSTR)wszTitle, hWnd, 0);
globals.hToolBar = CreateToolbarEx(hWnd, WS_CHILD|WS_VISIBLE, 0, 1, hInst,
IDB_TOOLBAR, tB, 10, 16, 16, 16, 16, sizeof(TBBUTTON));
SendMessage(globals.hToolBar, TB_ENABLEBUTTON, IDM_CREATEINST, FALSE);
SendMessage(globals.hToolBar, TB_ENABLEBUTTON, IDM_RELEASEINST, FALSE);
SendMessage(globals.hToolBar, TB_ENABLEBUTTON, IDM_VIEW, FALSE);
globals.hMainWnd = hWnd;
globals.hMainInst = hInst;
ShowWindow(hWnd, nCmdShow);
UpdateWindow(hWnd);
return TRUE;
}
int APIENTRY wWinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
LPWSTR lpCmdLine, int nCmdShow)
{
MSG msg;
HANDLE hAccelTable;
if(!hPrevInst)
{
if(!InitApplication(hInst))
return FALSE;
}
if(!InitInstance(hInst, nCmdShow))
return FALSE;
hAccelTable = LoadAccelerators(hInst, MAKEINTRESOURCE(IDA_OLEVIEW));
while(GetMessage(&msg, NULL, 0, 0))
{
if(TranslateAccelerator(globals.hMainWnd, hAccelTable, &msg)) continue;
TranslateMessage(&msg);
DispatchMessage(&msg);
}
return msg.wParam;
}
/*
* OleView (resource.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 IDS_APPNAME 1
#define IDS_APPTITLE 2
#define IDM_MENU 3
#define IDB_TOOLBAR 4
#define IDA_OLEVIEW 5
#define IDS_READY 10
#define IDM_BIND 100
#define IDM_TYPELIB 101
#define IDM_SYSCONF 102
#define IDM_REGEDIT 103
#define IDM_EXIT 104
#define IDM_TYPEINFO 110
#define IDM_CREATEINST 111
#define IDM_CREATEINSTON 112
#define IDM_RELEASEINST 113
#define IDM_COPYCLSID 114
#define IDM_HTMLTAG 115
#define IDM_VIEW 116
#define IDM_FLAG_INSERV 130
#define IDM_FLAG_INHANDL 131
#define IDM_FLAG_LOCSERV 132
#define IDM_FLAG_REMSERV 133
#define IDM_EXPERT 120
#define IDM_HIDDEN 121
#define IDM_TOOLBAR 122
#define IDM_STATUSBAR 123
#define IDM_REFRESH 124
#define IDM_ABOUT 125
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment