diff options
author | George Hazan <george.hazan@gmail.com> | 2015-06-28 15:20:06 +0000 |
---|---|---|
committer | George Hazan <george.hazan@gmail.com> | 2015-06-28 15:20:06 +0000 |
commit | dcc561ccf83c7468bf512ab94db0c34bfdb49dfc (patch) | |
tree | b71f88f9be3198372f8e8cf11fa6c4093367a8dc /plugins | |
parent | 7cd632b27e8bbae2005518606666547144c100dc (diff) |
code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@14428 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
43 files changed, 57 insertions, 98 deletions
diff --git a/plugins/Actman/ua/i_uaplaces.inc b/plugins/Actman/ua/i_uaplaces.inc index a74e56425a..d6307a6c36 100644 --- a/plugins/Actman/ua/i_uaplaces.inc +++ b/plugins/Actman/ua/i_uaplaces.inc @@ -624,9 +624,7 @@ begin end;
FillChar(mtButton,SizeOf(mtButton),0);
- mtButton.cbSize :=SizeOf(mtButton);
-
- mtButton.pszService:=TTB_SERVICE_NAME;//SERVICE_WITH_LPARAM_NAME;
+ mtButton.pszService:=TTB_SERVICE_NAME;
mtButton.lParamUp :=ActionItem.dwActID;
mtButton.lParamDown:=ActionItem.dwActID;
diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 7345f16720..c8ec5cd667 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -114,7 +114,7 @@ static int OnAccListChanged(WPARAM, LPARAM) static int CreateButton(WPARAM, LPARAM)
{
- TTBButton tbb = { sizeof(tbb) };
+ TTBButton tbb = { 0 };
tbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
tbb.pszService = MS_ADDCONTACTPLUS_SHOW;
tbb.name = tbb.pszTooltipUp = LPGEN("Add contact");
diff --git a/plugins/Alarms/src/alarms.cpp b/plugins/Alarms/src/alarms.cpp index 9c28386d1d..e7732c46b9 100644 --- a/plugins/Alarms/src/alarms.cpp +++ b/plugins/Alarms/src/alarms.cpp @@ -123,7 +123,7 @@ HBITMAP LoadBmpFromIcon(int IdRes) static int InitTopToolbarButton(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.hIconUp = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TBUP));
ttb.hIconDn = LoadIcon(hInst, MAKEINTRESOURCE(IDI_TBDN));
ttb.pszService = MODULE "/NewAlarm";
diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index 4e696ef1dc..927a03c439 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -411,7 +411,7 @@ static HANDLE hToolbarButton; int ToolbarLoaded(WPARAM,LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.hIconHandleUp = iconList[2].hIcolib;
ttb.hIconHandleDn = iconList[1].hIcolib;
ttb.pszService = "AutoShutdown/MenuCommand";
diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index c1dce1dfdd..60d262af6e 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -85,7 +85,7 @@ int PrebuildContactMenu(WPARAM hContact, LPARAM lParam) int ToolbarModuleLoaded(WPARAM wParam,LPARAM lParam)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.pszService = MS_HISTORY_SHOWCONTACTHISTORY;
ttb.name = ttb.pszTooltipUp = LPGEN("Open History");
ttb.dwFlags = TTBBF_SHOWTOOLTIP;
diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 96b73d6dbc..a30a429636 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -562,7 +562,7 @@ void RegisterCoreHotKeys(void) static int TopToolbarInit(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.pszService = MS_BOSSKEY_HIDE;
ttb.pszTooltipUp = ttb.name = LPGEN("Hide Miranda NG");
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 2b50be863d..a3cba86884 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -60,7 +60,6 @@ void Modern_InitButtons() {
for (int i = 0; i < _countof(BTNS); i++) {
TTBButton tbb = { 0 };
- tbb.cbSize = sizeof(tbb);
if (BTNS[i].pszButtonID) {
tbb.name = LPGEN(BTNS[i].pszButtonName);
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index 0bd79d24c2..d5689f67f5 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -46,7 +46,7 @@ static int g_index = -1; static void InitDefaultButtons()
{
for (int i = 0; i < _countof(BTNS); i++) {
- TTBButton tbb = { sizeof(tbb) };
+ TTBButton tbb = { 0 };
g_index = i;
if (BTNS[i].pszButtonID) {
diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 0608ac2d5f..8ce00a8cb6 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -121,7 +121,7 @@ static int OnTTBLoaded(WPARAM, LPARAM) {
int state = IsWindowVisible(hwndConsole);
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.hIconHandleUp = LoadIcon(IDI_BTN_UP);
ttb.hIconHandleDn = LoadIcon(IDI_BTN_DN);
ttb.dwFlags = (state ? TTBBF_PUSHED : 0) | TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index ba56531671..dbe47847c9 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -213,7 +213,7 @@ int OptionsInit(WPARAM wParam, LPARAM) static int ToolbarModulesLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.pszService = MS_CRASHDUMPER_STORETOCLIP;
ttb.name = ttb.pszTooltipUp = LPGEN("Version Information To Clipboard");
ttb.hIconHandleUp = GetIconHandle(IDI_VITOCLIP);
diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index ab44b2f97e..d38b38692e 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -98,7 +98,7 @@ INT_PTR DBEditorppMenuCommand(WPARAM wParam, LPARAM) static int OnTTBLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = "DBEditorpp/MenuCommand";
ttb.name = LPGEN("Database Editor++");
diff --git a/plugins/ExternalAPI/delphi/m_toptoolbar.inc b/plugins/ExternalAPI/delphi/m_toptoolbar.inc index 5dfbee3b53..2815b6e105 100644 --- a/plugins/ExternalAPI/delphi/m_toptoolbar.inc +++ b/plugins/ExternalAPI/delphi/m_toptoolbar.inc @@ -18,7 +18,6 @@ const type
PTTBButton = ^TTBButton;
TTBButton = record
- cbSize :int;
pszService :PAnsiChar; // or program for lButtons
dwFlags :dword;
lParamUp :LPARAM;
diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h index 1d3766290e..cd98be6dee 100644 --- a/plugins/ExternalAPI/m_toptoolbar.h +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -13,8 +13,8 @@ #define TTBBF_ISSBUTTON 0x0100
#define TTBBF_ASPUSHBUTTON 0x0200
-typedef struct {
- int cbSize;
+struct TTBButton
+{
union {
char *pszService;
TCHAR *program;
@@ -36,8 +36,7 @@ typedef struct { char *pszTooltipUp;
char *pszTooltipDn;
-}
- TTBButton, * lpTTBButton;
+};
//=== EVENTS ===
/*
diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index 94459df0ca..a660faf5b7 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -112,7 +112,7 @@ static __forceinline COLORREF sttShadeColor(COLORREF clLine1, COLORREF clBack) int ProcessTBLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.pszTooltipUp = ttb.name = LPGEN("Favorite Contacts");
ttb.pszService = MS_FAVCONTACTS_SHOWMENU;
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index e147086564..844a9cef97 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -316,18 +316,13 @@ function OnTTBLoaded(awParam: WPARAM; alParam: LPARAM): Integer; cdecl; var
ttb: TTBButton;
begin
- if Boolean(ServiceExists(MS_TTB_ADDBUTTON)) then
- begin
- ZeroMemory(@ttb,SizeOf(ttb));
- ttb.cbSize := SizeOf(ttb);
- ttb.hIconUp := hppIcons[HPP_ICON_GLOBALSEARCH].handle;
- ttb.pszService := MS_HPP_SHOWGLOBALSEARCH;
- ttb.dwFlags := TTBBF_VISIBLE or TTBBF_SHOWTOOLTIP;
- ttb.name := 'Global History Search';
- ttb.pszTooltipUp := ttb.name;
- CallService(MS_TTB_ADDBUTTON,WPARAM(@ttb), 0);
- UnhookEvent(HookTTBLoaded);
- end;
+ ZeroMemory(@ttb,SizeOf(ttb));
+ ttb.hIconUp := hppIcons[HPP_ICON_GLOBALSEARCH].handle;
+ ttb.pszService := MS_HPP_SHOWGLOBALSEARCH;
+ ttb.dwFlags := TTBBF_VISIBLE or TTBBF_SHOWTOOLTIP;
+ ttb.name := 'Global History Search';
+ ttb.pszTooltipUp := ttb.name;
+ CallService(MS_TTB_ADDBUTTON,WPARAM(@ttb), 0);
Result := 0;
end;
diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index d1d7cc45c4..76fbe3d140 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -453,7 +453,7 @@ int TopToolBarLoaded(WPARAM, LPARAM) CreateServiceFunction(MS_LISTENINGTO_TTB, TopToolBarClick);
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.hIconHandleDn = iconList[0].hIcolib;
ttb.hIconHandleUp = iconList[1].hIcolib;
ttb.pszService = MS_LISTENINGTO_TTB;
diff --git a/plugins/MirLua/src/m_toptoolbar.cpp b/plugins/MirLua/src/m_toptoolbar.cpp index 535f919823..4e96f645e5 100644 --- a/plugins/MirLua/src/m_toptoolbar.cpp +++ b/plugins/MirLua/src/m_toptoolbar.cpp @@ -3,7 +3,6 @@ static TTBButton* MakeTBButton(lua_State *L)
{
TTBButton *tbb = (TTBButton*)mir_calloc(sizeof(TTBButton));
- tbb->cbSize = sizeof(TTBButton);
lua_pushstring(L, "Name");
lua_gettable(L, -2);
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 7c22280e2d..3f0326764e 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -412,7 +412,7 @@ static int Create_TopToolbar(WPARAM, LPARAM) {
int SendOnEvent = CContactSettings(g_ProtoStates[(char*)NULL].Status).Autoreply;
if (ServiceExists(MS_TTB_REMOVEBUTTON)) {
- TTBButton ttbb = { sizeof(ttbb) };
+ TTBButton ttbb = { 0 };
ttbb.name = LPGEN("Toggle autoreply on/off");;
ttbb.hIconHandleUp = iconList[0].hIcolib;
ttbb.hIconHandleDn = iconList[1].hIcolib;
diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index 6553001288..9740c84963 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -1106,7 +1106,7 @@ void InitSound() int InitTopToolbar(WPARAM, LPARAM)
{
- TTBButton tbb = { sizeof(tbb) };
+ TTBButton tbb = { 0 };
tbb.pszService = MS_STATUSCHANGE_MENUCOMMAND;
tbb.dwFlags = (opt.TempDisabled ? 0 : TTBBF_PUSHED) | TTBBF_ASPUSHBUTTON;
tbb.name = LPGEN("Toggle status notification");
diff --git a/plugins/NewsAggregator/Src/Services.cpp b/plugins/NewsAggregator/Src/Services.cpp index ff5a09c348..68f323aba1 100644 --- a/plugins/NewsAggregator/Src/Services.cpp +++ b/plugins/NewsAggregator/Src/Services.cpp @@ -248,7 +248,7 @@ INT_PTR EnableDisable(WPARAM, LPARAM) int OnToolbarLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.name = LPGEN("Enable/disable auto update");
ttb.pszService = MS_NEWSAGGREGATOR_ENABLED;
ttb.pszTooltipUp = LPGEN("Auto Update Enabled");
diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index 14d765bd0b..f83edada99 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -129,8 +129,7 @@ int OnOptInitialise(WPARAM w, LPARAM L) int OnTopToolBarInit(WPARAM w, LPARAM L)
{
- TTBButton ttb = {0};
- ttb.cbSize = sizeof(TTBButton);
+ TTBButton ttb = { 0 };
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.hIconHandleUp = iconList[14].hIcolib;
diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index f25d17ffad..6731fdca09 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -46,7 +46,7 @@ static INT_PTR MenuCommand_OpenFolder(WPARAM, LPARAM) // toptoolbar (if plugin is installed)
static int ToptoolBarHook(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.hIconHandleUp = icon.hIcolib;
ttb.pszService = MS_OPENFOLDER_OPEN;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 6d32a12e4f..1dbbcad7bc 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -129,7 +129,7 @@ static int IconsChanged(WPARAM, LPARAM) static int TTBLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.pszService = MENUCOMMAND_SVC;
ttb.lParamUp = 1;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP | TTBBF_ASPUSHBUTTON;
diff --git a/plugins/QuickSearch/sr_global.pas b/plugins/QuickSearch/sr_global.pas index c7a160d990..578e631900 100644 --- a/plugins/QuickSearch/sr_global.pas +++ b/plugins/QuickSearch/sr_global.pas @@ -223,7 +223,6 @@ begin if ServiceExists(MS_TTB_ADDBUTTON)>0 then
begin
ZeroMemory(@ttbopt,sizeof(ttbopt));
- ttbopt.cbSize :=sizeof(ttbopt);
ttbopt.pszService:=QS_SHOWSERVICE;
ttbopt.hIconUp :=IcoLib_GetIcon(QS_QS,0);
ttbopt.hIconDn :=ttbopt.hIconUp;
diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 5f848f8a8d..463075d995 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -132,14 +132,14 @@ void InitMenu() mi.name.t = LPGENT("Refresh");
mi.icolibItem = Quotes_GetIconHandle(IDI_ICON_REFRESH);
mi.pszService = "Quotes/RefreshContact";
- g_hMenuRefresh = Menu_AddContactMenuItem(&mi);
+ g_hMenuRefresh = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
Menu_ConfigureItem(g_hMenuRefresh, MCI_OPT_EXECPARAM, INT_PTR(0));
CreateServiceFunction(mi.pszService, QuotesMenu_RefreshContact);
mi.name.t = LPGENT("Open Log File...");
mi.icolibItem = NULL;
mi.pszService = "Quotes/OpenLogFile";
- g_hMenuOpenLogFile = Menu_AddContactMenuItem(&mi);
+ g_hMenuOpenLogFile = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
Menu_ConfigureItem(g_hMenuOpenLogFile, MCI_OPT_EXECPARAM, 1);
CreateServiceFunction(mi.pszService, QuotesMenu_OpenLogFile);
@@ -148,14 +148,14 @@ void InitMenu() mi.popupPosition = 2;
mi.icolibItem = NULL;
mi.pszService = "Quotes/Chart";
- g_hMenuChart = Menu_AddContactMenuItem(&mi);
+ g_hMenuChart = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
CreateServiceFunction(mi.pszService, QuotesMenu_Chart);
#endif
mi.name.t = LPGENT("Edit Settings...");
mi.icolibItem = NULL;
mi.pszService = "Quotes/EditSettings";
- g_hMenuEditSettings = Menu_AddContactMenuItem(&mi);
+ g_hMenuEditSettings = Menu_AddContactMenuItem(&mi, QUOTES_PROTOCOL_NAME);
#ifdef CHART_IMPLEMENT
Menu_ConfigureItem(g_hMenuEditSettings, MCI_OPT_EXECPARAM, 3);
#else
@@ -166,7 +166,7 @@ void InitMenu() int Quotes_OnToolbarLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.name = LPGEN("Enable/Disable Quotes Auto Update");
ttb.pszService = g_pszAutoUpdateCmd;
ttb.pszTooltipUp = LPGEN("Quotes Auto Update Enabled");
diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 3e1daa0cf7..b523991085 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -449,7 +449,7 @@ static int OnContactSettingChanged( WPARAM hContact, LPARAM lParam ) int Create_TopToolbarShowList(WPARAM wParam, LPARAM lParam)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.hIconHandleUp = icon.hIcolib;
ttb.pszService = msLastUC_ShowList;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 69ee00a7ff..a8f130e6e2 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -721,7 +721,7 @@ INT_PTR BuildFavMenu(WPARAM, LPARAM) static int CreateButtons(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
ttb.pszService = MS_SESSIONS_OPENMANAGER;
diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 6281cde036..e017f3b7ec 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -1400,12 +1400,12 @@ VOID CALLBACK UpdateMsgTimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD d static int AddTopToolbarButton(WPARAM wParam, LPARAM lParam)
{
- TTBButton ttbb = { sizeof(ttbb) };
- ttbb.hIconHandleUp = ttbb.hIconHandleDn = GetIconHandle(IDI_CSMSG);
- ttbb.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
- ttbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
- ttbb.name = ttbb.pszTooltipUp = LPGEN("Change status message");
- hTTBButton = TopToolbar_AddButton(&ttbb);
+ TTBButton tbb = { 0 };
+ tbb.hIconHandleUp = tbb.hIconHandleDn = GetIconHandle(IDI_CSMSG);
+ tbb.pszService = MS_SIMPLESTATUSMSG_SHOWDIALOGINT;
+ tbb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
+ tbb.name = tbb.pszTooltipUp = LPGEN("Change status message");
+ hTTBButton = TopToolbar_AddButton(&tbb);
ReleaseIconEx("csmsg");
return 0;
diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index ab3aa9401b..442e47617e 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -317,7 +317,7 @@ void UpdateTTB() static int CreateTTButtons(WPARAM wParam, LPARAM lParam)
{
- TTBButton ttb = {sizeof(ttb)};
+ TTBButton ttb = { 0 };
ttb.dwFlags = (Enabled == 1 ? 0 : TTBBF_PUSHED) | TTBBF_VISIBLE | TTBBF_ASPUSHBUTTON;
ttb.pszService = SS_SERVICE_NAME;
ttb.hIconHandleDn = GetIconHandle(DISABLE_SILENCETTB);
diff --git a/plugins/StatusPlugins/StartupStatus/toolbars.cpp b/plugins/StatusPlugins/StartupStatus/toolbars.cpp index e5029981d1..4786230987 100644 --- a/plugins/StatusPlugins/StartupStatus/toolbars.cpp +++ b/plugins/StatusPlugins/StartupStatus/toolbars.cpp @@ -50,7 +50,6 @@ int CreateTopToolbarButtons(WPARAM wParam, LPARAM lParam) int profileCount = CallService(MS_SS_GETPROFILECOUNT, 0, 0);
TTBButton ttb = { 0 };
- ttb.cbSize = sizeof(ttb);
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_SS_LOADANDSETPROFILE;
for (int i=0; i < profileCount; i++) {
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 6098edf5c4..39f7ee160e 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -266,7 +266,6 @@ void CGlobals::hookSystemEvents() int CGlobals::TopToolbarLoaded(WPARAM, LPARAM)
{
TTBButton ttb = { 0 };
- ttb.cbSize = sizeof(ttb);
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
ttb.pszService = MS_TABMSG_TRAYSUPPORT;
ttb.name = "TabSRMM session list";
diff --git a/plugins/TopToolBar/src/InternalButtons.cpp b/plugins/TopToolBar/src/InternalButtons.cpp index ac0869d4a2..8ed9c6022d 100644 --- a/plugins/TopToolBar/src/InternalButtons.cpp +++ b/plugins/TopToolBar/src/InternalButtons.cpp @@ -113,8 +113,7 @@ void InitInternalButtons() CreateServiceFunction(TTBI_SHOWHIDEOFFLINE, TTBInternalShowHideOffline);
for (int i = 0; i < _countof(stdButtons); i++) {
- TTBButton ttb = {0};
- ttb.cbSize = sizeof(ttb);
+ TTBButton ttb = { 0 };
ttb.name = stdButtons[i].name;
ttb.pszService = stdButtons[i].pszService;
ttb.dwFlags = TTBBF_INTERNAL;
diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index d9b21dad72..c0c86131bf 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -1,8 +1,6 @@ #include "common.h"
-#define OLD_TBBUTTON_SIZE (offsetof(TTBButton, pszTooltipUp))
-
pfnCustomProc g_CustomProc = NULL;
LPARAM g_CustomProcParam = 0;
TTBCtrl *g_ctrl = NULL;
@@ -42,8 +40,7 @@ TopButtonInt *idtopos(int id, int *pPos) //----- Service buttons -----
void InsertSBut(int i)
{
- TTBButton ttb = {0};
- ttb.cbSize = sizeof(ttb);
+ TTBButton ttb = { 0 };
ttb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RUN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ttb.hIconUp = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RUN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISSBUTTON | TTBBF_INTERNAL;
@@ -78,8 +75,7 @@ INT_PTR LaunchService(WPARAM, LPARAM lParam) void InsertLBut(int i)
{
- TTBButton ttb = {0};
- ttb.cbSize = sizeof(ttb);
+ TTBButton ttb = { 0 };
ttb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RUN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISLBUTTON | TTBBF_INTERNAL;
ttb.name = LPGEN("Default");
@@ -99,8 +95,7 @@ void LoadAllLButs() //----- Separators -----
void InsertSeparator(int i)
{
- TTBButton ttb = {0};
- ttb.cbSize = sizeof(ttb);
+ TTBButton ttb = { 0 };
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISSEPARATOR | TTBBF_INTERNAL;
ttb.wParamDown = i;
TTBAddButton((WPARAM)&ttb, 0);
@@ -195,10 +190,8 @@ TopButtonInt *CreateButton(TTBButton *but) Icon2button(but, b->hIconHandleUp, b->hIconUp, true);
Icon2button(but, b->hIconHandleDn, b->hIconDn, false);
- if (but->cbSize > OLD_TBBUTTON_SIZE) {
- b->ptszTooltipUp = mir_a2t(but->pszTooltipUp);
- b->ptszTooltipDn = mir_a2t(but->pszTooltipDn);
- }
+ b->ptszTooltipUp = mir_a2t(but->pszTooltipUp);
+ b->ptszTooltipDn = mir_a2t(but->pszTooltipDn);
}
return b;
}
@@ -306,9 +299,6 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam) return -1;
TTBButton *but = (TTBButton *)wParam;
- if (but->cbSize != sizeof(TTBButton) && but->cbSize != OLD_TBBUTTON_SIZE)
- return -1;
-
if (!(but->dwFlags & TTBBF_ISLBUTTON) && nameexists(but->name))
return -1;
@@ -397,10 +387,7 @@ INT_PTR TTBGetOptions(WPARAM wParam, LPARAM lParam) case TTBO_ALLDATA:
if (lParam) {
- lpTTBButton lpTTB = (lpTTBButton)lParam;
- if (lpTTB->cbSize != sizeof(TTBButton))
- return -1;
-
+ TTBButton *lpTTB = (TTBButton*)lParam;
lpTTB->dwFlags = b->dwFlags & (~TTBBF_PUSHED);
if (b->bPushed)
lpTTB->dwFlags |= TTBBF_PUSHED;
@@ -461,10 +448,7 @@ INT_PTR TTBSetOptions(WPARAM wParam, LPARAM lParam) case TTBO_ALLDATA:
if (lParam) {
- lpTTBButton lpTTB = (lpTTBButton)lParam;
- if (lpTTB->cbSize != sizeof(TTBButton))
- return 0;
-
+ TTBButton *lpTTB = (TTBButton*)lParam;
DWORD retval = b->CheckFlags(lpTTB->dwFlags);
bool changed = false;
diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index ec2eab562b..6aa57f9d03 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -277,7 +277,6 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (!(btn->dwFlags & TTBBF_OPTIONAL)) {
// create button
TTBButton ttb = { 0 };
- ttb.cbSize = sizeof(ttb);
ttb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RUN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISLBUTTON | TTBBF_INTERNAL | TTBBF_OPTIONAL;
ttb.name = NULL;
@@ -306,7 +305,6 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (ctrlid == IDC_ADDLBUTTON) {
// create button
TTBButton ttb = { 0 };
- ttb.cbSize = sizeof(ttb);
ttb.hIconDn = (HICON)LoadImage(hInst, MAKEINTRESOURCE(IDI_RUN), IMAGE_ICON, 16, 16, LR_DEFAULTCOLOR);
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISLBUTTON | TTBBF_INTERNAL | TTBBF_OPTIONAL;
ttb.name = LPGEN("Default");
@@ -329,7 +327,6 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR if (ctrlid == IDC_ADDSEP) {
// create button
TTBButton ttb = { 0 };
- ttb.cbSize = sizeof(ttb);
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_ISSEPARATOR | TTBBF_INTERNAL | TTBBF_OPTIONAL;
TopButtonInt* b = CreateButton(&ttb);
diff --git a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp index 1921080234..9584657a6a 100644 --- a/plugins/UserInfoEx/src/dlg_anniversarylist.cpp +++ b/plugins/UserInfoEx/src/dlg_anniversarylist.cpp @@ -959,7 +959,7 @@ INT_PTR DlgAnniversaryListShow(WPARAM, LPARAM) **/
void DlgAnniversaryListOnTopToolBarLoaded()
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_USERINFO_REMINDER_LIST;
ttb.hIconHandleUp = IcoLib_GetIconHandle(ICO_COMMON_ANNIVERSARY);
diff --git a/plugins/UserInfoEx/src/svc_reminder.cpp b/plugins/UserInfoEx/src/svc_reminder.cpp index 82936b60ab..6d84a26dad 100644 --- a/plugins/UserInfoEx/src/svc_reminder.cpp +++ b/plugins/UserInfoEx/src/svc_reminder.cpp @@ -680,7 +680,7 @@ static int OnContactSettingChanged(MCONTACT hContact, DBCONTACTWRITESETTING* pdb void SvcReminderOnTopToolBarLoaded()
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_USERINFO_REMINDER_CHECK;
ttb.name = ttb.pszTooltipUp = LPGEN("Check anniversaries");
diff --git a/plugins/Watrack/i_gui.inc b/plugins/Watrack/i_gui.inc index fa10a41062..2f2f249c14 100644 --- a/plugins/Watrack/i_gui.inc +++ b/plugins/Watrack/i_gui.inc @@ -5,7 +5,6 @@ var ttb:m_api.TTBButton;
begin
FillChar(ttb,SizeOf(ttb),0);
- ttb.cbSize :=SizeOf(ttb);
ttb.dwFlags:=TTBBF_VISIBLE or TTBBF_SHOWTOOLTIP;
// plugin status button
@@ -15,11 +14,8 @@ begin ttb.hIconDn :=IcoLib_GetIcon(IcoBtnEnable,0);
ttb.hIconUp :=IcoLib_GetIcon(IcoBtnDisable,0);
ttb.wParamUp :=1;
-// ttb.wParamDown :=0;
ttb.pszService:=MS_WAT_PLUGINSTATUS;
ttb.name :='WATrack status';
-// ttb.tooltipDn:='Disable Plugin';
-// ttb.tooltipUp:='Enable Plugin';
ttbState:=TopToolbar_AddButton(@ttb);
if ttbState=THANDLE(-1) then
ttbState:=0
diff --git a/plugins/Watrack/popup/popups.pas b/plugins/Watrack/popup/popups.pas index a75264cf7c..fb6f9d1b53 100644 --- a/plugins/Watrack/popup/popups.pas +++ b/plugins/Watrack/popup/popups.pas @@ -374,7 +374,6 @@ begin UnhookEvent(onttbhook);
// get info button
FillChar(ttb,SizeOf(ttb),0);
- ttb.cbSize :=SizeOf(ttb);
ttb.dwFlags :=TTBBF_VISIBLE{ or TTBBF_SHOWTOOLTIP};
ttb.hIconUp :=IcoLib_GetIcon(IcoBtnInfo,0);
ttb.hIconDn :=ttb.hIconUp;
diff --git a/plugins/Weather/src/weather.cpp b/plugins/Weather/src/weather.cpp index 736293406c..458e7f1586 100644 --- a/plugins/Weather/src/weather.cpp +++ b/plugins/Weather/src/weather.cpp @@ -103,7 +103,7 @@ int WeatherShutdown(WPARAM wParam,LPARAM lParam) int OnToolbarLoaded(WPARAM wParam, LPARAM lParam)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.name = LPGEN("Enable/disable auto update");
ttb.pszService = MS_WEATHER_ENABLED;
ttb.pszTooltipUp = LPGEN("Auto Update Enabled");
diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index 7ad4b7a7c8..a421260b7e 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -31,7 +31,7 @@ int currentDay; static int OnTopToolBarModuleLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
ttb.pszService = MS_WWI_CHECK_BIRTHDAYS;
ttb.hIconHandleUp = hCheckMenu;
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index d641f612f2..c7e697f5f1 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -460,7 +460,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lpara int InitTopToolbar(WPARAM,LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.hIconUp = LoadIcon(hInst, MAKEINTRESOURCE(IDI_DRIVE));
ttb.pszService = MS_WUMF_CONNECTIONSSHOW;
ttb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP;
diff --git a/plugins/YAMN/src/services.cpp b/plugins/YAMN/src/services.cpp index 812dfd7e41..78662e565d 100644 --- a/plugins/YAMN/src/services.cpp +++ b/plugins/YAMN/src/services.cpp @@ -306,8 +306,7 @@ int AddTopToolbarIcon(WPARAM,LPARAM) {
if ( db_get_b(NULL, YAMN_DBMODULE, YAMN_TTBFCHECK, 1)) {
if ( ServiceExists(MS_TTB_REMOVEBUTTON) && hTTButton == NULL) {
- TTBButton btn = {0};
- btn.cbSize = sizeof(btn);
+ TTBButton btn = { 0 };
btn.pszService = MS_YAMN_FORCECHECK;
btn.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP;
btn.hIconHandleUp = btn.hIconHandleDn = g_GetIconHandle(0);
diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index dc8bb1074e..f51ce242cf 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -75,7 +75,7 @@ int ReloadFont(WPARAM wParam, LPARAM lParam) int TTBLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { sizeof(ttb) };
+ TTBButton ttb = { 0 };
ttb.pszService = "Popup/EnableDisableMenuCommand";
ttb.lParamUp = 1;
ttb.dwFlags = TTBBF_VISIBLE | TTBBF_SHOWTOOLTIP | TTBBF_ASPUSHBUTTON;
|