shdocvw: Add menu bar to Internet Explorer.

This commit is contained in:
Alexander Nicolaysen Sørnes 2010-06-20 20:25:34 +02:00 committed by Alexandre Julliard
parent 93f9b4e144
commit f2802b981d
6 changed files with 104 additions and 3 deletions

45
dlls/shdocvw/En.rc Normal file
View File

@ -0,0 +1,45 @@
/*
* Copyright 2010 Alexander N. Sørnes <alex@thehandofagony.com>
*
* 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 "resource.h"
LANGUAGE LANG_ENGLISH, SUBLANG_DEFAULT
IDR_BROWSE_MAIN_MENU MENU
{
POPUP "&File"
{
POPUP "&New"
{
MENUITEM "&Window" ID_BROWSE_NEW_WINDOW
}
MENUITEM "&Open...", ID_BROWSE_OPEN
MENUITEM "&Save", ID_BROWSE_SAVE
MENUITEM "Save &as...", ID_BROWSE_SAVE_AS
MENUITEM SEPARATOR
MENUITEM "Print &format...", ID_BROWSE_PRINT_FORMAT
MENUITEM "Pr&int...", ID_BROWSE_PRINT
MENUITEM "Print previe&w...", ID_BROWSE_PRINT_PREVIEW
MENUITEM SEPARATOR
MENUITEM "&Properties...", ID_BROWSE_PROPERTIES
}
POPUP "&Help"
{
MENUITEM "&About Internet Explorer...", ID_BROWSE_ABOUT
}
}

View File

@ -28,7 +28,10 @@ C_SRCS = \
view.c \
webbrowser.c
RC_SRCS = shdocvw.rc
RC_SRCS = \
En.rc \
shdocvw.rc
IDL_TLB_SRCS = shdocvw_v1.idl
@MAKE_DLL_RULES@

View File

@ -422,8 +422,25 @@ static HRESULT WINAPI InternetExplorer_get_MenuBar(IWebBrowser2 *iface, VARIANT_
static HRESULT WINAPI InternetExplorer_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
{
InternetExplorer *This = WEBBROWSER_THIS(iface);
FIXME("(%p)->(%x)\n", This, Value);
return E_NOTIMPL;
HMENU menu = NULL;
TRACE("(%p)->(%x)\n", This, Value);
if((menu = GetMenu(This->frame_hwnd)))
DestroyMenu(menu);
menu = NULL;
if(Value)
menu = LoadMenuW(shdocvw_hinstance, MAKEINTRESOURCEW(IDR_BROWSE_MAIN_MENU));
if(!SetMenu(This->frame_hwnd, menu))
{
DestroyMenu(menu);
return HRESULT_FROM_WIN32(GetLastError());
}
return S_OK;
}
static HRESULT WINAPI InternetExplorer_get_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL *pbFullScreen)

View File

@ -136,6 +136,7 @@ static IWebBrowser2 *create_ie_window(LPCSTR cmdline)
return NULL;
IWebBrowser2_put_Visible(wb, VARIANT_TRUE);
IWebBrowser2_put_MenuBar(wb, VARIANT_TRUE);
if(!*cmdline) {
IWebBrowser2_GoHome(wb);

33
dlls/shdocvw/resource.h Normal file
View File

@ -0,0 +1,33 @@
/*
* Resource identifiers for shdocvw.dll
*
* Copyright 2010 Alexander N. Sørnes <alex@thehandofagony.com>
*
* 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 <windef.h>
#define IDR_BROWSE_MAIN_MENU 1000
#define ID_BROWSE_NEW_WINDOW 275
#define ID_BROWSE_OPEN 256
#define ID_BROWSE_SAVE 257
#define ID_BROWSE_SAVE_AS 258
#define ID_BROWSE_PRINT_FORMAT 259
#define ID_BROWSE_PRINT 260
#define ID_BROWSE_PRINT_PREVIEW 277
#define ID_BROWSE_PROPERTIES 262
#define ID_BROWSE_ABOUT 336

View File

@ -40,6 +40,8 @@
#include "htiframe.h"
#include "wine/unicode.h"
#include "resource.h"
/**********************************************************************
* Shell Instance Objects