From 2b982f8a1f23ae29136f62fb3819df50c281e19f Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 11 Mar 2013 21:53:08 +0000 Subject: rest of minor TopToolbar_AddButton issues git-svn-id: http://svn.miranda-ng.org/main/trunk@3981 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/DbEditorPP/src/main.cpp | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) (limited to 'plugins/DbEditorPP') diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index df3505c2e5..7bc8b290fa 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -12,7 +12,7 @@ HANDLE hUserMenu; HANDLE hRestore; WatchListArrayStruct WatchListArray; HANDLE sMenuCommand, sRegisterModule, sRegisterSingleModule, sImport, sServicemodeLaunch; -HANDLE hModulesLoadedHook = NULL, hSettingsChangedHook=NULL, hOptInitHook=NULL, hPreShutdownHook=NULL, hTTBHook = NULL; +HANDLE hModulesLoadedHook = NULL, hSettingsChangedHook=NULL, hOptInitHook=NULL, hPreShutdownHook=NULL; //======================== // MirandaPluginInfo @@ -141,17 +141,15 @@ BOOL IsCP_UTF8(void) static int OnTTBLoaded(WPARAM wParam,LPARAM lParam) { - TTBButton ttbb = {0}; HICON ico = LoadIcon(hInst, MAKEINTRESOURCE(ICO_DBE_BUTT)); - UnhookEvent(hTTBHook); - - ttbb.cbSize = sizeof(ttbb); - ttbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; - ttbb.pszService = "DBEditorpp/MenuCommand"; - ttbb.name = LPGEN("Database Editor++"); - ttbb.hIconUp = ico; - ttbb.pszTooltipUp = LPGEN("Open Database Editor"); - hTTBButt = TopToolbar_AddButton(&ttbb); + + TTBButton ttb = { sizeof(ttb) }; + ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP; + ttb.pszService = "DBEditorpp/MenuCommand"; + ttb.name = LPGEN("Database Editor++"); + ttb.hIconUp = ico; + ttb.pszTooltipUp = LPGEN("Open Database Editor"); + hTTBButt = TopToolbar_AddButton(&ttb); return 0; } @@ -175,8 +173,7 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam) hUserMenu = Menu_AddContactMenuItem(&mi); // Register hotkeys - HOTKEYDESC hkd = {0}; - hkd.cbSize = sizeof(hkd); + HOTKEYDESC hkd = { sizeof(hkd) }; hkd.pszName = "hk_dbepp_open"; hkd.pszService = "DBEditorpp/MenuCommand"; hkd.ptszDescription = LPGEN("Open Database Editor"); @@ -235,7 +232,7 @@ int ModulesLoaded(WPARAM wParam,LPARAM lParam) DBFreeVariant(&dbv); } - hTTBHook = HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded); + HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded); if ( bServiceMode ) CallService("DBEditorpp/MenuCommand",0,0); -- cgit v1.2.3