Implement the emoji panel function in the right-click menu.

This commit is contained in:
fanlusky committed 2026-07-17 23:50:28 +08:00
1 parent fd0cff71e9
commit 6e235a8dfd
3 files changed
+26 -1

No files matched your search

+20
View File
@@ -732,6 +732,21 @@ HRESULT OnControllerCreatedMenuWnd( //
GetClientRect(hwnd, &bounds);
webviewControllerMenuWnd->put_Bounds(bounds);
EventRegistrationToken menuNavigationCompletedToken{};
webviewMenuWnd->add_NavigationCompleted(
Microsoft::WRL::Callback<ICoreWebView2NavigationCompletedEventHandler>(
[hwnd](ICoreWebView2 *sender, ICoreWebView2NavigationCompletedEventArgs *args) -> HRESULT {
BOOL success = FALSE;
if (!args || FAILED(args->get_IsSuccess(&success)) || !success)
{
return S_OK;
}
PostMessage(hwnd, WM_REFRESH_MENU_SIZE, 0, 0);
return S_OK;
})
.Get(),
&menuNavigationCompletedToken);
// Navigate to HTML
HRESULT hr = webviewMenuWnd->NavigateToString(::HTMLStringMenuWnd.c_str());
if (FAILED(hr))
@@ -770,6 +785,11 @@ HRESULT OnControllerCreatedMenuWnd( //
OpenSettingsApplication();
ShowWindow(::global_hwnd_menu, SW_HIDE);
}
else if (type == "emojiSymbols")
{
OpenEmojiPanelApplication();
ShowWindow(::global_hwnd_menu, SW_HIDE);
}
}
return S_OK;
})