From 9b57db9ad61503ebf96a1b1f9a9e3ce687d242f1 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 16 Jul 2018 12:56:51 +0300 Subject: nope.. this code must be executed each time we create a menu --- src/mir_app/src/clui.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp index 6b170e6edc..6166d78832 100644 --- a/src/mir_app/src/clui.cpp +++ b/src/mir_app/src/clui.cpp @@ -98,6 +98,14 @@ static int CluiLangpackChanged(WPARAM, LPARAM) g_clistApi.hMenuMain = LoadMenu(g_plugin.getInst(), MAKEINTRESOURCE(IDR_CLISTMENU)); TranslateMenu(g_clistApi.hMenuMain); + // make menu bar owner-drawn and set it on + MENUITEMINFO mii; + mii.cbSize = sizeof(mii); + mii.fMask = MIIM_TYPE | MIIM_DATA; + mii.dwItemData = MENU_MIRANDAMENU; + mii.fType = MFT_OWNERDRAW; + SetMenuItemInfo(g_clistApi.hMenuMain, 0, TRUE, &mii); + if (GetMenu(g_clistApi.hwndContactList)) SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain); return 0; @@ -321,13 +329,6 @@ int LoadCLUIModule(void) HookEvent(ME_LANGPACK_CHANGED, CluiLangpackChanged); CluiLangpackChanged(0, 0); - // make menu bar owner-drawn and set it on - MENUITEMINFO mii; - mii.cbSize = sizeof(mii); - mii.fMask = MIIM_TYPE | MIIM_DATA; - mii.dwItemData = MENU_MIRANDAMENU; - mii.fType = MFT_OWNERDRAW; - SetMenuItemInfo(g_clistApi.hMenuMain, 0, TRUE, &mii); SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain); g_clistApi.pfnOnCreateClc(); -- cgit v1.2.3