shdocvw: Add an address bar to IE.
This commit is contained in:
parent
07f169a959
commit
c5ac982903
|
@ -311,7 +311,8 @@ void create_doc_view_hwnd(DocHost *This)
|
|||
doc_view_atom = RegisterClassExW(&wndclass);
|
||||
}
|
||||
|
||||
GetClientRect(This->frame_hwnd, &rect); /* FIXME */
|
||||
GetClientRect(This->frame_hwnd, &rect);
|
||||
adjust_ie_docobj_rect(This->frame_hwnd, &rect);
|
||||
This->hwnd = CreateWindowExW(0, wszShell_DocObject_View,
|
||||
wszShell_DocObject_View,
|
||||
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP,
|
||||
|
|
|
@ -47,6 +47,15 @@ static const WCHAR szIEWinFrame[] = { 'I','E','F','r','a','m','e',0 };
|
|||
static const WCHAR wszWineInternetExplorer[] =
|
||||
{'W','i','n','e',' ','I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r',0};
|
||||
|
||||
void adjust_ie_docobj_rect(HWND frame, RECT* rc)
|
||||
{
|
||||
HWND hwndRebar = GetDlgItem(frame, IDC_BROWSE_REBAR);
|
||||
INT barHeight = SendMessageW(hwndRebar, RB_GETBARHEIGHT, 0, 0);
|
||||
|
||||
rc->top += barHeight;
|
||||
rc->bottom -= barHeight;
|
||||
}
|
||||
|
||||
static INT_PTR CALLBACK ie_dialog_open_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
static InternetExplorer* This;
|
||||
|
@ -105,18 +114,57 @@ static void ie_dialog_about(HWND hwnd)
|
|||
DestroyIcon(icon);
|
||||
}
|
||||
|
||||
static void create_rebar(HWND hwnd)
|
||||
{
|
||||
HWND hwndRebar;
|
||||
HWND hwndAddress;
|
||||
REBARINFO rebarinf;
|
||||
REBARBANDINFOW bandinf;
|
||||
WCHAR addr[] = {'A','d','d','r','e','s','s',0};
|
||||
|
||||
hwndRebar = CreateWindowExW(WS_EX_TOOLWINDOW, REBARCLASSNAMEW, NULL, WS_CHILD|WS_VISIBLE|WS_CLIPSIBLINGS|WS_CLIPCHILDREN|RBS_VARHEIGHT|CCS_TOP|CCS_NODIVIDER, 0, 0, 0, 0, hwnd, (HMENU)IDC_BROWSE_REBAR, shdocvw_hinstance, NULL);
|
||||
|
||||
rebarinf.cbSize = sizeof(rebarinf);
|
||||
rebarinf.fMask = 0;
|
||||
rebarinf.himl = NULL;
|
||||
rebarinf.cbSize = sizeof(rebarinf);
|
||||
|
||||
SendMessageW(hwndRebar, RB_SETBARINFO, 0, (LPARAM)&rebarinf);
|
||||
|
||||
hwndAddress = CreateWindowExW(0, WC_COMBOBOXEXW, NULL, WS_BORDER|WS_CHILD|WS_VISIBLE|CBS_DROPDOWN, 0, 0, 100,20,hwndRebar, (HMENU)IDC_BROWSE_ADDRESSBAR, shdocvw_hinstance, NULL);
|
||||
|
||||
bandinf.fMask = RBBIM_STYLE | RBBIM_CHILD | RBBIM_CHILDSIZE | RBBIM_SIZE | RBBIM_TEXT;
|
||||
bandinf.fStyle = RBBS_CHILDEDGE | RBBS_GRIPPERALWAYS;
|
||||
bandinf.lpText = addr;
|
||||
bandinf.cx = 100;
|
||||
bandinf.cyMinChild = 20;
|
||||
bandinf.hwndChild = hwndAddress;
|
||||
|
||||
SendMessageW(hwndRebar, RB_INSERTBANDW, 0, (LPARAM)&bandinf);
|
||||
}
|
||||
|
||||
static LRESULT iewnd_OnCreate(HWND hwnd, LPCREATESTRUCTW lpcs)
|
||||
{
|
||||
SetWindowLongPtrW(hwnd, 0, (LONG_PTR) lpcs->lpCreateParams);
|
||||
create_rebar(hwnd);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT iewnd_OnSize(InternetExplorer *This, INT width, INT height)
|
||||
{
|
||||
HWND hwndRebar = GetDlgItem(This->frame_hwnd, IDC_BROWSE_REBAR);
|
||||
INT barHeight = SendMessageW(hwndRebar, RB_GETBARHEIGHT, 0, 0);
|
||||
RECT docarea = {0, 0, width, height};
|
||||
|
||||
adjust_ie_docobj_rect(This->frame_hwnd, &docarea);
|
||||
|
||||
if(This->doc_host.hwnd)
|
||||
SetWindowPos(This->doc_host.hwnd, NULL, 0, 0, width, height,
|
||||
SetWindowPos(This->doc_host.hwnd, NULL, docarea.left, docarea.top, docarea.right, docarea.bottom,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
|
||||
SetWindowPos(hwndRebar, NULL, 0, 0, width, barHeight, SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -24,6 +24,8 @@
|
|||
#define IDR_BROWSE_MAIN_MENU 1000
|
||||
#define IDD_BROWSE_OPEN 1001
|
||||
#define IDC_BROWSE_OPEN_URL 1002
|
||||
#define IDC_BROWSE_REBAR 1003
|
||||
#define IDC_BROWSE_ADDRESSBAR 1004
|
||||
|
||||
#define ID_BROWSE_NEW_WINDOW 275
|
||||
#define ID_BROWSE_OPEN 256
|
||||
|
|
|
@ -270,6 +270,7 @@ static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_r
|
|||
extern HINSTANCE shdocvw_hinstance;
|
||||
extern void register_iewindow_class(void);
|
||||
extern void unregister_iewindow_class(void);
|
||||
extern void adjust_ie_docobj_rect(HWND, RECT*);
|
||||
|
||||
HRESULT register_class_object(BOOL);
|
||||
HRESULT get_typeinfo(ITypeInfo**);
|
||||
|
|
Loading…
Reference in New Issue