rodecomp/Source/Client/Browser/BrowserMessages.cpp
ragnarok-clanker d842cee831 Maintenance: [forced, user-approved] Collapse the Browser port's adapter structs into the original code (follow-up to 30cdd441). Evid
Batch #10110 by ragnarok-clanker: forced by an admin (0 lower score(s), 40 changed function(s)); checked with 495 compiled unit(s), including every includer of Source/Client/Application/ApplicationActivation.h, Source/Client/Application/Launcher.h, Source/Client/Browser/BrowserClientSite.h, Source/Client/Browser/BrowserPopupDispatch.h, Source/Client/Browser/WebBrowser.h, Source/Client/Browser/WebEventReceiver.h, Source/Client/Mode/CLoginMode.h, Source/Client/Mode/CMode.h, Source/Client/Mode/ModeTooltip.h, Source/UI/Window/UIWindowMgr.h, Source/Client/Browser/BrowserAddressBar.h, Source/Client/Browser/BrowserAddressEdit.h, Source/Client/Browser/BrowserClose.h, Source/Client/Browser/BrowserCreation.h, Source/Client/Browser/BrowserCursor.h, Source/Client/Browser/BrowserFactory.h, Source/Client/Browser/BrowserFrame.h, Source/Client/Browser/BrowserHostWindow.h, Source/Client/Browser/BrowserInputHandoff.h, Source/Client/Browser/BrowserInterface.h, Source/Client/Browser/BrowserMessages.h, Source/Client/Browser/BrowserRegistry.h, Source/Client/Browser/BrowserSiteAttachment.h, Source/Client/Browser/BrowserWindowSizing.h, Source/UI/Window/WindowFrameUpdate.h.
Deletes: Source/Client/Browser/BrowserAddressBar.h, Source/Client/Browser/BrowserAddressEdit.h, Source/Client/Browser/BrowserClose.h, Source/Client/Browser/BrowserCreation.h, Source/Client/Browser/BrowserCursor.h, Source/Client/Browser/BrowserFactory.h, Source/Client/Browser/BrowserFrame.h, Source/Client/Browser/BrowserHostWindow.h, Source/Client/Browser/BrowserInputHandoff.h, Source/Client/Browser/BrowserInterface.h, Source/Client/Browser/BrowserMessages.h, Source/Client/Browser/BrowserRegistry.h, Source/Client/Browser/BrowserSiteAttachment.h, Source/Client/Browser/BrowserWindowSizing.h, Source/UI/Window/WindowFrameUpdate.h
2026-11-02 16:41:37 +00:00

48 lines
1.2 KiB
C++

#include "Client/Application/ApplicationWindow.h"
#include "Client/Browser/WebBrowser.h"
#include "UI/Window/UIWindowMgr.h"
#include <cstdint>
// OFFSET: 0x00AB33C0
// FUNCTION: fn_17423
LRESULT CALLBACK BrowserHostProc(HWND window, UINT message, WPARAM value, LPARAM flags) {
CWebBrowser* browser = g_windowMgr.FindBrowser(window);
switch (message) {
case WM_CREATE:
case WM_NCHITTEST:
case WM_NCLBUTTONDOWN:
case WM_PARENTNOTIFY:
g_windowMgr.activeBrowser = g_windowMgr.FindBrowser(window);
break;
case WM_DESTROY:
SetFocus(hWnd);
break;
case WM_SIZE:
if (browser) {
const auto dimensions = static_cast<std::uint32_t>(flags);
browser->Resize(static_cast<std::uint16_t>(dimensions), dimensions >> 16);
}
break;
case WM_CLOSE:
g_windowMgr.RemoveBrowser(window);
break;
case WM_HELP:
return 1;
case WM_KEYDOWN:
if (value == VK_F1 || value == VK_F11) {
return 1;
}
break;
case WM_COMMAND:
if (LOWORD(value) == static_cast<WORD>(BrowserCommand::Navigate) && browser) {
char address[512];
GetWindowTextA(browser->combo, address, sizeof(address));
browser->Navigate(address);
}
break;
}
return DefWindowProcA(window, message, value, flags);
}