diff --git a/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.cpp b/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.cpp index 99c76ba44ac6..373b11c9c096 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.cpp +++ b/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.cpp @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: diff --git a/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.def b/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.def index f4b1a0e5ba31..af39eb8ada7d 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.def +++ b/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.def @@ -1,4 +1,4 @@ -; Copyright (c) 2023 Files +; Copyright (c) 2023 Files Community ; Licensed under the MIT License. See the LICENSE. ; Abstract: diff --git a/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.idl b/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.idl index 4165a55d0c89..a1ac7dbd9f17 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.idl +++ b/src/Files.OpenDialog/CustomOpenDialog/CustomOpenDialog.idl @@ -1,8 +1,8 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: -// IDL source for CustomOpenDialog +// IDL source for CustomOpenDialog. // Note: // This file will be processed by the MIDL tool for diff --git a/src/Files.OpenDialog/CustomOpenDialog/FilesOpenDialog.cpp b/src/Files.OpenDialog/CustomOpenDialog/FilesOpenDialog.cpp index 96f881638bba..7a3b0c947db1 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/FilesOpenDialog.cpp +++ b/src/Files.OpenDialog/CustomOpenDialog/FilesOpenDialog.cpp @@ -1,8 +1,8 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: -// Implementation of CFilesOpenDialog +// Implementation of CFilesOpenDialog. #include #include diff --git a/src/Files.OpenDialog/CustomOpenDialog/FilesOpenDialog.h b/src/Files.OpenDialog/CustomOpenDialog/FilesOpenDialog.h index daf60d7755f3..c82426ef1d38 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/FilesOpenDialog.h +++ b/src/Files.OpenDialog/CustomOpenDialog/FilesOpenDialog.h @@ -1,8 +1,8 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: -// Declaration of CFilesOpenDialog +// Declaration of CFilesOpenDialog. #pragma once diff --git a/src/Files.OpenDialog/CustomOpenDialog/UndefInterfaces.h b/src/Files.OpenDialog/CustomOpenDialog/UndefInterfaces.h index aac7d7b6f5a2..94a25934657c 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/UndefInterfaces.h +++ b/src/Files.OpenDialog/CustomOpenDialog/UndefInterfaces.h @@ -1,8 +1,8 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: -// Declaration of Undocumented interfaces and helpers +// Declaration of Undocumented interfaces and helpers. #pragma once diff --git a/src/Files.OpenDialog/CustomOpenDialog/dllmain.cpp b/src/Files.OpenDialog/CustomOpenDialog/dllmain.cpp index aa4b65b7ace2..ac5cc5b35f4a 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/dllmain.cpp +++ b/src/Files.OpenDialog/CustomOpenDialog/dllmain.cpp @@ -1,8 +1,8 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: -// Implementation of DllMain. +// Implementation of module class. #include "pch.h" #include "framework.h" diff --git a/src/Files.OpenDialog/CustomOpenDialog/dllmain.h b/src/Files.OpenDialog/CustomOpenDialog/dllmain.h index 403495524c87..605046f40f23 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/dllmain.h +++ b/src/Files.OpenDialog/CustomOpenDialog/dllmain.h @@ -1,8 +1,8 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: -// declaration of module class +// declaration of module class. class CCustomOpenDialogModule : public ATL::CAtlDllModuleT diff --git a/src/Files.OpenDialog/CustomOpenDialog/framework.h b/src/Files.OpenDialog/CustomOpenDialog/framework.h index 12d8950f3cbf..a7788f5b3df0 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/framework.h +++ b/src/Files.OpenDialog/CustomOpenDialog/framework.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. #pragma once diff --git a/src/Files.OpenDialog/CustomOpenDialog/pch.cpp b/src/Files.OpenDialog/CustomOpenDialog/pch.cpp index 11ed0e404ef5..eac72a394bbc 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/pch.cpp +++ b/src/Files.OpenDialog/CustomOpenDialog/pch.cpp @@ -1,10 +1,11 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: -// Source file pch.h corresponding to pch.h precompiled header. Do not change the file name. +// Source file pch.h corresponding to pch.h precompiled header. // Note: +// Do not Rename. // When using precompiled headers, this file is required for successful compilation. #include "pch.h" diff --git a/src/Files.OpenDialog/CustomOpenDialog/pch.h b/src/Files.OpenDialog/CustomOpenDialog/pch.h index a645435445b0..9d7ce114115b 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/pch.h +++ b/src/Files.OpenDialog/CustomOpenDialog/pch.h @@ -1,10 +1,11 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Abstract: -// pch.h is the precompiled header file named pch.h. Do not change the file name. +// pch.h is the precompiled header file named pch.h. // Note: +// Do not Rename. // The files listed below are compiled only once, which improves performance for subsequent compilations. // This setting also affects the performance of IntelliSense, including code completion and many other code browsing features. // However, the files listed here are ALL recompiled if one of them is updated from one build to another. diff --git a/src/Files.OpenDialog/CustomOpenDialog/targetver.h b/src/Files.OpenDialog/CustomOpenDialog/targetver.h index 4868a4c6f491..13a18efd53e3 100644 --- a/src/Files.OpenDialog/CustomOpenDialog/targetver.h +++ b/src/Files.OpenDialog/CustomOpenDialog/targetver.h @@ -1,4 +1,4 @@ -// Copyright (c) 2023 Files +// Copyright (c) 2023 Files Community // Licensed under the MIT License. See the LICENSE. // Note: diff --git a/src/Files.OpenDialog/FilesLauncher/DocumentServiceProvider.cpp b/src/Files.OpenDialog/FilesLauncher/DocumentServiceProvider.cpp deleted file mode 100644 index fdb6c447f72f..000000000000 --- a/src/Files.OpenDialog/FilesLauncher/DocumentServiceProvider.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// Copyright (C) Explorer++ Project -// SPDX-License-Identifier: GPL-3.0-only -// See LICENSE in the top level directory - -#include "DocumentServiceProvider.h" - -// IDispatch -// Note that none of these methods require any implementation. When attempting to find a shell -// window, the shell requests the IDispatch interface, but doesn't actually call any methods on it. -IFACEMETHODIMP DocumentServiceProvider::GetTypeInfoCount(UINT *typeInfoCount) -{ - UNREFERENCED_PARAMETER(typeInfoCount); - - return E_NOTIMPL; -} - -IFACEMETHODIMP DocumentServiceProvider::GetTypeInfo(UINT type, LCID localeId, ITypeInfo **typeInfo) -{ - UNREFERENCED_PARAMETER(type); - UNREFERENCED_PARAMETER(localeId); - UNREFERENCED_PARAMETER(typeInfo); - - return E_NOTIMPL; -} - -IFACEMETHODIMP DocumentServiceProvider::GetIDsOfNames( - REFIID riid, LPOLESTR *names, UINT numNames, LCID localeId, DISPID *dispId) -{ - UNREFERENCED_PARAMETER(riid); - UNREFERENCED_PARAMETER(names); - UNREFERENCED_PARAMETER(numNames); - UNREFERENCED_PARAMETER(localeId); - UNREFERENCED_PARAMETER(dispId); - - return E_NOTIMPL; -} - -IFACEMETHODIMP DocumentServiceProvider::Invoke(DISPID dispIdMember, REFIID riid, LCID localeId, - WORD flags, DISPPARAMS *dispParams, VARIANT *varResult, EXCEPINFO *exceptionInfo, UINT *argErr) -{ - UNREFERENCED_PARAMETER(dispIdMember); - UNREFERENCED_PARAMETER(riid); - UNREFERENCED_PARAMETER(localeId); - UNREFERENCED_PARAMETER(flags); - UNREFERENCED_PARAMETER(dispParams); - UNREFERENCED_PARAMETER(varResult); - UNREFERENCED_PARAMETER(exceptionInfo); - UNREFERENCED_PARAMETER(argErr); - - return E_NOTIMPL; -} - -// IServiceProvider -IFACEMETHODIMP DocumentServiceProvider::QueryService(REFGUID guidService, REFIID riid, void **ppv) -{ - return ServiceProviderBase::QueryService(guidService, riid, ppv); -} \ No newline at end of file diff --git a/src/Files.OpenDialog/FilesLauncher/DocumentServiceProvider.h b/src/Files.OpenDialog/FilesLauncher/DocumentServiceProvider.h deleted file mode 100644 index 77641fcfc62f..000000000000 --- a/src/Files.OpenDialog/FilesLauncher/DocumentServiceProvider.h +++ /dev/null @@ -1,25 +0,0 @@ -// Copyright (C) Explorer++ Project -// SPDX-License-Identifier: GPL-3.0-only -// See LICENSE in the top level directory - -#pragma once - -#include "ServiceProviderBase.h" -#include - -class DocumentServiceProvider : - public winrt::implements, - public ServiceProviderBase -{ -public: - // IDispatch - IFACEMETHODIMP GetTypeInfoCount(UINT *typeInfoCount); - IFACEMETHODIMP GetTypeInfo(UINT type, LCID localeId, ITypeInfo **typeInfo); - IFACEMETHODIMP GetIDsOfNames( - REFIID riid, LPOLESTR *names, UINT numNames, LCID localeId, DISPID *dispId); - IFACEMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID localeId, WORD flags, - DISPPARAMS *dispParams, VARIANT *varResult, EXCEPINFO *exceptionInfo, UINT *argErr); - - // IServiceProvider - IFACEMETHODIMP QueryService(REFGUID guidService, REFIID riid, void **ppv); -}; \ No newline at end of file diff --git a/src/Files.OpenDialog/FilesLauncher/FilesLauncher.cpp b/src/Files.OpenDialog/FilesLauncher/FilesLauncher.cpp index 6e5e0423cfde..25d42d4b9343 100644 --- a/src/Files.OpenDialog/FilesLauncher/FilesLauncher.cpp +++ b/src/Files.OpenDialog/FilesLauncher/FilesLauncher.cpp @@ -1,39 +1,44 @@ -// +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "OpenInFolder.h" +// Link additional libraries #pragma comment(lib, "ole32.lib") #pragma comment(lib, "Propsys.lib") #pragma comment(lib, "user32.lib") #pragma comment(lib, "uuid.lib") -#include - -#include "OpenInFolder.h" - -#define ID_TIMEREXPIRED 101 +constexpr auto ID_TIMEREXPIRED = 101; LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam); - bool OpenInExistingShellWindow(const TCHAR* folderPath); - void RunFileExplorer(const TCHAR* openDirectory); - size_t strifind(const std::wstring& strHaystack, const std::wstring& strNeedle); bool comparei(std::wstring stringA, std::wstring stringB); std::string wstring_to_utf8_hex(const std::wstring& input); std::wstring str2wstr(const std::string& str); -int WINAPI WinMain(HINSTANCE hInstance, - HINSTANCE hPrevInstance, - LPSTR lpCmdLine, - int cmdShow) +int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int cmdShow) { auto oleCleanup = wil::OleInitialize_failfast(); FILE* _debugStream = NULL; PWSTR pszPath = NULL; HRESULT hr = SHGetKnownFolderPath(FOLDERID_Desktop, 0, NULL, &pszPath); + if (SUCCEEDED(hr)) { TCHAR debugPath[MAX_PATH]; @@ -42,7 +47,8 @@ int WINAPI WinMain(HINSTANCE hInstance, CoTaskMemFree(pszPath); } - //Sleep(10 * 1000); // Uncomment to attach debugger + //Uncomment to attach debugger + //Sleep(10 * 1000); int numArgs = 0; bool withArgs = false; @@ -89,9 +95,7 @@ int WINAPI WinMain(HINSTANCE hInstance, RunFileExplorer(withArgs ? openDirectory : NULL); if (_debugStream) - { fclose(_debugStream); - } return 0; } @@ -101,9 +105,8 @@ int WINAPI WinMain(HINSTANCE hInstance, if (OpenInExistingShellWindow(openDirectory)) { if (_debugStream) - { fclose(_debugStream); - } + return 0; } @@ -122,23 +125,22 @@ int WINAPI WinMain(HINSTANCE hInstance, // Create the window. HWND hwnd = CreateWindowEx( - 0, // Optional window styles. - CLASS_NAME, // Window class - L"Files Launcher", // Window text - 0, // Window style - 0, 0, 0, 0, // Size and position - HWND_MESSAGE, // Parent window (message-only window) - NULL, // Menu - hInstance, // Instance handle - &openInFolder // Additional application data + 0, + CLASS_NAME, + L"Files Launcher", + 0, + 0, 0, 0, 0, + HWND_MESSAGE, + NULL, + hInstance, + &openInFolder ); if (hwnd == NULL) { if (_debugStream) - { fclose(_debugStream); - } + return 0; } @@ -184,6 +186,7 @@ int WINAPI WinMain(HINSTANCE hInstance, if (!ShellExecuteEx(&ShExecInfo)) { std::wcout << L"Protocol error: " << GetLastError() << std::endl; + //ShExecInfo.lpFile = L"files.exe"; //ShExecInfo.lpParameters = args; //if (!ShellExecuteEx(&ShExecInfo)) @@ -214,9 +217,7 @@ int WINAPI WinMain(HINSTANCE hInstance, } if (_debugStream) - { fclose(_debugStream); - } return 0; } @@ -257,15 +258,11 @@ LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) break; } - /* Jump across to the member window function (will handle all requests). */ + // Jump across to the member window function (will handle all requests). if (pContainer != nullptr) - { return pContainer->WindowProcedure(hwnd, uMsg, wParam, lParam); - } else - { return DefWindowProc(hwnd, uMsg, wParam, lParam); - } } size_t strifind(const std::wstring& strHaystack, const std::wstring& strNeedle) @@ -275,6 +272,7 @@ size_t strifind(const std::wstring& strHaystack, const std::wstring& strNeedle) strNeedle.begin(), strNeedle.end(), [](wchar_t ch1, wchar_t ch2) { return std::toupper(ch1) == std::toupper(ch2); } ); + return it != strHaystack.end() ? it - strHaystack.begin() : std::wstring::npos; } @@ -282,12 +280,14 @@ bool comparei(std::wstring stringA, std::wstring stringB) { transform(stringA.begin(), stringA.end(), stringA.begin(), std::toupper); transform(stringB.begin(), stringB.end(), stringB.begin(), std::toupper); + return (stringA == stringB); } std::string wstring_to_utf8_hex(const std::wstring& input) { std::string output; + int cbNeeded = WideCharToMultiByte(CP_UTF8, 0, input.c_str(), -1, NULL, 0, NULL, NULL); if (cbNeeded > 0) { @@ -301,8 +301,10 @@ std::string wstring_to_utf8_hex(const std::wstring& input) output.append(onehex); } } + delete[] utf8; } + return output; } @@ -315,6 +317,7 @@ std::wstring str2wstr(const std::string& str) MultiByteToWideChar(CP_UTF8, 0, &str[0], (int)str.size(), &wstrTo[0], cbNeeded); return wstrTo; } + return L""; } @@ -324,12 +327,14 @@ void RunFileExplorer(const TCHAR* openDirectory) SHELLEXECUTEINFO ShExecInfo = { 0 }; ShExecInfo.cbSize = sizeof(SHELLEXECUTEINFO); ShExecInfo.lpFile = L"explorer.exe"; + if (openDirectory != NULL) { TCHAR args[1024]; swprintf(args, _countof(args) - 1, L"\"%s\"", openDirectory); ShExecInfo.lpParameters = args; } + ShExecInfo.nShow = SW_SHOW; ShellExecuteEx(&ShExecInfo); } @@ -338,10 +343,10 @@ bool OpenInExistingShellWindow(const TCHAR* folderPath) { std::wstring openDirectory(folderPath); bool mustOpenInExplorer = false; + if (strifind(openDirectory, L"::{") == 0) - { openDirectory = L"shell:" + openDirectory; - } + if (strifind(openDirectory, L"shell:") == 0) { std::vector supportedShellFolders{ @@ -357,48 +362,51 @@ bool OpenInExistingShellWindow(const TCHAR* folderPath) supportedShellFolders.begin(), supportedShellFolders.end(), [openDirectory](std::wstring it) { return comparei(it, openDirectory); } ); + mustOpenInExplorer = it == supportedShellFolders.end(); } IShellItem* psi; PIDLIST_ABSOLUTE controlPanelCategoryViewPidl; + if (!SUCCEEDED(SHCreateItemFromParsingName(L"::{26EE0668-A00A-44D7-9371-BEB064C98683}", NULL, IID_IShellItem, (void**)&psi))) { if (mustOpenInExplorer) - { RunFileExplorer(openDirectory.c_str()); - } + return mustOpenInExplorer; } + if (!SUCCEEDED(SHGetIDListFromObject(psi, &controlPanelCategoryViewPidl))) { psi->Release(); if (mustOpenInExplorer) - { RunFileExplorer(openDirectory.c_str()); - } + return mustOpenInExplorer; } + psi->Release(); PIDLIST_ABSOLUTE targetFolderPidl; + if (!SUCCEEDED(SHCreateItemFromParsingName(openDirectory.c_str(), NULL, IID_IShellItem, (void**)&psi))) { if (mustOpenInExplorer) - { RunFileExplorer(openDirectory.c_str()); - } + return mustOpenInExplorer; } + if (!SUCCEEDED(SHGetIDListFromObject(psi, &targetFolderPidl))) { psi->Release(); if (mustOpenInExplorer) - { RunFileExplorer(openDirectory.c_str()); - } + return mustOpenInExplorer; } + psi->Release(); bool opened = false; @@ -459,9 +467,7 @@ bool OpenInExistingShellWindow(const TCHAR* folderPath) CoTaskMemFree(controlPanelCategoryViewPidl); if (!opened && mustOpenInExplorer) - { RunFileExplorer(openDirectory.c_str()); - } return opened || mustOpenInExplorer; } diff --git a/src/Files.OpenDialog/FilesLauncher/FilesLauncher.vcxproj b/src/Files.OpenDialog/FilesLauncher/FilesLauncher.vcxproj index 8f6a74b9b772..5d1bb82d1091 100644 --- a/src/Files.OpenDialog/FilesLauncher/FilesLauncher.vcxproj +++ b/src/Files.OpenDialog/FilesLauncher/FilesLauncher.vcxproj @@ -106,10 +106,6 @@ true Unicode - - - - @@ -371,18 +367,10 @@ certutil -hashfile "$(ProjectDir)..\..\..\src\Files.App\Assets\FilesOpenDialog\$ - - - - - - - - diff --git a/src/Files.OpenDialog/FilesLauncher/FilesLauncher.vcxproj.filters b/src/Files.OpenDialog/FilesLauncher/FilesLauncher.vcxproj.filters index 36da2d247314..39a785f3dbe4 100644 --- a/src/Files.OpenDialog/FilesLauncher/FilesLauncher.vcxproj.filters +++ b/src/Files.OpenDialog/FilesLauncher/FilesLauncher.vcxproj.filters @@ -1,54 +1,26 @@  - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - + {93995380-89BD-4b04-88EB-625FBE52EBFB} h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - File di origine - - - File di origine - - - File di origine - - - File di origine - - - File di origine + Sources - File di origine + Sources - - File di intestazione - - - File di intestazione - - - File di intestazione - - - File di intestazione - - File di intestazione + Headers diff --git a/src/Files.OpenDialog/FilesLauncher/OpenInFolder.cpp b/src/Files.OpenDialog/FilesLauncher/OpenInFolder.cpp index 38de47ccef76..9d2661c32cbe 100644 --- a/src/Files.OpenDialog/FilesLauncher/OpenInFolder.cpp +++ b/src/Files.OpenDialog/FilesLauncher/OpenInFolder.cpp @@ -1,11 +1,9 @@ -#include "OpenInFolder.h" +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. -#include "DocumentServiceProvider.h" -#include "ShellView.h" -#include "WebBrowserApp.h" +#include "OpenInFolder.h" -OpenInFolder::OpenInFolder() - : m_hwnd(NULL) +OpenInFolder::OpenInFolder() : m_hwnd(NULL) { m_shellWindows = winrt::create_instance(CLSID_ShellWindows, CLSCTX_ALL); } @@ -35,6 +33,7 @@ void OpenInFolder::OnCreate() IShellItem* psi; PIDLIST_ABSOLUTE pidlDirectory = NULL; + if (!SUCCEEDED(SHCreateItemFromParsingName(openDirectory, NULL, IID_IShellItem, (void**)&psi))) { return; @@ -48,9 +47,7 @@ void OpenInFolder::OnCreate() psi->Release(); if (!SUCCEEDED(NotifyShellOfNavigation(pidlDirectory))) - { return; - } } LRESULT CALLBACK OpenInFolder::WindowProcedure(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam) @@ -79,24 +76,7 @@ HRESULT OpenInFolder::NotifyShellOfNavigation(PCIDLIST_ABSOLUTE pidl) RETURN_IF_FAILED(InitVariantFromBuffer(pidl, ILGetSize(pidl), &pidlVariant)); wil::unique_variant empty; - - RETURN_IF_FAILED(m_shellWindows->RegisterPending(GetCurrentThreadId(), &pidlVariant, &empty, - SWC_BROWSER, &m_shellWindowCookie)); - - auto document = winrt::make_self(); - auto shellView = winrt::make_self(this, pidl); - document->RegisterService(IID_IFolderView, shellView.get()); - - auto browserApp = winrt::make_self(m_hwnd, document.get()); - - long registeredCookie; -#pragma warning(push) -#pragma warning( \ - disable : 4311 4302) // 'reinterpret_cast': pointer truncation from 'HWND' to 'long', - // 'reinterpret_cast': truncation from 'HWND' to 'long' - RETURN_IF_FAILED(m_shellWindows->Register(browserApp.get(), reinterpret_cast(m_hwnd), - SWC_BROWSER, ®isteredCookie)); -#pragma warning(pop) + RETURN_IF_FAILED(m_shellWindows->RegisterPending(GetCurrentThreadId(), &pidlVariant, &empty, SWC_BROWSER, &m_shellWindowCookie)); m_shellWindows->OnNavigate(m_shellWindowCookie, &pidlVariant); //m_shellWindows->OnActivated(m_shellWindowCookie, VARIANT_TRUE); @@ -116,6 +96,7 @@ void OpenInFolder::OnItemSelected(PIDLIST_ABSOLUTE pidl) PostMessage(m_hwnd, WM_CLOSE, 0, 0); CoTaskMemFree(pszPath); } + item->Release(); } } @@ -128,7 +109,5 @@ std::wstring OpenInFolder::GetResult() OpenInFolder::~OpenInFolder() { if (m_shellWindows) - { m_shellWindows->Revoke(m_shellWindowCookie); - } -} \ No newline at end of file +} diff --git a/src/Files.OpenDialog/FilesLauncher/OpenInFolder.h b/src/Files.OpenDialog/FilesLauncher/OpenInFolder.h index c829fd548186..51b3cbd3449e 100644 --- a/src/Files.OpenDialog/FilesLauncher/OpenInFolder.h +++ b/src/Files.OpenDialog/FilesLauncher/OpenInFolder.h @@ -1,7 +1,9 @@ +// Copyright (c) 2023 Files Community +// Licensed under the MIT License. See the LICENSE. + #pragma once #include - #include #include #include @@ -9,7 +11,6 @@ #include #include #include - #include class OpenInFolder @@ -24,11 +25,10 @@ class OpenInFolder std::wstring m_selectedItem; public: - LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam); - OpenInFolder(); ~OpenInFolder(); + LRESULT CALLBACK WindowProcedure(HWND hwnd, UINT Msg, WPARAM wParam, LPARAM lParam); void SetWindow(HWND hwnd); void OnItemSelected(PIDLIST_ABSOLUTE pidl); void OnCreate(); diff --git a/src/Files.OpenDialog/FilesLauncher/ServiceProviderBase.cpp b/src/Files.OpenDialog/FilesLauncher/ServiceProviderBase.cpp deleted file mode 100644 index 57768c1b678b..000000000000 --- a/src/Files.OpenDialog/FilesLauncher/ServiceProviderBase.cpp +++ /dev/null @@ -1,23 +0,0 @@ -// Copyright (C) Explorer++ Project -// SPDX-License-Identifier: GPL-3.0-only -// See LICENSE in the top level directory - -#include "ServiceProviderBase.h" - -void ServiceProviderBase::RegisterService(REFGUID guidService, IUnknown *service) -{ - m_services[guidService] = service; -} - -HRESULT ServiceProviderBase::QueryService(REFGUID guidService, REFIID riid, void **ppv) -{ - auto itr = m_services.find(guidService); - - if (itr == m_services.end()) - { - return E_NOINTERFACE; - } - - return itr->second->QueryInterface(riid, ppv); - return S_OK; -} \ No newline at end of file diff --git a/src/Files.OpenDialog/FilesLauncher/ServiceProviderBase.h b/src/Files.OpenDialog/FilesLauncher/ServiceProviderBase.h deleted file mode 100644 index 842e147e4a6b..000000000000 --- a/src/Files.OpenDialog/FilesLauncher/ServiceProviderBase.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (C) Explorer++ Project -// SPDX-License-Identifier: GPL-3.0-only -// See LICENSE in the top level directory - -#pragma once - -#include -#include - -namespace std { - template<> struct hash - { - size_t operator()(const GUID& guid) const noexcept { - const std::uint64_t* p = reinterpret_cast(&guid); - std::hash hash; - return hash(p[0]) ^ hash(p[1]); - } - }; -} - -class ServiceProviderBase -{ -public: - void RegisterService(REFGUID guidService, IUnknown* service); - HRESULT QueryService(REFGUID guidService, REFIID riid, void** ppv); - -protected: - ServiceProviderBase() = default; - -private: - std::unordered_map> m_services; -}; \ No newline at end of file diff --git a/src/Files.OpenDialog/FilesLauncher/ShellView.cpp b/src/Files.OpenDialog/FilesLauncher/ShellView.cpp deleted file mode 100644 index 4d46d908e847..000000000000 --- a/src/Files.OpenDialog/FilesLauncher/ShellView.cpp +++ /dev/null @@ -1,141 +0,0 @@ -// Copyright (C) Explorer++ Project -// SPDX-License-Identifier: GPL-3.0-only -// See LICENSE in the top level directory - -#include "ShellView.h" -#include -#include -#include - -#include "OpenInFolder.h" - -using unique_pidl_absolute = wil::unique_cotaskmem_ptr>; -using unique_pidl_relative = wil::unique_cotaskmem_ptr>; -using unique_pidl_child = wil::unique_cotaskmem_ptr>; - -ShellView::ShellView(OpenInFolder* pThis, PCIDLIST_ABSOLUTE directory) - : m_directory(directory), m_pThis(pThis) -{ -} - -// IShellView -IFACEMETHODIMP ShellView::TranslateAccelerator(MSG* msg) -{ - UNREFERENCED_PARAMETER(msg); - - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::EnableModeless(BOOL enable) -{ - UNREFERENCED_PARAMETER(enable); - - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::UIActivate(UINT state) -{ - UNREFERENCED_PARAMETER(state); - - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::Refresh() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::CreateViewWindow(IShellView* previous, LPCFOLDERSETTINGS folderSettings, - IShellBrowser* shellBrowser, RECT* view, HWND* hwnd) -{ - UNREFERENCED_PARAMETER(previous); - UNREFERENCED_PARAMETER(folderSettings); - UNREFERENCED_PARAMETER(shellBrowser); - UNREFERENCED_PARAMETER(view); - UNREFERENCED_PARAMETER(hwnd); - - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::DestroyViewWindow() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::GetCurrentInfo(LPFOLDERSETTINGS folderSettings) -{ - UNREFERENCED_PARAMETER(folderSettings); - - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::AddPropertySheetPages( - DWORD reserved, LPFNSVADDPROPSHEETPAGE callback, LPARAM lParam) -{ - UNREFERENCED_PARAMETER(reserved); - UNREFERENCED_PARAMETER(callback); - UNREFERENCED_PARAMETER(lParam); - - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::SaveViewState() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::SelectItem(PCUITEMID_CHILD pidlItem, SVSIF flags) -{ - if (flags == SVSI_EDIT) - { - auto pidlComplete = - unique_pidl_absolute(ILCombine(m_directory, pidlItem)); - - return S_OK; - } - else if (WI_IsFlagSet(flags, SVSI_SELECT)) - { - auto pidlComplete = - unique_pidl_absolute(ILCombine(m_directory, pidlItem)); - if (m_pThis) - { - m_pThis->OnItemSelected(pidlComplete.get()); - } - return S_OK; - } - - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::GetItemObject(UINT item, REFIID riid, void** ppv) -{ - UNREFERENCED_PARAMETER(item); - UNREFERENCED_PARAMETER(riid); - UNREFERENCED_PARAMETER(ppv); - - return E_NOTIMPL; -} - -// IOleWindow -IFACEMETHODIMP ShellView::GetWindow(HWND* hwnd) -{ - UNREFERENCED_PARAMETER(hwnd); - - return E_NOTIMPL; -} - -IFACEMETHODIMP ShellView::ContextSensitiveHelp(BOOL enterMode) -{ - UNREFERENCED_PARAMETER(enterMode); - - return E_NOTIMPL; -} - -namespace winrt -{ - template <> - bool is_guid_of(guid const& id) noexcept - { - return is_guid_of(id); - } -} \ No newline at end of file diff --git a/src/Files.OpenDialog/FilesLauncher/ShellView.h b/src/Files.OpenDialog/FilesLauncher/ShellView.h deleted file mode 100644 index c1c8976186e9..000000000000 --- a/src/Files.OpenDialog/FilesLauncher/ShellView.h +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (C) Explorer++ Project -// SPDX-License-Identifier: GPL-3.0-only -// See LICENSE in the top level directory - -#pragma once - -#include "wil/cppwinrt.h" -#include -#include -#include -#include - -class OpenInFolder; - -// This isn't a complete implementation. There's only enough functionality to support the "New -// Folder" item shown on the background context menu in a phone's virtual folder (when that phone is -// connected via USB). -class ShellView : public winrt::implements -{ -public: - ShellView(OpenInFolder *pThis, PCIDLIST_ABSOLUTE directory); - - // IShellView - IFACEMETHODIMP TranslateAccelerator(MSG *msg); - IFACEMETHODIMP EnableModeless(BOOL enable); - IFACEMETHODIMP UIActivate(UINT state); - IFACEMETHODIMP Refresh(); - IFACEMETHODIMP CreateViewWindow(IShellView *previous, LPCFOLDERSETTINGS folderSettings, - IShellBrowser *shellBrowser, RECT *view, HWND *hwnd); - IFACEMETHODIMP DestroyViewWindow(); - IFACEMETHODIMP GetCurrentInfo(LPFOLDERSETTINGS folderSettings); - IFACEMETHODIMP AddPropertySheetPages( - DWORD reserved, LPFNSVADDPROPSHEETPAGE callback, LPARAM lParam); - IFACEMETHODIMP SaveViewState(); - IFACEMETHODIMP SelectItem(PCUITEMID_CHILD pidlItem, SVSIF flags); - IFACEMETHODIMP GetItemObject(UINT item, REFIID riid, void **ppv); - - // IOleWindow - IFACEMETHODIMP GetWindow(HWND *hwnd); - IFACEMETHODIMP ContextSensitiveHelp(BOOL enterMode); - -private: - PCIDLIST_ABSOLUTE m_directory; - OpenInFolder* m_pThis; -}; - -namespace winrt -{ - template <> - bool is_guid_of(guid const &id) noexcept; -} \ No newline at end of file diff --git a/src/Files.OpenDialog/FilesLauncher/WebBrowserApp.cpp b/src/Files.OpenDialog/FilesLauncher/WebBrowserApp.cpp deleted file mode 100644 index 7084696a1133..000000000000 --- a/src/Files.OpenDialog/FilesLauncher/WebBrowserApp.cpp +++ /dev/null @@ -1,380 +0,0 @@ -// Copyright (C) Explorer++ Project -// SPDX-License-Identifier: GPL-3.0-only -// See LICENSE in the top level directory - -#include "WebBrowserApp.h" -#include - -WebBrowserApp::WebBrowserApp(HWND hwnd, IDispatch *document) : m_hwnd(hwnd) -{ - m_document.copy_from(document); -} - -// IWebBrowserApp -IFACEMETHODIMP WebBrowserApp::Quit() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::ClientToWindow(int *width, int *height) -{ - UNREFERENCED_PARAMETER(width); - UNREFERENCED_PARAMETER(height); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::PutProperty(BSTR property, VARIANT value) -{ - UNREFERENCED_PARAMETER(property); - UNREFERENCED_PARAMETER(value); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::GetProperty(BSTR property, VARIANT *value) -{ - UNREFERENCED_PARAMETER(property); - UNREFERENCED_PARAMETER(value); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Name(BSTR *name) -{ - UNREFERENCED_PARAMETER(name); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_HWND(SHANDLE_PTR *hwnd) -{ - *hwnd = reinterpret_cast(m_hwnd); - return S_OK; -} - -IFACEMETHODIMP WebBrowserApp::get_FullName(BSTR *fullName) -{ - UNREFERENCED_PARAMETER(fullName); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Path(BSTR *path) -{ - UNREFERENCED_PARAMETER(path); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Visible(VARIANT_BOOL *visible) -{ - UNREFERENCED_PARAMETER(visible); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_Visible(VARIANT_BOOL visible) -{ - UNREFERENCED_PARAMETER(visible); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_StatusBar(VARIANT_BOOL *statusBar) -{ - UNREFERENCED_PARAMETER(statusBar); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_StatusBar(VARIANT_BOOL statusBar) -{ - UNREFERENCED_PARAMETER(statusBar); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_StatusText(BSTR *statusText) -{ - UNREFERENCED_PARAMETER(statusText); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_StatusText(BSTR statusText) -{ - UNREFERENCED_PARAMETER(statusText); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_ToolBar(int *toolBar) -{ - UNREFERENCED_PARAMETER(toolBar); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_ToolBar(int toolBar) -{ - UNREFERENCED_PARAMETER(toolBar); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_MenuBar(VARIANT_BOOL *menuBar) -{ - UNREFERENCED_PARAMETER(menuBar); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_MenuBar(VARIANT_BOOL menuBar) -{ - UNREFERENCED_PARAMETER(menuBar); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_FullScreen(VARIANT_BOOL *fullScreen) -{ - UNREFERENCED_PARAMETER(fullScreen); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_FullScreen(VARIANT_BOOL fullScreen) -{ - UNREFERENCED_PARAMETER(fullScreen); - - return E_NOTIMPL; -} - -// IWebBrowser -IFACEMETHODIMP WebBrowserApp::GoBack() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::GoForward() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::GoHome() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::GoSearch() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::Navigate( - BSTR url, VARIANT *flags, VARIANT *targetFrameName, VARIANT *postData, VARIANT *headers) -{ - UNREFERENCED_PARAMETER(url); - UNREFERENCED_PARAMETER(flags); - UNREFERENCED_PARAMETER(targetFrameName); - UNREFERENCED_PARAMETER(postData); - UNREFERENCED_PARAMETER(headers); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::Refresh() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::Refresh2(VARIANT *level) -{ - UNREFERENCED_PARAMETER(level); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::Stop() -{ - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Application(IDispatch **dispatch) -{ - UNREFERENCED_PARAMETER(dispatch); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Parent(IDispatch **dispatch) -{ - UNREFERENCED_PARAMETER(dispatch); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Container(IDispatch **dispatch) -{ - UNREFERENCED_PARAMETER(dispatch); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Document(IDispatch **dispatch) -{ - m_document.copy_to(dispatch); - return S_OK; -} - -IFACEMETHODIMP WebBrowserApp::get_TopLevelContainer(VARIANT_BOOL *topLevelContainer) -{ - UNREFERENCED_PARAMETER(topLevelContainer); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Type(BSTR *type) -{ - UNREFERENCED_PARAMETER(type); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Left(long *left) -{ - UNREFERENCED_PARAMETER(left); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_Left(long left) -{ - UNREFERENCED_PARAMETER(left); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Top(long *top) -{ - UNREFERENCED_PARAMETER(top); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_Top(long top) -{ - UNREFERENCED_PARAMETER(top); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Width(long *width) -{ - UNREFERENCED_PARAMETER(width); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_Width(long width) -{ - UNREFERENCED_PARAMETER(width); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Height(long *height) -{ - UNREFERENCED_PARAMETER(height); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::put_Height(long height) -{ - UNREFERENCED_PARAMETER(height); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_LocationName(BSTR *locationName) -{ - UNREFERENCED_PARAMETER(locationName); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_LocationURL(BSTR *locationURL) -{ - UNREFERENCED_PARAMETER(locationURL); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::get_Busy(VARIANT_BOOL *busy) -{ - UNREFERENCED_PARAMETER(busy); - - return E_NOTIMPL; -} - -// IDispatch -IFACEMETHODIMP WebBrowserApp::GetTypeInfoCount(UINT *typeInfoCount) -{ - UNREFERENCED_PARAMETER(typeInfoCount); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::GetTypeInfo(UINT type, LCID localeId, ITypeInfo **typeInfo) -{ - UNREFERENCED_PARAMETER(type); - UNREFERENCED_PARAMETER(localeId); - UNREFERENCED_PARAMETER(typeInfo); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::GetIDsOfNames( - REFIID riid, LPOLESTR *names, UINT numNames, LCID localeId, DISPID *dispId) -{ - UNREFERENCED_PARAMETER(riid); - UNREFERENCED_PARAMETER(names); - UNREFERENCED_PARAMETER(numNames); - UNREFERENCED_PARAMETER(localeId); - UNREFERENCED_PARAMETER(dispId); - - return E_NOTIMPL; -} - -IFACEMETHODIMP WebBrowserApp::Invoke(DISPID dispIdMember, REFIID riid, LCID localeId, WORD flags, - DISPPARAMS *dispParams, VARIANT *varResult, EXCEPINFO *exceptionInfo, UINT *argErr) -{ - UNREFERENCED_PARAMETER(dispIdMember); - UNREFERENCED_PARAMETER(riid); - UNREFERENCED_PARAMETER(localeId); - UNREFERENCED_PARAMETER(flags); - UNREFERENCED_PARAMETER(dispParams); - UNREFERENCED_PARAMETER(varResult); - UNREFERENCED_PARAMETER(exceptionInfo); - UNREFERENCED_PARAMETER(argErr); - - return E_NOTIMPL; -} - -namespace winrt -{ - template <> - bool is_guid_of(guid const &id) noexcept - { - auto res = is_guid_of(id); - - //OLECHAR* guidString; - //(void)StringFromCLSID(id, &guidString); - //std::wcout << L"QueryInterface: " << guidString << L" = " << res << std::endl; - //CoTaskMemFree(guidString); - - return res; - } -} \ No newline at end of file diff --git a/src/Files.OpenDialog/FilesLauncher/WebBrowserApp.h b/src/Files.OpenDialog/FilesLauncher/WebBrowserApp.h deleted file mode 100644 index b5cabfc2e431..000000000000 --- a/src/Files.OpenDialog/FilesLauncher/WebBrowserApp.h +++ /dev/null @@ -1,87 +0,0 @@ -// Copyright (C) Explorer++ Project -// SPDX-License-Identifier: GPL-3.0-only -// See LICENSE in the top level directory - -#pragma once - -#include "wil/cppwinrt.h" -#include -#include - -// This isn't a web browser application, but the IWebBrowserApp interface is used when finding shell -// windows. -class WebBrowserApp : public winrt::implements -{ -public: - WebBrowserApp(HWND hwnd, IDispatch *document); - - // IWebBrowserApp - IFACEMETHODIMP Quit(); - IFACEMETHODIMP ClientToWindow(int *width, int *height); - IFACEMETHODIMP PutProperty(BSTR property, VARIANT value); - IFACEMETHODIMP GetProperty(BSTR property, VARIANT *value); - IFACEMETHODIMP get_Name(BSTR *name); - IFACEMETHODIMP get_HWND(SHANDLE_PTR *hwnd); - IFACEMETHODIMP get_FullName(BSTR *fullName); - IFACEMETHODIMP get_Path(BSTR *path); - IFACEMETHODIMP get_Visible(VARIANT_BOOL *visible); - IFACEMETHODIMP put_Visible(VARIANT_BOOL visible); - IFACEMETHODIMP get_StatusBar(VARIANT_BOOL *statusBar); - IFACEMETHODIMP put_StatusBar(VARIANT_BOOL statusBar); - IFACEMETHODIMP get_StatusText(BSTR *statusText); - IFACEMETHODIMP put_StatusText(BSTR statusText); - IFACEMETHODIMP get_ToolBar(int *toolBar); - IFACEMETHODIMP put_ToolBar(int toolBar); - IFACEMETHODIMP get_MenuBar(VARIANT_BOOL *menuBar); - IFACEMETHODIMP put_MenuBar(VARIANT_BOOL menuBar); - IFACEMETHODIMP get_FullScreen(VARIANT_BOOL *fullScreen); - IFACEMETHODIMP put_FullScreen(VARIANT_BOOL fullScreen); - - // IWebBrowser - IFACEMETHODIMP GoBack(); - IFACEMETHODIMP GoForward(); - IFACEMETHODIMP GoHome(); - IFACEMETHODIMP GoSearch(); - IFACEMETHODIMP Navigate( - BSTR url, VARIANT *flags, VARIANT *targetFrameName, VARIANT *postData, VARIANT *headers); - IFACEMETHODIMP Refresh(); - IFACEMETHODIMP Refresh2(VARIANT *level); - IFACEMETHODIMP Stop(); - IFACEMETHODIMP get_Application(IDispatch **dispatch); - IFACEMETHODIMP get_Parent(IDispatch **dispatch); - IFACEMETHODIMP get_Container(IDispatch **dispatch); - IFACEMETHODIMP get_Document(IDispatch **dispatch); - IFACEMETHODIMP get_TopLevelContainer(VARIANT_BOOL *topLevelContainer); - IFACEMETHODIMP get_Type(BSTR *type); - IFACEMETHODIMP get_Left(long *left); - IFACEMETHODIMP put_Left(long left); - IFACEMETHODIMP get_Top(long *top); - IFACEMETHODIMP put_Top(long top); - IFACEMETHODIMP get_Width(long *width); - IFACEMETHODIMP put_Width(long width); - IFACEMETHODIMP get_Height(long *height); - IFACEMETHODIMP put_Height(long height); - IFACEMETHODIMP get_LocationName(BSTR *locationName); - IFACEMETHODIMP get_LocationURL(BSTR *locationURL); - IFACEMETHODIMP get_Busy(VARIANT_BOOL *busy); - - // IDispatch - IFACEMETHODIMP GetTypeInfoCount(UINT *typeInfoCount); - IFACEMETHODIMP GetTypeInfo(UINT type, LCID localeId, ITypeInfo **typeInfo); - IFACEMETHODIMP GetIDsOfNames( - REFIID riid, LPOLESTR *names, UINT numNames, LCID localeId, DISPID *dispId); - IFACEMETHODIMP Invoke(DISPID dispIdMember, REFIID riid, LCID localeId, WORD flags, - DISPPARAMS *dispParams, VARIANT *varResult, EXCEPINFO *exceptionInfo, UINT *argErr); - -private: - HWND m_hwnd; - - // This represents the view of the folder, rather than a web document. - winrt::com_ptr m_document; -}; - -namespace winrt -{ - template <> - bool is_guid_of(guid const &id) noexcept; -} \ No newline at end of file diff --git a/src/Files.OpenDialog/FilesLauncher/packages.config b/src/Files.OpenDialog/FilesLauncher/packages.config index e11b462529ec..5ed24ba9b595 100644 --- a/src/Files.OpenDialog/FilesLauncher/packages.config +++ b/src/Files.OpenDialog/FilesLauncher/packages.config @@ -2,4 +2,4 @@ - \ No newline at end of file +