Implement the emoji panel function in the right-click menu.
This commit is contained in:
1 parent
fd0cff71e9
commit
6e235a8dfd
3 files changed
+26
-1
No files matched your search
@@ -19,4 +19,5 @@ inline const UINT WM_DOUBLESINGLEBYTESWITCH = WM_USER + 107;
|
||||
inline const UINT UPDATE_FTB_STATUS = WM_USER + 108;
|
||||
inline const UINT WM_PIN_TO_TOP_CANDIDATE = WM_USER + 109;
|
||||
inline const UINT WM_COMMIT_CANDIDATE = WM_USER + 110;
|
||||
inline const UINT WM_CLEAR_IME_ENGINE_CACHE = WM_USER + 111;
|
||||
inline const UINT WM_CLEAR_IME_ENGINE_CACHE = WM_USER + 111;
|
||||
inline const UINT WM_REFRESH_MENU_SIZE = WM_USER + 112;
|
||||
@@ -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;
|
||||
})
|
||||
|
||||
@@ -697,6 +697,10 @@ LRESULT CALLBACK WndProcMenuWindow(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||
break;
|
||||
}
|
||||
|
||||
case WM_REFRESH_MENU_SIZE:
|
||||
SetTimer(hwnd, TIMER_ID_INIT_WEBVIEW_MENU, 1, nullptr);
|
||||
return 0;
|
||||
|
||||
case WM_TIMER: {
|
||||
if (wParam == TIMER_ID_INIT_WEBVIEW_MENU)
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user