mirror of
https://github.com/reactos/reactos.git
synced 2025-02-22 16:36:33 +00:00
[BROWSEUI]
* Improve the message loop to allow processing of accelerators. [SHELL32] * Return the accelerator to the shell browser if the view doesn't handle it. svn path=/branches/shell-experiments/; revision=63397
This commit is contained in:
parent
033b716da1
commit
2defe4fed2
2 changed files with 43 additions and 38 deletions
|
@ -2528,7 +2528,7 @@ HRESULT STDMETHODCALLTYPE CShellBrowser::_SetFocus(LPTOOLBARITEM ptbi, HWND hwnd
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CShellBrowser::v_MayTranslateAccelerator(MSG *pmsg)
|
HRESULT STDMETHODCALLTYPE CShellBrowser::v_MayTranslateAccelerator(MSG *pmsg)
|
||||||
{
|
{
|
||||||
return E_NOTIMPL;
|
return fCurrentShellView->TranslateAcceleratorW(pmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT STDMETHODCALLTYPE CShellBrowser::_GetBorderDWHelper(IUnknown *punkSrc, LPRECT lprectBorder, BOOL bUseHmonitor)
|
HRESULT STDMETHODCALLTYPE CShellBrowser::_GetBorderDWHelper(IUnknown *punkSrc, LPRECT lprectBorder, BOOL bUseHmonitor)
|
||||||
|
@ -3272,56 +3272,59 @@ LRESULT CShellBrowser::RelayCommands(UINT uMsg, WPARAM wParam, LPARAM lParam, BO
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
//static LRESULT CALLBACK ExplorerWndProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
static HRESULT ExplorerMessageLoop(IEThreadParamBlock * parameters)
|
||||||
//{
|
|
||||||
// return DefWindowProc(hwnd, uMsg, wParam, lParam);
|
|
||||||
//}
|
|
||||||
|
|
||||||
static void ExplorerMessageLoop()
|
|
||||||
{
|
|
||||||
MSG Msg;
|
|
||||||
BOOL Ret;
|
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
Ret = (GetMessage(&Msg, NULL, 0, 0) != 0);
|
|
||||||
|
|
||||||
if (Ret != -1)
|
|
||||||
{
|
|
||||||
if (!Ret)
|
|
||||||
break;
|
|
||||||
|
|
||||||
TranslateMessage(&Msg);
|
|
||||||
DispatchMessage(&Msg);
|
|
||||||
|
|
||||||
if (Msg.message == WM_QUIT)
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD WINAPI BrowserThreadProc(LPVOID lpThreadParameter)
|
|
||||||
{
|
{
|
||||||
CComPtr<IShellBrowser> shellBrowser;
|
CComPtr<IShellBrowser> shellBrowser;
|
||||||
CComObject<CShellBrowser> *theCabinet;
|
CComObject<CShellBrowser> *theCabinet;
|
||||||
IEThreadParamBlock *parameters;
|
|
||||||
HRESULT hResult;
|
HRESULT hResult;
|
||||||
|
MSG Msg;
|
||||||
|
BOOL Ret;
|
||||||
|
|
||||||
parameters = (IEThreadParamBlock *)lpThreadParameter;
|
|
||||||
OleInitialize(NULL);
|
OleInitialize(NULL);
|
||||||
ATLTRY (theCabinet = new CComObject<CShellBrowser>);
|
|
||||||
|
ATLTRY(theCabinet = new CComObject<CShellBrowser>);
|
||||||
if (theCabinet == NULL)
|
if (theCabinet == NULL)
|
||||||
return E_OUTOFMEMORY;
|
{
|
||||||
|
hResult = E_OUTOFMEMORY;
|
||||||
|
goto uninitialize;
|
||||||
|
}
|
||||||
|
|
||||||
hResult = theCabinet->QueryInterface(IID_PPV_ARG(IShellBrowser, &shellBrowser));
|
hResult = theCabinet->QueryInterface(IID_PPV_ARG(IShellBrowser, &shellBrowser));
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
{
|
{
|
||||||
delete theCabinet;
|
delete theCabinet;
|
||||||
return hResult;
|
goto uninitialize;
|
||||||
}
|
}
|
||||||
|
|
||||||
hResult = theCabinet->Initialize(parameters->directoryPIDL, 0, 0, 0);
|
hResult = theCabinet->Initialize(parameters->directoryPIDL, 0, 0, 0);
|
||||||
if (FAILED(hResult))
|
if (FAILED(hResult))
|
||||||
return hResult;
|
goto uninitialize;
|
||||||
ExplorerMessageLoop();
|
|
||||||
|
while (Ret = GetMessage(&Msg, NULL, 0, 0))
|
||||||
|
{
|
||||||
|
if (Ret == -1)
|
||||||
|
{
|
||||||
|
// Error: continue or exit?
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (theCabinet->v_MayTranslateAccelerator(&Msg) != S_OK)
|
||||||
|
{
|
||||||
|
TranslateMessage(&Msg);
|
||||||
|
DispatchMessage(&Msg);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (Msg.message == WM_QUIT)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
uninitialize:
|
||||||
OleUninitialize();
|
OleUninitialize();
|
||||||
return 0;
|
return hResult;
|
||||||
|
}
|
||||||
|
|
||||||
|
DWORD WINAPI BrowserThreadProc(LPVOID lpThreadParameter)
|
||||||
|
{
|
||||||
|
IEThreadParamBlock * parameters = (IEThreadParamBlock *) lpThreadParameter;
|
||||||
|
return ExplorerMessageLoop(parameters);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1925,6 +1925,8 @@ HRESULT WINAPI CDefView::TranslateAccelerator(LPMSG lpmsg)
|
||||||
|
|
||||||
/* FIXME: should call TranslateAcceleratorSB */
|
/* FIXME: should call TranslateAcceleratorSB */
|
||||||
|
|
||||||
|
return m_pShellBrowser->TranslateAcceleratorSB(lpmsg, 0);
|
||||||
|
|
||||||
TRACE("-- key=0x04%lx\n", lpmsg->wParam) ;
|
TRACE("-- key=0x04%lx\n", lpmsg->wParam) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue