From f719c8b921c7a46b76453476204224d40c682914 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Wed, 11 Jul 2018 21:32:58 +0300 Subject: int hLangpack/m_hLang removed and replaced with HPLUGIN --- plugins/AVS/src/options.cpp | 6 +- plugins/Actman/i_opt_dlg.inc | 1 - plugins/Actman/version.RES | Bin 0 -> 312 bytes plugins/AddContactPlus/src/main.cpp | 2 +- plugins/Alarms/src/frame.cpp | 2 +- plugins/Alarms/src/options.cpp | 5 +- plugins/AsSingleWindow/src/Options.cpp | 5 -- plugins/AssocMgr/src/assoclist.cpp | 3 +- plugins/AuthState/src/main.cpp | 2 +- plugins/AuthState/src/options.cpp | 2 +- plugins/AutoRun/src/main.cpp | 3 +- plugins/AutoShutdown/src/options.cpp | 3 +- plugins/AutoShutdown/src/settingsdlg.cpp | 2 +- plugins/AvatarHistory/src/AvatarDlg.cpp | 2 +- plugins/AvatarHistory/src/options.cpp | 3 +- plugins/BASS_interface/src/Bass.h | 28 +++---- plugins/BASS_interface/src/Main.cpp | 3 +- plugins/BasicHistory/src/BasicHistory.cpp | 6 +- plugins/BasicHistory/src/Options.cpp | 3 +- plugins/Boltun/src/boltun.cpp | 5 +- plugins/BossKeyPlus/src/BossKey.cpp | 4 +- plugins/BossKeyPlus/src/Options.cpp | 1 - plugins/BuddyExpectator/src/BuddyExpectator.cpp | 2 +- plugins/BuddyExpectator/src/options.cpp | 4 +- plugins/BuddyPounce/src/main.cpp | 5 +- plugins/CSList/src/cslist.cpp | 5 +- plugins/ChangeKeyboardLayout/src/hook_events.cpp | 3 +- .../ClientChangeNotify/src/ClientChangeNotify.cpp | 2 +- plugins/ClientChangeNotify/src/OptDlg.cpp | 1 - plugins/Clist_blind/src/clcopts.cpp | 3 +- plugins/Clist_blind/src/clistopts.cpp | 3 +- plugins/Clist_blind/src/cluiopts.cpp | 3 +- plugins/Clist_modern/src/cluiframes.cpp | 16 ++-- plugins/Clist_modern/src/cluiframes.h | 2 +- plugins/Clist_modern/src/groupmenu.cpp | 4 +- plugins/Clist_modern/src/modern_clcopts.cpp | 3 +- plugins/Clist_modern/src/modern_clistmenus.cpp | 2 +- plugins/Clist_modern/src/modern_clistopts.cpp | 3 +- plugins/Clist_modern/src/modern_clui.cpp | 2 +- plugins/Clist_modern/src/modern_skinopt.cpp | 3 +- plugins/Clist_nicer/src/clcopts.cpp | 4 +- plugins/Clist_nicer/src/clistmenus.cpp | 2 +- plugins/Clist_nicer/src/cluiframes.cpp | 8 +- plugins/Clist_nicer/src/groupmenu.cpp | 2 +- plugins/CloudFile/src/Services/dropbox_service.cpp | 32 ++++---- plugins/CloudFile/src/Services/google_service.cpp | 33 ++++---- .../CloudFile/src/Services/microsoft_service.cpp | 32 ++++---- plugins/CloudFile/src/Services/yandex_service.cpp | 32 ++++---- plugins/CloudFile/src/cloud_file.cpp | 13 ++- plugins/CloudFile/src/cloud_file.h | 6 +- plugins/CloudFile/src/menus.cpp | 5 +- plugins/CloudFile/src/options.cpp | 2 +- plugins/CloudFile/src/srmm.cpp | 3 +- plugins/ConnectionNotify/src/ConnectionNotify.cpp | 1 - plugins/Console/src/Console.cpp | 5 +- plugins/ContactsPlus/src/main.cpp | 2 +- plugins/CountryFlags/src/extraimg.cpp | 2 +- plugins/CountryFlags/src/options.cpp | 3 +- plugins/CrashDumper/src/crshdmp.cpp | 3 +- plugins/CyrTranslit/src/MirandaContact.cpp | 2 +- plugins/Db3x_mmap/src/ui.cpp | 5 +- plugins/DbEditorPP/src/main.cpp | 2 +- plugins/DbEditorPP/src/options.cpp | 3 +- plugins/Db_autobackups/src/main.cpp | 2 +- plugins/Db_autobackups/src/options.cpp | 2 +- plugins/Dbx_mdbx/src/ui.cpp | 2 +- plugins/Exchange/src/hooked_events.cpp | 5 +- plugins/ExternalAPI/m_toptoolbar.h | 2 +- plugins/FTPFileYM/src/ftpfile.cpp | 6 +- plugins/FTPFileYM/src/options.cpp | 3 +- plugins/FavContacts/src/options.cpp | 3 +- plugins/FavContacts/src/services.cpp | 2 +- plugins/FileAsMessage/src/main.cpp | 3 +- plugins/FingerprintNG/src/fingerprint.cpp | 2 +- plugins/FingerprintNG/src/options.cpp | 3 +- plugins/FloatingContacts/src/main.cpp | 2 +- plugins/FloatingContacts/src/options.cpp | 3 +- plugins/Folders/src/dlg_handlers.cpp | 3 +- plugins/GmailNotifier/src/main.cpp | 2 +- plugins/GmailNotifier/src/options.cpp | 3 +- plugins/HTTPServer/src/GuiElements.cpp | 5 +- plugins/HTTPServer/src/main.cpp | 2 +- plugins/HistoryLinkListPlus/src/linklist.cpp | 3 +- plugins/HistoryPlusPlus/historypp.dpr | 1 - plugins/HistoryPlusPlus/historypp.dproj.local | 2 + plugins/HistoryPlusPlus/historypp.identcache | Bin 0 -> 2307 bytes plugins/HistoryStats/src/mu_common.cpp | 7 +- plugins/HistorySweeperLight/src/main.cpp | 8 +- plugins/HistorySweeperLight/src/options.cpp | 3 +- plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp | 2 - plugins/IEHistory/src/IEHistory.cpp | 2 +- plugins/IEHistory/src/events.cpp | 3 +- plugins/IEView/src/Options.cpp | 3 +- plugins/IgnoreState/src/options.cpp | 3 +- plugins/Import/src/main.cpp | 2 +- plugins/ImportTXT/version.RES | Bin 0 -> 1096 bytes plugins/KeyboardNotify/src/options.cpp | 3 +- plugins/ListeningTo/src/listeningto.cpp | 4 +- plugins/ListeningTo/src/options.cpp | 3 +- plugins/LotusNotify/src/LotusNotify.cpp | 5 +- plugins/MagneticWindows/src/Options.cpp | 1 - plugins/MenuItemEx/src/main.cpp | 6 +- plugins/MenuItemEx/src/options.cpp | 3 +- plugins/MessageState/src/messagestate.cpp | 2 +- plugins/MirFox/src/MirandaOptions.cpp | 3 +- plugins/MirLua/src/Modules/m_clist.cpp | 8 +- plugins/MirLua/src/Modules/m_core.cpp | 2 +- plugins/MirLua/src/Modules/m_hotkeys.cpp | 4 +- plugins/MirLua/src/Modules/m_icolib.cpp | 3 +- plugins/MirLua/src/Modules/m_options.cpp | 5 +- plugins/MirLua/src/Modules/m_srmm.cpp | 3 +- plugins/MirLua/src/environment.cpp | 16 ++-- plugins/MirLua/src/environment.h | 2 +- plugins/MirLua/src/lua.cpp | 7 -- plugins/MirLua/src/options.cpp | 3 +- plugins/MirLua/src/plugin.cpp | 8 +- plugins/MirLua/src/stdafx.h | 1 - plugins/MirOTR/src/mirotrmenu.cpp | 2 +- plugins/MirOTR/src/options.cpp | 3 +- plugins/MirOTR/src/svcs_menu.cpp | 2 +- plugins/MirOTR/src/svcs_srmm.cpp | 6 +- plugins/MirandaG15/src/CConfig.cpp | 3 +- plugins/MsgPopup/src/main.cpp | 3 +- plugins/Msg_Export/src/main.cpp | 2 +- plugins/Msg_Export/src/options.cpp | 3 +- plugins/MyDetails/src/frame.cpp | 2 +- plugins/MyDetails/src/mydetails.cpp | 2 +- plugins/MyDetails/src/options.cpp | 3 +- plugins/NewAwaySysMod/src/AwayOpt.cpp | 1 - plugins/NewAwaySysMod/src/AwaySys.cpp | 2 +- plugins/NewEventNotify/src/menuitem.cpp | 2 +- plugins/NewEventNotify/src/options.cpp | 3 +- plugins/NewXstatusNotify/src/indsnd.cpp | 3 +- plugins/NewXstatusNotify/src/main.cpp | 2 +- plugins/NewXstatusNotify/src/options.cpp | 3 +- plugins/New_GPG/src/init.cpp | 6 +- plugins/New_GPG/src/utilities.cpp | 2 +- plugins/NewsAggregator/Src/Menus.cpp | 2 +- plugins/NewsAggregator/Src/Options.cpp | 3 +- plugins/NoHistory/src/dllmain.cpp | 6 +- plugins/NoHistory/src/options.cpp | 3 +- plugins/Non-IM Contact/src/main.cpp | 5 +- plugins/NotesAndReminders/src/main.cpp | 5 +- plugins/NotifyAnything/src/options.cpp | 3 +- plugins/Nudge/src/main.cpp | 4 +- plugins/Nudge/src/options.cpp | 3 +- plugins/OpenFolder/src/openFolder.cpp | 2 +- plugins/PackUpdater/Src/Options.cpp | 3 +- plugins/PackUpdater/Src/PackUpdater.cpp | 2 +- plugins/PasteIt/src/Options.cpp | 3 +- plugins/PasteIt/src/PasteIt.cpp | 6 +- plugins/Ping/src/menu.cpp | 2 +- plugins/Ping/src/options.cpp | 3 +- plugins/Ping/src/pingthread.cpp | 2 +- plugins/PluginUpdater/src/Options.cpp | 3 +- plugins/PluginUpdater/src/PluginUpdater.cpp | 2 +- plugins/Popup/src/main.cpp | 5 +- plugins/Popup/src/srmm_menu.cpp | 8 +- plugins/ProfileManager/src/pmanagerEx.cpp | 2 +- plugins/ProxySwitch/src/main.cpp | 6 +- plugins/ProxySwitch/src/opt.cpp | 3 +- plugins/QuickContacts/src/options.cpp | 3 +- plugins/QuickContacts/src/quickcontacts.cpp | 2 +- plugins/QuickMessages/src/Utils.cpp | 4 +- plugins/QuickMessages/src/options.cpp | 3 +- plugins/QuickReplies/src/events.cpp | 2 +- plugins/QuickReplies/src/options.cpp | 3 +- plugins/QuickSearch/quicksearch.dpr | 1 - plugins/QuickSearch/sr_frame.pas | 2 +- plugins/QuickSearch/version.RES | Bin 0 -> 312 bytes plugins/Quotes/src/Forex.cpp | 5 +- plugins/Quotes/src/QuoteInfoDlg.cpp | 3 +- plugins/RecentContacts/src/RecentContacts.cpp | 2 +- plugins/RecentContacts/src/options.cpp | 3 +- plugins/RemovePersonalSettings/src/rps.cpp | 2 +- plugins/Restart/src/restart.cpp | 2 +- plugins/SMS/src/SMS_svc.cpp | 2 +- plugins/SMS/src/options.cpp | 3 +- plugins/Scriver/src/chat_main.cpp | 2 +- plugins/Scriver/src/msgoptions.cpp | 4 +- plugins/Scriver/src/msgs.cpp | 32 ++++---- plugins/SecureIM/src/main.cpp | 4 +- plugins/SecureIM/src/options.cpp | 3 +- plugins/SecureIM/src/popupOptions.cpp | 3 +- plugins/SecureIM/src/svcs_srmm.cpp | 8 +- plugins/SeenPlugin/src/menu.cpp | 2 +- plugins/SeenPlugin/src/options.cpp | 3 +- plugins/SeenPlugin/src/userinfo.cpp | 1 - plugins/SendScreenshotPlus/src/Main.cpp | 2 +- plugins/Sessions/Src/Main.cpp | 2 +- plugins/Sessions/Src/Options.cpp | 3 +- plugins/ShellExt/src/options.cpp | 1 - plugins/SimpleAR/src/Main.cpp | 2 +- plugins/SimpleAR/src/Options.cpp | 3 +- plugins/SimpleStatusMsg/src/awaymsg.cpp | 2 +- plugins/SimpleStatusMsg/src/main.cpp | 2 +- plugins/SimpleStatusMsg/src/options.cpp | 3 +- plugins/SkypeStatusChange/src/options.cpp | 3 +- plugins/SmileyAdd/src/dlgboxsubclass.cpp | 2 +- plugins/SmileyAdd/src/main.cpp | 2 +- plugins/SmileyAdd/src/options.cpp | 3 +- plugins/SmileyAdd/src/services.cpp | 2 +- plugins/Spamotron/src/options.cpp | 3 +- plugins/SpellChecker/src/options.cpp | 4 +- plugins/SpellChecker/src/spellchecker.cpp | 2 +- plugins/SplashScreen/src/options.cpp | 3 +- plugins/StartPosition/src/startposition.cpp | 1 - plugins/StartupSilence/src/main.cpp | 5 +- plugins/StatusChange/src/main.cpp | 3 +- plugins/StatusManager/src/aaa_options.cpp | 9 +-- plugins/StatusManager/src/advancedautoaway.cpp | 8 +- plugins/StatusManager/src/keepstatus.cpp | 88 ++++++++++----------- plugins/StatusManager/src/ks_options.cpp | 8 +- plugins/StatusManager/src/main.cpp | 6 ++ plugins/StatusManager/src/options.cpp | 3 +- plugins/StatusManager/src/ss_options.cpp | 5 +- plugins/StatusManager/src/ss_profiles.cpp | 2 +- plugins/StatusManager/src/startupstatus.cpp | 6 +- plugins/StatusManager/src/stdafx.h | 8 +- plugins/StopSpamMod/src/init.cpp | 2 +- plugins/StopSpamMod/src/options.cpp | 2 +- plugins/StopSpamPlus/src/options.cpp | 2 +- plugins/StopSpamPlus/src/stopspam.cpp | 2 +- plugins/TabSRMM/src/buttonsbar.cpp | 40 +++++----- plugins/TabSRMM/src/chat_main.cpp | 2 +- plugins/TabSRMM/src/chat_options.cpp | 4 +- plugins/TabSRMM/src/generic_msghandlers.cpp | 6 +- plugins/TabSRMM/src/globals.cpp | 4 +- plugins/TabSRMM/src/modplus.cpp | 2 +- plugins/TabSRMM/src/msgoptions.cpp | 1 - plugins/TabSRMM/src/typingnotify.cpp | 5 +- plugins/TipperYM/src/options.cpp | 3 +- plugins/Toaster/src/options.cpp | 2 +- plugins/TooltipNotify/src/TooltipNotify.cpp | 3 +- plugins/TopToolBar/src/stdafx.h | 2 +- plugins/TopToolBar/src/toolbar.cpp | 8 +- plugins/TopToolBar/src/topbutton.cpp | 2 +- plugins/TopToolBar/src/ttbopt.cpp | 3 +- plugins/TrafficCounter/src/TrafficCounter.cpp | 2 +- plugins/TrafficCounter/src/options.cpp | 3 +- plugins/TranslitSwitcher/src/TranslitSwitcher.cpp | 6 +- plugins/UserGuide/src/main.cpp | 2 +- plugins/UserInfoEx/src/Flags/svc_flags.cpp | 2 +- plugins/UserInfoEx/src/classPsTree.cpp | 3 +- plugins/UserInfoEx/src/classPsTreeItem.cpp | 6 +- plugins/UserInfoEx/src/dlg_propsheet.cpp | 3 +- plugins/UserInfoEx/src/mir_menuitems.cpp | 10 +-- plugins/UserInfoEx/src/psp_options.cpp | 3 +- plugins/UserInfoEx/src/svc_email.cpp | 2 +- plugins/UserInfoEx/src/svc_homepage.cpp | 2 +- plugins/Variables/src/options.cpp | 3 +- plugins/Watrack/i_opt_dlg.inc | 1 - plugins/Watrack/kolframe/kolframe.pas | 2 +- plugins/Watrack/popup/popups.pas | 1 - plugins/Watrack/version.RES | Bin 0 -> 312 bytes plugins/Watrack_MPD/src/options.cpp | 2 +- plugins/Weather/src/weather_opt.cpp | 4 +- plugins/Weather/src/weather_svcs.cpp | 2 +- plugins/Weather/src/weather_userinfo.cpp | 3 +- plugins/WebView/src/main.cpp | 2 +- plugins/WebView/src/webview.cpp | 3 +- plugins/WhenWasIt/src/WhenWasIt.cpp | 2 +- plugins/WhenWasIt/src/hooked_events.cpp | 3 +- plugins/WhoUsesMyFiles/src/options.cpp | 3 +- plugins/WhoUsesMyFiles/src/wumfplug.cpp | 2 +- plugins/WinterSpeak/src/main.cpp | 3 +- plugins/XSoundNotify/src/options.cpp | 3 +- plugins/XSoundNotify/src/xsn_main.cpp | 2 +- plugins/YAMN/src/main.cpp | 2 +- plugins/YAMN/src/proto/pop3/pop3opt.cpp | 3 +- plugins/YAPP/src/notify_imp.cpp | 3 +- plugins/YAPP/src/options.cpp | 3 +- plugins/YAPP/src/yapp.cpp | 2 +- plugins/YARelay/src/options.cpp | 3 +- plugins/ZeroNotification/src/main.cpp | 2 +- plugins/ZeroNotification/src/options.cpp | 3 +- plugins/mRadio/i_optdlg.inc | 1 - plugins/mRadio/rframeapi.pas | 2 +- plugins/mRadio/version.RES | Bin 0 -> 312 bytes plugins/wbOSD/src/options.cpp | 3 +- 280 files changed, 521 insertions(+), 672 deletions(-) create mode 100644 plugins/Actman/version.RES create mode 100644 plugins/HistoryPlusPlus/historypp.dproj.local create mode 100644 plugins/HistoryPlusPlus/historypp.identcache create mode 100644 plugins/ImportTXT/version.RES create mode 100644 plugins/QuickSearch/version.RES create mode 100644 plugins/Watrack/version.RES create mode 100644 plugins/mRadio/version.RES (limited to 'plugins') diff --git a/plugins/AVS/src/options.cpp b/plugins/AVS/src/options.cpp index 7b5998bf13..ac7f841cf1 100644 --- a/plugins/AVS/src/options.cpp +++ b/plugins/AVS/src/options.cpp @@ -706,8 +706,7 @@ INT_PTR CALLBACK DlgProcAvatarOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPA int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.szGroup.a = LPGEN("Contacts"); odp.szTitle.a = LPGEN("Avatars"); @@ -1098,8 +1097,7 @@ static INT_PTR CALLBACK DlgProcAvatarProtoInfo(HWND hwndDlg, UINT msg, WPARAM wP int OnDetailsInit(WPARAM wParam, LPARAM lParam) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.a = LPGEN("Avatar"); MCONTACT hContact = lParam; diff --git a/plugins/Actman/i_opt_dlg.inc b/plugins/Actman/i_opt_dlg.inc index 8ec24e42ac..878f127427 100644 --- a/plugins/Actman/i_opt_dlg.inc +++ b/plugins/Actman/i_opt_dlg.inc @@ -26,7 +26,6 @@ begin FillChar(odp,SizeOf(odp),0); odp.flags :=ODPF_BOLDGROUPS; odp.Position :=900003000; - odp.hInstance :=hInstance; odp.szGroup.a :='Services'; odp.szTitle.a :='Actions'; odp.szTab.a :='Actions'; diff --git a/plugins/Actman/version.RES b/plugins/Actman/version.RES new file mode 100644 index 0000000000..aa7c19667f Binary files /dev/null and b/plugins/Actman/version.RES differ diff --git a/plugins/AddContactPlus/src/main.cpp b/plugins/AddContactPlus/src/main.cpp index 00ab8d1e4d..0dae1e0946 100644 --- a/plugins/AddContactPlus/src/main.cpp +++ b/plugins/AddContactPlus/src/main.cpp @@ -80,7 +80,7 @@ static int OnAccListChanged(WPARAM, LPARAM) if (hMainMenuItem) return 0; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xb19db907, 0x870e, 0x49fa, 0xa7, 0x1e, 0x43, 0x5e, 0xa8, 0xe5, 0x9b, 0xbd); mi.position = 500020001; mi.flags = CMIF_UNICODE; diff --git a/plugins/Alarms/src/frame.cpp b/plugins/Alarms/src/frame.cpp index 87a1f7bd7a..744892450d 100755 --- a/plugins/Alarms/src/frame.cpp +++ b/plugins/Alarms/src/frame.cpp @@ -521,7 +521,7 @@ int CreateFrame() // create menu item CreateServiceFunction(MODULENAME "/ShowHideReminders", ShowHideMenuFunc); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Alarms"), 0); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8A3C1906-4809-4EE8-A32A-858003A2AAA7"); diff --git a/plugins/Alarms/src/options.cpp b/plugins/Alarms/src/options.cpp index 3b9027af7a..5b57bb9c4c 100755 --- a/plugins/Alarms/src/options.cpp +++ b/plugins/Alarms/src/options.cpp @@ -811,7 +811,7 @@ void AddMenuItem() { if (hMainMenuItem) return; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); if (!ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) { mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Alarms"), mi.position); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "24F03563-01BE-4118-8297-E94375A783E7"); @@ -1210,9 +1210,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT1); odp.szTitle.a = LPGEN("Alarms"); odp.szGroup.a = LPGEN("Events"); diff --git a/plugins/AsSingleWindow/src/Options.cpp b/plugins/AsSingleWindow/src/Options.cpp index 3e0567fb3e..8e7659e79c 100644 --- a/plugins/AsSingleWindow/src/Options.cpp +++ b/plugins/AsSingleWindow/src/Options.cpp @@ -3,17 +3,12 @@ int InitOptions(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE Opts = { 0 }; - Opts.szTitle.a = LPGEN("AsSingleWindow"); Opts.szGroup.a = LPGEN("Customize"); - Opts.pfnDlgProc = cbOptionsDialog; Opts.pszTemplate = MAKEINTRESOURCEA(IDD_ASW_OPTIONSPAGE); - Opts.hInstance = g_plugin.getInst(); Opts.flags = ODPF_BOLDGROUPS; - g_plugin.addOptions(wParam, &Opts); - return 0; } diff --git a/plugins/AssocMgr/src/assoclist.cpp b/plugins/AssocMgr/src/assoclist.cpp index f3b2a8ab05..a55e200092 100644 --- a/plugins/AssocMgr/src/assoclist.cpp +++ b/plugins/AssocMgr/src/assoclist.cpp @@ -912,8 +912,7 @@ static INT_PTR CALLBACK AssocListOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wPara static int AssocListOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ASSOCLIST); odp.position = 900000100; // network opts = 900000000 odp.szGroup.a = LPGEN("Services"); // autotranslated diff --git a/plugins/AuthState/src/main.cpp b/plugins/AuthState/src/main.cpp index dfec97add4..e4da8decb0 100644 --- a/plugins/AuthState/src/main.cpp +++ b/plugins/AuthState/src/main.cpp @@ -170,7 +170,7 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_ADDED, onDBContactAdded); CreateServiceFunction("AuthState/MenuItem", onAuthMenuSelected); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xc5a784ea, 0x8b07, 0x4b95, 0xa2, 0xb2, 0x84, 0x9d, 0x87, 0x43, 0x7e, 0xda); mi.position = -1999901005; mi.flags = CMIF_UNICODE; diff --git a/plugins/AuthState/src/options.cpp b/plugins/AuthState/src/options.cpp index 750cbe670c..d7f8b70cac 100644 --- a/plugins/AuthState/src/options.cpp +++ b/plugins/AuthState/src/options.cpp @@ -21,7 +21,7 @@ int onOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Icons"); odp.szTitle.a = LPGEN("Auth state"); odp.flags = ODPF_BOLDGROUPS; diff --git a/plugins/AutoRun/src/main.cpp b/plugins/AutoRun/src/main.cpp index 98accc4b3f..f1badb4082 100644 --- a/plugins/AutoRun/src/main.cpp +++ b/plugins/AutoRun/src/main.cpp @@ -102,9 +102,8 @@ static INT_PTR CALLBACK DlgProcAutorunOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA static int AutorunOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100100000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTORUN); odp.szTitle.a = MODULENAME; odp.szGroup.a = LPGEN("Services"); diff --git a/plugins/AutoShutdown/src/options.cpp b/plugins/AutoShutdown/src/options.cpp index cf06e45ce7..e882eb49d3 100644 --- a/plugins/AutoShutdown/src/options.cpp +++ b/plugins/AutoShutdown/src/options.cpp @@ -105,8 +105,7 @@ static INT_PTR CALLBACK ShutdownOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam static int ShutdownOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SHUTDOWN); odp.position = 900000002; odp.szGroup.w = LPGENW("Events"); /* autotranslated */ diff --git a/plugins/AutoShutdown/src/settingsdlg.cpp b/plugins/AutoShutdown/src/settingsdlg.cpp index f209b13bad..3e59a08882 100644 --- a/plugins/AutoShutdown/src/settingsdlg.cpp +++ b/plugins/AutoShutdown/src/settingsdlg.cpp @@ -433,7 +433,7 @@ static HGENMENU hMainMenuItem, hTrayMenuItem; void SetShutdownMenuItem(bool fActive) { /* main menu */ - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x61e2a38f, 0xcd94, 0x4f72, 0x84, 0x8c, 0x72, 0x92, 0xde, 0x1d, 0x6d, 0x5); mi.position = 2001090000; if (fActive) { diff --git a/plugins/AvatarHistory/src/AvatarDlg.cpp b/plugins/AvatarHistory/src/AvatarDlg.cpp index d48c571f4d..01b4e143a2 100644 --- a/plugins/AvatarHistory/src/AvatarDlg.cpp +++ b/plugins/AvatarHistory/src/AvatarDlg.cpp @@ -494,7 +494,7 @@ void InitMenuItem() { CreateServiceFunction(MS_AVATARHISTORY_SHOWDIALOG, ShowDialogSvc); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x2fb5c7eb, 0xa606, 0x4145, 0x9e, 0x86, 0x73, 0x88, 0x73, 0x1d, 0xe7, 0x5c); mi.name.w = LPGENW("View avatar history"); mi.flags = CMIF_UNICODE; diff --git a/plugins/AvatarHistory/src/options.cpp b/plugins/AvatarHistory/src/options.cpp index 08b6af4239..3ea17f3fff 100644 --- a/plugins/AvatarHistory/src/options.cpp +++ b/plugins/AvatarHistory/src/options.cpp @@ -146,8 +146,7 @@ static INT_PTR CALLBACK PopupsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPA int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("History"); // group to put your item under odp.szTitle.w = LPGENW("Avatar"); // name of the item odp.pfnDlgProc = OptionsDlgProc; diff --git a/plugins/BASS_interface/src/Bass.h b/plugins/BASS_interface/src/Bass.h index 4045f02a33..0fd5b255d5 100644 --- a/plugins/BASS_interface/src/Bass.h +++ b/plugins/BASS_interface/src/Bass.h @@ -47,15 +47,15 @@ extern "C" { #define NOBASSOVERLOADS #endif -typedef DWORD HMUSIC; // MOD music handle -typedef DWORD HSAMPLE; // sample handle -typedef DWORD HCHANNEL; // playing sample's channel handle -typedef DWORD HSTREAM; // sample stream handle -typedef DWORD HRECORD; // recording handle -typedef DWORD HSYNC; // synchronizer handle -typedef DWORD HDSP; // DSP handle -typedef DWORD HFX; // DX8 effect handle -typedef DWORD HPLUGIN; // Plugin handle +typedef DWORD HMUSIC; // MOD music handle +typedef DWORD HSAMPLE; // sample handle +typedef DWORD HCHANNEL; // playing sample's channel handle +typedef DWORD HSTREAM; // sample stream handle +typedef DWORD HRECORD; // recording handle +typedef DWORD HSYNC; // synchronizer handle +typedef DWORD HDSP; // DSP handle +typedef DWORD HFX; // DX8 effect handle +typedef DWORD HSUBPLUGIN; // Plugin handle // Error codes returned by BASS_ErrorGetCode #define BASS_OK 0 // all is OK @@ -361,7 +361,7 @@ typedef struct { DWORD flags; // BASS_SAMPLE/STREAM/MUSIC/SPEAKER flags DWORD ctype; // type of channel DWORD origres; // original resolution - HPLUGIN plugin; // plugin + HSUBPLUGIN plugin; // plugin HSAMPLE sample; // sample const char *filename; // filename } BASS_CHANNELINFO; @@ -1009,9 +1009,9 @@ BOOL BASSDEF(BASS_Pause)(); BOOL BASSDEF(BASS_SetVolume)(float volume); float BASSDEF(BASS_GetVolume)(); -HPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags); -BOOL BASSDEF(BASS_PluginFree)(HPLUGIN handle); -const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HPLUGIN handle); +HSUBPLUGIN BASSDEF(BASS_PluginLoad)(const char *file, DWORD flags); +BOOL BASSDEF(BASS_PluginFree)(HSUBPLUGIN handle); +const BASS_PLUGININFO *BASSDEF(BASS_PluginGetInfo)(HSUBPLUGIN handle); BOOL BASSDEF(BASS_Set3DFactors)(float distf, float rollf, float doppf); BOOL BASSDEF(BASS_Get3DFactors)(float *distf, float *rollf, float *doppf); @@ -1104,7 +1104,7 @@ BOOL BASSDEF(BASS_FXSetPriority)(HFX handle, int priority); } #if defined(_WIN32) && !defined(NOBASSOVERLOADS) -static inline HPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) +static inline HSUBPLUGIN BASS_PluginLoad(const WCHAR *file, DWORD flags) { return BASS_PluginLoad((const char*)file, flags|BASS_UNICODE); } diff --git a/plugins/BASS_interface/src/Main.cpp b/plugins/BASS_interface/src/Main.cpp index fa367f8420..9a16069332 100644 --- a/plugins/BASS_interface/src/Main.cpp +++ b/plugins/BASS_interface/src/Main.cpp @@ -308,8 +308,7 @@ INT_PTR CALLBACK OptionsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara int OptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = MODULENAME; odp.pfnDlgProc = OptionsProc; diff --git a/plugins/BasicHistory/src/BasicHistory.cpp b/plugins/BasicHistory/src/BasicHistory.cpp index 5bac74c444..a371fcdfa0 100644 --- a/plugins/BasicHistory/src/BasicHistory.cpp +++ b/plugins/BasicHistory/src/BasicHistory.cpp @@ -89,7 +89,7 @@ int ToolbarModuleLoaded(WPARAM, LPARAM) void InitMenuItems() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x28848d7a, 0x6995, 0x4799, 0x82, 0xd7, 0x18, 0x40, 0x3d, 0xe3, 0x71, 0xc4); mi.position = 1000090000; @@ -116,7 +116,7 @@ void InitTaskMenuItems() { if (Options::instance->taskOptions.size() > 0) { if (hTaskMainMenu == nullptr) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xbf66499, 0x1b39, 0x47a2, 0x9b, 0x74, 0xa6, 0xae, 0x89, 0x95, 0x59, 0x59); mi.position = 500060005; mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_HISTORY); @@ -134,7 +134,7 @@ void InitTaskMenuItems() int pos = (int)taskMenus.size(); for (; taskIt != Options::instance->taskOptions.end(); ++taskIt) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE | CMIF_KEEPUNTRANSLATED; mi.pszService = MS_HISTORY_EXECUTE_TASK; mi.root = hTaskMainMenu; diff --git a/plugins/BasicHistory/src/Options.cpp b/plugins/BasicHistory/src/Options.cpp index 907d13bd35..7981210cc9 100644 --- a/plugins/BasicHistory/src/Options.cpp +++ b/plugins/BasicHistory/src/Options.cpp @@ -117,9 +117,8 @@ Options::~Options() int Options::InitOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szTitle.w = LPGENW("History"); diff --git a/plugins/Boltun/src/boltun.cpp b/plugins/Boltun/src/boltun.cpp index e42a29f07f..54aa5a2287 100644 --- a/plugins/Boltun/src/boltun.cpp +++ b/plugins/Boltun/src/boltun.cpp @@ -432,9 +432,8 @@ static INT_PTR CALLBACK EngineDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP static int MessageOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 910000000; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = BOLTUN_GROUP; odp.szTitle.a = BOLTUN_NAME; odp.pfnDlgProc = MainDlgProc; @@ -527,7 +526,7 @@ int CMPlugin::Load() CreateServiceFunction(SERV_CONTACT_NOT_TO_CHAT, ContactClickNotToChat); CreateServiceFunction(SERV_CONTACT_START_CHATTING, ContactClickStartChatting); { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xea31f628, 0x1445, 0x4b62, 0x98, 0x19, 0xce, 0x15, 0x81, 0x49, 0xa, 0xbd); mi.position = -50010002; //TODO: check the warning diff --git a/plugins/BossKeyPlus/src/BossKey.cpp b/plugins/BossKeyPlus/src/BossKey.cpp index 01b2d15ea0..187e9f1083 100644 --- a/plugins/BossKeyPlus/src/BossKey.cpp +++ b/plugins/BossKeyPlus/src/BossKey.cpp @@ -523,7 +523,7 @@ static int GenMenuInit(WPARAM, LPARAM) // Modify menu item text before to show t void BossKeyMenuItemInit(void) // Add menu item { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x42428114, 0xfac7, 0x44c2, 0x9a, 0x11, 0x18, 0xbe, 0x81, 0xd4, 0xa9, 0xe3); mi.flags = CMIF_UNICODE; mi.position = 2000100000; @@ -583,7 +583,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM) bbd.pwszTooltip = LPGENW("Hide Miranda NG"); bbd.bbbFlags = BBBF_ISRSIDEBUTTON | BBBF_CANBEHIDDEN; bbd.hIcon = iconList[0].hIcolib; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/BossKeyPlus/src/Options.cpp b/plugins/BossKeyPlus/src/Options.cpp index 14c24b4eed..e3133c55c6 100644 --- a/plugins/BossKeyPlus/src/Options.cpp +++ b/plugins/BossKeyPlus/src/Options.cpp @@ -318,7 +318,6 @@ int OptsDlgInit(WPARAM wParam, LPARAM) optDi.position = 920000000; optDi.pfnDlgProc = MainOptDlg; optDi.pszTemplate = MAKEINTRESOURCEA(IDD_OPTDIALOGMAIN); - optDi.hInstance = g_plugin.getInst(); optDi.szTitle.a = LPGEN("BossKey"); optDi.szGroup.a = LPGEN("Events"); optDi.szTab.a = LPGEN("Main"); diff --git a/plugins/BuddyExpectator/src/BuddyExpectator.cpp b/plugins/BuddyExpectator/src/BuddyExpectator.cpp index 5401ff0e96..1e419f8915 100644 --- a/plugins/BuddyExpectator/src/BuddyExpectator.cpp +++ b/plugins/BuddyExpectator/src/BuddyExpectator.cpp @@ -605,7 +605,7 @@ int ModulesLoaded(WPARAM, LPARAM) if (options.enableMissYou) { HookEvent(ME_CLIST_PREBUILDCONTACTMENU, onPrebuildContactMenu); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xc48c31d4, 0x56b6, 0x48c6, 0x8e, 0xe9, 0xe6, 0x57, 0xb5, 0x80, 0xb8, 0x1e); mi.flags = CMIF_UNICODE; mi.hIcolibItem = iconList[2].hIcolib; diff --git a/plugins/BuddyExpectator/src/options.cpp b/plugins/BuddyExpectator/src/options.cpp index 327f40a910..536b6100e7 100644 --- a/plugins/BuddyExpectator/src/options.cpp +++ b/plugins/BuddyExpectator/src/options.cpp @@ -431,8 +431,7 @@ static INT_PTR CALLBACK PopupOptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wP */ static int OptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("Contacts"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPANEL); odp.szTitle.w = LPGENW("Buddy Expectator"); @@ -529,7 +528,6 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam) { if (lparam > 0) { OPTIONSDIALOGPAGE uip = { sizeof(uip) }; - uip.hInstance = g_plugin.getInst(); uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO); uip.szTitle.a = LPGEN("Buddy Expectator"); uip.pfnDlgProc = UserinfoDlgProc; diff --git a/plugins/BuddyPounce/src/main.cpp b/plugins/BuddyPounce/src/main.cpp index 6137208c63..41853700b2 100644 --- a/plugins/BuddyPounce/src/main.cpp +++ b/plugins/BuddyPounce/src/main.cpp @@ -27,7 +27,7 @@ CMPlugin::CMPlugin() : int MainInit(WPARAM, LPARAM) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x719c1596, 0xb0fd, 0x4c74, 0xb7, 0xe4, 0xeb, 0x22, 0xf4, 0x99, 0xd7, 0x68); mi.position = 10; mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_POUNCE)); @@ -76,9 +76,8 @@ int MsgAck(WPARAM, LPARAM lParam) int BuddyPounceOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szGroup.w = LPGENW("Message sessions"); odp.szTitle.w = LPGENW("Buddy Pounce"); diff --git a/plugins/CSList/src/cslist.cpp b/plugins/CSList/src/cslist.cpp index d469929aea..9ca2277552 100644 --- a/plugins/CSList/src/cslist.cpp +++ b/plugins/CSList/src/cslist.cpp @@ -68,9 +68,8 @@ static int OnDbChanged(WPARAM hContact, LPARAM lparam) static int OnInitOptions(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 955000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = CSOptionsProc; odp.szGroup.w = L"Status"; @@ -210,7 +209,7 @@ void addProtoStatusMenuItem(char *protoName) if (!ServiceExists(buf)) CreateServiceFunctionParam(buf, showList, (LPARAM)protoName); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; mi.hIcolibItem = forms[0].hIcoLibItem; mi.name.w = MODULENAME; diff --git a/plugins/ChangeKeyboardLayout/src/hook_events.cpp b/plugins/ChangeKeyboardLayout/src/hook_events.cpp index 30e14780fd..79cad93fdc 100644 --- a/plugins/ChangeKeyboardLayout/src/hook_events.cpp +++ b/plugins/ChangeKeyboardLayout/src/hook_events.cpp @@ -140,8 +140,7 @@ int ModulesLoaded(WPARAM, LPARAM) int OnOptionsInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_MAIN_OPTION_FORM); odp.szTitle.a = MODULENAME; odp.szGroup.a = LPGEN("Message sessions"); diff --git a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp index 99b8dfc2c1..b6a2b82c2b 100644 --- a/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp +++ b/plugins/ClientChangeNotify/src/ClientChangeNotify.cpp @@ -324,7 +324,7 @@ static int MirandaLoaded(WPARAM, LPARAM) CreateServiceFunction(MS_CCN_TOGGLEPOPUPS, srvTogglePopups); HookEvent(ME_CLIST_PREBUILDMAINMENU, PrebuildMainMenu); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xfabb9181, 0xdb92, 0x43f4, 0x86, 0x40, 0xca, 0xb6, 0x4c, 0x93, 0x34, 0x27); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0); mi.flags = CMIF_UNICODE; diff --git a/plugins/ClientChangeNotify/src/OptDlg.cpp b/plugins/ClientChangeNotify/src/OptDlg.cpp index 0ec1557d1c..c806b5f56f 100644 --- a/plugins/ClientChangeNotify/src/OptDlg.cpp +++ b/plugins/ClientChangeNotify/src/OptDlg.cpp @@ -167,7 +167,6 @@ int OptionsDlgInit(WPARAM wParam, LPARAM) optDi.szTitle.a = LPGEN("ClientChangeNotify"); optDi.pfnDlgProc = PopupOptDlg; optDi.pszTemplate = MAKEINTRESOURCEA(IDD_POPUPOPTDLG); - optDi.hInstance = g_plugin.getInst(); optDi.flags = ODPF_BOLDGROUPS; g_plugin.addOptions(wParam, &optDi); } diff --git a/plugins/Clist_blind/src/clcopts.cpp b/plugins/Clist_blind/src/clcopts.cpp index d06c5d8d93..8122c07614 100644 --- a/plugins/Clist_blind/src/clcopts.cpp +++ b/plugins/Clist_blind/src/clcopts.cpp @@ -254,8 +254,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam int ClcOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Contact list"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC); odp.szTitle.a = LPGEN("List"); diff --git a/plugins/Clist_blind/src/clistopts.cpp b/plugins/Clist_blind/src/clistopts.cpp index eb0c7fb5e6..f0eb05dd78 100644 --- a/plugins/Clist_blind/src/clistopts.cpp +++ b/plugins/Clist_blind/src/clistopts.cpp @@ -180,9 +180,8 @@ static UINT expertOnlyControls[] = { IDC_ALWAYSSTATUS }; int CListOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -1000000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST); odp.szTitle.a = LPGEN("Contact list"); odp.pfnDlgProc = DlgProcGenOpts; diff --git a/plugins/Clist_blind/src/cluiopts.cpp b/plugins/Clist_blind/src/cluiopts.cpp index 56c397973e..1acb1998b0 100644 --- a/plugins/Clist_blind/src/cluiopts.cpp +++ b/plugins/Clist_blind/src/cluiopts.cpp @@ -307,8 +307,7 @@ static UINT expertOnlyControls[] = int CluiOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI); odp.szTitle.a = LPGEN("Window"); odp.szGroup.a = LPGEN("Contact list"); diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index 6d85477399..c29b26e41e 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -735,7 +735,7 @@ static int CLUIFramesGetalClientFrame(void) static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, FRAMEWND &F, int frameid, bool bMain) { - pmi->langId = F.hLang; + pmi->pPlugin = F.pPlugin; HGENMENU res = (bMain) ? Menu_AddMainMenuItem(pmi) : Menu_AddContextFrameMenuItem(pmi); if (pmi->pszService != nullptr) Menu_ConfigureItem(res, MCI_OPT_EXECPARAM, frameid); @@ -751,7 +751,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp auto &F = g_pfwFrames[framepos]; FrameMenuHandles &fmh = (frameid == -1) ? cont : F.MenuHandles; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = root; mi.position = popuppos++; mi.name.a = LPGEN("&Visible"); @@ -1041,7 +1041,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) fw.TitleBar.tbname = mir_a2u((char*)lParam); if (fw.floating && (fw.TitleBar.tbname != nullptr)) - SetWindowText(fw.ContainerWnd, TranslateW_LP(fw.TitleBar.tbname, fw.hLang)); + SetWindowText(fw.ContainerWnd, TranslateW_LP(fw.TitleBar.tbname, fw.pPlugin)); return 0; case FO_TBTIPNAME: @@ -1473,7 +1473,7 @@ static int CLUIFramesLoadMainMenu() g_frameMenus.destroy(); // create frames menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = cont.MainMenuItem; int separator = 3000200000; for (int i = 0; i < g_nFramesCount; i++) { @@ -1525,7 +1525,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam) F.hWnd = clfrm->hWnd; F.height = clfrm->height; F.TitleBar.hicon = clfrm->hIcon; - F.hLang = (int)lParam; + F.pPlugin = (HPLUGIN)lParam; F.floating = FALSE; if (clfrm->Flags & F_NO_SUBCONTAINER || !g_CluiData.fLayered) F.OwnerWindow = (HWND)-2; @@ -1560,7 +1560,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM lParam) //Frames[nFramescount].OwnerWindow = 0; - F.TitleBar.hwnd = CreateWindow(CLUIFrameTitleBarClassName, TranslateW_LP(F.name, F.hLang), + F.TitleBar.hwnd = CreateWindow(CLUIFrameTitleBarClassName, TranslateW_LP(F.name, F.pPlugin), (db_get_b(0, CLUIFrameModule, "RemoveAllTitleBarBorders", 1) ? 0 : WS_BORDER) | WS_CHILD | WS_CLIPCHILDREN | (F.TitleBar.ShowTitleBar ? WS_VISIBLE : 0) | @@ -2492,7 +2492,7 @@ int DrawTitleBar(HDC hdcMem2, RECT *rect, int Frameid) textrc.top += 2; } - wchar_t *wszTitle = TranslateW_LP(F.TitleBar.tbname, F.hLang); + wchar_t *wszTitle = TranslateW_LP(F.TitleBar.tbname, F.pPlugin); ske_TextOut(hdcMem, textrc.left, textrc.top, wszTitle, (int)mir_wstrlen(wszTitle)); if (!AlignCOLLIconToLeft) @@ -3315,7 +3315,7 @@ int LoadCLUIFramesModule(void) InitGroupMenus(); { // create root menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x3931AC4, 0x7A32, 0x4D9C, 0x99, 0x92, 0x94, 0xD4, 0xB5, 0x9B, 0xD6, 0xB6); mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME); mi.position = 3000090000; diff --git a/plugins/Clist_modern/src/cluiframes.h b/plugins/Clist_modern/src/cluiframes.h index a7a24d3a81..c17510f0a6 100644 --- a/plugins/Clist_modern/src/cluiframes.h +++ b/plugins/Clist_modern/src/cluiframes.h @@ -117,7 +117,7 @@ struct FRAMEWND POINT FloatingPos; POINT FloatingSize; int order; - int hLang; + HPLUGIN pPlugin; DockOpt dockOpt; HWND OwnerWindow; tPaintCallbackProc PaintCallbackProc; diff --git a/plugins/Clist_modern/src/groupmenu.cpp b/plugins/Clist_modern/src/groupmenu.cpp index 431bc8ace8..193fc9e445 100644 --- a/plugins/Clist_modern/src/groupmenu.cpp +++ b/plugins/Clist_modern/src/groupmenu.cpp @@ -56,7 +56,7 @@ void InitGroupMenus(void) InitSubGroupMenus(); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xe386678a, 0x5aee, 0x4bfa, 0xa8, 0x23, 0xd, 0xa0, 0x11, 0x99, 0xb1, 0x98); mi.position = 500; @@ -132,7 +132,7 @@ void InitSubGroupMenus(void) // add exit command to menu GroupMenuParam gmp = { POPUP_GROUPSHOWOFFLINE, 0 }; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x7E081A28, 0x19B3, 0x407F, 0x80, 0x6B, 0x70, 0xC3, 0xC3, 0xA9, 0xD2, 0xA4); mi.position = 1002; mi.pszService = "CLISTMENUSSubGroup/GroupMenuExecProxy"; diff --git a/plugins/Clist_modern/src/modern_clcopts.cpp b/plugins/Clist_modern/src/modern_clcopts.cpp index 5927682020..8f8ac960f5 100644 --- a/plugins/Clist_modern/src/modern_clcopts.cpp +++ b/plugins/Clist_modern/src/modern_clcopts.cpp @@ -1518,8 +1518,7 @@ static clist_opt_items[] = int ClcOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC); odp.szTitle.a = LPGEN("Contact list"); odp.pfnDlgProc = DlgProcClistListOpts; diff --git a/plugins/Clist_modern/src/modern_clistmenus.cpp b/plugins/Clist_modern/src/modern_clistmenus.cpp index 923242e93f..95eec95d18 100644 --- a/plugins/Clist_modern/src/modern_clistmenus.cpp +++ b/plugins/Clist_modern/src/modern_clistmenus.cpp @@ -93,7 +93,7 @@ INT_PTR FAV_ToggleShowOffline(WPARAM hContact, LPARAM) void LoadFavoriteContactMenu() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xf99a2320, 0xc024, 0x48bd, 0x81, 0xf7, 0x9f, 0xa2, 0x5, 0xb0, 0x7f, 0xdc); mi.name.w = FAVMENUROOTNAME; mi.flags = CMIF_UNICODE; diff --git a/plugins/Clist_modern/src/modern_clistopts.cpp b/plugins/Clist_modern/src/modern_clistopts.cpp index 4481781157..da055263f7 100644 --- a/plugins/Clist_modern/src/modern_clistopts.cpp +++ b/plugins/Clist_modern/src/modern_clistopts.cpp @@ -929,9 +929,8 @@ static row_opt_items[] = int CListOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -200000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_ITEMS); odp.szGroup.a = LPGEN("Contact list"); odp.szTitle.a = LPGEN("Row items"); diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index 181d59c2e1..5abbec1ca8 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -325,7 +325,7 @@ HRESULT CLUI::RegisterAvatarMenu() { g_plugin.registerIcon(LPGEN("Contact list"), iconItem); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x1cc99858, 0x40ca, 0x4558, 0xae, 0x10, 0xba, 0x81, 0xaf, 0x4c, 0x67, 0xb5); CreateServiceFunction("CList/ShowContactAvatar", CLUI::Service_Menu_ShowContactAvatar); mi.position = 2000150000; diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index bfd20fc48b..e474281160 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -48,9 +48,8 @@ int SkinOptInit(WPARAM wParam, LPARAM) { if (!g_CluiData.fDisableSkinEngine) { //Tabbed settings - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -200000000; - odp.hInstance = g_plugin.getInst(); odp.pfnDlgProc = DlgSkinOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SKIN); odp.szGroup.w = LPGENW("Skins"); diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 2268822a7c..87bba912aa 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -513,12 +513,10 @@ static INT_PTR CALLBACK DlgProcIcons(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPar int ClcOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); - //////////////////////////////////////////////////////////////////////////// // Main options tabs + OPTIONSDIALOGPAGE odp = {}; odp.position = -1000000000; odp.flags = ODPF_BOLDGROUPS; odp.szTitle.a = LPGEN("Contact list"); diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index a5fd27c1fe..3aba1439c4 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -360,7 +360,7 @@ int InitCustomMenus(void) CreateServiceFunction("CloseAction", CloseAction); CreateServiceFunction("CList/SetContactIgnore", SetContactIgnore); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xe3b08c6f, 0x8a01, 0x4c94, 0xb3, 0xf5, 0x9d, 0x38, 0x6, 0x63, 0x7a, 0xa9); mi.position = 200000; mi.pszService = "CList/SetContactIgnore"; diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 502d2e8a06..32609d0055 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -553,7 +553,7 @@ int CLUIFramesGetalClientFrame(void) static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, int frameid, bool bMain) { - pmi->langId = g_plugin.m_hLang; + pmi->pPlugin = &g_plugin; HGENMENU res = (bMain) ? Menu_AddMainMenuItem(pmi) : Menu_AddContextFrameMenuItem(pmi); if (pmi->pszService != nullptr) Menu_ConfigureItem(res, MCI_OPT_EXECPARAM, frameid); @@ -568,7 +568,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, boo int framepos = id2pos(frameid); FrameMenuHandles &fmh = (frameid == -1) ? cont : Frames[framepos].MenuHandles; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA); mi.root = root; mi.position = popuppos++; @@ -1323,7 +1323,7 @@ static int CLUIFramesLoadMainMenu() g_frameMenus.destroy(); // create frames menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = cont.MainMenuItem; mi.flags = CMIF_UNICODE | CMIF_SYSTEM; int separator = (int)3000200000; @@ -2937,7 +2937,7 @@ int LoadCLUIFramesModule(void) RegisterClass(&cntclass); // create root menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x3931AC4, 0x7A32, 0x4D9C, 0x99, 0x92, 0x94, 0xD4, 0xB5, 0x9B, 0xD6, 0xB6); mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME); mi.position = 3000090000; diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp index 0d9a351a49..6f5cb4aa83 100644 --- a/plugins/Clist_nicer/src/groupmenu.cpp +++ b/plugins/Clist_nicer/src/groupmenu.cpp @@ -95,7 +95,7 @@ void InitGroupMenus(void) HookEvent(ME_CLIST_PREBUILDGROUPMENU, OnBuildGroupMenu); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xe386678a, 0x5aee, 0x4bfa, 0xa8, 0x23, 0xd, 0xa0, 0x11, 0x99, 0xb1, 0x98); mi.position = 500; mi.pszService = MS_CLIST_SHOWHIDE; diff --git a/plugins/CloudFile/src/Services/dropbox_service.cpp b/plugins/CloudFile/src/Services/dropbox_service.cpp index bb67ff24fe..9634eba955 100644 --- a/plugins/CloudFile/src/Services/dropbox_service.cpp +++ b/plugins/CloudFile/src/Services/dropbox_service.cpp @@ -1,8 +1,22 @@ #include "..\stdafx.h" #include "dropbox_api.h" -CDropboxService::CDropboxService(const char *protoName, const wchar_t *userName) - : CCloudService(protoName, userName) +struct CMPluginDropbox : public PLUGIN +{ + CMPluginDropbox() : + PLUGIN(MODULENAME "/Dropbox", pluginInfoEx) + { + m_hInst = g_plugin.getInst(); + + RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CDropboxService::Init, (pfnUninitProto)CDropboxService::UnInit); + } +} +g_pluginDropbox; + +///////////////////////////////////////////////////////////////////////////////////////// + +CDropboxService::CDropboxService(const char *protoName, const wchar_t *userName) : + CCloudService(protoName, userName, &g_pluginDropbox) { m_hProtoIcon = GetIconHandle(IDI_DROPBOX); } @@ -286,17 +300,3 @@ void CDropboxService::Upload(FileTransferParam *ftp) } } while (ftp->NextFile()); } - -///////////////////////////////////////////////////////////////////////////////////////// - -struct CMPluginDropbox : public PLUGIN -{ - CMPluginDropbox() : - PLUGIN(MODULENAME "/Dropbox", pluginInfoEx) - { - m_hInst = g_plugin.getInst(); - - RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CDropboxService::Init, (pfnUninitProto)CDropboxService::UnInit); - } -} -g_pluginDropbox; diff --git a/plugins/CloudFile/src/Services/google_service.cpp b/plugins/CloudFile/src/Services/google_service.cpp index 906e9e817d..9679c17fc0 100644 --- a/plugins/CloudFile/src/Services/google_service.cpp +++ b/plugins/CloudFile/src/Services/google_service.cpp @@ -1,8 +1,23 @@ #include "..\stdafx.h" #include "google_api.h" -CGDriveService::CGDriveService(const char *protoName, const wchar_t *userName) - : CCloudService(protoName, userName) + +struct CMPluginGoogle : public CMPluginBase +{ + CMPluginGoogle() : + CMPluginBase(MODULENAME "/GDrive", pluginInfoEx) + { + m_hInst = g_plugin.getInst(); + + RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CGDriveService::Init, (pfnUninitProto)CGDriveService::UnInit); + } +} +g_pluginGoogle; + +///////////////////////////////////////////////////////////////////////////////////////// + +CGDriveService::CGDriveService(const char *protoName, const wchar_t *userName) : + CCloudService(protoName, userName, &g_pluginGoogle) { m_hProtoIcon = GetIconHandle(IDI_GDRIVE); } @@ -280,17 +295,3 @@ void CGDriveService::Upload(FileTransferParam *ftp) } } while (ftp->NextFile()); } - -///////////////////////////////////////////////////////////////////////////////////////// - -struct CMPluginGoogle : public CMPluginBase -{ - CMPluginGoogle() : - CMPluginBase(MODULENAME "/GDrive", pluginInfoEx) - { - m_hInst = g_plugin.getInst(); - - RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CGDriveService::Init, (pfnUninitProto)CGDriveService::UnInit); - } -} -g_pluginGoogle; diff --git a/plugins/CloudFile/src/Services/microsoft_service.cpp b/plugins/CloudFile/src/Services/microsoft_service.cpp index 5adf66649a..c435bc19b4 100644 --- a/plugins/CloudFile/src/Services/microsoft_service.cpp +++ b/plugins/CloudFile/src/Services/microsoft_service.cpp @@ -1,8 +1,22 @@ #include "..\stdafx.h" #include "microsoft_api.h" -COneDriveService::COneDriveService(const char *protoName, const wchar_t *userName) - : CCloudService(protoName, userName) +struct CMPluginOnedrive : public CMPluginBase +{ + CMPluginOnedrive() : + CMPluginBase(MODULENAME "/OneDrive", pluginInfoEx) + { + m_hInst = g_plugin.getInst(); + + RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)COneDriveService::Init, (pfnUninitProto)COneDriveService::UnInit); + } +} +g_pluginOnedrive; + +///////////////////////////////////////////////////////////////////////////////////////// + +COneDriveService::COneDriveService(const char *protoName, const wchar_t *userName) : + CCloudService(protoName, userName, &g_pluginOnedrive) { m_hProtoIcon = GetIconHandle(IDI_ONEDRIVE); } @@ -253,17 +267,3 @@ void COneDriveService::Upload(FileTransferParam *ftp) } } while (ftp->NextFile()); } - -///////////////////////////////////////////////////////////////////////////////////////// - -struct CMPluginOnedrive : public CMPluginBase -{ - CMPluginOnedrive() : - CMPluginBase(MODULENAME "/OneDrive", pluginInfoEx) - { - m_hInst = g_plugin.getInst(); - - RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)COneDriveService::Init, (pfnUninitProto)COneDriveService::UnInit); - } -} -g_pluginOnedrive; diff --git a/plugins/CloudFile/src/Services/yandex_service.cpp b/plugins/CloudFile/src/Services/yandex_service.cpp index c5dbb50400..ca8ba197d6 100644 --- a/plugins/CloudFile/src/Services/yandex_service.cpp +++ b/plugins/CloudFile/src/Services/yandex_service.cpp @@ -1,8 +1,22 @@ #include "..\stdafx.h" #include "yandex_api.h" -CYandexService::CYandexService(const char *protoName, const wchar_t *userName) - : CCloudService(protoName, userName) +struct CMPluginYandex : public CMPluginBase +{ + CMPluginYandex() : + CMPluginBase(MODULENAME "/YandexDisk", pluginInfoEx) + { + m_hInst = g_plugin.getInst(); + + RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CYandexService::Init, (pfnUninitProto)CYandexService::UnInit); + } +} +g_pluginYandex; + +///////////////////////////////////////////////////////////////////////////////////////// + +CYandexService::CYandexService(const char *protoName, const wchar_t *userName) : + CCloudService(protoName, userName, &g_pluginYandex) { m_hProtoIcon = GetIconHandle(IDI_YADISK); } @@ -274,17 +288,3 @@ void CYandexService::Upload(FileTransferParam *ftp) } } while (ftp->NextFile()); } - -///////////////////////////////////////////////////////////////////////////////////////// - -struct CMPluginYandex : public CMPluginBase -{ - CMPluginYandex() : - CMPluginBase(MODULENAME "/YandexDisk", pluginInfoEx) - { - m_hInst = g_plugin.getInst(); - - RegisterProtocol(PROTOTYPE_PROTOWITHACCS, (pfnInitProto)CYandexService::Init, (pfnUninitProto)CYandexService::UnInit); - } -} -g_pluginYandex; diff --git a/plugins/CloudFile/src/cloud_file.cpp b/plugins/CloudFile/src/cloud_file.cpp index 13ba742690..d1993b6d27 100644 --- a/plugins/CloudFile/src/cloud_file.cpp +++ b/plugins/CloudFile/src/cloud_file.cpp @@ -1,10 +1,9 @@ #include "stdafx.h" -CCloudService::CCloudService(const char *protoName, const wchar_t *userName) - : PROTO(protoName, userName) +CCloudService::CCloudService(const char *protoName, const wchar_t *userName, HPLUGIN pPlugin) + : PROTO(protoName, userName), + m_pPlugin(pPlugin) { - m_hLangpack = GetPluginLangId(MIID_LAST, 0); - NETLIBUSER nlu = {}; nlu.flags = NUF_OUTGOING | NUF_HTTPCONNS | NUF_UNICODE; nlu.szSettingsModule = (char*)protoName; @@ -22,12 +21,12 @@ CCloudService::~CCloudService() void CCloudService::OnErase() { - KillModuleMenus(m_hLangpack); + KillModuleMenus(m_pPlugin); } -int CCloudService::GetId() const +HPLUGIN CCloudService::GetId() const { - return m_hLangpack; + return m_pPlugin; } const char* CCloudService::GetAccountName() const diff --git a/plugins/CloudFile/src/cloud_file.h b/plugins/CloudFile/src/cloud_file.h index f16d5affe4..1e70671054 100644 --- a/plugins/CloudFile/src/cloud_file.h +++ b/plugins/CloudFile/src/cloud_file.h @@ -11,7 +11,7 @@ enum OnConflict class CCloudService : public PROTO { protected: - int m_hLangpack; + HPLUGIN m_pPlugin; HNETLIBUSER m_hConnection; INT_PTR __cdecl OnAccountManagerInit(WPARAM, LPARAM); @@ -34,7 +34,7 @@ protected: public: std::map InterceptedContacts; - CCloudService(const char *protoName, const wchar_t *userName); + CCloudService(const char *protoName, const wchar_t *userName, HPLUGIN); virtual ~CCloudService(); INT_PTR GetCaps(int type, MCONTACT) override; @@ -42,7 +42,7 @@ public: int FileCancel(MCONTACT hContact, HANDLE hTransfer) override; HANDLE SendFile(MCONTACT hContact, const wchar_t *msg, wchar_t **ppszFiles) override; - int GetId() const; + HPLUGIN GetId() const; virtual const char* GetModuleName() const = 0; const char* GetAccountName() const; const wchar_t* GetUserName() const; diff --git a/plugins/CloudFile/src/menus.cpp b/plugins/CloudFile/src/menus.cpp index c6861e27a2..7a5ddb084d 100644 --- a/plugins/CloudFile/src/menus.cpp +++ b/plugins/CloudFile/src/menus.cpp @@ -11,7 +11,7 @@ static INT_PTR UploadMenuCommand(void *obj, WPARAM hContact, LPARAM) void InitializeMenus() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x93d4495b, 0x259b, 0x4fba, 0xbc, 0x14, 0xf9, 0x46, 0x2c, 0xda, 0xfc, 0x6d); mi.name.a = LPGEN("Upload to..."); @@ -32,11 +32,10 @@ void InitializeMenus() void CCloudService::OnModulesLoaded() { - CMenuItem mi(g_plugin); + CMenuItem mi(GetId()); mi.root = hContactMenu; CMStringA serviceName(FORMAT, "/%s/Upload", GetAccountName()); mi.pszService = serviceName.GetBuffer(); - mi.langId = GetId(); mi.flags = CMIF_SYSTEM | CMIF_UNICODE; mi.name.w = (wchar_t*)GetUserName(); mi.position = Services.getCount(); diff --git a/plugins/CloudFile/src/options.cpp b/plugins/CloudFile/src/options.cpp index ee3aaec11e..c17ef8d9d2 100644 --- a/plugins/CloudFile/src/options.cpp +++ b/plugins/CloudFile/src/options.cpp @@ -75,7 +75,7 @@ bool COptionsMainDlg::OnApply() int OnOptionsInitialized(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = _A2W(MODULENAME); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/CloudFile/src/srmm.cpp b/plugins/CloudFile/src/srmm.cpp index 2690a97a28..ae12de3bf1 100644 --- a/plugins/CloudFile/src/srmm.cpp +++ b/plugins/CloudFile/src/srmm.cpp @@ -11,8 +11,7 @@ int OnSrmmToolbarLoaded(WPARAM, LPARAM) bbd.hIcon = GetIconHandle(IDI_UPLOAD); bbd.dwButtonID = BBB_ID_FILE_SEND; bbd.dwDefPos = 100 + bbd.dwButtonID; - Srmm_AddButton(&bbd, g_plugin.m_hLang); - + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/ConnectionNotify/src/ConnectionNotify.cpp b/plugins/ConnectionNotify/src/ConnectionNotify.cpp index 602ac4d22e..49ca5c36e3 100644 --- a/plugins/ConnectionNotify/src/ConnectionNotify.cpp +++ b/plugins/ConnectionNotify/src/ConnectionNotify.cpp @@ -585,7 +585,6 @@ INT_PTR CALLBACK DlgProcConnectionNotifyOpts(HWND hwndDlg, UINT msg, WPARAM wPar int ConnectionNotifyOptInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_DIALOG); odp.szTitle.w = _A2W(PLUGINNAME); odp.szGroup.w = LPGENW("Plugins"); diff --git a/plugins/Console/src/Console.cpp b/plugins/Console/src/Console.cpp index 17c1be2363..c9b09e9a14 100644 --- a/plugins/Console/src/Console.cpp +++ b/plugins/Console/src/Console.cpp @@ -1053,8 +1053,7 @@ static INT_PTR CALLBACK OptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM static int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szGroup.a = LPGEN("Services"); odp.szTitle.a = LPGEN("Console"); @@ -1141,7 +1140,7 @@ static int OnSystemModulesLoaded(WPARAM, LPARAM) if (hwndConsole && IsWindow(hwndConsole)) { HookEvent(ME_TTB_MODULELOADED, OnTTBLoaded); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x6d97694e, 0x2024, 0x4560, 0xbb, 0xbc, 0x20, 0x62, 0x7e, 0x5, 0xdf, 0xb3); mi.flags = CMIF_UNICODE; mi.hIcolibItem = hIcons[0]; diff --git a/plugins/ContactsPlus/src/main.cpp b/plugins/ContactsPlus/src/main.cpp index a3ff85c702..6a2c053891 100644 --- a/plugins/ContactsPlus/src/main.cpp +++ b/plugins/ContactsPlus/src/main.cpp @@ -132,7 +132,7 @@ static int HookModulesLoaded(WPARAM, LPARAM) modules[0] = MODULENAME; CallService("DBEditorpp/RegisterModule", (WPARAM)modules, 1); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x94a4ed39, 0xabd0, 0x4c70, 0x89, 0xeb, 0x1b, 0x2, 0xf0, 0xac, 0x6, 0x4c); mi.name.a = LPGEN("Contacts"); mi.position = -2000009990; //position in menu diff --git a/plugins/CountryFlags/src/extraimg.cpp b/plugins/CountryFlags/src/extraimg.cpp index 4b09fb3b36..30edfe8e27 100644 --- a/plugins/CountryFlags/src/extraimg.cpp +++ b/plugins/CountryFlags/src/extraimg.cpp @@ -178,7 +178,7 @@ static int ExtraImgModulesLoaded(WPARAM, LPARAM) StatusIconData sid = {}; sid.szModule = MODULENAME; // dwID = 0 sid.flags = MBF_HIDDEN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); HookEvent(ME_MSG_WINDOWEVENT, MsgWndEvent); return 0; diff --git a/plugins/CountryFlags/src/options.cpp b/plugins/CountryFlags/src/options.cpp index df5ac76dc5..cde19a8664 100644 --- a/plugins/CountryFlags/src/options.cpp +++ b/plugins/CountryFlags/src/options.cpp @@ -82,8 +82,7 @@ static INT_PTR CALLBACK ExtraImgOptDlgProc(HWND hwndDlg, UINT msg, WPARAM, LPARA int OnOptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXTRAIMG); odp.position = 900000002; odp.szGroup.a = LPGEN("Icons"); /* autotranslated */ diff --git a/plugins/CrashDumper/src/crshdmp.cpp b/plugins/CrashDumper/src/crshdmp.cpp index e4972c70b9..89d6229fa6 100644 --- a/plugins/CrashDumper/src/crshdmp.cpp +++ b/plugins/CrashDumper/src/crshdmp.cpp @@ -199,7 +199,6 @@ int OptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = MODULENAME; odp.szGroup.a = LPGEN("Services"); @@ -253,7 +252,7 @@ static int ModulesLoaded(WPARAM, LPARAM) FoldersPathChanged(0, 0); } - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Version Information"), 2000089999, GetIconHandle(IDI_VI)); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "9A7A9C76-7FD8-4C05-B402-6C46060C2D78"); diff --git a/plugins/CyrTranslit/src/MirandaContact.cpp b/plugins/CyrTranslit/src/MirandaContact.cpp index 207135c19d..4d981e3b60 100644 --- a/plugins/CyrTranslit/src/MirandaContact.cpp +++ b/plugins/CyrTranslit/src/MirandaContact.cpp @@ -63,7 +63,7 @@ void MirandaContact::save(MCONTACT hContact, bool bValue) void MirandaContact::addMenuItem() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi,0x47bbf49f, 0x2b77, 0x412a, 0xaa, 0x80, 0xbe, 0xd5, 0x2f, 0x8, 0x29, 0x96); mi.name.a = MENU_ITEM_TEXT; mi.position = 65535; diff --git a/plugins/Db3x_mmap/src/ui.cpp b/plugins/Db3x_mmap/src/ui.cpp index e0929408a7..12e9731748 100644 --- a/plugins/Db3x_mmap/src/ui.cpp +++ b/plugins/Db3x_mmap/src/ui.cpp @@ -300,9 +300,8 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP static int OnOptionsInit(PVOID obj, WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.flags = ODPF_BOLDGROUPS; odp.szTitle.a = LPGEN("Database"); @@ -327,7 +326,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); // main menu item mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib); diff --git a/plugins/DbEditorPP/src/main.cpp b/plugins/DbEditorPP/src/main.cpp index 97f9f267af..193ea74cc3 100644 --- a/plugins/DbEditorPP/src/main.cpp +++ b/plugins/DbEditorPP/src/main.cpp @@ -101,7 +101,7 @@ static int ModulesLoaded(WPARAM, LPARAM) IcoLibRegister(); // Register menu item - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 1900000001); SET_UID(mi, 0xe298849c, 0x1a8c, 0x4fc7, 0xa0, 0xf4, 0x78, 0x18, 0xf, 0xe2, 0xf7, 0xc9); diff --git a/plugins/DbEditorPP/src/options.cpp b/plugins/DbEditorPP/src/options.cpp index f7bc725573..bcc4ea98fb 100644 --- a/plugins/DbEditorPP/src/options.cpp +++ b/plugins/DbEditorPP/src/options.cpp @@ -56,8 +56,7 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l INT OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szGroup.a = LPGEN("Database"); odp.szTitle.a = modFullname; diff --git a/plugins/Db_autobackups/src/main.cpp b/plugins/Db_autobackups/src/main.cpp index db34035088..5910de994a 100644 --- a/plugins/Db_autobackups/src/main.cpp +++ b/plugins/Db_autobackups/src/main.cpp @@ -64,7 +64,7 @@ static int FoldersGetBackupPath(WPARAM, LPARAM) static int ModulesLoad(WPARAM, LPARAM) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 500100000); SET_UID(mi, 0x1439b1db, 0x7d95, 0x495b, 0xbf, 0x5, 0x3d, 0x21, 0xc1, 0xeb, 0xf7, 0x58); diff --git a/plugins/Db_autobackups/src/options.cpp b/plugins/Db_autobackups/src/options.cpp index a795f06e30..2545308e3d 100644 --- a/plugins/Db_autobackups/src/options.cpp +++ b/plugins/Db_autobackups/src/options.cpp @@ -348,7 +348,7 @@ public: int OptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.szTitle.a = LPGEN("Automatic backups"); odp.szGroup.a = LPGEN("Database"); diff --git a/plugins/Dbx_mdbx/src/ui.cpp b/plugins/Dbx_mdbx/src/ui.cpp index 9795cb305d..58317a9720 100644 --- a/plugins/Dbx_mdbx/src/ui.cpp +++ b/plugins/Dbx_mdbx/src/ui.cpp @@ -186,7 +186,7 @@ static int OnModulesLoaded(PVOID obj, WPARAM, LPARAM) HookEventObj(ME_OPT_INITIALISE, OnOptionsInit, db); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); // main menu item mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), 500000000, iconList[0].hIcolib); diff --git a/plugins/Exchange/src/hooked_events.cpp b/plugins/Exchange/src/hooked_events.cpp index 9739e41ae9..3ec4de1ad2 100644 --- a/plugins/Exchange/src/hooked_events.cpp +++ b/plugins/Exchange/src/hooked_events.cpp @@ -54,7 +54,7 @@ int OnModulesLoaded(WPARAM, LPARAM) { UpdateTimers(); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xcbfbfd3d, 0x5002, 0x4c64, 0x92, 0xb, 0x9c, 0x12, 0x4b, 0x6, 0x51, 0x2a); mi.hIcolibItem = hiMailIcon; mi.position = 10000000; @@ -72,9 +72,8 @@ int OnModulesLoaded(WPARAM, LPARAM) //add the exchange options dialog to miranda int OnOptionsInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_EXCHANGE); odp.szTitle.w = LPGENW("Exchange notify"); odp.szGroup.w = LPGENW("Plugins"); diff --git a/plugins/ExternalAPI/m_toptoolbar.h b/plugins/ExternalAPI/m_toptoolbar.h index 00f1c34c83..75e9f9c73c 100644 --- a/plugins/ExternalAPI/m_toptoolbar.h +++ b/plugins/ExternalAPI/m_toptoolbar.h @@ -58,7 +58,7 @@ Called when the toolbar services are available /* toptoolbar/addbutton service wparam = (TTBButton*)lpTTBButton -lparam = hLangpack +lparam = (HPLUGIN)&g_pPlugin returns: hTTBButton - handle of added button on success, -1 on failure. */ diff --git a/plugins/FTPFileYM/src/ftpfile.cpp b/plugins/FTPFileYM/src/ftpfile.cpp index 16a76bc66e..01dd4374a7 100644 --- a/plugins/FTPFileYM/src/ftpfile.cpp +++ b/plugins/FTPFileYM/src/ftpfile.cpp @@ -80,7 +80,7 @@ void InitMenuItems() { wchar_t stzName[256]; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xB7132F5A, 0x65FC, 0x42C5, 0xB4, 0xCB, 0x54, 0xBC, 0xAC, 0x58, 0x34, 0xE9); mi.flags = CMIF_UNICODE; mi.hIcolibItem = iconList[ServerList::FTP_COUNT].hIcolib; @@ -95,7 +95,7 @@ void InitMenuItems() mi.name.w = stzName; mi.flags = CMIF_UNICODE | CMIF_SYSTEM; - CMenuItem mi2(g_plugin); + CMenuItem mi2(&g_plugin); mi2.flags = CMIF_UNICODE | CMIF_SYSTEM; mi2.pszService = MS_FTPFILE_CONTACTMENU; @@ -178,7 +178,7 @@ void InitTabsrmmButton() btn.hIcon = iconList[ServerList::FTP_COUNT].hIcolib; btn.bbbFlags = BBBF_ISARROWBUTTON | BBBF_ISIMBUTTON | BBBF_CANBEHIDDEN; btn.pwszTooltip = TranslateT("FTP File"); - Srmm_AddButton(&btn, g_plugin.m_hLang); + Srmm_AddButton(&btn, &g_plugin); HookEvent(ME_MSG_BUTTONPRESSED, TabsrmmButtonPressed); } diff --git a/plugins/FTPFileYM/src/options.cpp b/plugins/FTPFileYM/src/options.cpp index eff7b5e7bd..cb32cc66c4 100644 --- a/plugins/FTPFileYM/src/options.cpp +++ b/plugins/FTPFileYM/src/options.cpp @@ -246,9 +246,8 @@ INT_PTR CALLBACK Options::DlgProcOptsAdvanced(HWND hwndDlg, UINT msg, WPARAM wPa int Options::InitOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szTitle.w = LPGENW("FTP File"); odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/FavContacts/src/options.cpp b/plugins/FavContacts/src/options.cpp index 55f1c10d6c..0a5fe13acb 100644 --- a/plugins/FavContacts/src/options.cpp +++ b/plugins/FavContacts/src/options.cpp @@ -253,9 +253,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA int ProcessOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szGroup.a = LPGEN("Contacts"); odp.szTitle.a = LPGEN("Favorites"); diff --git a/plugins/FavContacts/src/services.cpp b/plugins/FavContacts/src/services.cpp index a6959164c1..7d91eb4ad8 100644 --- a/plugins/FavContacts/src/services.cpp +++ b/plugins/FavContacts/src/services.cpp @@ -151,7 +151,7 @@ int ProcessModulesLoaded(WPARAM, LPARAM) sid.szTooltip = LPGEN("Favorite Contacts"); sid.hIcon = IcoLib_GetIconByHandle(iconList[0].hIcolib); sid.hIconDisabled = IcoLib_GetIconByHandle(iconList[1].hIcolib); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); HookEvent(ME_MSG_ICONPRESSED, ProcessSrmmIconClick); HookEvent(ME_MSG_WINDOWEVENT, ProcessSrmmEvent); diff --git a/plugins/FileAsMessage/src/main.cpp b/plugins/FileAsMessage/src/main.cpp index 3815e347e5..2cebbb4a99 100644 --- a/plugins/FileAsMessage/src/main.cpp +++ b/plugins/FileAsMessage/src/main.cpp @@ -151,7 +151,6 @@ INT_PTR OnRecvMessage(WPARAM wParam, LPARAM lParam) int OnOptInitialise(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = SERVICE_TITLE; odp.szGroup.a = LPGEN("Events"); @@ -172,7 +171,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) hHookSkinIconsChanged = HookEvent(ME_SKIN2_ICONSCHANGED, OnSkinIconsChanged); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xe4a98d2a, 0xa54a, 0x4db1, 0x8d, 0x29, 0xd, 0x5c, 0xf1, 0x10, 0x69, 0x35); mi.position = 200011; mi.hIcolibItem = iconList[ICON_MAIN].hIcolib; diff --git a/plugins/FingerprintNG/src/fingerprint.cpp b/plugins/FingerprintNG/src/fingerprint.cpp index 74bc1332dd..073f43db31 100644 --- a/plugins/FingerprintNG/src/fingerprint.cpp +++ b/plugins/FingerprintNG/src/fingerprint.cpp @@ -932,7 +932,7 @@ int OnModulesLoaded(WPARAM, LPARAM) sid.szModule = MODULENAME; sid.flags = MBF_HIDDEN; sid.dwId = 1; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); } return 0; diff --git a/plugins/FingerprintNG/src/options.cpp b/plugins/FingerprintNG/src/options.cpp index 67c6971ea9..b8dc5dc728 100644 --- a/plugins/FingerprintNG/src/options.cpp +++ b/plugins/FingerprintNG/src/options.cpp @@ -111,8 +111,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP int OnOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("Icons"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG); odp.szTitle.w = LPGENW("Fingerprint"); diff --git a/plugins/FloatingContacts/src/main.cpp b/plugins/FloatingContacts/src/main.cpp index 9226ad8fb9..df26a93e29 100644 --- a/plugins/FloatingContacts/src/main.cpp +++ b/plugins/FloatingContacts/src/main.cpp @@ -707,7 +707,7 @@ static INT_PTR OnHotKey_HideWhenCListShow(WPARAM, LPARAM) static void LoadMenus() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); // Remove thumb menu item CreateServiceFunction(MODULE "/RemoveThumb", OnContactMenu_Remove); diff --git a/plugins/FloatingContacts/src/options.cpp b/plugins/FloatingContacts/src/options.cpp index feec786728..689ab51453 100644 --- a/plugins/FloatingContacts/src/options.cpp +++ b/plugins/FloatingContacts/src/options.cpp @@ -332,8 +332,7 @@ static INT_PTR APIENTRY OptSknWndProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LP int OnOptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FLTCONT); odp.szTitle.a = LPGEN("Floating Contacts"); odp.szGroup.a = LPGEN("Contact list"); diff --git a/plugins/Folders/src/dlg_handlers.cpp b/plugins/Folders/src/dlg_handlers.cpp index df0756e5d6..a29911c2b5 100644 --- a/plugins/Folders/src/dlg_handlers.cpp +++ b/plugins/Folders/src/dlg_handlers.cpp @@ -245,9 +245,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM l static int OnOptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_FOLDERS); odp.szTitle.a = LPGEN("Folders"); odp.szGroup.a = LPGEN("Customize"); diff --git a/plugins/GmailNotifier/src/main.cpp b/plugins/GmailNotifier/src/main.cpp index 330fcd2a09..c24d707c59 100644 --- a/plugins/GmailNotifier/src/main.cpp +++ b/plugins/GmailNotifier/src/main.cpp @@ -132,7 +132,7 @@ int CMPlugin::Load() CreateServiceFunction(MODULENAME "/MenuCommand", PluginMenuCommand); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xbe16f37, 0x17be, 0x4494, 0xaa, 0xb2, 0x3a, 0xa7, 0x38, 0xfa, 0xf9, 0xcc); mi.position = -0x7FFFFFFF; mi.hIcolibItem = Skin_LoadProtoIcon(MODULENAME, ID_STATUS_ONLINE); diff --git a/plugins/GmailNotifier/src/options.cpp b/plugins/GmailNotifier/src/options.cpp index 7d3729a0e5..3d037c5b59 100644 --- a/plugins/GmailNotifier/src/options.cpp +++ b/plugins/GmailNotifier/src/options.cpp @@ -270,9 +270,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT); odp.szTitle.a = LPGEN("GmailNotifier"); odp.szGroup.a = LPGEN("Network"); diff --git a/plugins/HTTPServer/src/GuiElements.cpp b/plugins/HTTPServer/src/GuiElements.cpp index 20216b816b..44c430dd8b 100644 --- a/plugins/HTTPServer/src/GuiElements.cpp +++ b/plugins/HTTPServer/src/GuiElements.cpp @@ -1338,9 +1338,8 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 900000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT_HTTP_SERVER); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szTitle.w = LPGENW("HTTP Server"); @@ -1473,7 +1472,7 @@ void InitGuiElements() hShareNewFileService = CreateServiceFunction(MS_SHARE_NEW_FILE, nShareNewFile); hShowStatisticsViewService = CreateServiceFunction(MS_SHOW_STATISTICS_VIEW, nShowStatisticsView); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; SET_UID(mi, 0xb30a6ab5, 0x17a8, 0x4e2e, 0x84, 0x52, 0x5f, 0xbc, 0x83, 0x35, 0xf2, 0x6); mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_SHARE_NEW_FILE)); diff --git a/plugins/HTTPServer/src/main.cpp b/plugins/HTTPServer/src/main.cpp index 38c8fa787e..e951994a83 100644 --- a/plugins/HTTPServer/src/main.cpp +++ b/plugins/HTTPServer/src/main.cpp @@ -876,7 +876,7 @@ int CMPlugin::Load() indexCreationMode = (eIndexCreationMode)db_get_b(NULL, MODULENAME, "IndexCreationMode", 2); if (db_get_b(NULL, MODULENAME, "AddAcceptConMenuItem", 1)) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xf0a68784, 0xc30e, 0x4245, 0xb6, 0x2b, 0xb8, 0x71, 0x7e, 0xe6, 0xe1, 0x73); mi.flags = CMIF_UNICODE; mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_SHARE_NEW_FILE)); diff --git a/plugins/HistoryLinkListPlus/src/linklist.cpp b/plugins/HistoryLinkListPlus/src/linklist.cpp index 634a292574..d51959d712 100644 --- a/plugins/HistoryLinkListPlus/src/linklist.cpp +++ b/plugins/HistoryLinkListPlus/src/linklist.cpp @@ -45,7 +45,6 @@ CMPlugin::CMPlugin() : static int InitOptionsDlg(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("History"); odp.szTitle.a = LPGEN("History Linklist"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_DLG); @@ -149,7 +148,7 @@ int CMPlugin::Load() { CreateServiceFunction("Linklist/MenuCommand", LinkList_Main); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x2964dc6c, 0x9cf9, 0x4f20, 0x8f, 0x8a, 0xc6, 0xfe, 0xe2, 0x65, 0xac, 0xc9); mi.flags = CMIF_UNICODE; mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_LINKLISTICON)); diff --git a/plugins/HistoryPlusPlus/historypp.dpr b/plugins/HistoryPlusPlus/historypp.dpr index 73dbe61c11..605f320c9c 100644 --- a/plugins/HistoryPlusPlus/historypp.dpr +++ b/plugins/HistoryPlusPlus/historypp.dpr @@ -401,7 +401,6 @@ var odp: TOPTIONSDIALOGPAGE; begin ZeroMemory(@odp,SizeOf(odp)); - odp.hInstance := hInstance; odp.pszTemplate := MakeIntResourceA(IDD_OPT_HISTORYPP); odp.szTitle.a := 'History'; odp.szGroup.a := nil; diff --git a/plugins/HistoryPlusPlus/historypp.dproj.local b/plugins/HistoryPlusPlus/historypp.dproj.local new file mode 100644 index 0000000000..b3811b7ecc --- /dev/null +++ b/plugins/HistoryPlusPlus/historypp.dproj.local @@ -0,0 +1,2 @@ + + diff --git a/plugins/HistoryPlusPlus/historypp.identcache b/plugins/HistoryPlusPlus/historypp.identcache new file mode 100644 index 0000000000..450d89fe88 Binary files /dev/null and b/plugins/HistoryPlusPlus/historypp.identcache differ diff --git a/plugins/HistoryStats/src/mu_common.cpp b/plugins/HistoryStats/src/mu_common.cpp index 3287d8ed5b..06ffb1e051 100644 --- a/plugins/HistoryStats/src/mu_common.cpp +++ b/plugins/HistoryStats/src/mu_common.cpp @@ -18,7 +18,7 @@ namespace mu HGENMENU addMainMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService, HGENMENU hRoot) { // TODO: support for unicode-core with unicode-aware CList - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.name.w = (wchar_t*)pszName; mi.flags = flags | CMIF_UNICODE; mi.position = position; @@ -32,7 +32,7 @@ namespace mu HGENMENU addContactMenuItem(const wchar_t* pszName, DWORD flags, int position, HICON hIcon, const char* pszService) { // TODO: support for unicode-core with unicode-aware CList - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.name.w = (wchar_t*)pszName; mi.flags = flags | CMIF_UNICODE; mi.position = position; @@ -80,11 +80,10 @@ namespace mu { void addPage(WPARAM addInfo, const wchar_t* pszGroup, const wchar_t* pszTitle, const wchar_t* pszTab, DLGPROC pfnDlgProc, const char* pszTemplate, HINSTANCE hInstance, DWORD flags /* = ODPF_BOLDGROUPS */) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = const_cast(pszTitle); odp.pfnDlgProc = pfnDlgProc; odp.pszTemplate = const_cast(pszTemplate); - odp.hInstance = hInstance; odp.szGroup.w = const_cast(pszGroup); odp.flags = flags | ODPF_UNICODE; odp.szTab.w = const_cast(pszTab); diff --git a/plugins/HistorySweeperLight/src/main.cpp b/plugins/HistorySweeperLight/src/main.cpp index d0218610be..3cc113a692 100644 --- a/plugins/HistorySweeperLight/src/main.cpp +++ b/plugins/HistorySweeperLight/src/main.cpp @@ -88,25 +88,25 @@ static int OnModulesLoaded(WPARAM, LPARAM) sid.szTooltip = LPGEN("Delete all events"); sid.flags = MBF_HIDDEN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 1; sid.hIcon = LoadIconEx("act1"); sid.szTooltip = time_stamp_strings[db_get_b(NULL, ModuleName, "StartupShutdownOlder", 0)]; sid.flags = MBF_HIDDEN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 2; sid.hIcon = LoadIconEx("act2"); sid.szTooltip = keep_strings[db_get_b(NULL, ModuleName, "StartupShutdownKeep", 0)]; sid.flags = MBF_HIDDEN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 3; sid.hIcon = LoadIconEx("actDel"); sid.szTooltip = LPGEN("Delete all events"); sid.flags = MBF_HIDDEN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent); HookEvent(ME_MSG_ICONPRESSED, OnIconPressed); diff --git a/plugins/HistorySweeperLight/src/options.cpp b/plugins/HistorySweeperLight/src/options.cpp index 61364a1907..b3f902dfd0 100644 --- a/plugins/HistorySweeperLight/src/options.cpp +++ b/plugins/HistorySweeperLight/src/options.cpp @@ -269,8 +269,7 @@ INT_PTR CALLBACK DlgProcHSOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) int HSOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORYSWEEPER); odp.szTitle.a = ModuleName; odp.szGroup.a = LPGEN("History"); diff --git a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp index f8269bbfba..a9438690e2 100644 --- a/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp +++ b/plugins/HwHotKeys/src/HwHotKeys_DllMain.cpp @@ -110,13 +110,11 @@ int initializeOptions(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE OptDlgPg = { sizeof(OptDlgPg) }; OptDlgPg.position = 100000000; - OptDlgPg.hInstance = g_plugin.getInst(); OptDlgPg.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; OptDlgPg.pszTemplate = MAKEINTRESOURCEA(dlg_options); OptDlgPg.szGroup.w = LPGENW("Customize"); OptDlgPg.szTitle.w = LPGENW("Hardware HotKeys"); OptDlgPg.pfnDlgProc = OptDlgProc; - OptDlgPg.langId = g_plugin.m_hLang; g_plugin.addOptions(wParam, &OptDlgPg); return 0; } diff --git a/plugins/IEHistory/src/IEHistory.cpp b/plugins/IEHistory/src/IEHistory.cpp index 14883311d6..63652e826d 100644 --- a/plugins/IEHistory/src/IEHistory.cpp +++ b/plugins/IEHistory/src/IEHistory.cpp @@ -72,7 +72,7 @@ int CMPlugin::Load() InitServices(); /// menu items - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x28848d7a, 0x6995, 0x4799, 0x82, 0xd7, 0x18, 0x40, 0x3d, 0xe3, 0x71, 0xc4); mi.name.w = LPGENW("View &history"); mi.flags = CMIF_UNICODE; diff --git a/plugins/IEHistory/src/events.cpp b/plugins/IEHistory/src/events.cpp index e092c681e3..30b80dbf23 100644 --- a/plugins/IEHistory/src/events.cpp +++ b/plugins/IEHistory/src/events.cpp @@ -37,12 +37,11 @@ int UnhookEvents() int OnOptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; odp.szTitle.w = LPGENW("History"); odp.pfnDlgProc = OptionsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HISTORY); - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; g_plugin.addOptions(wParam, &odp); return 0; diff --git a/plugins/IEView/src/Options.cpp b/plugins/IEView/src/Options.cpp index 1ca8ece36c..3fb64021ee 100644 --- a/plugins/IEView/src/Options.cpp +++ b/plugins/IEView/src/Options.cpp @@ -435,8 +435,7 @@ static bool BrowseFile(HWND hwndDlg, char *filter, char *defExt, char *path, int int IEViewOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("Message sessions"); odp.szTitle.w = LPGENW("IEView"); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; diff --git a/plugins/IgnoreState/src/options.cpp b/plugins/IgnoreState/src/options.cpp index a7b1e0ca94..78da3941d2 100644 --- a/plugins/IgnoreState/src/options.cpp +++ b/plugins/IgnoreState/src/options.cpp @@ -103,8 +103,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int onOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.szGroup.a = LPGEN("Icons"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_IGNORE_OPT); diff --git a/plugins/Import/src/main.cpp b/plugins/Import/src/main.cpp index ecafcc9d01..abb97ffd29 100644 --- a/plugins/Import/src/main.cpp +++ b/plugins/Import/src/main.cpp @@ -60,7 +60,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_IMPORT static int ModulesLoaded(WPARAM, LPARAM) { // menu item - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x20ffaf55, 0xafa0, 0x4da3, 0xa9, 0x46, 0x20, 0x51, 0xa0, 0x24, 0xb, 0x41); mi.hIcolibItem = GetIconHandle(IDI_IMPORT); mi.name.a = LPGEN("&Import..."); diff --git a/plugins/ImportTXT/version.RES b/plugins/ImportTXT/version.RES new file mode 100644 index 0000000000..432e6d2ae4 Binary files /dev/null and b/plugins/ImportTXT/version.RES differ diff --git a/plugins/KeyboardNotify/src/options.cpp b/plugins/KeyboardNotify/src/options.cpp index 7f993f1291..a7cb0b5128 100644 --- a/plugins/KeyboardNotify/src/options.cpp +++ b/plugins/KeyboardNotify/src/options.cpp @@ -1383,8 +1383,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP // ** int InitializeOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = LPGEN("Keyboard Flash"); odp.szGroup.a = LPGEN("Events"); diff --git a/plugins/ListeningTo/src/listeningto.cpp b/plugins/ListeningTo/src/listeningto.cpp index 79da8a41a7..d7ee6d32d6 100644 --- a/plugins/ListeningTo/src/listeningto.cpp +++ b/plugins/ListeningTo/src/listeningto.cpp @@ -94,7 +94,7 @@ void RebuildMenu() wchar_t text[512]; mir_snwprintf(text, TranslateT("Send to %s"), info->account); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.position = 100000 + i; mi.root = hMainMenuGroup; mi.position = 500080000 + i; @@ -192,7 +192,7 @@ int ModulesLoaded(WPARAM, LPARAM) } // Add main menu item - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xe8e4e594, 0x255e, 0x434d, 0x83, 0x74, 0x79, 0x44, 0x1b, 0x4e, 0xe7, 0x16); mi.position = 500080000; mi.name.w = LPGENW("Listening to"); diff --git a/plugins/ListeningTo/src/options.cpp b/plugins/ListeningTo/src/options.cpp index 295d87c4d7..3f6983e05d 100644 --- a/plugins/ListeningTo/src/options.cpp +++ b/plugins/ListeningTo/src/options.cpp @@ -70,8 +70,7 @@ static OptPageControl playersControls[] = { int InitOptionsCallback(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.szGroup.a = LPGEN("Status"); diff --git a/plugins/LotusNotify/src/LotusNotify.cpp b/plugins/LotusNotify/src/LotusNotify.cpp index 702cd11aae..6c70db5ab3 100644 --- a/plugins/LotusNotify/src/LotusNotify.cpp +++ b/plugins/LotusNotify/src/LotusNotify.cpp @@ -1461,8 +1461,7 @@ static INT_PTR CALLBACK DlgProcLotusNotifyMiscOpts(HWND hwndDlg, UINT msg, WPARA //options page on miranda called int LotusNotifyOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("Plugins"); odp.szTitle.w = _A2W(__PLUGIN_NAME); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; @@ -1702,7 +1701,7 @@ int CMPlugin::Load() //function that will be called on menu click CreateServiceFunction("LotusNotify/MenuCommand", PluginMenuCommand); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x4519458, 0xb55a, 0x4e22, 0xac, 0x95, 0x5e, 0xa4, 0x4d, 0x92, 0x65, 0x65); mi.position = -0x7FFFFFFF; //on top menu position mi.flags = CMIF_UNICODE; diff --git a/plugins/MagneticWindows/src/Options.cpp b/plugins/MagneticWindows/src/Options.cpp index 1f90473801..5af8e262f5 100644 --- a/plugins/MagneticWindows/src/Options.cpp +++ b/plugins/MagneticWindows/src/Options.cpp @@ -80,7 +80,6 @@ int InitOptions(WPARAM wParam, LPARAM) OPTIONSDIALOGPAGE Opt = { sizeof(Opt) }; Opt.pfnDlgProc = OptionsDlgProc; Opt.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MAGNETICWINDOWS); - Opt.hInstance = g_plugin.getInst(); Opt.szGroup.a = LPGEN("Customize"); Opt.szTitle.a = LPGEN("Magnetic Windows"); Opt.flags = ODPF_BOLDGROUPS; diff --git a/plugins/MenuItemEx/src/main.cpp b/plugins/MenuItemEx/src/main.cpp index 0ed62c9026..31dc559030 100644 --- a/plugins/MenuItemEx/src/main.cpp +++ b/plugins/MenuItemEx/src/main.cpp @@ -737,7 +737,7 @@ static INT_PTR onIgnore(WPARAM wparam, LPARAM lparam) static HGENMENU AddSubmenuItem(HGENMENU hRoot, wchar_t* name, HICON icon, DWORD flag, char* service, int pos, INT_PTR param) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = hRoot; mi.position = pos; mi.name.w = name; @@ -905,7 +905,7 @@ static int TabsrmmButtonsInit(WPARAM, LPARAM) bbd.pwszTooltip = LPGENW("Browse Received Files"); bbd.bbbFlags = BBBF_CANBEHIDDEN; bbd.hIcon = IcoLib_GetIconHandle("miex_recfiles"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } @@ -943,7 +943,7 @@ static int PluginInit(WPARAM, LPARAM) ModuleLoad(0, 0); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; SET_UID(mi, 0x2616aa3f, 0x535a, 0x464c, 0xbd, 0x26, 0x1b, 0x15, 0xbe, 0xfa, 0x1f, 0xf); diff --git a/plugins/MenuItemEx/src/options.cpp b/plugins/MenuItemEx/src/options.cpp index eeee4998c6..313ee51702 100644 --- a/plugins/MenuItemEx/src/options.cpp +++ b/plugins/MenuItemEx/src/options.cpp @@ -96,9 +96,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) int OptionsInit(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 955000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = MODULENAME; odp.pfnDlgProc = OptionsProc; diff --git a/plugins/MessageState/src/messagestate.cpp b/plugins/MessageState/src/messagestate.cpp index 34ee40af80..805ad0884e 100644 --- a/plugins/MessageState/src/messagestate.cpp +++ b/plugins/MessageState/src/messagestate.cpp @@ -105,7 +105,7 @@ int OnModulesLoaded(WPARAM, LPARAM) sid.szModule = MODULENAME; sid.flags = MBF_HIDDEN; sid.dwId = 1; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); InitClistExtraIcon(); diff --git a/plugins/MirFox/src/MirandaOptions.cpp b/plugins/MirFox/src/MirandaOptions.cpp index 4fef2aa8c7..34991bb4b3 100644 --- a/plugins/MirFox/src/MirandaOptions.cpp +++ b/plugins/MirFox/src/MirandaOptions.cpp @@ -669,9 +669,8 @@ INT_PTR CALLBACK DlgProcOpts_Tab3(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM */ int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.szTitle.a = LPGEN(PLUGIN_OPTIONS_NAME); odp.szGroup.a = LPGEN("Services"); odp.flags = ODPF_BOLDGROUPS; diff --git a/plugins/MirLua/src/Modules/m_clist.cpp b/plugins/MirLua/src/Modules/m_clist.cpp index c43ee1782e..0b6d390004 100644 --- a/plugins/MirLua/src/Modules/m_clist.cpp +++ b/plugins/MirLua/src/Modules/m_clist.cpp @@ -2,7 +2,7 @@ void MakeMenuItem(lua_State *L, CMenuItem &mi) { - mi.langId = CMLuaEnvironment::GetEnvironmentId(L); + mi.pPlugin = CMLuaEnvironment::GetEnvironmentId(L); lua_getfield(L, -1, "Flags"); mi.flags = lua_tointeger(L, -1); @@ -57,7 +57,7 @@ static int clist_AddMainMenuItem(lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); MakeMenuItem(L, mi); HGENMENU res = Menu_AddMainMenuItem(&mi); @@ -88,7 +88,7 @@ static int clist_AddContactMenuItem(lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); MakeMenuItem(L, mi); ptrA szProto(mir_utf8decodeA(lua_tostring(L, 2))); @@ -105,7 +105,7 @@ static int clist_AddTrayMenuItem(lua_State *L) { luaL_checktype(L, 1, LUA_TTABLE); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); MakeMenuItem(L, mi); HGENMENU res = Menu_AddTrayMenuItem(&mi); diff --git a/plugins/MirLua/src/Modules/m_core.cpp b/plugins/MirLua/src/Modules/m_core.cpp index 281aa288fe..36cbcb3dc4 100644 --- a/plugins/MirLua/src/Modules/m_core.cpp +++ b/plugins/MirLua/src/Modules/m_core.cpp @@ -222,7 +222,7 @@ static int core_Translate(lua_State *L) char *what = (char*)luaL_checkstring(L, 1); ptrW value(mir_utf8decodeW(what)); - lua_pushstring(L, T2Utf(TranslateW_LP(value, g_plugin.m_hLang))); + lua_pushstring(L, T2Utf(TranslateW_LP(value, &g_plugin))); return 1; } diff --git a/plugins/MirLua/src/Modules/m_hotkeys.cpp b/plugins/MirLua/src/Modules/m_hotkeys.cpp index 1245d2348f..a6c35fdefb 100644 --- a/plugins/MirLua/src/Modules/m_hotkeys.cpp +++ b/plugins/MirLua/src/Modules/m_hotkeys.cpp @@ -41,9 +41,7 @@ static int hotkeys_Register(lua_State *L) HOTKEYDESC hk; MakeHotkey(L, hk); - int hScriptLangpack = CMLuaEnvironment::GetEnvironmentId(L); - - INT_PTR res = Hotkey_Register(&hk, hScriptLangpack); + INT_PTR res = Hotkey_Register(&hk, CMLuaEnvironment::GetEnvironmentId(L)); lua_pushboolean(L, res); return 1; diff --git a/plugins/MirLua/src/Modules/m_icolib.cpp b/plugins/MirLua/src/Modules/m_icolib.cpp index 86b5163290..3f94e26894 100644 --- a/plugins/MirLua/src/Modules/m_icolib.cpp +++ b/plugins/MirLua/src/Modules/m_icolib.cpp @@ -69,8 +69,7 @@ static int lua_AddIcon(lua_State *L) else luaL_argerror(L, 1, luaL_typename(L, 1)); - int hScriptLangpack = CMLuaEnvironment::GetEnvironmentId(L); - HANDLE res = IcoLib_AddIcon(&sid, hScriptLangpack); + HANDLE res = IcoLib_AddIcon(&sid, CMLuaEnvironment::GetEnvironmentId(L)); lua_pushlightuserdata(L, res); mir_free((void*)sid.pszName); diff --git a/plugins/MirLua/src/Modules/m_options.cpp b/plugins/MirLua/src/Modules/m_options.cpp index 29383e89ad..bcb9c799d0 100644 --- a/plugins/MirLua/src/Modules/m_options.cpp +++ b/plugins/MirLua/src/Modules/m_options.cpp @@ -45,8 +45,7 @@ public: void MakeOptionDialogPage(lua_State *L, OPTIONSDIALOGPAGE &odp) { - odp.hInstance = g_plugin.getInst(); - odp.langId = CMLuaEnvironment::GetEnvironmentId(L); + odp.pPlugin = CMLuaEnvironment::GetEnvironmentId(L); lua_getfield(L, -1, "Flags"); odp.flags = luaL_optinteger(L, -1, ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE); @@ -91,7 +90,7 @@ int opt_AddPage(lua_State *L) luaL_checktype(L, 1, LUA_TLIGHTUSERDATA); WPARAM wParam = (WPARAM)lua_touserdata(L, 1); - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; MakeOptionDialogPage(L, odp); INT_PTR res = g_plugin.addOptions(wParam, &odp); diff --git a/plugins/MirLua/src/Modules/m_srmm.cpp b/plugins/MirLua/src/Modules/m_srmm.cpp index bbaf3edc3f..316a81171f 100644 --- a/plugins/MirLua/src/Modules/m_srmm.cpp +++ b/plugins/MirLua/src/Modules/m_srmm.cpp @@ -47,8 +47,7 @@ static int lua_AddButton(lua_State *L) BBButton bbb = {}; MakeBBButton(L, bbb); - int hScriptLangpack = CMLuaEnvironment::GetEnvironmentId(L); - HANDLE res = Srmm_AddButton(&bbb, hScriptLangpack); + HANDLE res = Srmm_AddButton(&bbb, CMLuaEnvironment::GetEnvironmentId(L)); CleanBBButton(bbb); if (!res) { diff --git a/plugins/MirLua/src/environment.cpp b/plugins/MirLua/src/environment.cpp index 76a34cbc55..88e7bff62b 100644 --- a/plugins/MirLua/src/environment.cpp +++ b/plugins/MirLua/src/environment.cpp @@ -8,16 +8,14 @@ CMLuaEnvironment::CMLuaEnvironment(lua_State *_l) : CMPluginBase(nullptr, pluginInfoEx), L(_l) { - MUUID muidLast = MIID_LAST; - m_hLang = GetPluginLangId(muidLast, 0); } CMLuaEnvironment::~CMLuaEnvironment() { - KillModuleIcons(m_hLang); - KillModuleSounds(m_hLang); - KillModuleMenus(m_hLang); - KillModuleHotkeys(m_hLang); + KillModuleIcons(this); + KillModuleSounds(this); + KillModuleMenus(this); + KillModuleHotkeys(this); KillObjectEventHooks(this); KillObjectServices(this); @@ -41,12 +39,10 @@ CMLuaEnvironment* CMLuaEnvironment::GetEnvironment(lua_State *L) return env; } -int CMLuaEnvironment::GetEnvironmentId(lua_State *L) +HPLUGIN CMLuaEnvironment::GetEnvironmentId(lua_State *L) { CMLuaEnvironment *env = GetEnvironment(L); - return env != nullptr - ? env->m_hLang - : g_hMLuaLangpack; + return env != nullptr ? HPLUGIN(env) : &g_plugin; } static int HookEventEnvParam(void *obj, WPARAM wParam, LPARAM lParam, LPARAM param) diff --git a/plugins/MirLua/src/environment.h b/plugins/MirLua/src/environment.h index 1f05f1f986..7c2300b6d9 100644 --- a/plugins/MirLua/src/environment.h +++ b/plugins/MirLua/src/environment.h @@ -15,7 +15,7 @@ public: virtual ~CMLuaEnvironment(); static CMLuaEnvironment* GetEnvironment(lua_State *L); - static int GetEnvironmentId(lua_State *L); + static HPLUGIN GetEnvironmentId(lua_State *L); HANDLE HookEvent(const char *name, int ref); int UnhookEvent(HANDLE hHook); diff --git a/plugins/MirLua/src/lua.cpp b/plugins/MirLua/src/lua.cpp index dd2fd64606..7f96a2300f 100644 --- a/plugins/MirLua/src/lua.cpp +++ b/plugins/MirLua/src/lua.cpp @@ -2,19 +2,12 @@ CMLua::CMLua() : L(nullptr) { - //MUUID muidLast = MIID_LAST; - //g_hMLuaLangpack = GetPluginLangId(muidLast, 0); } CMLua::~CMLua() { Log("Unloading lua engine"); - KillModuleIcons(g_hMLuaLangpack); - KillModuleSounds(g_hMLuaLangpack); - KillModuleMenus(g_hMLuaLangpack); - KillModuleHotkeys(g_hMLuaLangpack); - KillObjectEventHooks(L); KillObjectServices(L); diff --git a/plugins/MirLua/src/options.cpp b/plugins/MirLua/src/options.cpp index f6b0f4cd51..fe3ac6abba 100644 --- a/plugins/MirLua/src/options.cpp +++ b/plugins/MirLua/src/options.cpp @@ -25,6 +25,8 @@ static int ScriptStatusToIcon(ScriptStatus status) case ScriptStatus::Failed: return 1; } + + return 0; } void CMLuaOptions::LoadScripts() @@ -163,7 +165,6 @@ void CMLuaOptions::OnReload(CCtrlBase*) int OnOptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE | ODPF_DONTTRANSLATE; odp.szGroup.w = LPGENW("Services"); odp.szTitle.w = L"Lua"; diff --git a/plugins/MirLua/src/plugin.cpp b/plugins/MirLua/src/plugin.cpp index 02a849b2dd..d8f1864c94 100644 --- a/plugins/MirLua/src/plugin.cpp +++ b/plugins/MirLua/src/plugin.cpp @@ -50,10 +50,10 @@ void CMPlugin::UnloadLua() { Scripts.destroy(); - KillModuleIcons(g_hMLuaLangpack); - KillModuleSounds(g_hMLuaLangpack); - KillModuleMenus(g_hMLuaLangpack); - KillModuleHotkeys(g_hMLuaLangpack); + KillModuleIcons(this); + KillModuleSounds(this); + KillModuleMenus(this); + KillModuleHotkeys(this); KillObjectEventHooks(lua->L); KillObjectServices(lua->L); diff --git a/plugins/MirLua/src/stdafx.h b/plugins/MirLua/src/stdafx.h index 434dcb8e50..2aabb9c8a5 100644 --- a/plugins/MirLua/src/stdafx.h +++ b/plugins/MirLua/src/stdafx.h @@ -50,7 +50,6 @@ class CMLuaScript; #define MODULENAME "MirLua" -extern int g_hMLuaLangpack; extern PLUGININFOEX g_pluginInfoEx; extern HANDLE g_hCLibsFolder; diff --git a/plugins/MirOTR/src/mirotrmenu.cpp b/plugins/MirOTR/src/mirotrmenu.cpp index cc47a815f9..d5dc58db0d 100644 --- a/plugins/MirOTR/src/mirotrmenu.cpp +++ b/plugins/MirOTR/src/mirotrmenu.cpp @@ -166,7 +166,7 @@ void InitMirOTRMenu(void) Menu_ConfigureObject(hMirOTRMenuObject, MCO_OPT_ONADD_SERVICE, "MIROTRMENUS/OnAddMenuItemMirOTRMenu"); // menu items - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_DISABLED | CMIF_UNICODE; mi.name.w = LPGENW("OTR Status"); mi.position = 0; diff --git a/plugins/MirOTR/src/options.cpp b/plugins/MirOTR/src/options.cpp index b0cd74e3ba..415fbc58d4 100644 --- a/plugins/MirOTR/src/options.cpp +++ b/plugins/MirOTR/src/options.cpp @@ -826,9 +826,8 @@ static INT_PTR CALLBACK DlgProcMirOTROptsFinger(HWND hwndDlg, UINT msg, WPARAM w static int OpenOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100; - odp.hInstance = g_plugin.getInst(); odp.szGroup.w = LPGENW("Services"); odp.szTitle.w = L"OTR"; odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; diff --git a/plugins/MirOTR/src/svcs_menu.cpp b/plugins/MirOTR/src/svcs_menu.cpp index d375500602..0dc6a16897 100644 --- a/plugins/MirOTR/src/svcs_menu.cpp +++ b/plugins/MirOTR/src/svcs_menu.cpp @@ -158,7 +158,7 @@ void InitMenu() CreateServiceFunction(MS_OTR_MENUVERIFY, SVC_VerifyOTR); CreateServiceFunction(MS_OTR_MENUTOGGLEHTML, SVC_ToggleHTMLOTR); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_NOTOFFLINE | CMIF_UNICODE; mi.position = -400000; diff --git a/plugins/MirOTR/src/svcs_srmm.cpp b/plugins/MirOTR/src/svcs_srmm.cpp index db37ca4f6e..6b4c70d1e5 100644 --- a/plugins/MirOTR/src/svcs_srmm.cpp +++ b/plugins/MirOTR/src/svcs_srmm.cpp @@ -86,7 +86,7 @@ void SetEncryptionStatus(MCONTACT hContact, TrustLevel level) int SVC_ButtonsBarLoaded(WPARAM, LPARAM) { - Srmm_AddButton(&OTRButton, g_plugin.m_hLang); + Srmm_AddButton(&OTRButton, &g_plugin); return 0; } @@ -121,12 +121,12 @@ void InitSRMM() sid.hIconDisabled = hIconNotSecure; sid.flags = MBF_DISABLED | MBF_HIDDEN; sid.szTooltip = LANG_OTR_TOOLTIP; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 1; sid.hIcon = hIconPrivate; sid.hIconDisabled = hIconUnverified; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); // hook the window events so that we can can change the status of the icon HookEvent(ME_MSG_ICONPRESSED, SVC_IconPressed); diff --git a/plugins/MirandaG15/src/CConfig.cpp b/plugins/MirandaG15/src/CConfig.cpp index 26c8f2b0dd..e2302eac84 100644 --- a/plugins/MirandaG15/src/CConfig.cpp +++ b/plugins/MirandaG15/src/CConfig.cpp @@ -241,9 +241,8 @@ void CConfig::OnConnectionChanged() int CConfig::InitOptionsDialog(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 847000000; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("MirandaG15"); odp.flags = ODPF_BOLDGROUPS; diff --git a/plugins/MsgPopup/src/main.cpp b/plugins/MsgPopup/src/main.cpp index 11bb810d63..ee0cd78a91 100644 --- a/plugins/MsgPopup/src/main.cpp +++ b/plugins/MsgPopup/src/main.cpp @@ -190,8 +190,7 @@ int HookedInit(WPARAM, LPARAM) int HookedOptions(WPARAM wParam, LPARAM) { if (ServiceExists(MS_POPUP_ADDPOPUPT)) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.w = LPGENW("MessagePopup"); odp.szGroup.w = LPGENW("Popups"); diff --git a/plugins/Msg_Export/src/main.cpp b/plugins/Msg_Export/src/main.cpp index 4464680323..89817922df 100755 --- a/plugins/Msg_Export/src/main.cpp +++ b/plugins/Msg_Export/src/main.cpp @@ -111,7 +111,7 @@ int MainInit(WPARAM /*wparam*/, LPARAM /*lparam*/) HookEvent(ME_OPT_INITIALISE, OptionsInitialize); if (!bReplaceHistory) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x701c543, 0xd078, 0x41dd, 0x95, 0xe3, 0x96, 0x49, 0x8a, 0x72, 0xc7, 0x50); mi.hIcolibItem = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_EXPORT_MESSAGE)); mi.position = 1000090100; diff --git a/plugins/Msg_Export/src/options.cpp b/plugins/Msg_Export/src/options.cpp index 4b3bab4c98..99d6912123 100755 --- a/plugins/Msg_Export/src/options.cpp +++ b/plugins/Msg_Export/src/options.cpp @@ -1226,9 +1226,8 @@ int OptionsInitialize(WPARAM wParam, LPARAM /*lParam*/) { bUnaplyedChanges = FALSE; - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_MSGEXPORT); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szTitle.w = LPGENW("Message export"); diff --git a/plugins/MyDetails/src/frame.cpp b/plugins/MyDetails/src/frame.cpp index 9b1e207684..46f69fb83e 100644 --- a/plugins/MyDetails/src/frame.cpp +++ b/plugins/MyDetails/src/frame.cpp @@ -325,7 +325,7 @@ int CreateFrame() // Create menu item - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("My details"), 500010000); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "8C1C981C-4F28-4C4C-9121-544156210CE9"); diff --git a/plugins/MyDetails/src/mydetails.cpp b/plugins/MyDetails/src/mydetails.cpp index 36de82c6e5..bd4c42fd95 100644 --- a/plugins/MyDetails/src/mydetails.cpp +++ b/plugins/MyDetails/src/mydetails.cpp @@ -75,7 +75,7 @@ static int MainInit(WPARAM, LPARAM) InitProtocolData(); // Add options to menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x73ff525d, 0x7b8, 0x49cc, 0xa2, 0xdf, 0xc5, 0xad, 0x13, 0xf3, 0x8e, 0x2d); mi.position = 500050000; mi.flags = CMIF_UNICODE; diff --git a/plugins/MyDetails/src/options.cpp b/plugins/MyDetails/src/options.cpp index 6ee25f1604..e1cd488025 100644 --- a/plugins/MyDetails/src/options.cpp +++ b/plugins/MyDetails/src/options.cpp @@ -161,9 +161,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int InitOptionsCallback(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -200000000; - odp.hInstance = g_plugin.getInst(); odp.pfnDlgProc = DlgProcOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS); odp.szGroup.w = LPGENW("Contact list"); diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp index 53a2ee4ecd..43eb9434dc 100644 --- a/plugins/NewAwaySysMod/src/AwayOpt.cpp +++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp @@ -1020,7 +1020,6 @@ int OptsDlgInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE optDi = { sizeof(optDi) }; optDi.position = 920000000; - optDi.hInstance = g_plugin.getInst(); optDi.flags = ODPF_BOLDGROUPS; optDi.szTitle.a = OPT_MAINGROUP; diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp index 7f0f2f3cf6..402fe90431 100644 --- a/plugins/NewAwaySysMod/src/AwaySys.cpp +++ b/plugins/NewAwaySysMod/src/AwaySys.cpp @@ -619,7 +619,7 @@ int MirandaLoaded(WPARAM, LPARAM) int SendOnEvent = CContactSettings(g_ProtoStates[(char*)NULL].m_status).Autoreply; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xa379c361, 0x9e3f, 0x468d, 0xb2, 0xac, 0xc4, 0x89, 0xbb, 0xfc, 0x81, 0x15); mi.position = 1000020000; mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE; diff --git a/plugins/NewEventNotify/src/menuitem.cpp b/plugins/NewEventNotify/src/menuitem.cpp index a2d03a96b5..b31d755faf 100644 --- a/plugins/NewEventNotify/src/menuitem.cpp +++ b/plugins/NewEventNotify/src/menuitem.cpp @@ -52,7 +52,7 @@ int MenuitemInit(BOOL bStatus) HGENMENU hRoot = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 0); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x7aed93f7, 0x835, 0x4ff6, 0xb1, 0x34, 0xae, 0x0, 0x21, 0x2a, 0xd7, 0x81); mi.root = hRoot; mi.position = 1; diff --git a/plugins/NewEventNotify/src/options.cpp b/plugins/NewEventNotify/src/options.cpp index 933fc75dbc..946cab50f3 100644 --- a/plugins/NewEventNotify/src/options.cpp +++ b/plugins/NewEventNotify/src/options.cpp @@ -289,8 +289,7 @@ static INT_PTR CALLBACK OptionsDlgProc(HWND hWnd, UINT message, WPARAM wParam, L int OptionsAdd(HINSTANCE hInst, WPARAM addInfo) { if (ServiceExists(MS_POPUP_ADDPOPUPT)) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = hInst; + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT); odp.szTitle.a = LPGEN("Event Notify"); odp.szGroup.a = LPGEN("Popups"); diff --git a/plugins/NewXstatusNotify/src/indsnd.cpp b/plugins/NewXstatusNotify/src/indsnd.cpp index dcd7f8abdd..db3911f2a2 100644 --- a/plugins/NewXstatusNotify/src/indsnd.cpp +++ b/plugins/NewXstatusNotify/src/indsnd.cpp @@ -595,9 +595,8 @@ INT_PTR CALLBACK DlgProcFiltering(HWND hwndDlg, UINT msg, WPARAM, LPARAM lParam) int UserInfoInitialise(WPARAM wParam, LPARAM lParam) { if (lParam) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_INFO_SOUNDS); odp.szTitle.a = LPGEN("Status Notify"); odp.pfnDlgProc = DlgProcSoundUIPage; diff --git a/plugins/NewXstatusNotify/src/main.cpp b/plugins/NewXstatusNotify/src/main.cpp index c15933478b..23d3587ab9 100644 --- a/plugins/NewXstatusNotify/src/main.cpp +++ b/plugins/NewXstatusNotify/src/main.cpp @@ -1081,7 +1081,7 @@ INT_PTR EnableDisableMenuCommand(WPARAM, LPARAM) void InitMainMenuItem() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x22b7b4db, 0xa9a1, 0x4d43, 0x88, 0x80, 0x4c, 0x23, 0x20, 0x31, 0xc6, 0xa0); mi.flags = CMIF_UNICODE; if (ServiceExists(MS_POPUP_ADDPOPUPT)) diff --git a/plugins/NewXstatusNotify/src/options.cpp b/plugins/NewXstatusNotify/src/options.cpp index 8c3e5954b8..c109c5fafd 100644 --- a/plugins/NewXstatusNotify/src/options.cpp +++ b/plugins/NewXstatusNotify/src/options.cpp @@ -1172,9 +1172,8 @@ INT_PTR CALLBACK DlgProcLogOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int OptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS; odp.szTitle.a = LPGEN("Status Notify"); odp.szGroup.a = LPGEN("Status"); diff --git a/plugins/New_GPG/src/init.cpp b/plugins/New_GPG/src/init.cpp index 907c4cffb1..d2e50a0ffb 100755 --- a/plugins/New_GPG/src/init.cpp +++ b/plugins/New_GPG/src/init.cpp @@ -109,12 +109,12 @@ static int OnModulesLoaded(WPARAM, LPARAM) sid.dwId = 0x00000001; sid.hIcon = IcoLib_GetIcon("secured"); sid.szTooltip = LPGEN("GPG Turn off encryption"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 0x00000002; sid.hIcon = IcoLib_GetIcon("unsecured"); sid.szTooltip = LPGEN("GPG Turn on encryption"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); if(globals.bJabberAPI) GetJabberInterface(0,0); @@ -151,7 +151,7 @@ int CMPlugin::Load() CreateServiceFunction("/ExportGPGKeys",ExportGpGKeys); CreateServiceFunction("/ImportGPGKeys",ImportGpGKeys); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xbd22e3f8, 0xc19c, 0x45a8, 0xb7, 0x37, 0x6b, 0x3b, 0x27, 0xf0, 0x8c, 0xbb); mi.position = -0x7FFFFFFF; diff --git a/plugins/New_GPG/src/utilities.cpp b/plugins/New_GPG/src/utilities.cpp index fddc9e357a..b4da20d147 100755 --- a/plugins/New_GPG/src/utilities.cpp +++ b/plugins/New_GPG/src/utilities.cpp @@ -217,7 +217,7 @@ int OnPreBuildContactMenu(WPARAM w, LPARAM) { MCONTACT hContact = db_mc_tryMeta(w); { - CMenuItem mi2(g_plugin); + CMenuItem mi2(&g_plugin); LPSTR proto = GetContactProto(hContact); PROTOACCOUNT *acc = Proto_GetAccount(proto); std::string setting; diff --git a/plugins/NewsAggregator/Src/Menus.cpp b/plugins/NewsAggregator/Src/Menus.cpp index e64b3f0764..8623ec52c4 100644 --- a/plugins/NewsAggregator/Src/Menus.cpp +++ b/plugins/NewsAggregator/Src/Menus.cpp @@ -23,7 +23,7 @@ HGENMENU hService2[7]; void InitMenu() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE | CMIF_NOTOFFLINE; mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("News Aggregator"), 500099000); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D9733E4F-1946-4390-8EB3-591E8687222E"); diff --git a/plugins/NewsAggregator/Src/Options.cpp b/plugins/NewsAggregator/Src/Options.cpp index 2413a64191..4723f798e7 100644 --- a/plugins/NewsAggregator/Src/Options.cpp +++ b/plugins/NewsAggregator/Src/Options.cpp @@ -1075,8 +1075,7 @@ void COptionsMain::OnFeedListDoubleClick(CCtrlBase*) int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szGroup.w = LPGENW("Network"); odp.szTitle.w = LPGENW("News Aggregator"); diff --git a/plugins/NoHistory/src/dllmain.cpp b/plugins/NoHistory/src/dllmain.cpp index 117144be63..8fd739e37e 100644 --- a/plugins/NoHistory/src/dllmain.cpp +++ b/plugins/NoHistory/src/dllmain.cpp @@ -222,12 +222,12 @@ void SrmmMenu_Load() sid.dwId = 0; sid.szTooltip = LPGEN("History Enabled"); sid.hIcon = sid.hIconDisabled = hIconKeep; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 1; sid.szTooltip = LPGEN("History Disabled"); sid.hIcon = sid.hIconDisabled = hIconRemove; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); // hook the window events so that we can can change the status of the icon HookEvent(ME_MSG_WINDOWEVENT, WindowEvent); @@ -239,7 +239,7 @@ void SrmmMenu_Load() static int ModulesLoaded(WPARAM, LPARAM) { // create contact menu item - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; SET_UID(mi, 0xede12697, 0x3e9d, 0x47ca, 0x83, 0xe0, 0xc1, 0x40, 0x69, 0xbf, 0x2d, 0xab); diff --git a/plugins/NoHistory/src/options.cpp b/plugins/NoHistory/src/options.cpp index c0eba96e71..65f7728bab 100644 --- a/plugins/NoHistory/src/options.cpp +++ b/plugins/NoHistory/src/options.cpp @@ -218,10 +218,9 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS|ODPF_UNICODE; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT); odp.szTitle.w = LPGENW("No History"); odp.szGroup.w = LPGENW("History"); diff --git a/plugins/Non-IM Contact/src/main.cpp b/plugins/Non-IM Contact/src/main.cpp index c04f0dcd25..62bac3b7c5 100644 --- a/plugins/Non-IM Contact/src/main.cpp +++ b/plugins/Non-IM Contact/src/main.cpp @@ -47,8 +47,7 @@ int LCStatus = ID_STATUS_OFFLINE; // int NimcOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szGroup.a = LPGEN("Plugins"); odp.szTitle.a = LPGEN("Non-IM Contacts"); @@ -133,7 +132,7 @@ int CMPlugin::Load() CreateServiceFunction("TestStringReplaceLine", testStringReplacer); CreateServiceFunction("NIM_Contact/DoubleClick", doubleClick); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("&Non-IM Contact"), 600090000); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D7CE61C5-1178-41BA-B2ED-5A711BB21AE9"); diff --git a/plugins/NotesAndReminders/src/main.cpp b/plugins/NotesAndReminders/src/main.cpp index b1207d055d..9255fcd318 100644 --- a/plugins/NotesAndReminders/src/main.cpp +++ b/plugins/NotesAndReminders/src/main.cpp @@ -120,9 +120,8 @@ void InitIcons(void) static int OnOptInitialise(WPARAM w, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 900002000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_STNOTEOPTIONS); odp.szTitle.a = SECTIONNAME; odp.szGroup.a = LPGEN("Plugins"); @@ -198,7 +197,7 @@ int OnModulesLoaded(WPARAM, LPARAM) g_AddContListMI = (BOOL)db_get_dw(0, MODULENAME, "AddContactMenuItems", 1); // register menus - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Notes && Reminders"), 1600000000); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "A5E140BC-D697-4689-B75B-8ECFB6FE5931"); mi.flags = CMIF_UNICODE; diff --git a/plugins/NotifyAnything/src/options.cpp b/plugins/NotifyAnything/src/options.cpp index d26cb7131c..cbebfd6b59 100644 --- a/plugins/NotifyAnything/src/options.cpp +++ b/plugins/NotifyAnything/src/options.cpp @@ -171,13 +171,12 @@ void load_settings() int OptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(NA_OPTIONS); odp.pfnDlgProc = DlgProcOpts; odp.szTitle.a = LPGEN("Notify Anything"); odp.szGroup.a = LPGEN("Plugins"); odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS; g_plugin.addOptions(wParam, &odp); return 0; diff --git a/plugins/Nudge/src/main.cpp b/plugins/Nudge/src/main.cpp index e9c5640131..06e3590aa0 100644 --- a/plugins/Nudge/src/main.cpp +++ b/plugins/Nudge/src/main.cpp @@ -411,7 +411,7 @@ static int TabsrmmButtonInit(WPARAM, LPARAM) bbd.hIcon = iconList[0].hIcolib; bbd.dwButtonID = 6000; bbd.pszHotkey = hkd.pszName; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } @@ -488,7 +488,7 @@ int CMPlugin::Load() CreateServiceFunction(MS_NUDGE_SHOWMENU, NudgeShowMenu); // Add contact menu entry - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xd617db26, 0x22ba, 0x4205, 0x9c, 0x3e, 0x53, 0x10, 0xbc, 0xcf, 0xce, 0x19); mi.flags = CMIF_NOTOFFLINE | CMIF_UNICODE; mi.position = -500050004; diff --git a/plugins/Nudge/src/options.cpp b/plugins/Nudge/src/options.cpp index 157cc48682..3952cc040b 100644 --- a/plugins/Nudge/src/options.cpp +++ b/plugins/Nudge/src/options.cpp @@ -372,9 +372,8 @@ static INT_PTR CALLBACK DlgProcNudgeOpt(HWND hwnd, UINT msg, WPARAM wParam, LPAR int NudgeOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NUDGE); odp.szTitle.a = LPGEN("Nudge"); odp.szGroup.a = LPGEN("Events"); diff --git a/plugins/OpenFolder/src/openFolder.cpp b/plugins/OpenFolder/src/openFolder.cpp index cd4b741ea8..096b0dc485 100644 --- a/plugins/OpenFolder/src/openFolder.cpp +++ b/plugins/OpenFolder/src/openFolder.cpp @@ -99,7 +99,7 @@ int CMPlugin::Load() hotkey.DefHotKey = MAKEWORD( 'O', HOTKEYF_SHIFT | HOTKEYF_ALT ); g_plugin.addHotkey(&hotkey); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xbba6ad01, 0x755a, 0x4d01, 0x94, 0xee, 0x57, 0x84, 0x18, 0x70, 0x77, 0x4f); mi.position = 0x7FFFFFFF; mi.flags = CMIF_UNICODE; diff --git a/plugins/PackUpdater/Src/Options.cpp b/plugins/PackUpdater/Src/Options.cpp index 5758e734b6..0e5b293e3a 100644 --- a/plugins/PackUpdater/Src/Options.cpp +++ b/plugins/PackUpdater/Src/Options.cpp @@ -380,9 +380,8 @@ INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM lParam) int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY); odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp index cdae7910ce..a9c4c801e6 100644 --- a/plugins/PackUpdater/Src/PackUpdater.cpp +++ b/plugins/PackUpdater/Src/PackUpdater.cpp @@ -64,7 +64,7 @@ int CMPlugin::Load() // Add cheking update menu item CreateServiceFunction(MODULENAME"/CheckUpdates", MenuCommand); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x326495e8, 0xab0a, 0x47d2, 0xb2, 0x22, 0x2a, 0x8e, 0xa8, 0xae, 0x53, 0x1a); mi.position = -0x7FFFFFFF; mi.flags = CMIF_UNICODE; diff --git a/plugins/PasteIt/src/Options.cpp b/plugins/PasteIt/src/Options.cpp index 1077714690..fe6a819888 100644 --- a/plugins/PasteIt/src/Options.cpp +++ b/plugins/PasteIt/src/Options.cpp @@ -677,9 +677,8 @@ void Options::SetCodepageCB(HWND hwndCB, unsigned int codepage) int Options::InitOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szTitle.w = LPGENW("Paste It"); odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/PasteIt/src/PasteIt.cpp b/plugins/PasteIt/src/PasteIt.cpp index 4e48b1aabf..0b538f5cae 100644 --- a/plugins/PasteIt/src/PasteIt.cpp +++ b/plugins/PasteIt/src/PasteIt.cpp @@ -251,7 +251,7 @@ static INT_PTR ContactMenuService(WPARAM hContact, LPARAM lParam) static void InitMenuItems() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x33ecc112, 0x6, 0x487d, 0xbb, 0x8b, 0x76, 0xb4, 0x17, 0x9b, 0xdb, 0xc5); mi.flags = CMIF_UNICODE; @@ -277,7 +277,7 @@ static void InitMenuItems() HGENMENU hDefWebMenu = Menu_AddContactMenuItem(&mi); Menu_ConfigureItem(hDefWebMenu, MCI_OPT_EXECPARAM, DEF_PAGES_START - 1); - CMenuItem mi2(g_plugin); + CMenuItem mi2(&g_plugin); mi2.pszService = MS_PASTEIT_CONTACTMENU; mi2.root = hDefWebMenu; for (int i = 0; i < PasteToWeb::pages; ++i) { @@ -309,7 +309,7 @@ static void InitTabsrmmButton() btn.hIcon = iconList[0].hIcolib; btn.bbbFlags = BBBF_ISARROWBUTTON | BBBF_ISIMBUTTON | BBBF_CANBEHIDDEN | BBBF_ISCHATBUTTON; btn.pwszTooltip = TranslateT("Paste It"); - Srmm_AddButton(&btn, g_plugin.m_hLang); + Srmm_AddButton(&btn, &g_plugin); if (hTabsrmmButtonPressed != nullptr) UnhookEvent(hTabsrmmButtonPressed); diff --git a/plugins/Ping/src/menu.cpp b/plugins/Ping/src/menu.cpp index fd49c789df..99a2cc1fd2 100644 --- a/plugins/Ping/src/menu.cpp +++ b/plugins/Ping/src/menu.cpp @@ -6,7 +6,7 @@ HANDLE hEventMenuBuild; void InitMenus() { // main menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Ping"), 500099900); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "FF273885-6AEC-4C8A-B8BC-9247D920F223"); diff --git a/plugins/Ping/src/options.cpp b/plugins/Ping/src/options.cpp index b1753d5143..c6bac11d8d 100644 --- a/plugins/Ping/src/options.cpp +++ b/plugins/Ping/src/options.cpp @@ -496,8 +496,7 @@ static INT_PTR CALLBACK DlgProcOpts2(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int PingOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szGroup.w = LPGENW("Network"); odp.szTitle.w = LPGENW("Ping"); diff --git a/plugins/Ping/src/pingthread.cpp b/plugins/Ping/src/pingthread.cpp index fa4b172eb2..8823b181be 100644 --- a/plugins/Ping/src/pingthread.cpp +++ b/plugins/Ping/src/pingthread.cpp @@ -880,7 +880,7 @@ void InitList() CreateServiceFunction(MODULENAME "/ShowWindow", PingPlugShowWindow); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Ping"), 1000200001); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "7CFBF239-86B5-48B2-8D5B-39E09A7DB514"); diff --git a/plugins/PluginUpdater/src/Options.cpp b/plugins/PluginUpdater/src/Options.cpp index d77d0c9be1..89e6b9cf60 100644 --- a/plugins/PluginUpdater/src/Options.cpp +++ b/plugins/PluginUpdater/src/Options.cpp @@ -503,9 +503,8 @@ static INT_PTR CALLBACK DlgPopupOpts(HWND hdlg, UINT msg, WPARAM wParam, LPARAM static int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_UPDATENOTIFY); odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/PluginUpdater/src/PluginUpdater.cpp b/plugins/PluginUpdater/src/PluginUpdater.cpp index 7bac5a686f..424d99cf80 100644 --- a/plugins/PluginUpdater/src/PluginUpdater.cpp +++ b/plugins/PluginUpdater/src/PluginUpdater.cpp @@ -62,7 +62,7 @@ int CMPlugin::Load() // Add cheking update menu item InitCheck(); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xfa2cbe01, 0x3b37, 0x4a4c, 0xa6, 0x97, 0xe4, 0x6f, 0x31, 0xa9, 0xfc, 0x33); mi.name.a = LPGEN("Check for updates"); diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index 7517084fce..e82c40c5fa 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -61,9 +61,8 @@ HANDLE hTTButton; static int OptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS; odp.szTitle.a = MODULNAME_PLU; @@ -173,7 +172,7 @@ INT_PTR svcShowHistory(WPARAM, LPARAM) void InitMenuItems(void) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; HANDLE hIcon = GetIconHandle(PopupOptions.ModuleIsEnabled ? IDI_POPUP : IDI_NOPOPUP); diff --git a/plugins/Popup/src/srmm_menu.cpp b/plugins/Popup/src/srmm_menu.cpp index aef8080306..2ff5091fba 100644 --- a/plugins/Popup/src/srmm_menu.cpp +++ b/plugins/Popup/src/srmm_menu.cpp @@ -110,22 +110,22 @@ void SrmmMenu_Load() sid.dwId = 0; sid.szTooltip = LPGEN("Popup Mode: Auto"); sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_POPUP); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 1; sid.szTooltip = LPGEN("Popup Mode: Favorite"); sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_OPT_FAVORITE); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 2; sid.szTooltip = LPGEN("Popup Mode: Ignore fullscreen"); sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_OPT_FULLSCREEN); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = 3; sid.szTooltip = LPGEN("Popup Mode: Block contact"); sid.hIcon = sid.hIconDisabled = LoadIconEx(IDI_NOPOPUP); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); HookEvent(ME_MSG_ICONPRESSED, SrmmMenu_ProcessIconClick); HookEvent(ME_MSG_WINDOWEVENT, SrmmMenu_ProcessEvent); diff --git a/plugins/ProfileManager/src/pmanagerEx.cpp b/plugins/ProfileManager/src/pmanagerEx.cpp index 1944dcb8ee..cf313004dd 100644 --- a/plugins/ProfileManager/src/pmanagerEx.cpp +++ b/plugins/ProfileManager/src/pmanagerEx.cpp @@ -89,7 +89,7 @@ int CMPlugin::Load() CreateServiceFunction(SRV_CHANGE_PM, ChangePM); CreateServiceFunction(SRV_RESTART_ME, RestartMe); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Database"), -500200000); for (int i = 0; i < _countof(iconList); i++) { diff --git a/plugins/ProxySwitch/src/main.cpp b/plugins/ProxySwitch/src/main.cpp index 06cea7f732..2b28f39993 100644 --- a/plugins/ProxySwitch/src/main.cpp +++ b/plugins/ProxySwitch/src/main.cpp @@ -126,7 +126,7 @@ static INT_PTR CopyIP2Clipboard(WPARAM, LPARAM, LPARAM idx) void UpdateInterfacesMenu(void) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mir_cslock lck(csNIF_List); for (auto &it : g_arNIF) { @@ -163,7 +163,7 @@ void UpdateInterfacesMenu(void) void UpdatePopupMenu(BOOL State) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); if (!hEnableDisablePopupMenu) return; @@ -254,7 +254,7 @@ int Init(WPARAM, LPARAM) mir_forkthread(IP_WatchDog, 0); // menu item - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x53b0835b, 0x7162, 0x4272, 0x83, 0x3b, 0x3f, 0x60, 0x9e, 0xe, 0x76, 0x4a); mi.position = 0xC0000000; mi.flags = CMIF_UNICODE; diff --git a/plugins/ProxySwitch/src/opt.cpp b/plugins/ProxySwitch/src/opt.cpp index 416ff92fc8..2a071da495 100644 --- a/plugins/ProxySwitch/src/opt.cpp +++ b/plugins/ProxySwitch/src/opt.cpp @@ -128,9 +128,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 95600; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = OptionsProc; odp.szGroup.w = LPGENW("Services"); diff --git a/plugins/QuickContacts/src/options.cpp b/plugins/QuickContacts/src/options.cpp index a7969c3059..e0b59efd5f 100644 --- a/plugins/QuickContacts/src/options.cpp +++ b/plugins/QuickContacts/src/options.cpp @@ -49,8 +49,7 @@ void LoadOptions() int InitOptionsCallback(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("Contacts"); odp.szTitle.w = LPGENW("Quick Contacts"); odp.pfnDlgProc = OptionsDlgProc; diff --git a/plugins/QuickContacts/src/quickcontacts.cpp b/plugins/QuickContacts/src/quickcontacts.cpp index e387eae8be..99e8b69857 100644 --- a/plugins/QuickContacts/src/quickcontacts.cpp +++ b/plugins/QuickContacts/src/quickcontacts.cpp @@ -122,7 +122,7 @@ static int ModulesLoaded(WPARAM, LPARAM) } // Add menu item - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x3a3f768a, 0xcf47, 0x43d5, 0x92, 0x16, 0xe4, 0xeb, 0x93, 0xf6, 0x72, 0xfa); mi.position = 500100001; mi.flags = CMIF_UNICODE; diff --git a/plugins/QuickMessages/src/Utils.cpp b/plugins/QuickMessages/src/Utils.cpp index 618f8ba92f..bf6bb2ff66 100644 --- a/plugins/QuickMessages/src/Utils.cpp +++ b/plugins/QuickMessages/src/Utils.cpp @@ -254,7 +254,7 @@ DWORD BalanceButtons(int buttonsWas, int buttonsNow) bb.dwButtonID = buttonsWas++; bb.dwDefPos = 300 + buttonsWas; bb.hIcon = AddIcon(iconname); - Srmm_AddButton(&bb, g_plugin.m_hLang); + Srmm_AddButton(&bb, &g_plugin); } return buttonsNow; @@ -376,7 +376,7 @@ int RegisterCustomButton(WPARAM, LPARAM) bbd.hIcon = AddIcon(iconname); bbd.pszModuleName = MODULENAME; bbd.pwszTooltip = ld->ptszButtonName; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); } return 0; } diff --git a/plugins/QuickMessages/src/options.cpp b/plugins/QuickMessages/src/options.cpp index 5dee646403..7d72dd7a14 100644 --- a/plugins/QuickMessages/src/options.cpp +++ b/plugins/QuickMessages/src/options.cpp @@ -1083,9 +1083,8 @@ INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM lparam) int OptionsInit(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 940000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = LPGEN("Quick Messages"); odp.pfnDlgProc = OptionsProc; diff --git a/plugins/QuickReplies/src/events.cpp b/plugins/QuickReplies/src/events.cpp index f925b6a2fd..9f40d42038 100644 --- a/plugins/QuickReplies/src/events.cpp +++ b/plugins/QuickReplies/src/events.cpp @@ -46,7 +46,7 @@ int OnModulesLoaded(WPARAM, LPARAM) bbd.hIcon = iconList[0].hIcolib; bbd.dwButtonID = iNumber; bbd.dwDefPos = 220; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/QuickReplies/src/options.cpp b/plugins/QuickReplies/src/options.cpp index ee5ee16568..170bfba27e 100644 --- a/plugins/QuickReplies/src/options.cpp +++ b/plugins/QuickReplies/src/options.cpp @@ -164,12 +164,11 @@ int OnOptInitialized(WPARAM wParam, LPARAM) char tabName[32]; mir_snprintf(tabName, "%s %x", Translate("Button"), iNumber + 1); - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Message sessions"); odp.szTitle.a = LPGEN("Quick Replies"); odp.szTab.a = tabName; odp.position = iNumber; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS_PAGE); odp.pfnDlgProc = DlgProcOptionsPage; g_plugin.addOptions(wParam, &odp); diff --git a/plugins/QuickSearch/quicksearch.dpr b/plugins/QuickSearch/quicksearch.dpr index d60426aa74..59f0c1ddcc 100644 --- a/plugins/QuickSearch/quicksearch.dpr +++ b/plugins/QuickSearch/quicksearch.dpr @@ -116,7 +116,6 @@ var begin ZeroMemory(@odp,sizeof(odp)); odp.Position :=900003000; - odp.hInstance :=hInstance; odp.pszTemplate:=PAnsiChar(IDD_DIALOG1); odp.szTitle.a :=qs_name; odp.szGroup.a :='Contacts'; diff --git a/plugins/QuickSearch/sr_frame.pas b/plugins/QuickSearch/sr_frame.pas index ed83536d43..76696e462c 100644 --- a/plugins/QuickSearch/sr_frame.pas +++ b/plugins/QuickSearch/sr_frame.pas @@ -171,7 +171,7 @@ begin TBName.w:='Quick search'; end; - FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),0); + FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),lparam(@g_Plugin)); if FrameId>=0 then begin CallService(MS_CLIST_FRAMES_UPDATEFRAME,FrameId, FU_FMPOS); diff --git a/plugins/QuickSearch/version.RES b/plugins/QuickSearch/version.RES new file mode 100644 index 0000000000..ac94f5ecf9 Binary files /dev/null and b/plugins/QuickSearch/version.RES differ diff --git a/plugins/Quotes/src/Forex.cpp b/plugins/Quotes/src/Forex.cpp index 8e501c3e80..2ee56b9554 100644 --- a/plugins/Quotes/src/Forex.cpp +++ b/plugins/Quotes/src/Forex.cpp @@ -61,7 +61,7 @@ INT_PTR QuotesMenu_EnableDisable(WPARAM, LPARAM) void InitMenu() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Quotes"), 0, Quotes_GetIconHandle(IDI_ICON_MAIN)); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "B474F556-22B6-42A1-A91E-22FE4F671388"); @@ -260,9 +260,8 @@ int QuotesEventFunc_OptInitialise(WPARAM wp, LPARAM/* lp*/) const CModuleInfo::TQuotesProvidersPtr& pProviders = CModuleInfo::GetQuoteProvidersPtr(); const CQuotesProviders::TQuotesProviders& rapProviders = pProviders->GetProviders(); - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 910000000; - odp.hInstance = g_plugin.getInst(); odp.szTitle.w = _T(QUOTES_PROTOCOL_NAME); odp.szGroup.w = LPGENW("Network"); odp.flags = ODPF_USERINFOTAB | ODPF_UNICODE; diff --git a/plugins/Quotes/src/QuoteInfoDlg.cpp b/plugins/Quotes/src/QuoteInfoDlg.cpp index c95504e08d..4e454fd7f9 100644 --- a/plugins/Quotes/src/QuoteInfoDlg.cpp +++ b/plugins/Quotes/src/QuoteInfoDlg.cpp @@ -107,8 +107,7 @@ int QuotesEventFunc_OnUserInfoInit(WPARAM wp, LPARAM lp) g_hContact = hContact; - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pfnDlgProc = QuoteInfoDlgProc; odp.position = -2000000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_QUOTE_INFO); diff --git a/plugins/RecentContacts/src/RecentContacts.cpp b/plugins/RecentContacts/src/RecentContacts.cpp index 8b2fb34115..2951ff1ce0 100644 --- a/plugins/RecentContacts/src/RecentContacts.cpp +++ b/plugins/RecentContacts/src/RecentContacts.cpp @@ -437,7 +437,7 @@ int Create_TopToolbarShowList(WPARAM, LPARAM) int Create_MenuitemShowList(void) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xe22ce213, 0x362a, 0x444a, 0xa5, 0x82, 0xc, 0xcf, 0xf5, 0x4b, 0xd1, 0x8e); mi.hIcolibItem = iconList[0].hIcolib; mi.name.a = LPGEN("Recent Contacts"); diff --git a/plugins/RecentContacts/src/options.cpp b/plugins/RecentContacts/src/options.cpp index 313d89a130..57795570bb 100644 --- a/plugins/RecentContacts/src/options.cpp +++ b/plugins/RecentContacts/src/options.cpp @@ -57,8 +57,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP int onOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Contacts"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_LASTUC_OPT); odp.szTitle.a = LPGEN("Recent Contacts"); diff --git a/plugins/RemovePersonalSettings/src/rps.cpp b/plugins/RemovePersonalSettings/src/rps.cpp index 0900f3ee71..5bba760a16 100644 --- a/plugins/RemovePersonalSettings/src/rps.cpp +++ b/plugins/RemovePersonalSettings/src/rps.cpp @@ -589,7 +589,7 @@ static INT_PTR RemoveAllService(WPARAM, LPARAM) int CMPlugin::Load() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x2f9f21df, 0xf33c, 0x4640, 0xb9, 0x63, 0xd3, 0x26, 0x8a, 0xb8, 0xb1, 0xf0); mi.position = -0x7FFFFFFF; mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA); diff --git a/plugins/Restart/src/restart.cpp b/plugins/Restart/src/restart.cpp index 037cc634be..91e5fa4a0b 100644 --- a/plugins/Restart/src/restart.cpp +++ b/plugins/Restart/src/restart.cpp @@ -49,7 +49,7 @@ int CMPlugin::Load() hRestartMe = CreateServiceFunction("System/RestartMe", RestartMe); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x9181059, 0x5316, 0x4be3, 0x96, 0xb7, 0x80, 0x51, 0xa9, 0x3a, 0xd8, 0x49); mi.position = -0x7FFFFFFF; mi.hIcolibItem = iconList[0].hIcolib; diff --git a/plugins/SMS/src/SMS_svc.cpp b/plugins/SMS/src/SMS_svc.cpp index 17f692252e..803ef766af 100644 --- a/plugins/SMS/src/SMS_svc.cpp +++ b/plugins/SMS/src/SMS_svc.cpp @@ -27,7 +27,7 @@ int LoadModules(void) char szServiceFunction[MAX_PATH]; mir_snprintf(szServiceFunction, "%s%s", MODULENAME, SMS_SEND); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x3ce387db, 0xbaac, 0x490f, 0xac, 0xab, 0x8c, 0xf7, 0xe9, 0xcd, 0x86, 0xa1); mi.position = 300050000; diff --git a/plugins/SMS/src/options.cpp b/plugins/SMS/src/options.cpp index 3a9bfd6014..0ddd928ea3 100644 --- a/plugins/SMS/src/options.cpp +++ b/plugins/SMS/src/options.cpp @@ -88,9 +88,8 @@ INT_PTR CALLBACK DlgProcEditorOptions(HWND hWndDlg, UINT msg, WPARAM wParam, LPA int OptInitialise(WPARAM wParam,LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 910000000; - odp.hInstance = ssSMSSettings.hInstance; odp.szGroup.a = LPGEN("Events"); odp.flags = ODPF_BOLDGROUPS; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SMSPLUGIN); diff --git a/plugins/Scriver/src/chat_main.cpp b/plugins/Scriver/src/chat_main.cpp index 2a8e500710..191bd75ffd 100644 --- a/plugins/Scriver/src/chat_main.cpp +++ b/plugins/Scriver/src/chat_main.cpp @@ -127,7 +127,7 @@ static void OnLoadSettings() int Chat_Load() { - CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Messaging") L"/" LPGENW("Group chats"), FONTMODE_SKIP, g_plugin.m_hLang }; + CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Messaging") L"/" LPGENW("Group chats"), FONTMODE_SKIP, &g_plugin }; Chat_CustomizeApi(&data); g_chatApi.OnCreateModule = OnCreateModule; diff --git a/plugins/Scriver/src/msgoptions.cpp b/plugins/Scriver/src/msgoptions.cpp index 84088c24f9..0379451f63 100644 --- a/plugins/Scriver/src/msgoptions.cpp +++ b/plugins/Scriver/src/msgoptions.cpp @@ -897,9 +897,8 @@ static INT_PTR CALLBACK DlgProcTypeOptions(HWND hwndDlg, UINT msg, WPARAM wParam int OptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 910000000; - odp.hInstance = g_plugin.getInst(); odp.szTitle.a = LPGEN("Message sessions"); odp.flags = ODPF_BOLDGROUPS; @@ -943,7 +942,6 @@ int OptInitialise(WPARAM wParam, LPARAM) if (g_dat.popupInstalled) { odp.position = 910000002; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSPOPUP); odp.szGroup.a = LPGEN("Popups"); odp.szTitle.a = LPGEN("Messaging"); diff --git a/plugins/Scriver/src/msgs.cpp b/plugins/Scriver/src/msgs.cpp index cc1b078373..9a417afbd7 100644 --- a/plugins/Scriver/src/msgs.cpp +++ b/plugins/Scriver/src/msgs.cpp @@ -403,7 +403,7 @@ static void RegisterStatusIcons() sid.hIcon = GetCachedIcon("scriver_TYPING"); sid.hIconDisabled = GetCachedIcon("scriver_TYPINGOFF"); sid.flags = MBF_HIDDEN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); } void ChangeStatusIcons() @@ -442,7 +442,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("scriver_SEND"); bbd.pwszText = LPGENW("&OK"); bbd.pwszTooltip = LPGENW("Send message"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_QUOTE; @@ -450,7 +450,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("scriver_QUOTE"); bbd.pwszText = LPGENW("&Quote"); bbd.pwszTooltip = LPGENW("Quote"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags |= BBBF_ISRSIDEBUTTON; bbd.dwButtonID = IDC_ADD; @@ -458,21 +458,21 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("scriver_ADD"); bbd.pwszText = LPGENW("&Add"); bbd.pwszTooltip = LPGENW("Add contact permanently to list"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_USERMENU; bbd.dwDefPos = 30; bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_DOWNARROW); bbd.pwszText = LPGENW("&User menu"); bbd.pwszTooltip = LPGENW("User menu"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_DETAILS; bbd.dwDefPos = 40; bbd.hIcon = IcoLib_GetIconHandle("scriver_USERDETAILS"); bbd.pwszText = LPGENW("User &details"); bbd.pwszTooltip = LPGENW("View user's details"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags |= BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON; bbd.dwButtonID = IDC_SRMM_HISTORY; @@ -480,7 +480,7 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("scriver_HISTORY"); bbd.pwszText = LPGENW("&History"); bbd.pwszTooltip = LPGENW("View user's history (CTRL+H)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); // chat buttons bbd.bbbFlags = BBBF_ISPUSHBUTTON | BBBF_ISCHATBUTTON | BBBF_CREATEBYID; @@ -489,35 +489,35 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("chat_bold"); bbd.pwszText = LPGENW("&Bold"); bbd.pwszTooltip = LPGENW("Make the text bold (CTRL+B)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_ITALICS; bbd.dwDefPos = 15; bbd.hIcon = IcoLib_GetIconHandle("chat_italics"); bbd.pwszText = LPGENW("&Italic"); bbd.pwszTooltip = LPGENW("Make the text italicized (CTRL+I)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_UNDERLINE; bbd.dwDefPos = 20; bbd.hIcon = IcoLib_GetIconHandle("chat_underline"); bbd.pwszText = LPGENW("&Underline"); bbd.pwszTooltip = LPGENW("Make the text underlined (CTRL+U)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_COLOR; bbd.dwDefPos = 25; bbd.hIcon = IcoLib_GetIconHandle("chat_fgcol"); bbd.pwszText = LPGENW("&Color"); bbd.pwszTooltip = LPGENW("Select a foreground color for the text (CTRL+K)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_BKGCOLOR; bbd.dwDefPos = 30; bbd.hIcon = IcoLib_GetIconHandle("chat_bkgcol"); bbd.pwszText = LPGENW("&Background color"); bbd.pwszTooltip = LPGENW("Select a background color for the text (CTRL+L)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_CHANMGR; @@ -525,21 +525,21 @@ int RegisterToolbarIcons(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("chat_settings"); bbd.pwszText = LPGENW("&Room settings"); bbd.pwszTooltip = LPGENW("Control this room (CTRL+O)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_SHOWNICKLIST; bbd.dwDefPos = 20; bbd.hIcon = IcoLib_GetIconHandle("chat_nicklist"); bbd.pwszText = LPGENW("&Show/hide nick list"); bbd.pwszTooltip = LPGENW("Show/hide the nick list (CTRL+N)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_FILTER; bbd.dwDefPos = 10; bbd.hIcon = IcoLib_GetIconHandle("chat_filter"); bbd.pwszText = LPGENW("&Filter"); bbd.pwszTooltip = LPGENW("Enable/disable the event filter (CTRL+F)"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } @@ -570,7 +570,7 @@ static int OnModulesLoaded(WPARAM, LPARAM) LoadMsgLogIcons(); ModuleLoad(0, 0); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x58d8dc1, 0x1c25, 0x49c0, 0xb8, 0x7c, 0xa3, 0x22, 0x2b, 0x3d, 0xf1, 0xd8); mi.position = -2000090000; mi.flags = CMIF_DEFAULT; diff --git a/plugins/SecureIM/src/main.cpp b/plugins/SecureIM/src/main.cpp index 6dd6706a23..35bd01a72d 100644 --- a/plugins/SecureIM/src/main.cpp +++ b/plugins/SecureIM/src/main.cpp @@ -26,7 +26,7 @@ CMPlugin::CMPlugin() : static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, LPCSTR szUid, HICON hicon, LPCSTR service, int flags = 0, WPARAM wParam = 0) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = flags | CMIF_HIDDEN | CMIF_UNICODE; mi.position = pos; mi.hIcolibItem = hicon; @@ -39,7 +39,7 @@ static HGENMENU MyAddMenuItem(LPCWSTR name, int pos, LPCSTR szUid, HICON hicon, static HGENMENU MyAddSubItem(HGENMENU hRoot, LPCSTR name, int pos, int poppos, LPCSTR service, WPARAM wParam = 0) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_HIDDEN | CMIF_SYSTEM; mi.position = pos; mi.name.a = (char*)name; diff --git a/plugins/SecureIM/src/options.cpp b/plugins/SecureIM/src/options.cpp index 789a7bf667..89fce2390d 100644 --- a/plugins/SecureIM/src/options.cpp +++ b/plugins/SecureIM/src/options.cpp @@ -1686,8 +1686,7 @@ BOOL LoadImportRSAKeyDlg(HWND hParent, LPSTR key, BOOL priv) int onRegisterOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONSTAB); odp.szTitle.a = (char*)MODULENAME; odp.szGroup.a = LPGEN("Services"); diff --git a/plugins/SecureIM/src/popupOptions.cpp b/plugins/SecureIM/src/popupOptions.cpp index 8f799ea352..6082ed09cc 100644 --- a/plugins/SecureIM/src/popupOptions.cpp +++ b/plugins/SecureIM/src/popupOptions.cpp @@ -162,8 +162,7 @@ void RefreshPopupOptionsDlg(HWND hec, HWND hdc, HWND hss, HWND hsr, HWND hks, HW int onRegisterPopOptions(WPARAM wParam, LPARAM) { if (bPopupExists) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCE(IDD_POPUP); odp.szTitle.a = (char*)MODULENAME; odp.szGroup.a = LPGEN("Popups"); diff --git a/plugins/SecureIM/src/svcs_srmm.cpp b/plugins/SecureIM/src/svcs_srmm.cpp index 4fe6189727..1d9f0f065f 100644 --- a/plugins/SecureIM/src/svcs_srmm.cpp +++ b/plugins/SecureIM/src/svcs_srmm.cpp @@ -40,28 +40,28 @@ void InitSRMMIcons() sid.hIcon = mode2icon(MODE_NATIVE | SECURED, 3); sid.hIconDisabled = mode2icon(MODE_NATIVE, 3); sid.szTooltip = LPGEN("SecureIM [Native]"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); // PGP sid.dwId = MODE_PGP; sid.hIcon = mode2icon(MODE_PGP | SECURED, 3); sid.hIconDisabled = mode2icon(MODE_PGP, 3); sid.szTooltip = LPGEN("SecureIM [PGP]"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); // GPG sid.dwId = MODE_GPG; sid.hIcon = mode2icon(MODE_GPG | SECURED, 3); sid.hIconDisabled = mode2icon(MODE_GPG, 3); sid.szTooltip = LPGEN("SecureIM [GPG]"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); // RSAAES sid.dwId = MODE_RSAAES; sid.hIcon = mode2icon(MODE_RSAAES | SECURED, 3); sid.hIconDisabled = mode2icon(MODE_RSAAES, 3); sid.szTooltip = LPGEN("SecureIM [RSA/AES]"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); // hook the window events so that we can can change the status of the icon HookEvent(ME_MSG_WINDOWEVENT, onWindowEvent); diff --git a/plugins/SeenPlugin/src/menu.cpp b/plugins/SeenPlugin/src/menu.cpp index aa5bcccfa2..7127318474 100644 --- a/plugins/SeenPlugin/src/menu.cpp +++ b/plugins/SeenPlugin/src/menu.cpp @@ -69,7 +69,7 @@ void InitMenuitem() { CreateServiceFunction("LastSeenUserDetails", MenuitemClicked); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x7d9b9518, 0x85fa, 0x40f1, 0xb5, 0x3e, 0x3e, 0x3c, 0x68, 0xae, 0xda, 0x90); mi.position = -0x7FFFFFFF; mi.name.a = LPGEN("Last seen"); diff --git a/plugins/SeenPlugin/src/options.cpp b/plugins/SeenPlugin/src/options.cpp index db4914a3e6..8c9d456781 100644 --- a/plugins/SeenPlugin/src/options.cpp +++ b/plugins/SeenPlugin/src/options.cpp @@ -486,9 +486,8 @@ INT_PTR CALLBACK OptsSettingsDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM int OptionsInit(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETTINGS); odp.szGroup.w = LPGENW("Contacts"); diff --git a/plugins/SeenPlugin/src/userinfo.cpp b/plugins/SeenPlugin/src/userinfo.cpp index 6be9c40bba..b4d5dc07a8 100644 --- a/plugins/SeenPlugin/src/userinfo.cpp +++ b/plugins/SeenPlugin/src/userinfo.cpp @@ -70,7 +70,6 @@ int UserinfoInit(WPARAM wparam, LPARAM lparam) if (IsWatchedProtocol(szProto) && !db_get_b(hContact, szProto, "ChatRoom", false)) { OPTIONSDIALOGPAGE uip = { sizeof(uip) }; - uip.hInstance = g_plugin.getInst(); uip.pszTemplate = MAKEINTRESOURCEA(IDD_USERINFO); uip.szTitle.a = LPGEN("Last seen"); uip.pfnDlgProc = UserinfoDlgProc; diff --git a/plugins/SendScreenshotPlus/src/Main.cpp b/plugins/SendScreenshotPlus/src/Main.cpp index d0576407f0..437eaaeb1b 100644 --- a/plugins/SendScreenshotPlus/src/Main.cpp +++ b/plugins/SendScreenshotPlus/src/Main.cpp @@ -283,7 +283,7 @@ int CMPlugin::Load() srv_reg(Send2ImageShack); // menu items - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; mi.hIcolibItem = GetIconHandle(ICO_MAINXS); diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 6d44ad45c2..cf0b3bebcf 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -772,7 +772,7 @@ static int PluginInit(WPARAM, LPARAM) g_plugin.addHotkey(&hkd); // Main menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.position = 1000000000; mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Sessions Manager"), 1000000000); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "D77B9AB4-AF7E-43DB-A487-BD581704D635"); diff --git a/plugins/Sessions/Src/Options.cpp b/plugins/Sessions/Src/Options.cpp index 51409e4785..6aab0f3f35 100644 --- a/plugins/Sessions/Src/Options.cpp +++ b/plugins/Sessions/Src/Options.cpp @@ -489,9 +489,8 @@ static INT_PTR CALLBACK OptionsProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM l int OptionsInit(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 955000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = MODULENAME; odp.pfnDlgProc = OptionsProc; diff --git a/plugins/ShellExt/src/options.cpp b/plugins/ShellExt/src/options.cpp index e8f56e1614..e6b24c66f8 100644 --- a/plugins/ShellExt/src/options.cpp +++ b/plugins/ShellExt/src/options.cpp @@ -115,7 +115,6 @@ int OnOptionsInit(WPARAM wParam, LPARAM) opt.szTitle.a = LPGEN("Shell context menus"); opt.position = -1066; opt.pszTemplate = MAKEINTRESOURCEA(IDD_SHLOPTS); - opt.hInstance = g_plugin.getInst(); opt.pfnDlgProc = OptDialogProc; g_plugin.addOptions(wParam, &opt); return 0; diff --git a/plugins/SimpleAR/src/Main.cpp b/plugins/SimpleAR/src/Main.cpp index 734cee99ef..a4883dfeeb 100644 --- a/plugins/SimpleAR/src/Main.cpp +++ b/plugins/SimpleAR/src/Main.cpp @@ -246,7 +246,7 @@ int CMPlugin::Load() CreateServiceFunction(MODULENAME"/ToggleEnable", ToggleEnable); CreateServiceFunction(MODULENAME"/ToggleAutoanswer", Toggle); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xac1c64a, 0x82ca, 0x4845, 0x86, 0x89, 0x59, 0x76, 0x12, 0x74, 0x72, 0x7b); mi.position = 500090000; diff --git a/plugins/SimpleAR/src/Options.cpp b/plugins/SimpleAR/src/Options.cpp index 33ec72f31d..4fb0a78f34 100644 --- a/plugins/SimpleAR/src/Options.cpp +++ b/plugins/SimpleAR/src/Options.cpp @@ -135,9 +135,8 @@ INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara INT OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTION); odp.szTitle.a = LPGEN("Simple Auto Replier"); odp.szGroup.a = LPGEN("Message sessions"); diff --git a/plugins/SimpleStatusMsg/src/awaymsg.cpp b/plugins/SimpleStatusMsg/src/awaymsg.cpp index 72555d6130..c338b2b668 100644 --- a/plugins/SimpleStatusMsg/src/awaymsg.cpp +++ b/plugins/SimpleStatusMsg/src/awaymsg.cpp @@ -382,7 +382,7 @@ int LoadAwayMsgModule(void) hWindowList = WindowList_Create(); hWindowList2 = WindowList_Create(); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; SET_UID(mi, 0xd3282acc, 0x9ff1, 0x4ede, 0x8a, 0x1e, 0x36, 0x72, 0x3f, 0x44, 0x4f, 0x84); diff --git a/plugins/SimpleStatusMsg/src/main.cpp b/plugins/SimpleStatusMsg/src/main.cpp index 13a65ce4ce..eddf7ad04f 100644 --- a/plugins/SimpleStatusMsg/src/main.cpp +++ b/plugins/SimpleStatusMsg/src/main.cpp @@ -1269,7 +1269,7 @@ static int ChangeStatusMsgPrebuild(WPARAM, LPARAM) if (!iStatusMsgFlags || !iStatusMenuItemCount) return 0; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; if (!db_get_b(NULL, MODULENAME, "ShowStatusMenuItem", 1)) mi.flags |= CMIF_HIDDEN; diff --git a/plugins/SimpleStatusMsg/src/options.cpp b/plugins/SimpleStatusMsg/src/options.cpp index be24533c97..1652e32181 100644 --- a/plugins/SimpleStatusMsg/src/options.cpp +++ b/plugins/SimpleStatusMsg/src/options.cpp @@ -1525,8 +1525,7 @@ int InitOptions(WPARAM wParam, LPARAM) if (accounts->statusCount == 0) return 0; - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; if (!ServiceExists(MS_SS_GETPROFILECOUNT)) { diff --git a/plugins/SkypeStatusChange/src/options.cpp b/plugins/SkypeStatusChange/src/options.cpp index dadabb5995..ee990c5762 100644 --- a/plugins/SkypeStatusChange/src/options.cpp +++ b/plugins/SkypeStatusChange/src/options.cpp @@ -299,9 +299,8 @@ static INT_PTR CALLBACK SettingsDlgProc(HWND hdlg,UINT msg,WPARAM wp,LPARAM lp) int SSC_OptInitialise(WPARAM wp, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 910000000; - odp.hInstance = g_plugin.getInst(); odp.szTitle.a = LPGEN("Change Skype status"); odp.szGroup.a = LPGEN("Plugins"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG_SETTINGS); diff --git a/plugins/SmileyAdd/src/dlgboxsubclass.cpp b/plugins/SmileyAdd/src/dlgboxsubclass.cpp index f8adf3d796..1a786ddae2 100644 --- a/plugins/SmileyAdd/src/dlgboxsubclass.cpp +++ b/plugins/SmileyAdd/src/dlgboxsubclass.cpp @@ -120,7 +120,7 @@ int SmileyButtonCreate(WPARAM, LPARAM) bbd.hIcon = IcoLib_GetIconHandle("SmileyAdd_ButtonSmiley"); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON; bbd.pszHotkey = desc.pszName; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/SmileyAdd/src/main.cpp b/plugins/SmileyAdd/src/main.cpp index 409e5bb81a..7745910a4f 100644 --- a/plugins/SmileyAdd/src/main.cpp +++ b/plugins/SmileyAdd/src/main.cpp @@ -54,7 +54,7 @@ static IconItem iconList[] = static int ModulesLoaded(WPARAM, LPARAM) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x5ba238de, 0xe16b, 0x4928, 0xa0, 0x70, 0xff, 0x43, 0xf6, 0x1f, 0x16, 0xd4); mi.position = 2000070050; mi.hIcolibItem = iconList[0].hIcolib; diff --git a/plugins/SmileyAdd/src/options.cpp b/plugins/SmileyAdd/src/options.cpp index 7c1e1ebe69..e2c18a576f 100644 --- a/plugins/SmileyAdd/src/options.cpp +++ b/plugins/SmileyAdd/src/options.cpp @@ -629,9 +629,8 @@ static INT_PTR CALLBACK DlgProcSmileysOptions(HWND hwndDlg, UINT msg, WPARAM wPa int SmileysOptionsInitialize(WPARAM addInfo, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 910000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SMILEYS); odp.szTitle.a = LPGEN("Smileys"); odp.szGroup.a = LPGEN("Customize"); diff --git a/plugins/SmileyAdd/src/services.cpp b/plugins/SmileyAdd/src/services.cpp index ae9db94aed..21ca56813b 100644 --- a/plugins/SmileyAdd/src/services.cpp +++ b/plugins/SmileyAdd/src/services.cpp @@ -287,7 +287,7 @@ int RebuildContactMenu(WPARAM wParam, LPARAM) CMStringW cat; opt.ReadContactCategory(wParam, cat); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.root = hContactMenuItem; mi.flags = CMIF_UNICODE | CMIF_SYSTEM; mi.pszService = MS_SMILEYADD_CUSTOMCATMENU; diff --git a/plugins/Spamotron/src/options.cpp b/plugins/Spamotron/src/options.cpp index 2183656a5e..bb2a2d15db 100644 --- a/plugins/Spamotron/src/options.cpp +++ b/plugins/Spamotron/src/options.cpp @@ -551,8 +551,7 @@ extern INT_PTR CALLBACK DlgProcOptionsPopups(HWND optDlg, UINT msg, WPARAM wPara int OnOptInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Message sessions"); odp.szTitle.a = MODULENAME; odp.flags = ODPF_BOLDGROUPS; diff --git a/plugins/SpellChecker/src/options.cpp b/plugins/SpellChecker/src/options.cpp index b1580a3701..7302be7246 100644 --- a/plugins/SpellChecker/src/options.cpp +++ b/plugins/SpellChecker/src/options.cpp @@ -55,8 +55,7 @@ static OptPageControl autoReplaceControls[] = { int InitOptionsCallback(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Message sessions"); odp.szTitle.a = LPGEN("Spell Checker"); odp.pfnDlgProc = OptionsDlgProc; @@ -65,7 +64,6 @@ int InitOptionsCallback(WPARAM wParam, LPARAM) g_plugin.addOptions(wParam, &odp); memset(&odp, 0, sizeof(odp)); - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("Message sessions"); odp.szTitle.a = LPGEN("Auto-replacements"); odp.pfnDlgProc = AutoreplaceDlgProc; diff --git a/plugins/SpellChecker/src/spellchecker.cpp b/plugins/SpellChecker/src/spellchecker.cpp index 2226ae058a..f5ce69d0a7 100644 --- a/plugins/SpellChecker/src/spellchecker.cpp +++ b/plugins/SpellChecker/src/spellchecker.cpp @@ -198,7 +198,7 @@ static int ModulesLoaded(WPARAM, LPARAM) mir_snwprintf(tmp, L"%s - %s", TranslateT("Spell Checker"), languages[i]->full_name); sid.tszTooltip = tmp; sid.hIcon = (opts.use_flags) ? IcoLib_GetIconByHandle(languages[i]->hIcolib) : IcoLib_GetIcon("spellchecker_enabled"); - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); } HOTKEYDESC hkd = {}; diff --git a/plugins/SplashScreen/src/options.cpp b/plugins/SplashScreen/src/options.cpp index db5b2f2bcd..ae68e43f83 100644 --- a/plugins/SplashScreen/src/options.cpp +++ b/plugins/SplashScreen/src/options.cpp @@ -335,8 +335,7 @@ INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP int OptInit(WPARAM wParam, LPARAM lParam) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Skins"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_SPLASH_OPT); odp.szTitle.a = LPGEN("Splash Screen"); diff --git a/plugins/StartPosition/src/startposition.cpp b/plugins/StartPosition/src/startposition.cpp index 85c29bea02..75f0634117 100644 --- a/plugins/StartPosition/src/startposition.cpp +++ b/plugins/StartPosition/src/startposition.cpp @@ -48,7 +48,6 @@ void CMPlugin::positionClist() int CMPlugin::OnOptionsInit(WPARAM wParam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("Contact list"); odp.szTitle.a = LPGEN("Start position"); odp.pDialog = new COptionsDlg(); diff --git a/plugins/StartupSilence/src/main.cpp b/plugins/StartupSilence/src/main.cpp index 60f72d9e28..03b9b5e43c 100644 --- a/plugins/StartupSilence/src/main.cpp +++ b/plugins/StartupSilence/src/main.cpp @@ -240,7 +240,7 @@ static INT_PTR SilenceConnection(WPARAM wParam, LPARAM) static INT_PTR InitMenu() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x9100c881, 0x6f76, 0x4cb5, 0x97, 0x66, 0xeb, 0xf5, 0xc5, 0x22, 0x46, 0x1f); mi.position = 100000000; mi.hIcolibItem = GetIconHandle(MENU_NAME); @@ -412,8 +412,7 @@ static INT_PTR CALLBACK DlgProcOptions(HWND hwndDlg, UINT msg, WPARAM wParam, LP int InitializeOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_SSOPT); odp.szGroup.a = LPGEN("Events");//FIXME: move to...Group? odp.szTitle.a = MENU_NAME; diff --git a/plugins/StatusChange/src/main.cpp b/plugins/StatusChange/src/main.cpp index 21be66c31f..580d8bb631 100644 --- a/plugins/StatusChange/src/main.cpp +++ b/plugins/StatusChange/src/main.cpp @@ -318,8 +318,7 @@ static INT_PTR CALLBACK DlgProcStatusChangeOpts(HWND hwndDlg, UINT msg, WPARAM w int StatusChangeOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.w = LPGENW("Status Change"); odp.szGroup.w = LPGENW("Status"); diff --git a/plugins/StatusManager/src/aaa_options.cpp b/plugins/StatusManager/src/aaa_options.cpp index 153b1656f7..934e550227 100644 --- a/plugins/StatusManager/src/aaa_options.cpp +++ b/plugins/StatusManager/src/aaa_options.cpp @@ -600,9 +600,8 @@ static INT_PTR CALLBACK DlgProcAutoAwayGeneralOpts(HWND hwndDlg, UINT msg, WPARA int AutoAwayOptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 1000000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS; odp.szGroup.a = LPGEN("Status"); odp.szTitle.a = LPGEN("Auto away"); @@ -610,16 +609,16 @@ int AutoAwayOptInitialise(WPARAM wParam, LPARAM) odp.szTab.a = LPGEN("General"); odp.pfnDlgProc = DlgProcAutoAwayGeneralOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_GENAUTOAWAY); - Options_AddPage(wParam, &odp, AAALangPack); + Options_AddPage(wParam, &odp, &AAAPlugin); odp.szTab.a = LPGEN("Rules"); odp.pfnDlgProc = DlgProcAutoAwayRulesOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTOAWAY); - Options_AddPage(wParam, &odp, AAALangPack); + Options_AddPage(wParam, &odp, &AAAPlugin); odp.szTab.a = LPGEN("Status messages"); odp.pfnDlgProc = DlgProcAutoAwayMsgOpts; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_AUTOAWAYMSG); - Options_AddPage(wParam, &odp, AAALangPack); + Options_AddPage(wParam, &odp, &AAAPlugin); return 0; } diff --git a/plugins/StatusManager/src/advancedautoaway.cpp b/plugins/StatusManager/src/advancedautoaway.cpp index 8f37e7d596..b3a9d10c75 100644 --- a/plugins/StatusManager/src/advancedautoaway.cpp +++ b/plugins/StatusManager/src/advancedautoaway.cpp @@ -30,7 +30,7 @@ ///////////////////////////////////////////////////////////////////////////////////////// -int AAALangPack; +CFakePlugin AAAPlugin(AAAMODULENAME); static HANDLE hEvents[3]; @@ -517,9 +517,7 @@ static int AAAModuleLoaded(WPARAM, LPARAM) void AdvancedAutoAwayLoad() { - AAALangPack = GetPluginLangId(MIID_LAST, 0); - - g_bAAASettingSame = db_get_b(0, AAAMODULENAME, SETTING_SAMESETTINGS, 0); + g_bAAASettingSame = AAAPlugin.getByte(SETTING_SAMESETTINGS); if (g_bMirandaLoaded) AAAModuleLoaded(0, 0); @@ -532,7 +530,7 @@ void AdvancedAutoAwayUnload() if (g_bMirandaLoaded) AutoAwayShutdown(0, 0); - KillModuleOptions(AAALangPack); + KillModuleOptions(&AAAPlugin); for (auto &it : hEvents) { UnhookEvent(it); diff --git a/plugins/StatusManager/src/keepstatus.cpp b/plugins/StatusManager/src/keepstatus.cpp index cbb52e8777..2fd5caf039 100644 --- a/plugins/StatusManager/src/keepstatus.cpp +++ b/plugins/StatusManager/src/keepstatus.cpp @@ -19,7 +19,7 @@ #include "stdafx.h" -int KSLangPack; +CFakePlugin KSPlugin(KSMODULENAME); static HANDLE hConnectionEvent = nullptr; static HANDLE hServices[4], hEvents[2]; @@ -93,18 +93,18 @@ int KSLoadOptions() { KSUnloadOptions(); - if (db_get_b(0, KSMODULENAME, SETTING_CHECKCONNECTION, FALSE)) { - if (db_get_b(0, KSMODULENAME, SETTING_CONTCHECK, FALSE)) { - if (db_get_b(0, KSMODULENAME, SETTING_BYPING, FALSE)) { + if (KSPlugin.getByte(SETTING_CHECKCONNECTION, FALSE)) { + if (KSPlugin.getByte(SETTING_CONTCHECK, FALSE)) { + if (KSPlugin.getByte(SETTING_BYPING, FALSE)) { WSADATA wsaData; WSAStartup(MAKEWORD(2, 2), &wsaData); } StartTimer(IDT_CHECKCONTIN, 0, FALSE); } - increaseExponential = db_get_b(0, KSMODULENAME, SETTING_INCREASEEXPONENTIAL, FALSE); - currentDelay = initDelay = 1000 * db_get_dw(0, KSMODULENAME, SETTING_INITDELAY, DEFAULT_INITDELAY); - maxDelay = 1000 * db_get_dw(0, KSMODULENAME, SETTING_MAXDELAY, DEFAULT_MAXDELAY); - maxRetries = db_get_b(0, KSMODULENAME, SETTING_MAXRETRIES, 0); + increaseExponential = KSPlugin.getByte(SETTING_INCREASEEXPONENTIAL, FALSE); + currentDelay = initDelay = 1000 * KSPlugin.getDword(SETTING_INITDELAY, DEFAULT_INITDELAY); + maxDelay = 1000 * KSPlugin.getDword(SETTING_MAXDELAY, DEFAULT_MAXDELAY); + maxRetries = KSPlugin.getByte(SETTING_MAXRETRIES, 0); if (maxRetries == 0) maxRetries = -1; hProtoAckHook = HookEvent(ME_PROTO_ACK, ProcessProtoAck); @@ -112,7 +112,7 @@ int KSLoadOptions() if (ServiceExists(ME_CS_STATUSCHANGE)) hCSStatusChangeHook = HookEvent(ME_CS_STATUSCHANGE, CSStatusChange); hCSStatusChangeExHook = HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChangeEx); - if (db_get_b(0, KSMODULENAME, SETTING_CHECKAPMRESUME, 0)) { + if (KSPlugin.getByte(SETTING_CHECKAPMRESUME, 0)) { if (!IsWindow(hMessageWindow)) { hMessageWindow = CreateWindowEx(0, L"STATIC", nullptr, 0, 0, 0, 0, 0, nullptr, nullptr, nullptr, nullptr); SetWindowLongPtr(hMessageWindow, GWLP_WNDPROC, (LONG_PTR)MessageWndProc); @@ -132,7 +132,7 @@ int SMProto::AssignStatus(int iStatus, int iLastStatus, wchar_t *pwszMsg) return -1; if (iStatus != ID_STATUS_OFFLINE && m_status == ID_STATUS_DISABLED) return -2; - if (!db_get_b(0, KSMODULENAME, SETTING_NOLOCKED, 0) && Proto_GetAccount(m_szName)->IsLocked()) + if (!KSPlugin.getByte(SETTING_NOLOCKED, 0) && Proto_GetAccount(m_szName)->IsLocked()) return -3; mir_cslock lck(GenStatusCS); @@ -140,7 +140,7 @@ int SMProto::AssignStatus(int iStatus, int iLastStatus, wchar_t *pwszMsg) char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", m_szName); m_lastStatus = (iLastStatus == 0) ? m_status : iLastStatus; - if (!db_get_b(0, KSMODULENAME, dbSetting, 1)) + if (!KSPlugin.getByte(dbSetting, 1)) m_status = ID_STATUS_DISABLED; else if (iStatus == ID_STATUS_LAST) m_status = m_lastStatus; @@ -192,7 +192,7 @@ static int SetCurrentStatus() log_infoA("KeepStatus: status for %s differs: stored = %d, real = %d", p->m_szName, curStatus, realStatus); // force offline before reconnecting? - if (realStatus != ID_STATUS_OFFLINE && db_get_b(0, KSMODULENAME, SETTING_FIRSTOFFLINE, FALSE)) { + if (realStatus != ID_STATUS_OFFLINE && KSPlugin.getByte(SETTING_FIRSTOFFLINE, FALSE)) { log_infoA("KeepStatus: Setting %s offline before making a new connection attempt", p->m_szName); CallProtoService(p->m_szName, PS_SETSTATUS, (WPARAM)ID_STATUS_OFFLINE, 0); } @@ -333,7 +333,7 @@ static INT_PTR CALLBACK StartTimerApcProc(void *param) KillTimer(nullptr, checkContinTimerId); if (ti->timeout == 0) - ti->timeout = 1000 * db_get_dw(0, KSMODULENAME, SETTING_CNTDELAY, CHECKCONTIN_DELAY); + ti->timeout = 1000 * KSPlugin.getDword(SETTING_CNTDELAY, CHECKCONTIN_DELAY); checkContinTimerId = SetTimer(nullptr, 0, ti->timeout, CheckContinueslyTimer); } } @@ -434,7 +434,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", ack->szModule); - if (!db_get_b(0, KSMODULENAME, dbSetting, 1)) + if (!KSPlugin.getByte(dbSetting, 1)) return 0; if (ack->type == ACKTYPE_STATUS && ack->result == ACKRESULT_SUCCESS) { @@ -451,7 +451,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) for (auto &it : protoList) { if (!mir_strcmp(ack->szModule, it->m_szName)) { it->AssignStatus(ID_STATUS_OFFLINE); - if (db_get_b(0, KSMODULENAME, SETTING_CNCOTHERLOC, 0)) { + if (KSPlugin.getByte(SETTING_CNCOTHERLOC, 0)) { StopTimer(IDT_PROCESSACK); for (auto &jt : protoList) jt->AssignStatus(ID_STATUS_OFFLINE); @@ -466,7 +466,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) // login failed NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOGINERROR, (LPARAM)ack->szModule); - switch (db_get_b(0, KSMODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING)) { + switch (KSPlugin.getByte(SETTING_LOGINERR, LOGINERR_NOTHING)) { case LOGINERR_CANCEL: log_infoA("KeepStatus: cancel on login error (%s)", ack->szModule); for (auto &it : protoList) @@ -479,7 +479,7 @@ static int ProcessProtoAck(WPARAM, LPARAM lParam) case LOGINERR_SETDELAY: { - int newDelay = 1000 * db_get_dw(0, KSMODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY); + int newDelay = 1000 * KSPlugin.getDword(SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY); log_infoA("KeepStatus: set delay to %d ms on login error (%s)", newDelay, ack->szModule); StartTimer(IDT_CHECKCONN, newDelay, TRUE); } @@ -504,7 +504,7 @@ static VOID CALLBACK CheckConnectingTimer(HWND, UINT, UINT_PTR, DWORD) for (auto &it : protoList) { int curStatus = it->GetStatus(); if (IsStatusConnecting(curStatus)) { // connecting - int maxConnectingTime = db_get_dw(0, KSMODULENAME, SETTING_MAXCONNECTINGTIME, 0); + int maxConnectingTime = KSPlugin.getDword(SETTING_MAXCONNECTINGTIME, 0); if (maxConnectingTime > 0) { if ((unsigned int)maxConnectingTime <= ((GetTickCount() - it->lastStatusAckTime) / 1000)) { // set offline @@ -529,7 +529,7 @@ static VOID CALLBACK CheckAckStatusTimer(HWND, UINT, UINT_PTR, DWORD) continue; if (IsStatusConnecting(newStatus)) { // connecting - int maxConnectingTime = db_get_dw(0, KSMODULENAME, SETTING_MAXCONNECTINGTIME, 0); + int maxConnectingTime = KSPlugin.getDword(SETTING_MAXCONNECTINGTIME, 0); if (maxConnectingTime > 0) StartTimer(IDT_CHECKCONNECTING, (maxConnectingTime * 1000 - (GetTickCount() - it->lastStatusAckTime)), FALSE); } @@ -575,7 +575,7 @@ static VOID CALLBACK CheckConnectionTimer(HWND, UINT, UINT_PTR, DWORD) if (increaseExponential) currentDelay = min(2 * currentDelay, maxDelay); - if (((db_get_b(0, KSMODULENAME, SETTING_CHKINET, 0)) && (!InternetGetConnectedState(nullptr, 0))) || ((db_get_b(0, KSMODULENAME, SETTING_BYPING, FALSE)) && (!bLastPingResult))) { + if (((KSPlugin.getByte(SETTING_CHKINET, 0)) && (!InternetGetConnectedState(nullptr, 0))) || ((KSPlugin.getByte(SETTING_BYPING, FALSE)) && (!bLastPingResult))) { // no network NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_RETRYNOCONN, (LPARAM)retryCount + 1); ProcessPopup(KS_CONN_STATE_RETRYNOCONN, 0); @@ -670,7 +670,7 @@ static void CheckContinuouslyFunction(void *) return; } - BOOL ping = db_get_b(0, KSMODULENAME, SETTING_BYPING, FALSE); + BOOL ping = KSPlugin.getByte(SETTING_BYPING, FALSE); if (ping) { DBVARIANT dbv; if (db_get(0, KSMODULENAME, SETTING_PINGHOST, &dbv)) @@ -748,7 +748,7 @@ static void CheckContinuouslyFunction(void *) log_infoA("KeepStatus: connection lost! (continuesly check)"); NotifyEventHooks(hConnectionEvent, (WPARAM)KS_CONN_STATE_LOST, 0); ProcessPopup(KS_CONN_STATE_LOST, 0); - maxRetries = db_get_b(0, KSMODULENAME, SETTING_MAXRETRIES, 0); + maxRetries = KSPlugin.getByte(SETTING_MAXRETRIES, 0); if (maxRetries == 0) maxRetries = -1; StartTimer(IDT_CHECKCONN, initDelay, FALSE); @@ -757,7 +757,7 @@ static void CheckContinuouslyFunction(void *) static VOID CALLBACK CheckContinueslyTimer(HWND, UINT, UINT_PTR, DWORD) { - if (db_get_b(0, KSMODULENAME, SETTING_BYPING, FALSE)) + if (KSPlugin.getByte(SETTING_BYPING, FALSE)) mir_forkthread(CheckContinuouslyFunction); else CheckContinuouslyFunction(nullptr); @@ -772,19 +772,19 @@ static INT_PTR ShowPopup(const wchar_t *msg, HICON hIcon) ppd.lchIcon = hIcon; wcsncpy(ppd.lptzContactName, TranslateT("Keep status"), MAX_CONTACTNAME); wcsncpy(ppd.lptzText, msg, MAX_SECONDLINE); - if (db_get_b(0, KSMODULENAME, SETTING_POPUP_USEWINCOLORS, 0)) { + if (KSPlugin.getByte(SETTING_POPUP_USEWINCOLORS, 0)) { ppd.colorBack = GetSysColor(COLOR_BTNFACE); ppd.colorText = GetSysColor(COLOR_WINDOWTEXT); } - else if (!db_get_b(0, KSMODULENAME, SETTING_POPUP_USEDEFCOLORS, 0)) { - ppd.colorBack = db_get_dw(0, KSMODULENAME, SETTING_POPUP_BACKCOLOR, 0xAAAAAA); - ppd.colorText = db_get_dw(0, KSMODULENAME, SETTING_POPUP_TEXTCOLOR, 0x0000CC); + else if (!KSPlugin.getByte(SETTING_POPUP_USEDEFCOLORS, 0)) { + ppd.colorBack = KSPlugin.getDword(SETTING_POPUP_BACKCOLOR, 0xAAAAAA); + ppd.colorText = KSPlugin.getDword(SETTING_POPUP_TEXTCOLOR, 0x0000CC); } ppd.PluginWindowProc = KSPopupDlgProc; - switch (db_get_b(0, KSMODULENAME, SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { + switch (KSPlugin.getByte(SETTING_POPUP_DELAYTYPE, POPUP_DELAYFROMPU)) { case POPUP_DELAYCUSTOM: - ppd.iSeconds = (int)db_get_dw(0, KSMODULENAME, SETTING_POPUP_TIMEOUT, 0); + ppd.iSeconds = (int)KSPlugin.getDword(SETTING_POPUP_TIMEOUT, 0); if (ppd.iSeconds == 0) ppd.iSeconds = currentDelay / 1000 - 1; break; @@ -809,7 +809,7 @@ static wchar_t* GetHumanName(LPARAM lParam) static int ProcessPopup(int reason, LPARAM lParam) { - if (!db_get_b(0, KSMODULENAME, SETTING_SHOWCONNECTIONPOPUPS, FALSE) || !ServiceExists(MS_POPUP_ADDPOPUPT)) + if (!KSPlugin.getByte(SETTING_SHOWCONNECTIONPOPUPS, FALSE) || !ServiceExists(MS_POPUP_ADDPOPUPT)) return -1; HICON hIcon = nullptr; @@ -817,7 +817,7 @@ static int ProcessPopup(int reason, LPARAM lParam) switch (reason) { case KS_CONN_STATE_OTHERLOCATION: // lParam = 1 proto - if (!db_get_b(0, KSMODULENAME, SETTING_PUOTHER, TRUE)) + if (!KSPlugin.getByte(SETTING_PUOTHER, TRUE)) return -1; hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); @@ -825,20 +825,20 @@ static int ProcessPopup(int reason, LPARAM lParam) break; case KS_CONN_STATE_LOGINERROR: // lParam = 1 proto - if (!db_get_b(0, KSMODULENAME, SETTING_PUOTHER, TRUE)) + if (!KSPlugin.getByte(SETTING_PUOTHER, TRUE)) return -1; hIcon = Skin_LoadProtoIcon((char*)lParam, SKINICON_STATUS_OFFLINE); - if (db_get_b(0, KSMODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) + if (KSPlugin.getByte(SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_CANCEL) wszText.Format(TranslateT("%s login error, cancel reconnecting"), GetHumanName(lParam)); - else if (db_get_b(0, KSMODULENAME, SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) - wszText.Format(TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, db_get_dw(0, KSMODULENAME, SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); + else if (KSPlugin.getByte(SETTING_LOGINERR, LOGINERR_NOTHING) == LOGINERR_SETDELAY) + wszText.Format(TranslateT("%s login error (next retry (%d) in %d s)"), GetHumanName(lParam), retryCount + 1, KSPlugin.getDword(SETTING_LOGINERR_DELAY, DEFAULT_MAXDELAY)); else return -1; break; case KS_CONN_STATE_LOST: // lParam = 1 proto, or nullptr - if (!db_get_b(0, KSMODULENAME, SETTING_PUCONNLOST, TRUE)) + if (!KSPlugin.getByte(SETTING_PUCONNLOST, TRUE)) return -1; if (lParam) { // указатель на имя модуля. @@ -849,7 +849,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break; case KS_CONN_STATE_RETRY: // lParam = PROTOCOLSETTINGEX** - if (!db_get_b(0, KSMODULENAME, SETTING_PUCONNRETRY, TRUE)) + if (!KSPlugin.getByte(SETTING_PUCONNRETRY, TRUE)) return -1; if (lParam) { @@ -866,7 +866,7 @@ static int ProcessPopup(int reason, LPARAM lParam) continue; if (mir_wstrlen(p->m_tszAccName) > 0) - if (db_get_b(0, KSMODULENAME, SETTING_PUSHOWEXTRA, TRUE)) + if (KSPlugin.getByte(SETTING_PUSHOWEXTRA, TRUE)) wszText.AppendFormat(TranslateT("%s\t(will be set to %s)\r\n"), p->m_tszAccName, Clist_GetStatusModeDescription(p->m_status, 0)); } @@ -876,7 +876,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break; case KS_CONN_STATE_RETRYNOCONN: // lParam = nullptr - if (!db_get_b(0, KSMODULENAME, SETTING_PUOTHER, TRUE)) + if (!KSPlugin.getByte(SETTING_PUOTHER, TRUE)) return -1; if (retryCount == maxRetries - 1) @@ -886,7 +886,7 @@ static int ProcessPopup(int reason, LPARAM lParam) break; case KS_CONN_STATE_STOPPEDCHECKING: // lParam == BOOL succes - if (!db_get_b(0, KSMODULENAME, SETTING_PURESULT, TRUE)) + if (!KSPlugin.getByte(SETTING_PURESULT, TRUE)) return -1; if (lParam) { @@ -946,7 +946,7 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam) char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", szProto); - if (!db_get_b(0, KSMODULENAME, dbSetting, 1)) // 'hard' disabled + if (!KSPlugin.getByte(dbSetting, 1)) // 'hard' disabled return -1; int ret = -2; @@ -970,7 +970,7 @@ INT_PTR IsProtocolEnabledService(WPARAM, LPARAM lParam) char dbSetting[128]; mir_snprintf(dbSetting, "%s_enabled", szProto); - if (!db_get_b(0, KSMODULENAME, dbSetting, 1)) + if (!KSPlugin.getByte(dbSetting, 1)) return FALSE; for (auto &it : protoList) @@ -1066,8 +1066,6 @@ int KSModuleLoaded(WPARAM, LPARAM) void KeepStatusLoad() { - KSLangPack = GetPluginLangId(MIID_LAST, 0); - if (g_bMirandaLoaded) KSModuleLoaded(0, 0); else @@ -1086,7 +1084,7 @@ void KeepStatusUnload() if (g_bMirandaLoaded) onShutdown(0, 0); - KillModuleOptions(KSLangPack); + KillModuleOptions(&KSPlugin); for (auto &it : hServices) { DestroyServiceFunction(it); diff --git a/plugins/StatusManager/src/ks_options.cpp b/plugins/StatusManager/src/ks_options.cpp index 11428347db..00fb0ac893 100644 --- a/plugins/StatusManager/src/ks_options.cpp +++ b/plugins/StatusManager/src/ks_options.cpp @@ -457,7 +457,6 @@ static INT_PTR CALLBACK PopupOptDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L int KeepStatusOptionsInit(WPARAM wparam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("Status"); odp.szTitle.a = LPGEN("Keep status"); odp.flags = ODPF_BOLDGROUPS; @@ -465,23 +464,22 @@ int KeepStatusOptionsInit(WPARAM wparam, LPARAM) odp.szTab.a = LPGEN("Basic"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_KS_BASIC); odp.pfnDlgProc = DlgProcKSBasicOpts; - Options_AddPage(wparam, &odp, KSLangPack); + KSPlugin.addOptions(wparam, &odp); odp.szTab.a = LPGEN("Advanced"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_KS_ADV); odp.pfnDlgProc = DlgProcKSAdvOpts; - Options_AddPage(wparam, &odp, KSLangPack); + KSPlugin.addOptions(wparam, &odp); if (ServiceExists(MS_POPUP_ADDPOPUPT)) { memset(&odp, 0, sizeof(odp)); odp.position = 150000000; odp.szGroup.a = LPGEN("Popups"); - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_PUOPT_KEEPSTATUS); odp.szTitle.a = LPGEN("Keep status"); odp.pfnDlgProc = PopupOptDlgProc; odp.flags = ODPF_BOLDGROUPS; - Options_AddPage(wparam, &odp, KSLangPack); + KSPlugin.addOptions(wparam, &odp); } return 0; } diff --git a/plugins/StatusManager/src/main.cpp b/plugins/StatusManager/src/main.cpp index 14116c9033..597d155589 100644 --- a/plugins/StatusManager/src/main.cpp +++ b/plugins/StatusManager/src/main.cpp @@ -41,6 +41,12 @@ CMPlugin::CMPlugin() : PLUGIN(MODULENAME, pluginInfoEx) {} +CFakePlugin::CFakePlugin(const char *szModuleName) : + CMPluginBase(szModuleName, pluginInfoEx) +{ + m_hInst = g_plugin.getInst(); +} + ///////////////////////////////////////////////////////////////////////////////////////// // interfaces diff --git a/plugins/StatusManager/src/options.cpp b/plugins/StatusManager/src/options.cpp index b2b28b0d81..ee375493df 100644 --- a/plugins/StatusManager/src/options.cpp +++ b/plugins/StatusManager/src/options.cpp @@ -55,8 +55,7 @@ public: int OnCommonOptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.szGroup.w = LPGENW("Status"); odp.szTitle.w = LPGENW("Status manager"); diff --git a/plugins/StatusManager/src/ss_options.cpp b/plugins/StatusManager/src/ss_options.cpp index 833c6dd5f4..5c3a3b0d3f 100644 --- a/plugins/StatusManager/src/ss_options.cpp +++ b/plugins/StatusManager/src/ss_options.cpp @@ -895,17 +895,16 @@ public: int StartupStatusOptionsInit(WPARAM wparam, LPARAM) { OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.szGroup.a = LPGEN("Status"); odp.szTitle.a = LPGEN("Startup status"); odp.flags = ODPF_BOLDGROUPS; odp.szTab.a = LPGEN("General"); odp.pDialog = new CSSMainOptDlg(); - Options_AddPage(wparam, &odp, SSLangPack); + SSPlugin.addOptions(wparam, &odp); odp.szTab.a = LPGEN("Status profiles"); odp.pDialog = new CSSAdvancedOptDlg(); - Options_AddPage(wparam, &odp, SSLangPack); + SSPlugin.addOptions(wparam, &odp); return 0; } diff --git a/plugins/StatusManager/src/ss_profiles.cpp b/plugins/StatusManager/src/ss_profiles.cpp index 2898136d83..c6082e3479 100644 --- a/plugins/StatusManager/src/ss_profiles.cpp +++ b/plugins/StatusManager/src/ss_profiles.cpp @@ -57,7 +57,7 @@ static INT_PTR profileService(WPARAM, LPARAM, LPARAM param) static int CreateMainMenuItems(WPARAM, LPARAM) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.position = 2000100000; mi.flags = CMIF_UNICODE; mcount = 0; diff --git a/plugins/StatusManager/src/startupstatus.cpp b/plugins/StatusManager/src/startupstatus.cpp index 6adac7c061..f6c539f902 100644 --- a/plugins/StatusManager/src/startupstatus.cpp +++ b/plugins/StatusManager/src/startupstatus.cpp @@ -19,7 +19,7 @@ #include "stdafx.h" -int SSLangPack; +CFakePlugin SSPlugin(SSMODULENAME); static HANDLE hServices[3], hEvents[3]; static UINT_PTR setStatusTimerId = 0; @@ -413,8 +413,6 @@ static INT_PTR SrvGetProfile(WPARAM wParam, LPARAM lParam) void StartupStatusLoad() { - SSLangPack = GetPluginLangId(MIID_LAST, 0); - if (g_bMirandaLoaded) SSModuleLoaded(0, 0); else @@ -445,7 +443,7 @@ void StartupStatusUnload() if (g_bMirandaLoaded) OnShutdown(0, 0); - KillModuleOptions(SSLangPack); + KillModuleOptions(&SSPlugin); for (auto &it : hServices) { DestroyServiceFunction(it); diff --git a/plugins/StatusManager/src/stdafx.h b/plugins/StatusManager/src/stdafx.h index 253429458d..6162650dad 100644 --- a/plugins/StatusManager/src/stdafx.h +++ b/plugins/StatusManager/src/stdafx.h @@ -46,13 +46,19 @@ struct CMPlugin : public PLUGIN int Unload() override; }; +struct CFakePlugin : public CMPluginBase +{ + CFakePlugin(const char *szModuleName); +}; + + #include "commonstatus.h" #include "keepstatus.h" #include "startupstatus.h" #include "advancedautoaway.h" extern bool g_bMirandaLoaded; -extern int AAALangPack, KSLangPack, SSLangPack; +extern CFakePlugin AAAPlugin, KSPlugin, SSPlugin; extern CMOption g_AAAEnabled, g_KSEnabled, g_SSEnabled; int OnCommonOptionsInit(WPARAM wParam, LPARAM); diff --git a/plugins/StopSpamMod/src/init.cpp b/plugins/StopSpamMod/src/init.cpp index 27a58fb800..4cf7cc8cad 100755 --- a/plugins/StopSpamMod/src/init.cpp +++ b/plugins/StopSpamMod/src/init.cpp @@ -137,7 +137,7 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnDbContactSettingChanged); HookEvent(ME_OPT_INITIALISE, OnOptInit); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x60ce7660, 0x5a5, 0x4234, 0x99, 0xb6, 0x55, 0x21, 0xed, 0xa0, 0xb8, 0x32); mi.position = -0x7FFFFFFF; mi.hIcolibItem = Skin_LoadIcon(SKINICON_OTHER_MIRANDA); diff --git a/plugins/StopSpamMod/src/options.cpp b/plugins/StopSpamMod/src/options.cpp index ad9ca4f3d7..9bfcf9a0d2 100755 --- a/plugins/StopSpamMod/src/options.cpp +++ b/plugins/StopSpamMod/src/options.cpp @@ -284,7 +284,7 @@ int OnOptInit(WPARAM w, LPARAM l) { UNREFERENCED_PARAMETER(l); - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("Message sessions"); odp.szTitle.w = LPGENW("StopSpam"); odp.position = -1; diff --git a/plugins/StopSpamPlus/src/options.cpp b/plugins/StopSpamPlus/src/options.cpp index 568479c6dc..757369bb55 100644 --- a/plugins/StopSpamPlus/src/options.cpp +++ b/plugins/StopSpamPlus/src/options.cpp @@ -161,7 +161,7 @@ public: int OnOptInit(WPARAM w, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Message sessions"); odp.szTitle.a = MODULENAME; diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp index 411b734f2d..8c609cf5e6 100644 --- a/plugins/StopSpamPlus/src/stopspam.cpp +++ b/plugins/StopSpamPlus/src/stopspam.cpp @@ -35,7 +35,7 @@ int CMPlugin::Load() HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnDbContactSettingchanged); // Add deleting temporary contacts - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xf2164e17, 0xa4c1, 0x4b07, 0xae, 0x81, 0x9e, 0xae, 0x7f, 0xa2, 0x55, 0x13); mi.position = -0x7FFFFFFF; mi.flags = CMIF_UNICODE; diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp index fa4ce611f2..d779f15afe 100644 --- a/plugins/TabSRMM/src/buttonsbar.cpp +++ b/plugins/TabSRMM/src/buttonsbar.cpp @@ -12,80 +12,80 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.hIcon = Skin_GetIconHandle(SKINICON_OTHER_CONNECTING); bbd.pszModuleName = "Tabsrmm"; bbd.pwszTooltip = LPGENW("Protocol button"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_NAME; bbd.dwDefPos = 20; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[20]; bbd.pwszTooltip = LPGENW("Info button"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_BOLD; bbd.dwDefPos = 40; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[10]; bbd.pwszTooltip = LPGENW("Bold text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_ITALICS; bbd.dwDefPos = 50; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[11]; bbd.pwszTooltip = LPGENW("Italic text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_UNDERLINE; bbd.dwDefPos = 60; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[12]; bbd.pwszTooltip = LPGENW("Underlined text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISPUSHBUTTON | BBBF_CANBEHIDDEN | BBBF_CREATEBYID; bbd.dwButtonID = IDC_FONTSTRIKEOUT; bbd.dwDefPos = 70; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[15]; bbd.pwszTooltip = LPGENW("Strike-through text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_ISARROWBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDOK; bbd.dwDefPos = 10; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[6]; bbd.pwszTooltip = LPGENW("Send message\nClick dropdown arrow for sending options"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_CLOSE; bbd.dwDefPos = 20; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[8]; bbd.pwszTooltip = LPGENW("Close session"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_QUOTE; bbd.dwDefPos = 30; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[4]; bbd.pwszTooltip = LPGENW("Quote last message OR selected text"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_TIME; bbd.dwDefPos = 40; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[2]; bbd.pwszTooltip = LPGENW("Message log options"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_HISTORY; bbd.dwDefPos = 50; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[0]; bbd.pwszTooltip = LPGENW("View user's history"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISIMBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_PIC; bbd.dwDefPos = 60; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[7]; bbd.pwszTooltip = LPGENW("Edit user notes"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); // chat buttons bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISSEPARATOR; @@ -94,15 +94,15 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.dwDefPos = 35; bbd.hIcon = nullptr; bbd.pwszTooltip = nullptr; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = 2; bbd.dwDefPos = 22; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = 3; bbd.dwDefPos = 71; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISPUSHBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_COLOR; @@ -110,32 +110,32 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM) bbd.dwDefPos = 80; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[14]; bbd.pwszTooltip = LPGENW("Select font color"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_BKGCOLOR; bbd.dwDefPos = 81; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[16]; bbd.pwszTooltip = LPGENW("Change background color"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.bbbFlags = BBBF_ISCHATBUTTON | BBBF_ISRSIDEBUTTON | BBBF_CREATEBYID; bbd.dwButtonID = IDC_SRMM_SHOWNICKLIST; bbd.dwDefPos = 22; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[19]; bbd.pwszTooltip = LPGENW("Toggle nick list"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_FILTER; bbd.dwDefPos = 24; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[18]; bbd.pwszTooltip = LPGENW("Event filter - right click to setup, left click to activate/deactivate"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.dwButtonID = IDC_SRMM_CHANMGR; bbd.dwDefPos = 33; bbd.hIcon = PluginConfig.g_buttonBarIconHandles[17]; bbd.pwszTooltip = LPGENW("Channel manager"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp index af44648190..1dc5e20f7e 100644 --- a/plugins/TabSRMM/src/chat_main.cpp +++ b/plugins/TabSRMM/src/chat_main.cpp @@ -215,7 +215,7 @@ int Chat_Load() CheckUpdate(); Utils::RTF_CTableInit(); - CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER, g_plugin.m_hLang }; + CHAT_MANAGER_INITDATA data = { &g_Settings, sizeof(MODULEINFO), sizeof(SESSION_INFO), LPGENW("Message sessions") L"/" LPGENW("Group chats"), FONTMODE_ALTER, &g_plugin }; Chat_CustomizeApi(&data); g_chatApi.OnCreateModule = OnCreateModule; diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp index 67390c9a5e..8802145baf 100644 --- a/plugins/TabSRMM/src/chat_options.cpp +++ b/plugins/TabSRMM/src/chat_options.cpp @@ -262,8 +262,8 @@ static IconItem _logicons[] = // add icons to the skinning module void Chat_AddIcons(void) { - Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat windows"), _icons, _countof(_icons), 0, g_plugin.m_hLang); - Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat log"), _logicons, _countof(_logicons), 0, g_plugin.m_hLang); + Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat windows"), _icons, _countof(_icons), 0, &g_plugin); + Icon_Register(g_hIconDLL, LPGEN("Message Sessions") "/" LPGEN("Group chat log"), _logicons, _countof(_logicons), 0, &g_plugin); g_chatApi.MM_IconsChanged(); } diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp index fb456ab4f4..3eb99ed124 100644 --- a/plugins/TabSRMM/src/generic_msghandlers.cpp +++ b/plugins/TabSRMM/src/generic_msghandlers.cpp @@ -1466,13 +1466,13 @@ int SI_InitStatusIcons() StatusIconData sid = {}; sid.szModule = MSG_ICON_MODULE; sid.dwId = MSG_ICON_SOUND; // Sounds - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = MSG_ICON_UTN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); sid.dwId = MSG_ICON_SESSION; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); HookEvent(ME_MSG_ICONSCHANGED, OnSrmmIconChanged); return 0; diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp index 271d689adb..6edea54ef5 100644 --- a/plugins/TabSRMM/src/globals.cpp +++ b/plugins/TabSRMM/src/globals.cpp @@ -115,7 +115,7 @@ void CGlobals::reloadSystemModulesChanged() g_bPopupAvail = ServiceExists(MS_POPUP_ADDPOPUPT) != 0; - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x58d8dc1, 0x1c25, 0x49c0, 0xb8, 0x7c, 0xa3, 0x22, 0x2b, 0x3d, 0xf1, 0xd8); mi.position = -2000090000; mi.flags = CMIF_DEFAULT; @@ -294,7 +294,7 @@ int CGlobals::ModulesLoaded(WPARAM, LPARAM) if (nen_options.bTraySupport) ::CreateSystrayIcon(TRUE); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x9f68b822, 0xff97, 0x477d, 0xb7, 0x6d, 0xa5, 0x59, 0x33, 0x1c, 0x54, 0x40); mi.position = -500050005; mi.hIcolibItem = PluginConfig.g_iconContainer; diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp index d2a1c1640b..6052e090d6 100644 --- a/plugins/TabSRMM/src/modplus.cpp +++ b/plugins/TabSRMM/src/modplus.cpp @@ -56,7 +56,7 @@ static int RegisterCustomButton(WPARAM, LPARAM) bbd.hIcon = PluginConfig.g_buttonBarIconHandles[3]; bbd.pszModuleName = "Tabmodplus"; bbd.pwszTooltip = LPGENW("Insert [img] tag / surround selected text with [img][/img]"); - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp index 1d9615ebd8..e8cb510573 100644 --- a/plugins/TabSRMM/src/msgoptions.cpp +++ b/plugins/TabSRMM/src/msgoptions.cpp @@ -1329,7 +1329,6 @@ static int OptInitialise(WPARAM wParam, LPARAM lParam) g_plugin.addOptions(wParam, &odpnew); OPTIONSDIALOGPAGE odp = {}; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS; odp.position = 910000000; diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp index 766c4121fa..6d4cb8bc9f 100644 --- a/plugins/TabSRMM/src/typingnotify.cpp +++ b/plugins/TabSRMM/src/typingnotify.cpp @@ -490,9 +490,8 @@ static INT_PTR CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int TN_OptionsInitialize(WPARAM wParam, LPARAM) { if (ServiceExists(MS_POPUP_ADDPOPUPT)) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TYPINGNOTIFYPOPUP); odp.szTitle.a = LPGEN("Typing notify"); odp.szGroup.a = LPGEN("Popups"); @@ -531,7 +530,7 @@ int TN_ModuleInit() if (PluginConfig.g_bPopupAvail && ShowMenu) { CreateServiceFunction("TypingNotify/EnableDisableMenuCommand", EnableDisableMenuCommand); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xe18fd2cf, 0xcf90, 0x459e, 0xb6, 0xe6, 0x70, 0xec, 0xad, 0xc6, 0x73, 0xef); if (!Disabled) { mi.name.a = LPGEN("Disable &typing notification"); diff --git a/plugins/TipperYM/src/options.cpp b/plugins/TipperYM/src/options.cpp index 673b94426f..b2060654d7 100644 --- a/plugins/TipperYM/src/options.cpp +++ b/plugins/TipperYM/src/options.cpp @@ -2080,10 +2080,9 @@ INT_PTR CALLBACK DlgProcOptsTraytip(HWND hwndDlg, UINT msg, WPARAM wParam, LPARA int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_APPEARANCE); odp.szTab.a = LPGEN("Appearance"); diff --git a/plugins/Toaster/src/options.cpp b/plugins/Toaster/src/options.cpp index 326d6ef369..e5e497fc03 100644 --- a/plugins/Toaster/src/options.cpp +++ b/plugins/Toaster/src/options.cpp @@ -46,7 +46,7 @@ void COptions::Enabled_OnChange(CCtrlCheck* chk) int OnOptionsInitialized(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = L"Popups"; //_T(MODULENAME); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.position = -790000000; diff --git a/plugins/TooltipNotify/src/TooltipNotify.cpp b/plugins/TooltipNotify/src/TooltipNotify.cpp index 5e12e64a5b..ae03ca7685 100644 --- a/plugins/TooltipNotify/src/TooltipNotify.cpp +++ b/plugins/TooltipNotify/src/TooltipNotify.cpp @@ -255,9 +255,8 @@ int CTooltipNotify::ContactSettingChanged(WPARAM hContact, LPARAM lParam) int CTooltipNotify::InitializeOptions(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = LPGEN("Tooltip Notify"); odp.szGroup.a = LPGEN("Popups"); diff --git a/plugins/TopToolBar/src/stdafx.h b/plugins/TopToolBar/src/stdafx.h index 44d4193d40..1b2cd4f566 100644 --- a/plugins/TopToolBar/src/stdafx.h +++ b/plugins/TopToolBar/src/stdafx.h @@ -84,7 +84,7 @@ struct TopButtonInt : public MZeroedObject LPARAM lParamDown; WPARAM wParamDown; - int hLangpack; + HPLUGIN pPlugin; wchar_t *ptszTooltipUp, *ptszTooltipDn; }; diff --git a/plugins/TopToolBar/src/toolbar.cpp b/plugins/TopToolBar/src/toolbar.cpp index ae798838c2..da81db4300 100644 --- a/plugins/TopToolBar/src/toolbar.cpp +++ b/plugins/TopToolBar/src/toolbar.cpp @@ -309,7 +309,7 @@ INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam) return -1; TopButtonInt *b = CreateButton(but); - b->hLangpack = (int)lParam; + b->pPlugin = (HPLUGIN)lParam; b->LoadSettings(); b->CreateWnd(); if (b->hwnd == nullptr) { @@ -553,13 +553,13 @@ int OnPluginLoad(WPARAM, LPARAM lParam) int OnPluginUnload(WPARAM, LPARAM lParam) { - int lang = GetPluginLangByInstance((HINSTANCE)lParam); - if (lang) { + HPLUGIN pPlugin = &GetPluginByInstance((HINSTANCE)lParam); + if (pPlugin) { bool bNeedUpdate = false; mir_cslock lck(csButtonsHook); for (auto &it : Buttons.rev_iter()) - if (it->hLangpack == lang) { + if (it->pPlugin == pPlugin) { TTBRemoveButton(it->id, 0); bNeedUpdate = true; } diff --git a/plugins/TopToolBar/src/topbutton.cpp b/plugins/TopToolBar/src/topbutton.cpp index f9bf74a0fc..7a4c357ac7 100644 --- a/plugins/TopToolBar/src/topbutton.cpp +++ b/plugins/TopToolBar/src/topbutton.cpp @@ -171,6 +171,6 @@ void TopButtonInt::SetBitmap() pTooltip = ptszTooltipUp; } if (pTooltip) - SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)TranslateW_LP(pTooltip, hLangpack), BATF_UNICODE); + SendMessage(hwnd, BUTTONADDTOOLTIP, (WPARAM)TranslateW_LP(pTooltip, pPlugin), BATF_UNICODE); } } diff --git a/plugins/TopToolBar/src/ttbopt.cpp b/plugins/TopToolBar/src/ttbopt.cpp index 226dc8d57a..45642f84dc 100644 --- a/plugins/TopToolBar/src/ttbopt.cpp +++ b/plugins/TopToolBar/src/ttbopt.cpp @@ -540,8 +540,7 @@ static INT_PTR CALLBACK ButOrderOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR int TTBOptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Contact list"); odp.position = -1000000000; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_BUTORDER); diff --git a/plugins/TrafficCounter/src/TrafficCounter.cpp b/plugins/TrafficCounter/src/TrafficCounter.cpp index cc01aa9724..37e6ac7a85 100644 --- a/plugins/TrafficCounter/src/TrafficCounter.cpp +++ b/plugins/TrafficCounter/src/TrafficCounter.cpp @@ -859,7 +859,7 @@ INT_PTR MenuCommand_TrafficShowHide(WPARAM, LPARAM) void Traffic_AddMainMenuItem(void) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x7fe75b30, 0x3cf6, 0x4280, 0xb9, 0xd2, 0x88, 0x6b, 0xbb, 0x69, 0xa3, 0x7e); mi.position = -0x7FFFFFFF; mi.hIcolibItem = nullptr; diff --git a/plugins/TrafficCounter/src/options.cpp b/plugins/TrafficCounter/src/options.cpp index 00a17afbfe..1c7ce7688a 100644 --- a/plugins/TrafficCounter/src/options.cpp +++ b/plugins/TrafficCounter/src/options.cpp @@ -342,9 +342,8 @@ static INT_PTR CALLBACK DlgProcTCOptions(HWND hwndDlg, UINT msg, WPARAM wParam, int TrafficCounterOptInitialise(WPARAM wParam, LPARAM) { // Main options page - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 900000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_TRAFFIC); odp.szGroup.a = LPGEN("Services"); odp.szTab.a = LPGEN("Options"); diff --git a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp index 67dc807af9..eee021c5bd 100644 --- a/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp +++ b/plugins/TranslitSwitcher/src/TranslitSwitcher.cpp @@ -91,21 +91,21 @@ int OnModulesLoaded(WPARAM, LPARAM) bbd.hIcon = iconList[0].hIcolib; bbd.dwButtonID = 1; bbd.dwDefPos = 30; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.pszModuleName = "Translit and Send"; bbd.pwszTooltip = TranslateT("Translit and Send"); bbd.hIcon = iconList[1].hIcolib; bbd.dwButtonID = 1; bbd.dwDefPos = 40; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); bbd.pszModuleName = "Invert Case and Send"; bbd.pwszTooltip = TranslateT("Invert Case and Send"); bbd.hIcon = iconList[2].hIcolib; bbd.dwButtonID = 1; bbd.dwDefPos = 50; - Srmm_AddButton(&bbd, g_plugin.m_hLang); + Srmm_AddButton(&bbd, &g_plugin); return 0; } diff --git a/plugins/UserGuide/src/main.cpp b/plugins/UserGuide/src/main.cpp index 156ee338eb..1be4b8763f 100644 --- a/plugins/UserGuide/src/main.cpp +++ b/plugins/UserGuide/src/main.cpp @@ -67,7 +67,7 @@ static INT_PTR ShowGuideFile(WPARAM, LPARAM) int CMPlugin::Load() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x6787c12d, 0xdc85, 0x409d, 0xaa, 0x6c, 0x1f, 0xfe, 0x5f, 0xe8, 0xc1, 0x18); mi.position = 500000; mi.flags = CMIF_UNICODE; diff --git a/plugins/UserInfoEx/src/Flags/svc_flags.cpp b/plugins/UserInfoEx/src/Flags/svc_flags.cpp index 972e4d5214..9d8f999db2 100644 --- a/plugins/UserInfoEx/src/Flags/svc_flags.cpp +++ b/plugins/UserInfoEx/src/Flags/svc_flags.cpp @@ -238,7 +238,7 @@ void SvcFlagsOnModulesLoaded() sid.szModule = MODNAMEFLAGS; if (!g_bShowStatusIconFlag) sid.flags = MBF_HIDDEN; - Srmm_AddIcon(&sid, g_plugin.m_hLang); + Srmm_AddIcon(&sid, &g_plugin); HookEvent(ME_DB_CONTACT_SETTINGCHANGED, OnContactSettingChanged); HookEvent(ME_CLIST_EXTRA_IMAGE_APPLY, OnCListApplyIcons); diff --git a/plugins/UserInfoEx/src/classPsTree.cpp b/plugins/UserInfoEx/src/classPsTree.cpp index d1567bba69..fb895460cc 100644 --- a/plugins/UserInfoEx/src/classPsTree.cpp +++ b/plugins/UserInfoEx/src/classPsTree.cpp @@ -127,8 +127,7 @@ int CPsTree::AddDummyItem(LPCSTR pszGroup) psh._pPages = _pItems; psh._numPages = _numItems; - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_UNICODE; odp.szTitle.w = mir_utf8decodeW(pszGroup); diff --git a/plugins/UserInfoEx/src/classPsTreeItem.cpp b/plugins/UserInfoEx/src/classPsTreeItem.cpp index 2645b3f8d7..ff72aa2933 100644 --- a/plugins/UserInfoEx/src/classPsTreeItem.cpp +++ b/plugins/UserInfoEx/src/classPsTreeItem.cpp @@ -322,7 +322,7 @@ int CPsTreeItem::Icon(HIMAGELIST hIml, OPTIONSDIALOGPAGE *odp, BYTE bInitIconsOn // the item to insert brings along an icon? if (odp->flags & ODPF_ICON) { // is it uinfoex item? - if (odp->hInstance == g_plugin.getInst()) { + if (odp->pPlugin == &g_plugin) { // the pszGroup holds the iconfile for items added by uinfoex sid.defaultFile.w = odp->szGroup.w; @@ -383,9 +383,9 @@ int CPsTreeItem::Create(CPsHdr* pPsh, OPTIONSDIALOGPAGE *odp) wchar_t szTitle[ MAXSETTING ]; // check parameter - if (pPsh && pPsh->_dwSize == sizeof(CPsHdr) && odp && PtrIsValid(odp->hInstance)) { + if (pPsh && pPsh->_dwSize == sizeof(CPsHdr) && odp && PtrIsValid(odp->pPlugin)) { // instance value - _hInst = odp->hInstance; + _hInst = odp->pPlugin->getInst(); _dwFlags = odp->flags; _initParam = odp->dwInitParam; diff --git a/plugins/UserInfoEx/src/dlg_propsheet.cpp b/plugins/UserInfoEx/src/dlg_propsheet.cpp index d0c212c04b..55a471a088 100644 --- a/plugins/UserInfoEx/src/dlg_propsheet.cpp +++ b/plugins/UserInfoEx/src/dlg_propsheet.cpp @@ -505,8 +505,7 @@ static int InitDetails(WPARAM wParam, LPARAM lParam) if (!(pPsh->_dwFlags & PSF_PROTOPAGESONLY)) { BYTE bChangeDetailsEnabled = myGlobals.CanChangeDetails && db_get_b(NULL, MODULENAME, SET_PROPSHEET_CHANGEMYDETAILS, FALSE); if (lParam || bChangeDetailsEnabled) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_ICON | ODPF_UNICODE; odp.szGroup.w = IcoLib_GetDefaultIconFileName(); diff --git a/plugins/UserInfoEx/src/mir_menuitems.cpp b/plugins/UserInfoEx/src/mir_menuitems.cpp index 75532fdfd8..157d7fcc1a 100644 --- a/plugins/UserInfoEx/src/mir_menuitems.cpp +++ b/plugins/UserInfoEx/src/mir_menuitems.cpp @@ -83,7 +83,7 @@ void RebuildContact() RemoveMenuItems(hMenuItem, _countof(hMenuItem)); // support new genmenu style - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); switch (flag) { @@ -176,7 +176,7 @@ void RebuildMain() RemoveMenuItems(hMenuItem, _countof(hMenuItem)); // support new genmenu style - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); switch (flag) { case 3: @@ -313,7 +313,7 @@ void RebuildGroup() char text[200]; mir_strcpy(text, "UserInfo"); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.pszService = text; switch (flag) { @@ -404,7 +404,7 @@ void RebuildSubGroup() char text[200]; mir_strcpy(text, "UserInfo"); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.pszService = text; char* tDest = text + mir_strlen(text); @@ -520,7 +520,7 @@ INT_PTR RebuildAccount(WPARAM, LPARAM lParam) char text[200]; mir_strcpy(text, it->szProto); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.pszService = text; char* tDest = text + mir_strlen(text); diff --git a/plugins/UserInfoEx/src/psp_options.cpp b/plugins/UserInfoEx/src/psp_options.cpp index e37239af27..e8e6e9fd9c 100644 --- a/plugins/UserInfoEx/src/psp_options.cpp +++ b/plugins/UserInfoEx/src/psp_options.cpp @@ -1028,9 +1028,8 @@ static int OnInitOptions(WPARAM wParam, LPARAM) { DlgContactInfoInitTreeIcons(); - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 95400; - odp.hInstance = g_plugin.getInst(); odp.szTitle.a = MODULELONGNAME; odp.szGroup.a = LPGEN("Contacts"); diff --git a/plugins/UserInfoEx/src/svc_email.cpp b/plugins/UserInfoEx/src/svc_email.cpp index 2d3960017b..8d7d7c4952 100644 --- a/plugins/UserInfoEx/src/svc_email.cpp +++ b/plugins/UserInfoEx/src/svc_email.cpp @@ -183,7 +183,7 @@ void SvcEMailRebuildMenu() if (!ghMenuItem) { // insert contact menuitem - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x61d8e25a, 0x92e, 0x4470, 0x84, 0x57, 0x5e, 0x52, 0x17, 0x7f, 0xfa, 0x3); mi.position = -2000010000; mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_EMAIL); diff --git a/plugins/UserInfoEx/src/svc_homepage.cpp b/plugins/UserInfoEx/src/svc_homepage.cpp index 12e3e33b4a..dbf32d5f67 100644 --- a/plugins/UserInfoEx/src/svc_homepage.cpp +++ b/plugins/UserInfoEx/src/svc_homepage.cpp @@ -153,7 +153,7 @@ void SvcHomepageRebuildMenu() if (!ghMenuItem) { // insert contact menuitem - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xdb78c16e, 0x50db, 0x4a40, 0x80, 0x0, 0xd1, 0xa4, 0x1c, 0x1b, 0xa3, 0x2d); mi.position = -2000010000; mi.hIcolibItem = IcoLib_GetIcon(ICO_BTN_GOTO); diff --git a/plugins/Variables/src/options.cpp b/plugins/Variables/src/options.cpp index 0b22ba13ca..8a528b39b8 100644 --- a/plugins/Variables/src/options.cpp +++ b/plugins/Variables/src/options.cpp @@ -129,12 +129,11 @@ static INT_PTR CALLBACK SetOptsDlgProc(HWND hwndDlg,UINT msg,WPARAM wParam,LPARA int OptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.position = 150000000; odp.szGroup.a = LPGEN("Services"); odp.szTitle.a = LPGEN("Variables"); - odp.hInstance = g_plugin.getInst(); odp.pfnDlgProc = SetOptsDlgProc; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTS_DIALOG); g_plugin.addOptions(wParam, &odp); diff --git a/plugins/Watrack/i_opt_dlg.inc b/plugins/Watrack/i_opt_dlg.inc index ad1f576fe4..53f4c578ce 100644 --- a/plugins/Watrack/i_opt_dlg.inc +++ b/plugins/Watrack/i_opt_dlg.inc @@ -21,7 +21,6 @@ begin FillChar(odp,SizeOf(odp),0); odp.Position :=900003000; - odp.hInstance :=hInstance; odp.szTitle.a :=PluginName; odp.szGroup.a :='Plugins'; diff --git a/plugins/Watrack/kolframe/kolframe.pas b/plugins/Watrack/kolframe/kolframe.pas index c8e33ce408..e3255c8f8c 100644 --- a/plugins/Watrack/kolframe/kolframe.pas +++ b/plugins/Watrack/kolframe/kolframe.pas @@ -223,7 +223,7 @@ begin end; FrameHeight:=CLFrame.height; - PWATFrameData(FrameCtrl.CustomData).FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,twparam(@CLFrame),0); + PWATFrameData(FrameCtrl.CustomData).FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,twparam(@CLFrame),lparam(@g_Plugin)); if PWATFrameData(FrameCtrl.CustomData).FrameId>=0 then begin plStatusHook:=HookEvent(ME_WAT_NEWSTATUS,@NewPlStatus); diff --git a/plugins/Watrack/popup/popups.pas b/plugins/Watrack/popup/popups.pas index f7b4b98da5..604436c835 100644 --- a/plugins/Watrack/popup/popups.pas +++ b/plugins/Watrack/popup/popups.pas @@ -350,7 +350,6 @@ begin FillChar(odp,SizeOf(odp),0); odp.flags :=ODPF_BOLDGROUPS; odp.Position :=900003000; - odp.hInstance :=hInstance; odp.szTitle.a :=PluginName; odp.szGroup.a :='Popups'; diff --git a/plugins/Watrack/version.RES b/plugins/Watrack/version.RES new file mode 100644 index 0000000000..3c8432b9e9 Binary files /dev/null and b/plugins/Watrack/version.RES differ diff --git a/plugins/Watrack_MPD/src/options.cpp b/plugins/Watrack_MPD/src/options.cpp index 652e2766a7..93bcefa620 100755 --- a/plugins/Watrack_MPD/src/options.cpp +++ b/plugins/Watrack_MPD/src/options.cpp @@ -54,7 +54,7 @@ private: int WaMpdOptInit(WPARAM wParam,LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.szTitle.w = LPGENW("Winamp Track"); odp.szGroup.w = LPGENW("Plugins"); odp.szTab.w = LPGENW("Watrack MPD"); diff --git a/plugins/Weather/src/weather_opt.cpp b/plugins/Weather/src/weather_opt.cpp index ae739f5012..4a4beb67d1 100644 --- a/plugins/Weather/src/weather_opt.cpp +++ b/plugins/Weather/src/weather_opt.cpp @@ -570,10 +570,8 @@ static INT_PTR CALLBACK DlgProcText(HWND hdlg, UINT msg, WPARAM wParam, LPARAM l // register the weather option pages int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); - // plugin options + OPTIONSDIALOGPAGE odp = {}; odp.position = 95600; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.pfnDlgProc = OptionsProc; diff --git a/plugins/Weather/src/weather_svcs.cpp b/plugins/Weather/src/weather_svcs.cpp index 6b7cd2c6fe..6a3351c463 100644 --- a/plugins/Weather/src/weather_svcs.cpp +++ b/plugins/Weather/src/weather_svcs.cpp @@ -262,7 +262,7 @@ INT_PTR MenuitemNotifyCmd(WPARAM, LPARAM) // copied and modified form "modified MSN Protocol" void AddMenuItems(void) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); // contact menu SET_UID(mi, 0x266ef52b, 0x869a, 0x4cac, 0xa9, 0xf8, 0xea, 0x5b, 0xb8, 0xab, 0xe0, 0x24); diff --git a/plugins/Weather/src/weather_userinfo.cpp b/plugins/Weather/src/weather_userinfo.cpp index 442be8a388..b535e6cfa8 100644 --- a/plugins/Weather/src/weather_userinfo.cpp +++ b/plugins/Weather/src/weather_userinfo.cpp @@ -313,8 +313,7 @@ static INT_PTR CALLBACK DlgProcUIPage(HWND hwndDlg, UINT msg, WPARAM wParam, LPA // lParam = current contact int UserInfoInit(WPARAM wParam, LPARAM lParam) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; odp.szTitle.a = WEATHERPROTONAME; diff --git a/plugins/WebView/src/main.cpp b/plugins/WebView/src/main.cpp index 2c7d70ec58..4bbbe80c61 100644 --- a/plugins/WebView/src/main.cpp +++ b/plugins/WebView/src/main.cpp @@ -126,7 +126,7 @@ int CMPlugin::Load() //value is 1 if menu is disabled db_set_b(NULL, MODULENAME, MENU_IS_DISABLED_KEY, 1); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; if ( db_get_b(NULL, MODULENAME, MENU_OFF, 0)) { //value is 0 if menu is enabled diff --git a/plugins/WebView/src/webview.cpp b/plugins/WebView/src/webview.cpp index f384f48132..7ec393d3fc 100644 --- a/plugins/WebView/src/webview.cpp +++ b/plugins/WebView/src/webview.cpp @@ -290,8 +290,7 @@ void CALLBACK Countdownfunc(HWND, UINT, UINT_PTR, DWORD) static int OptInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT); odp.szGroup.a = LPGEN("Network"); odp.szTitle.a = MODULENAME; diff --git a/plugins/WhenWasIt/src/WhenWasIt.cpp b/plugins/WhenWasIt/src/WhenWasIt.cpp index e97f7fcab9..fe56baa9f4 100644 --- a/plugins/WhenWasIt/src/WhenWasIt.cpp +++ b/plugins/WhenWasIt/src/WhenWasIt.cpp @@ -68,7 +68,7 @@ int CMPlugin::Load() hAddBirthdayWndsList = WindowList_Create(); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.position = 10000000; mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Birthdays (When Was It)"), mi.position); Menu_ConfigureItem(mi.root, MCI_OPT_UID, "95D842AE-FCCE-43C9-87E3-C28546B7E00E"); diff --git a/plugins/WhenWasIt/src/hooked_events.cpp b/plugins/WhenWasIt/src/hooked_events.cpp index 3d3065c969..7320a42530 100644 --- a/plugins/WhenWasIt/src/hooked_events.cpp +++ b/plugins/WhenWasIt/src/hooked_events.cpp @@ -42,9 +42,8 @@ static int OnTopToolBarModuleLoaded(WPARAM, LPARAM) static int OnOptionsInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_WWI); odp.szTitle.w = LPGENW("Birthdays"); odp.szGroup.w = LPGENW("Contacts"); diff --git a/plugins/WhoUsesMyFiles/src/options.cpp b/plugins/WhoUsesMyFiles/src/options.cpp index 59b37d4d6b..a552d7cb6e 100644 --- a/plugins/WhoUsesMyFiles/src/options.cpp +++ b/plugins/WhoUsesMyFiles/src/options.cpp @@ -268,9 +268,8 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lpara int OptionsInit(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 945000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szTitle.a = LPGEN("Who uses my files"); odp.pfnDlgProc = OptionsDlgProc; diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index fce2633623..2ebbb5f7ef 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -223,7 +223,7 @@ int CMPlugin::Load() CreateServiceFunction(MS_WUMF_SWITCHPOPUP, WumfMenuCommand); CreateServiceFunction(MS_WUMF_CONNECTIONSSHOW, WumfShowConnections); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xcfce6487, 0x907b, 0x4822, 0xb0, 0x49, 0x18, 0x4e, 0x47, 0x17, 0x0, 0x69); mi.root = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 1999990000); diff --git a/plugins/WinterSpeak/src/main.cpp b/plugins/WinterSpeak/src/main.cpp index c9643147f5..86f79301ab 100644 --- a/plugins/WinterSpeak/src/main.cpp +++ b/plugins/WinterSpeak/src/main.cpp @@ -69,8 +69,7 @@ int protocolAck(WPARAM, LPARAM lParam) int dialogOptionsInitialise(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.w = LPGENW("Speak"); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; diff --git a/plugins/XSoundNotify/src/options.cpp b/plugins/XSoundNotify/src/options.cpp index e1d5148edc..32e14c5569 100644 --- a/plugins/XSoundNotify/src/options.cpp +++ b/plugins/XSoundNotify/src/options.cpp @@ -342,9 +342,8 @@ static INT_PTR CALLBACK OptsProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l INT OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_BOLDGROUPS | ODPF_UNICODE; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS); odp.szGroup.w = LPGENW("Sounds"); diff --git a/plugins/XSoundNotify/src/xsn_main.cpp b/plugins/XSoundNotify/src/xsn_main.cpp index d8713148ce..bb7e1ecb2f 100644 --- a/plugins/XSoundNotify/src/xsn_main.cpp +++ b/plugins/XSoundNotify/src/xsn_main.cpp @@ -201,7 +201,7 @@ static int OnPlaySound(WPARAM, LPARAM) static int OnLoadInit(WPARAM, LPARAM) { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x5d72ca1f, 0xc52, 0x436d, 0x81, 0x47, 0x29, 0xf6, 0xc3, 0x28, 0xb5, 0xd1); mi.position = -0x7FFFFFFF; mi.flags = CMIF_UNICODE; diff --git a/plugins/YAMN/src/main.cpp b/plugins/YAMN/src/main.cpp index 739ba30a83..f40bc54a1e 100644 --- a/plugins/YAMN/src/main.cpp +++ b/plugins/YAMN/src/main.cpp @@ -122,7 +122,7 @@ void CheckMenuItems() int SystemModulesLoaded(WPARAM, LPARAM) { //Insert "Check mail (YAMN)" item to Miranda's menu - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0xa01ff3d9, 0x53cb, 0x4406, 0x85, 0xd9, 0xf1, 0x90, 0x3a, 0x94, 0xed, 0xf4); mi.position = 0xb0000000; diff --git a/plugins/YAMN/src/proto/pop3/pop3opt.cpp b/plugins/YAMN/src/proto/pop3/pop3opt.cpp index 3842602582..8516144847 100644 --- a/plugins/YAMN/src/proto/pop3/pop3opt.cpp +++ b/plugins/YAMN/src/proto/pop3/pop3opt.cpp @@ -153,8 +153,7 @@ INT_PTR CALLBACK DlgProcPluginOpt(HWND hDlg, UINT msg, WPARAM wParam, LPARAM) int YAMNOptInitSvc(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.szGroup.a = LPGEN("Network"); odp.szTitle.a = LPGEN("YAMN"); odp.flags = ODPF_BOLDGROUPS; diff --git a/plugins/YAPP/src/notify_imp.cpp b/plugins/YAPP/src/notify_imp.cpp index ed7d92bdc2..f714fd9f67 100644 --- a/plugins/YAPP/src/notify_imp.cpp +++ b/plugins/YAPP/src/notify_imp.cpp @@ -94,8 +94,7 @@ INT_PTR CALLBACK DlgProcPopups(HWND hwnd, UINT msg, WPARAM, LPARAM lParam) int NotifyOptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOTIFY); odp.szTitle.a = LPGEN("YAPP Popups"); odp.flags = ODPF_BOLDGROUPS; diff --git a/plugins/YAPP/src/options.cpp b/plugins/YAPP/src/options.cpp index a3538a7969..ac6877707c 100644 --- a/plugins/YAPP/src/options.cpp +++ b/plugins/YAPP/src/options.cpp @@ -472,10 +472,9 @@ static INT_PTR CALLBACK DlgProcOptsClasses(HWND hwndDlg, UINT msg, WPARAM wParam int OptInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.flags = ODPF_BOLDGROUPS; odp.position = -790000000; - odp.hInstance = g_plugin.getInst(); odp.szTitle.a = LPGEN("Popups"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT1); diff --git a/plugins/YAPP/src/yapp.cpp b/plugins/YAPP/src/yapp.cpp index 28b10abc35..041ef7d85a 100644 --- a/plugins/YAPP/src/yapp.cpp +++ b/plugins/YAPP/src/yapp.cpp @@ -165,7 +165,7 @@ static void InitMenuItems(void) hMenuRoot = g_plugin.addRootMenu(MO_MAIN, LPGENW("Popups"), 500010000, IcoLib_GetIcon(isEnabled ? ICO_POPUP_ON : ICO_POPUP_OFF, 0)); Menu_ConfigureItem(hMenuRoot, MCI_OPT_UID, "043A641A-2767-4C57-AA57-9233D6F9DC54"); - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); mi.flags = CMIF_UNICODE; mi.root = hMenuRoot; diff --git a/plugins/YARelay/src/options.cpp b/plugins/YARelay/src/options.cpp index 4855369189..5082c2f6bd 100644 --- a/plugins/YARelay/src/options.cpp +++ b/plugins/YARelay/src/options.cpp @@ -191,8 +191,7 @@ static INT_PTR CALLBACK OptionsFrameProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, int OptionsInit(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; - odp.hInstance = g_plugin.getInst(); + OPTIONSDIALOGPAGE odp = {}; odp.position = -1; odp.szGroup.a = LPGEN("Message sessions"); odp.pszTemplate = MAKEINTRESOURCEA(IDD_SETTINGS); diff --git a/plugins/ZeroNotification/src/main.cpp b/plugins/ZeroNotification/src/main.cpp index 78c3aa0f05..eacb760c32 100644 --- a/plugins/ZeroNotification/src/main.cpp +++ b/plugins/ZeroNotification/src/main.cpp @@ -85,7 +85,7 @@ static INT_PTR NoSoundMenuCommand(WPARAM, LPARAM) int CMPlugin::Load() { - CMenuItem mi(g_plugin); + CMenuItem mi(&g_plugin); SET_UID(mi, 0x6bd635eb, 0xc4bb, 0x413b, 0xb9, 0x3, 0x81, 0x6d, 0x8f, 0xf1, 0x9b, 0xb0); mi.position = -0x7FFFFFFF; mi.flags = CMIF_UNICODE; diff --git a/plugins/ZeroNotification/src/options.cpp b/plugins/ZeroNotification/src/options.cpp index efb190cb4f..ba4970f54b 100644 --- a/plugins/ZeroNotification/src/options.cpp +++ b/plugins/ZeroNotification/src/options.cpp @@ -127,9 +127,8 @@ static INT_PTR CALLBACK DlgProcNoSoundOpts(HWND hwndDlg, UINT msg, WPARAM, LPARA int OptionsInitialize(WPARAM wParam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 100000000; - odp.hInstance = g_plugin.getInst(); odp.flags = ODPF_UNICODE; odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_NOSOUND); odp.szTitle.w = LPGENW("Zero Notifications"); diff --git a/plugins/mRadio/i_optdlg.inc b/plugins/mRadio/i_optdlg.inc index a48d987989..5146b57adc 100644 --- a/plugins/mRadio/i_optdlg.inc +++ b/plugins/mRadio/i_optdlg.inc @@ -622,7 +622,6 @@ begin FillChar(odp,SizeOf(odp),0); odp.flags :=ODPF_BOLDGROUPS; odp.Position :=900003000; - odp.hInstance :=hInstance; odp.szGroup.a :='Network'; odp.szTitle.a :=PluginName; diff --git a/plugins/mRadio/rframeapi.pas b/plugins/mRadio/rframeapi.pas index c0cc1702bc..94d5438ea5 100644 --- a/plugins/mRadio/rframeapi.pas +++ b/plugins/mRadio/rframeapi.pas @@ -227,7 +227,7 @@ begin TBName.w:=TranslateW(cPluginName + ' volume control'); end; - FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),0); + FrameId:=CallService(MS_CLIST_FRAMES_ADDFRAME,wparam(@Frame),lparam(@g_Plugin)); if FrameId>=0 then begin CallService(MS_CLIST_FRAMES_UPDATEFRAME,FrameId, FU_FMPOS); diff --git a/plugins/mRadio/version.RES b/plugins/mRadio/version.RES new file mode 100644 index 0000000000..b130578b35 Binary files /dev/null and b/plugins/mRadio/version.RES differ diff --git a/plugins/wbOSD/src/options.cpp b/plugins/wbOSD/src/options.cpp index fa35231f73..4e2cb3f448 100644 --- a/plugins/wbOSD/src/options.cpp +++ b/plugins/wbOSD/src/options.cpp @@ -409,9 +409,8 @@ xxx: int OptionsInit(WPARAM wparam, LPARAM) { - OPTIONSDIALOGPAGE odp = { 0 }; + OPTIONSDIALOGPAGE odp = {}; odp.position = 150000000; - odp.hInstance = g_plugin.getInst(); odp.pszTemplate = MAKEINTRESOURCEA(IDD_DIALOG1); odp.szGroup.w = LPGENW("Plugins"); odp.szTitle.w = LPGENW("OSD"); -- cgit v1.2.3