From fbdfd82d0cf0975b80a2afa5eda141c4940ada9d Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 30 Jul 2017 21:42:04 +0300 Subject: SmileyAdd toolbar icon now has wrongly removed hotkey --- plugins/SmileyAdd/src/dlgboxsubclass.cpp | 10 ++++++++++ plugins/SmileyAdd/src/main.cpp | 7 ------- 2 files changed, 10 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index 9f8eab1afe..fff1cfee75 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -149,12 +149,22 @@ static LRESULT CALLBACK MessageDlgSubclass(HWND hwnd, UINT uMsg, WPARAM wParam, int SmileyButtonCreate(WPARAM, LPARAM) { + // create a hotkey for the button first + HOTKEYDESC desc = {}; + desc.pszName = "srmm_smileyadd"; + desc.szSection.a = BB_HK_SECTION; + desc.szDescription.a = LPGEN("Smiley selector"); + desc.DefHotKey = HOTKEYCODE(HOTKEYF_ALT, 'E'); + desc.lParam = LPARAM(g_hInst); + Hotkey_Register(&desc); + BBButton bbd = {}; bbd.pszModuleName = MODULENAME; bbd.pwszTooltip = LPGENW("Show smiley selection window"); bbd.dwDefPos = 31; bbd.hIcon = IcoLib_GetIconHandle("SmileyAdd_ButtonSmiley"); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON; + bbd.pszHotkey = desc.pszName; Srmm_AddButton(&bbd); return 0; } diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index fb8ed6a51d..38d1380068 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -67,13 +67,6 @@ static int ModulesLoaded(WPARAM, LPARAM) g_SmileyCategories.AddAllProtocolsAsCategory(); g_SmileyCategories.ClearAndLoadAll(); - HOTKEYDESC desc = {}; - desc.pszName = "smileyadd"; - desc.szSection.a = MODULENAME; - desc.szDescription.a = LPGEN("Smiley selector"); - desc.DefHotKey = HOTKEYCODE(HOTKEYF_ALT, 'E'); - Hotkey_Register(&desc); - ColourID cid = { sizeof(cid) }; strcpy_s(cid.dbSettingsGroup, MODULENAME); strcpy_s(cid.group, MODULENAME); -- cgit v1.2.3