summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--plugins/Clist_blind/res/resource.rc27
-rw-r--r--plugins/Clist_blind/src/cluiopts.cpp2
-rw-r--r--plugins/Clist_blind/src/resource.h1
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp26
-rw-r--r--plugins/Clist_modern/src/resource.h1
-rw-r--r--plugins/Clist_nicer/res/resource.rc28
-rw-r--r--plugins/Clist_nicer/src/clui.cpp3
-rw-r--r--plugins/Clist_nicer/src/resource.h1
-rw-r--r--src/core/stdclist/res/resource.rc27
-rw-r--r--src/core/stdclist/src/resource.h1
-rw-r--r--src/mir_app/res/resource.rc22
-rw-r--r--src/mir_app/src/clui.cpp26
12 files changed, 56 insertions, 109 deletions
diff --git a/plugins/Clist_blind/res/resource.rc b/plugins/Clist_blind/res/resource.rc
index 41b18e0705..5e139eeb32 100644
--- a/plugins/Clist_blind/res/resource.rc
+++ b/plugins/Clist_blind/res/resource.rc
@@ -311,33 +311,6 @@ IDC_HYPERLINKHAND CURSOR "..\\..\\..\\src\\mir_app\\res\\
IDC_DROP CURSOR "..\\..\\..\\src\\mir_app\\res\\cursor_drag_copy.cur"
IDC_DROPUSER CURSOR "..\\..\\..\\src\\mir_app\\res\\cursor_drop_user.cur"
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_CLISTMENU MENU
-BEGIN
- POPUP "&Main menu"
- BEGIN
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_ICQ_EXIT
- END
- POPUP "&Status"
- BEGIN
- MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
- MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
- MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
- MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA
- MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
- MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND
- MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
- MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
- MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
- MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
- END
-END
-
#endif // Русский (Россия) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp
index 1acb1998b0..a7ede404d9 100644
--- a/plugins/Clist_blind/src/cluiopts.cpp
+++ b/plugins/Clist_blind/src/cluiopts.cpp
@@ -201,10 +201,12 @@ static INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
else
SetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE,
GetWindowLongPtr(g_clistApi.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
+
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
SetMenu(g_clistApi.hwndContactList, nullptr);
else
SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
+
SetWindowPos(g_clistApi.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
RedrawWindow(g_clistApi.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE);
if (IsIconic(g_clistApi.hwndContactList) && BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
diff --git a/plugins/Clist_blind/src/resource.h b/plugins/Clist_blind/src/resource.h
index 5f07d6caf0..c5f4824b5d 100644
--- a/plugins/Clist_blind/src/resource.h
+++ b/plugins/Clist_blind/src/resource.h
@@ -5,7 +5,6 @@
#define IDD_OPT_CLIST 126
#define IDC_DROP 183
#define IDD_OPT_HOTKEY 184
-#define IDR_CLISTMENU 199
#define IDC_HYPERLINKHAND 214
#define IDC_DROPUSER 215
#define IDD_OPT_CLUI 218
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 5abbec1ca8..49c16ff8f0 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -60,7 +60,6 @@ BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LP
UINT g_dwMainThreadID = 0;
HANDLE g_hAwayMsgThread = nullptr, g_hGetTextAsyncThread = nullptr, g_hSmoothAnimationThread = nullptr;
-HMENU g_hMenuMain;
BOOL g_bTransparentFlag = FALSE;
BOOL g_mutex_bChangingMode = FALSE, g_mutex_bSizing = FALSE;
@@ -239,17 +238,6 @@ INT_PTR CLUI::Service_Menu_HideContactAvatar(WPARAM hContact, LPARAM)
HRESULT CLUI::CreateCluiFrames()
{
- g_hMenuMain = GetMenu(g_clistApi.hwndContactList);
-
- MENUITEMINFO mii = { 0 };
- mii.cbSize = sizeof(mii);
- mii.fMask = MIIM_SUBMENU;
- mii.hSubMenu = Menu_GetMainMenu();
- SetMenuItemInfo(g_hMenuMain, 0, TRUE, &mii);
-
- mii.hSubMenu = Menu_GetStatusMenu();
- SetMenuItemInfo(g_hMenuMain, 1, TRUE, &mii);
-
CreateCLCWindow(g_clistApi.hwndContactList);
CLUI_ChangeWindowMode();
@@ -688,10 +676,10 @@ void CLUI_ChangeWindowMode()
CLUI_UpdateAeroGlass();
- if (g_CluiData.fLayered || !db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT)) {
+ if (g_CluiData.fLayered || !db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(g_clistApi.hwndContactList, nullptr);
- }
- else SetMenu(g_clistApi.hwndContactList, g_hMenuMain);
+ else
+ SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
if (g_CluiData.fLayered && (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)))
ske_UpdateWindowImage();
@@ -2182,7 +2170,7 @@ LRESULT CLUI::OnNcHitTest(UINT, WPARAM wParam, LPARAM lParam)
if (result == HTMENU) {
POINT pt = UNPACK_POINT(lParam);
- int t = MenuItemFromPoint(m_hWnd, g_hMenuMain, pt);
+ int t = MenuItemFromPoint(m_hWnd, g_clistApi.hMenuMain, pt);
if (t == -1 && (db_get_b(0, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)))
return HTCAPTION;
}
@@ -2520,9 +2508,9 @@ LRESULT CLUI::OnDestroy(UINT, WPARAM, LPARAM)
UnLoadContactListModule();
ClcUnloadModule();
- RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
- RemoveMenu(g_hMenuMain, 0, MF_BYPOSITION);
- DestroyMenu(g_hMenuMain);
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ DestroyMenu(g_clistApi.hMenuMain);
Clist_TrayIconDestroy(m_hWnd);
mutex_bAnimationInProgress = 0;
diff --git a/plugins/Clist_modern/src/resource.h b/plugins/Clist_modern/src/resource.h
index cb794ad7e3..e2aa094406 100644
--- a/plugins/Clist_modern/src/resource.h
+++ b/plugins/Clist_modern/src/resource.h
@@ -19,7 +19,6 @@
#define IDI_DELETE 175
#define IDC_DROP 183
#define IDI_SENDEMAIL 193
-#define IDR_CLISTMENU 199
#define IDI_BLANK 200
#define IDD_OPT_ICONS 207
#define IDI_FILE 207
diff --git a/plugins/Clist_nicer/res/resource.rc b/plugins/Clist_nicer/res/resource.rc
index abc645a9e7..21f242752c 100644
--- a/plugins/Clist_nicer/res/resource.rc
+++ b/plugins/Clist_nicer/res/resource.rc
@@ -580,34 +580,6 @@ IDC_DROPUSER CURSOR "..\\..\\..\\src\\mir_app\\res\\
/////////////////////////////////////////////////////////////////////////////
//
-// Menu
-//
-
-IDR_CLISTMENU MENU
-BEGIN
- POPUP "&Main menu"
- BEGIN
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_ICQ_EXIT
- END
- POPUP "&Status"
- BEGIN
- MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
- MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
- MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
- MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA
- MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
- MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND
- MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
- MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
- MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
- MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
- END
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
// DESIGNINFO
//
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index cf269c7bf4..d025bd8496 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -733,8 +733,7 @@ static void ShowCLUI(HWND hwnd)
int onTop = db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT);
SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE);
- if (!db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
- SetMenu(g_clistApi.hwndContactList, nullptr);
+
if (state == SETTING_STATE_NORMAL) {
SendMessage(g_clistApi.hwndContactList, WM_SIZE, 0, 0);
ShowWindow(g_clistApi.hwndContactList, SW_SHOWNORMAL);
diff --git a/plugins/Clist_nicer/src/resource.h b/plugins/Clist_nicer/src/resource.h
index 5e9cabe936..176986c10d 100644
--- a/plugins/Clist_nicer/src/resource.h
+++ b/plugins/Clist_nicer/src/resource.h
@@ -14,7 +14,6 @@
#define IDI_CLVM_OPTIONS 176
#define IDI_CLVM_SELECT 177
#define IDC_DROP 183
-#define IDR_CLISTMENU 199
#define IDI_BLANK 200
#define IDI_ADDCONTACT 210
#define IDC_HYPERLINKHAND 214
diff --git a/src/core/stdclist/res/resource.rc b/src/core/stdclist/res/resource.rc
index 4e32d4bcf2..0b367c5e78 100644
--- a/src/core/stdclist/res/resource.rc
+++ b/src/core/stdclist/res/resource.rc
@@ -347,33 +347,6 @@ IDC_HYPERLINKHAND CURSOR "hyperlin.cur"
IDC_DROP CURSOR "dragcopy.cur"
IDC_DROPUSER CURSOR "dropuser.cur"
-/////////////////////////////////////////////////////////////////////////////
-//
-// Menu
-//
-
-IDR_CLISTMENU MENU
-BEGIN
- POPUP "&Main menu"
- BEGIN
- MENUITEM SEPARATOR
- MENUITEM "E&xit", ID_ICQ_EXIT
- END
- POPUP "&Status"
- BEGIN
- MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
- MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
- MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
- MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA
- MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
- MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND
- MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
- MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
- MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
- MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
- END
-END
-
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/core/stdclist/src/resource.h b/src/core/stdclist/src/resource.h
index f9c37606a3..2bb3c4ef25 100644
--- a/src/core/stdclist/src/resource.h
+++ b/src/core/stdclist/src/resource.h
@@ -5,7 +5,6 @@
#define IDD_OPT_CLIST 126
#define IDC_DROP 183
#define IDD_OPT_HOTKEY 184
-#define IDR_CLISTMENU 199
#define IDC_HYPERLINKHAND 214
#define IDC_DROPUSER 215
#define IDD_OPT_CLUI 218
diff --git a/src/mir_app/res/resource.rc b/src/mir_app/res/resource.rc
index cc030252d6..f0f22abf34 100644
--- a/src/mir_app/res/resource.rc
+++ b/src/mir_app/res/resource.rc
@@ -1298,6 +1298,28 @@ BEGIN
END
END
+IDR_CLISTMENU MENU
+BEGIN
+ POPUP "&Main menu"
+ BEGIN
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_ICQ_EXIT
+ END
+ POPUP "&Status"
+ BEGIN
+ MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
+ MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
+ MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
+ MENUITEM "&Not available\tCtrl+3", ID_STATUS_NA
+ MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
+ MENUITEM "&Do not disturb\tCtrl+5", ID_STATUS_DND
+ MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
+ MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
+ MENUITEM "On the &phone\tCtrl+8", ID_STATUS_ONTHEPHONE
+ MENUITEM "Out to &lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
+ END
+END
+
#endif // English (United States) resources
/////////////////////////////////////////////////////////////////////////////
diff --git a/src/mir_app/src/clui.cpp b/src/mir_app/src/clui.cpp
index 568586b417..0805220825 100644
--- a/src/mir_app/src/clui.cpp
+++ b/src/mir_app/src/clui.cpp
@@ -63,8 +63,10 @@ static int CluiModulesLoaded(WPARAM, LPARAM)
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
mii.fMask = MIIM_SUBMENU;
+
mii.hSubMenu = Menu_GetMainMenu();
SetMenuItemInfo(g_clistApi.hMenuMain, 0, TRUE, &mii);
+
mii.hSubMenu = Menu_GetStatusMenu();
SetMenuItemInfo(g_clistApi.hMenuMain, 1, TRUE, &mii);
}
@@ -85,6 +87,20 @@ static int CluiIconsChanged(WPARAM, LPARAM)
return 0;
}
+static int CluiLangpackChanged(WPARAM, LPARAM)
+{
+ if (g_clistApi.hMenuMain) {
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ DestroyMenu(g_clistApi.hMenuMain);
+ }
+
+ g_clistApi.hMenuMain = LoadMenuA(g_plugin.getInst(), MAKEINTRESOURCEA(IDR_CLISTMENU));
+ TranslateMenu(g_clistApi.hMenuMain);
+ SetMenu(g_clistApi.hwndContactList, g_clistApi.hMenuMain);
+ return 0;
+}
+
static HGENMENU hRenameMenuItem;
static int MenuItem_PreBuild(WPARAM, LPARAM)
@@ -265,7 +281,6 @@ int LoadCLUIModule(void)
wndclass.hIcon = Skin_LoadIcon(SKINICON_OTHER_MIRANDA, true);
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE + 1);
- wndclass.lpszMenuName = MAKEINTRESOURCE(IDR_CLISTMENU);
wndclass.lpszClassName = _T(MIRANDACLASS);
wndclass.hIconSm = Skin_LoadIcon(SKINICON_OTHER_MIRANDA);
RegisterClassEx(&wndclass);
@@ -303,16 +318,21 @@ int LoadCLUIModule(void)
g_clistApi.pfnOnCreateClc();
+ HookEvent(ME_LANGPACK_CHANGED, CluiLangpackChanged);
+ CluiLangpackChanged(0, 0);
+
PostMessage(g_clistApi.hwndContactList, M_RESTORESTATUS, 0, 0);
int state = db_get_b(0, "CList", "State", SETTING_STATE_NORMAL);
- g_clistApi.hMenuMain = GetMenu(g_clistApi.hwndContactList);
+
if (!db_get_b(0, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT))
SetMenu(g_clistApi.hwndContactList, nullptr);
+
if (state == SETTING_STATE_NORMAL)
ShowWindow(g_clistApi.hwndContactList, SW_SHOW);
else if (state == SETTING_STATE_MINIMIZED)
ShowWindow(g_clistApi.hwndContactList, SW_SHOWMINIMIZED);
+
SetWindowPos(g_clistApi.hwndContactList,
db_get_b(0, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST,
0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
@@ -1030,6 +1050,8 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
RemoveMenu(g_clistApi.hMenuMain, 0, MF_BYPOSITION);
+ DestroyMenu(g_clistApi.hMenuMain);
+ g_clistApi.hMenuMain = nullptr;
if (g_clistApi.hwndStatus) {
DestroyWindow(g_clistApi.hwndStatus);