summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-06-27 13:58:25 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-06-27 13:58:25 +0000
commit81e8caf42867b65677efe2bffaa52ecff7303c3a (patch)
tree846f06ef51787c58205cd87546976bda29556680
parentd9da7f147fbe91d2e70721de96907ae1d273b591 (diff)
no more pluginLink in load()
git-svn-id: http://svn.miranda-ng.org/main/trunk@652 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/m_protomod.h2
-rw-r--r--include/m_userinfo.h2
-rw-r--r--include/newpluginapi.h4
-rw-r--r--plugins/AVS/main.cpp4
-rw-r--r--plugins/AddContactPlus/main.cpp6
-rw-r--r--plugins/Alarms/alarms.cpp6
-rw-r--r--plugins/Alarms/common.h17
-rw-r--r--plugins/AssocMgr/main.cpp4
-rw-r--r--plugins/AuthState/main.cpp7
-rw-r--r--plugins/AutoRun/main.cpp4
-rw-r--r--plugins/BASS_interface/Main.cpp7
-rw-r--r--plugins/BasicHistory/BasicHistory.cpp4
-rw-r--r--plugins/BasicHistory/Options.cpp2
-rw-r--r--plugins/BasicHistory/Options.h2
-rw-r--r--plugins/Boltun/boltun.cpp4
-rw-r--r--plugins/BossKeyPlus/BossKey.cpp4
-rw-r--r--plugins/BuddyExpectator/BuddyExpectator.cpp7
-rw-r--r--plugins/BuddyExpectator/common.h1
-rw-r--r--plugins/CSList/cslist.cpp4
-rw-r--r--plugins/CSList/cslist.h17
-rw-r--r--plugins/ChangeKeyboardLayout/main.cpp4
-rw-r--r--plugins/Chat/main.cpp4
-rw-r--r--plugins/ClientChangeNotify/ClientChangeNotify.cpp4
-rw-r--r--plugins/Clist_classic/init.cpp8
-rw-r--r--plugins/Clist_modern/init.cpp11
-rw-r--r--plugins/Clist_modern/modern_clcopts.cpp2
-rw-r--r--plugins/Clist_modern/modern_cluiframes.cpp303
-rw-r--r--plugins/Clist_mw/CLUIFrames/cluiframes.cpp16
-rw-r--r--plugins/Clist_mw/init.cpp11
-rw-r--r--plugins/Clist_nicer/CLUIFrames/cluiframes.cpp3
-rw-r--r--plugins/Clist_nicer/SRC/init.cpp6
-rw-r--r--plugins/Clist_nicer/skineditor/main.cpp4
-rw-r--r--plugins/Console/init.cpp4
-rw-r--r--plugins/ContactsPlus/main.cpp8
-rw-r--r--plugins/ContactsPlus/utils.cpp101
-rw-r--r--plugins/ContactsPlus/utils.h11
-rw-r--r--plugins/CountryFlags/main.cpp4
-rw-r--r--plugins/CryptoPP/commonheaders.cpp1
-rw-r--r--plugins/CryptoPP/commonheaders.h1
-rw-r--r--plugins/CryptoPP/main.cpp8
-rw-r--r--plugins/CyrTranslit/main.cpp5
-rw-r--r--plugins/Db3x/commonheaders.h1
-rw-r--r--plugins/Db3x/init.cpp14
-rw-r--r--plugins/Db3x_mmap/commonheaders.h2
-rw-r--r--plugins/Db3x_mmap/init.cpp11
-rw-r--r--plugins/Db_autobackups/main.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/Dbtool/encryption.cpp31
-rw-r--r--plugins/Dbx_mmap_SA/Import_SA/main.cpp6
-rw-r--r--plugins/Dbx_mmap_SA/commonheaders.h2
-rw-r--r--plugins/Dbx_mmap_SA/dialogs.cpp3
-rw-r--r--plugins/Dbx_mmap_SA/init.cpp19
-rw-r--r--plugins/Dbx_tree/DatabaseLink.cpp9
-rw-r--r--plugins/Dbx_tree/Interface.h1
-rw-r--r--plugins/Dbx_tree/init.cpp2
-rw-r--r--plugins/ExtraIcons/commons.h1
-rw-r--r--plugins/ExtraIcons/extraicons.cpp6
-rw-r--r--plugins/FavContacts/src/main.cpp9
-rw-r--r--plugins/FingerPrintModPlus/src/fingerprint.cpp9
-rw-r--r--plugins/FirstRun/main.cpp6
-rw-r--r--plugins/FlashAvatars/cflash.cpp6
-rw-r--r--plugins/FloatingContacts/main.cpp5
-rw-r--r--plugins/Folders/folders.cpp6
-rw-r--r--plugins/FreeImage/Miranda/main.cpp5
-rw-r--r--plugins/Gender/main.cpp6
-rw-r--r--plugins/HistoryLinkListPlus/linklist.cpp6
-rw-r--r--plugins/HistorySweeperLight/main.cpp6
-rw-r--r--plugins/IEView/ieview_main.cpp6
-rw-r--r--plugins/IgnoreState/main.cpp9
-rw-r--r--plugins/Import/main.cpp6
-rw-r--r--plugins/KeyboardNotify/main.cpp9
-rw-r--r--plugins/LangMan/main.cpp6
-rw-r--r--plugins/ListeningTo/commons.h1
-rw-r--r--plugins/ListeningTo/listeningto.cpp6
-rw-r--r--plugins/MenuItemEx/main.cpp6
-rw-r--r--plugins/MenuItemEx/menuex.h1
-rw-r--r--plugins/MetaContacts/meta_main.cpp5
-rw-r--r--plugins/MirOTR/MirOTR/dllmain.cpp6
-rw-r--r--plugins/MirOTR/MirOTR/dllmain.h1
-rw-r--r--plugins/ModernOpt/main.cpp6
-rw-r--r--plugins/NewAwaySysMod/AwaySys.cpp174
-rw-r--r--plugins/NewAwaySysMod/Common.h6
-rw-r--r--plugins/NewAwaySysMod/Services.cpp67
-rw-r--r--plugins/NewEventNotify/main.c9
-rw-r--r--plugins/NewXstatusNotify/main.cpp6
-rw-r--r--plugins/Nudge/main.cpp6
-rw-r--r--plugins/PackUpdater/Src/PackUpdater.cpp6
-rw-r--r--plugins/Popup/src/config.cpp2
-rw-r--r--plugins/Popup/src/config.h1
-rw-r--r--plugins/Popup/src/main.cpp4
-rw-r--r--plugins/ProfileManager/pmanagerEx.cpp6
-rw-r--r--plugins/QuickMessages/main.cpp6
-rw-r--r--plugins/QuickReplies/quickreplies.cpp8
-rw-r--r--plugins/Rate/main.cpp9
-rw-r--r--plugins/RecentContacts/RecentContacts.cpp8
-rw-r--r--plugins/SRMM/srmm.cpp7
-rw-r--r--plugins/Scriver/srmm.cpp6
-rw-r--r--plugins/SecureIM/commonheaders.h2
-rw-r--r--plugins/SecureIM/main.cpp6
-rw-r--r--plugins/SeenPlugin/main.cpp6
-rw-r--r--plugins/Sessions/Src/Main.cpp6
-rw-r--r--plugins/SimpleAR/Src/Main.cpp6
-rw-r--r--plugins/SimpleStatusMsg/main.cpp6
-rw-r--r--plugins/SmileyAdd/main.cpp6
-rw-r--r--plugins/SmileyAdd/smileys.cpp4
-rw-r--r--plugins/SpellChecker/spellchecker.cpp6
-rw-r--r--plugins/SplashScreen/src/main.cpp9
-rw-r--r--plugins/StatusPlugins/AdvancedAutoAway/main.cpp6
-rw-r--r--plugins/StatusPlugins/KeepStatus/main.cpp6
-rw-r--r--plugins/StatusPlugins/StartupStatus/main.cpp6
-rw-r--r--plugins/StopSpamPlus/src/stopspam.cpp9
-rw-r--r--plugins/Svc_crshdmp/crshdmp.cpp6
-rw-r--r--plugins/Svc_dbepp/main.cpp6
-rw-r--r--plugins/Svc_vi/main.cpp9
-rw-r--r--plugins/TabSRMM/chat/main.cpp2
-rw-r--r--plugins/TabSRMM/include/themes.h2
-rw-r--r--plugins/TabSRMM/src/srmm.cpp10
-rw-r--r--plugins/TabSRMM/src/themes.cpp2
-rw-r--r--plugins/TipperYM/common.h1
-rw-r--r--plugins/TipperYM/tipper.cpp6
-rw-r--r--plugins/TooltipNotify/src/main.cpp10
-rw-r--r--plugins/TopToolBar/main.cpp6
-rw-r--r--plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp6
-rw-r--r--plugins/Updater/common.h1
-rw-r--r--plugins/Updater/updater.cpp6
-rw-r--r--plugins/UserGuide/main.cpp6
-rw-r--r--plugins/UserInfoEx/ex_import/tinyxml.h2
-rw-r--r--plugins/UserInfoEx/init.cpp7
-rw-r--r--plugins/Variables/main.cpp6
-rw-r--r--plugins/W7UI/jumplistbuilder.h2
-rw-r--r--plugins/W7UI/main.cpp10
-rw-r--r--plugins/WhenWasIt/WhenWasIt.cpp6
-rw-r--r--plugins/YAPP/common.h1
-rw-r--r--plugins/YAPP/popups2.cpp6
-rw-r--r--plugins/ZeroNotification/main.cpp6
-rw-r--r--plugins/mTextControl/src/main.cpp5
-rw-r--r--plugins/mTextControl/src/services.cpp2
-rw-r--r--plugins/testplugin/testplug.c2
-rw-r--r--protocols/AimOscar/aim.cpp6
-rw-r--r--protocols/FacebookRM/main.cpp6
-rw-r--r--protocols/GTalkExt/GTalkExt.cpp6
-rw-r--r--protocols/Gadu-Gadu/gg.c6
-rw-r--r--protocols/Gadu-Gadu/gg.h1
-rw-r--r--protocols/IRCG/main.cpp7
-rw-r--r--protocols/IcqOscarJ/init.cpp5
-rw-r--r--protocols/JabberG/jabber.cpp6
-rw-r--r--protocols/MRA/Mra.cpp9
-rw-r--r--protocols/MSN/msn.cpp6
-rw-r--r--protocols/NewsAggregator/Src/NewsAggregator.cpp9
-rw-r--r--protocols/Omegle/main.cpp6
-rw-r--r--protocols/Quotes/Forex.cpp5
-rw-r--r--protocols/Twitter/main.cpp6
-rw-r--r--protocols/Weather/weather.cpp6
-rw-r--r--protocols/YAMN/main.cpp9
-rw-r--r--protocols/Yahoo/main.cpp10
-rw-r--r--protocols/Yahoo/yahoo.h5
-rw-r--r--src/core/modules.cpp2
-rw-r--r--src/modules/database/database.cpp4
-rw-r--r--src/modules/plugins/newplugins.cpp6
-rw-r--r--src/modules/plugins/plugins.h2
159 files changed, 684 insertions, 866 deletions
diff --git a/include/m_protomod.h b/include/m_protomod.h
index bce86385d6..887e673625 100644
--- a/include/m_protomod.h
+++ b/include/m_protomod.h
@@ -36,7 +36,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//wParam=0
//lParam=(PROTOCOLDESCRIPTOR*)&descriptor
//returns 0 on success, nonzero on failure
-//This service must be called in your module's Load() routine.
+//This service must be called in your module's Load(void) routine.
//descriptor.type can be a value other than the PROTOTYPE_ constants specified
//above to provide more precise positioning information for the contact
//protocol lists. It is strongly recommended that you give values relative to
diff --git a/include/m_userinfo.h b/include/m_userinfo.h
index 0456fb70e8..e19b08211c 100644
--- a/include/m_userinfo.h
+++ b/include/m_userinfo.h
@@ -39,7 +39,7 @@ wParam=addInfo
lParam=(LPARAM)hContact
addInfo should be passed straight to the wParam of userinfo/addpage
NB: The built-in userinfo module is loaded after all plugins, so calling
-HookEvent() in your plugin's Load() function will fail if you specify this
+HookEvent() in your plugin's Load(void) function will fail if you specify this
hook. Look up core/m_system.h:me_system_modulesloaded.
*/
#define ME_USERINFO_INITIALISE "UserInfo/Initialise"
diff --git a/include/newpluginapi.h b/include/newpluginapi.h
index c539b9222b..e27855e34b 100644
--- a/include/newpluginapi.h
+++ b/include/newpluginapi.h
@@ -220,12 +220,12 @@ typedef struct {
which is a PLUGINLINK structure
Returns: 0 on success, nonzero on failure
*/
- int (*Load) (char * profile, void * link);
+ int (*Load) (char * profile);
/*
Affect: The database plugin should shutdown, unloading things from the core and freeing internal structures
Returns: 0 on success, nonzero on failure
- Note: Unload() might be called even if Load() was never called, wasLoaded is set to 1 if Load() was ever called.
+ Note: Unload() might be called even if Load(void) was never called, wasLoaded is set to 1 if Load(void) was ever called.
*/
int (*Unload) (int wasLoaded);
diff --git a/plugins/AVS/main.cpp b/plugins/AVS/main.cpp
index 75aa1cd71e..984c7e3e05 100644
--- a/plugins/AVS/main.cpp
+++ b/plugins/AVS/main.cpp
@@ -25,7 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "version.h"
HINSTANCE g_hInst = 0;
-PLUGINLINK *pluginLink;
int hLangpack;
static TCHAR g_szDataPath[MAX_PATH]; // user datae path (read at startup only)
@@ -2468,11 +2467,10 @@ extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) Load(void)
{
INT_PTR result = CALLSERVICE_NOTFOUND;
- pluginLink = link;
mir_getLP( &pluginInfoEx );
if (ServiceExists(MS_IMG_GETINTERFACE))
diff --git a/plugins/AddContactPlus/main.cpp b/plugins/AddContactPlus/main.cpp
index 3ce31e7a5e..e7c33cb9e0 100644
--- a/plugins/AddContactPlus/main.cpp
+++ b/plugins/AddContactPlus/main.cpp
@@ -21,8 +21,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include "addcontactplus.h"
HINSTANCE hInst;
-PLUGINLINK* pluginLink;
-int hLangpack;
+int hLangpack;
static HANDLE hModulesLoaded = 0, hChangedIcons = 0, hAccListChanged = 0,
hMainMenuItem = 0, hToolBarItem = 0, hService = 0;
HANDLE hIconLibItem;
@@ -177,9 +176,8 @@ static int OnModulesLoaded(WPARAM, LPARAM)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK* link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
mir_getLP(&pluginInfo);
INITCOMMONCONTROLSEX icex = {0};
diff --git a/plugins/Alarms/alarms.cpp b/plugins/Alarms/alarms.cpp
index 19af4e7883..27a5c53a97 100644
--- a/plugins/Alarms/alarms.cpp
+++ b/plugins/Alarms/alarms.cpp
@@ -20,7 +20,6 @@ There is no warranty.
TCHAR szGamePrefix[] = COMMANDPREFIX;
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
int hLangpack;
HANDLE hTopToolbarButton;
@@ -300,11 +299,10 @@ static int MainDeInit(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+ mir_getLP(&pluginInfo);
- mir_getLP(&pluginInfo);
// ensure datetime picker is loaded
INITCOMMONCONTROLSEX ccx;
ccx.dwSize = sizeof(ccx);
diff --git a/plugins/Alarms/common.h b/plugins/Alarms/common.h
index b86cd036c0..36ac58ea3b 100644
--- a/plugins/Alarms/common.h
+++ b/plugins/Alarms/common.h
@@ -46,23 +46,22 @@
#define MODULE "Alarm"
extern HINSTANCE hInst;
-extern PLUGINLINK *pluginLink;
extern HANDLE hTopToolbarButton;
typedef struct ALARM_tag {
- unsigned short id;
+ unsigned short id;
TCHAR *szTitle;
TCHAR *szDesc;
Occurrence occurrence;
- BOOL snoozer;
- SYSTEMTIME time;
- unsigned short action;
- TCHAR *szCommand;
- TCHAR *szCommandParams;
- BYTE sound_num;
+ BOOL snoozer;
+ SYSTEMTIME time;
+ unsigned short action;
+ TCHAR *szCommand;
+ TCHAR *szCommandParams;
+ BYTE sound_num;
int flags;
- DWORD trigger_id;
+ DWORD trigger_id;
} ALARM;
#ifndef MIID_ALARMS
diff --git a/plugins/AssocMgr/main.cpp b/plugins/AssocMgr/main.cpp
index 0d5c3dac82..9e81a0b74b 100644
--- a/plugins/AssocMgr/main.cpp
+++ b/plugins/AssocMgr/main.cpp
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "version.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
static HANDLE hHookModulesLoaded;
int hLangpack;
@@ -98,9 +97,8 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink=link;
mir_getLP(&pluginInfo);
InitAssocList();
diff --git a/plugins/AuthState/main.cpp b/plugins/AuthState/main.cpp
index c08a7bca86..ba37eeeb3d 100644
--- a/plugins/AuthState/main.cpp
+++ b/plugins/AuthState/main.cpp
@@ -26,7 +26,6 @@
#include "commonheaders.h"
HINSTANCE g_hInst;
-PLUGINLINK *pluginLink;
static HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL;
static HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactSettingChanged = NULL, hContactAdded = NULL;
static HANDLE hPrebuildContactMenu = NULL, hAuthMenuSelected = NULL;
@@ -322,10 +321,10 @@ int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfo);
+
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit);
hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
diff --git a/plugins/AutoRun/main.cpp b/plugins/AutoRun/main.cpp
index 638d10f211..0ae7dcc634 100644
--- a/plugins/AutoRun/main.cpp
+++ b/plugins/AutoRun/main.cpp
@@ -1,7 +1,6 @@
#include "autorun.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
HANDLE hHookOptionInit = NULL;
int hLangpack;
@@ -130,9 +129,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
mir_getLP(&pluginInfoEx);
hHookOptionInit = HookEvent(ME_OPT_INITIALISE, AutorunOptInitialise);
return 0;
diff --git a/plugins/BASS_interface/Main.cpp b/plugins/BASS_interface/Main.cpp
index bbea422e0d..7dfb902cb4 100644
--- a/plugins/BASS_interface/Main.cpp
+++ b/plugins/BASS_interface/Main.cpp
@@ -5,7 +5,6 @@ Copyright (C) 2010, 2011 tico-tico
#include "bass_interface.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
int hLangpack;
PLUGININFOEX pluginInfo={
@@ -472,10 +471,10 @@ int OnShutdown(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfo);
+
hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
hHooks[1] = HookEvent(ME_SYSTEM_SHUTDOWN, OnShutdown);
hHooks[2] = HookEvent(ME_TB_MODULELOADED, OnToolbarLoaded);
diff --git a/plugins/BasicHistory/BasicHistory.cpp b/plugins/BasicHistory/BasicHistory.cpp
index 0897ab9ce9..89d15167cd 100644
--- a/plugins/BasicHistory/BasicHistory.cpp
+++ b/plugins/BasicHistory/BasicHistory.cpp
@@ -28,7 +28,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#define MS_HISTORY_DELETEALLCONTACTHISTORY "BasicHistory/DeleteAllContactHistory"
#define MS_HISTORY_EXECUTE_TASK "BasicHistory/ExecuteTask"
-PLUGINLINK *pluginLink;
HCURSOR hCurSplitNS, hCurSplitWE;
HANDLE g_hMainThread=NULL;
@@ -371,10 +370,9 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
hTaskMainMenu = NULL;
- pluginLink = link;
DuplicateHandle(GetCurrentProcess(),GetCurrentThread(),GetCurrentProcess(),&g_hMainThread,0,FALSE,DUPLICATE_SAME_ACCESS);
mir_getTMI(&tmi);
mir_getLP(&pluginInfo);
diff --git a/plugins/BasicHistory/Options.cpp b/plugins/BasicHistory/Options.cpp
index 06a64d35e4..218e721f03 100644
--- a/plugins/BasicHistory/Options.cpp
+++ b/plugins/BasicHistory/Options.cpp
@@ -237,7 +237,7 @@ void Options::Unload()
DeleteCriticalSection(&criticalSection);
}
-void Options::Load()
+void Options::Load(void)
{
InitializeCriticalSection(&criticalSection);
FontIDT fid = {0};
diff --git a/plugins/BasicHistory/Options.h b/plugins/BasicHistory/Options.h
index 7ff61bb997..4a5d17229c 100644
--- a/plugins/BasicHistory/Options.h
+++ b/plugins/BasicHistory/Options.h
@@ -149,7 +149,7 @@ public:
void Save();
void SaveTasks(std::list<TaskOptions>* tasks);
void SaveTaskTime(TaskOptions& to);
- void Load();
+ void Load(void);
void LoadTasks();
void Unload();
diff --git a/plugins/Boltun/boltun.cpp b/plugins/Boltun/boltun.cpp
index 2235ebf138..9e4881c080 100644
--- a/plugins/Boltun/boltun.cpp
+++ b/plugins/Boltun/boltun.cpp
@@ -53,7 +53,6 @@ TalkBot* bot = NULL;
#define MAX_MIND_FILE 1024
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
BOOL blInit = FALSE;
UINT pTimer = 0;
TCHAR *path;
@@ -622,9 +621,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
mir_getLP(&pluginInfo);
path = new TCHAR[MAX_PATH];
diff --git a/plugins/BossKeyPlus/BossKey.cpp b/plugins/BossKeyPlus/BossKey.cpp
index 67f5604b0a..1f115858b1 100644
--- a/plugins/BossKeyPlus/BossKey.cpp
+++ b/plugins/BossKeyPlus/BossKey.cpp
@@ -32,7 +32,6 @@
// unique to this DLL, not to be shared
HINSTANCE g_hInstance;
-PLUGINLINK *pluginLink;
CLIST_INTERFACE *pcli;
HANDLE g_hmGenMenuInit, g_hIcon, g_hMenuItem, g_hHideService, g_hIsHiddenService;
HANDLE g_hHooks[7];
@@ -857,9 +856,8 @@ int MirandaLoaded(WPARAM wParam,LPARAM lParam)
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
mir_getLP(&pluginInfo);
g_wMaskAdv = DBGetContactSettingWord(NULL,MOD_NAME,"optsmaskadv",0);
diff --git a/plugins/BuddyExpectator/BuddyExpectator.cpp b/plugins/BuddyExpectator/BuddyExpectator.cpp
index d4620de3dc..3e7daed480 100644
--- a/plugins/BuddyExpectator/BuddyExpectator.cpp
+++ b/plugins/BuddyExpectator/BuddyExpectator.cpp
@@ -28,7 +28,6 @@
#include "options.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
int hLangpack;
DWORD timer_id = 0;
@@ -884,10 +883,10 @@ int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
- mir_getLP(&pluginInfo);
+ mir_getLP(&pluginInfo);
+
setlocale(LC_ALL, "English"); // Set English locale
InitOptions();
diff --git a/plugins/BuddyExpectator/common.h b/plugins/BuddyExpectator/common.h
index 2794b9e91f..09bfd58011 100644
--- a/plugins/BuddyExpectator/common.h
+++ b/plugins/BuddyExpectator/common.h
@@ -57,7 +57,6 @@
#define MODULE_NAME "BuddyExpectator"
extern HINSTANCE hInst;
-extern PLUGINLINK *pluginLink;
void CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD);
extern DWORD timer_id;
diff --git a/plugins/CSList/cslist.cpp b/plugins/CSList/cslist.cpp
index cc0f0f989b..ff4870f4d4 100644
--- a/plugins/CSList/cslist.cpp
+++ b/plugins/CSList/cslist.cpp
@@ -72,10 +72,8 @@ extern "C" __declspec( dllexport ) const MUUID* MirandaPluginInterfaces( void )
// ====[ LOADER ]=============================================================
-extern "C" __declspec( dllexport ) int Load( PLUGINLINK *link )
+extern "C" __declspec( dllexport ) int Load( )
{
- // link plugin
- pluginLink = link;
mir_getLP(&pluginInfoEx);
servicesList = List_Create(0, 10);
diff --git a/plugins/CSList/cslist.h b/plugins/CSList/cslist.h
index 9fd1b5a5c9..b2cffb6549 100644
--- a/plugins/CSList/cslist.h
+++ b/plugins/CSList/cslist.h
@@ -327,7 +327,7 @@ template< class T > struct ListItem
{
T* item;
ListItem* next;
-
+
ListItem( )
{
this->item = NULL;
@@ -338,7 +338,7 @@ template< class T > struct ListItem
{
delete this->item;
}
-
+
ListItem( StatusItem* si )
{
this->item = si;
@@ -358,7 +358,7 @@ template< class T > struct List
private:
ListItem< T >* items;
unsigned int count;
-
+
public:
typedef int ( *compareFunc )( const T* p1, const T* p2 );
compareFunc compare;
@@ -448,7 +448,7 @@ public:
this->count--;
return position;
}
-
+
T* get( const unsigned int item )
{
ListItem< T >* help = items;
@@ -625,9 +625,9 @@ BOOL CSList::bAccountsSupported = FALSE;
static const MUUID interfaces[] = { PLUGIN_GUUID, MIID_LAST };
-PLUGINLINK* pluginLink = NULL;
-PLUGININFOEX pluginInfoEx = {
- sizeof(PLUGININFOEX),
+PLUGININFOEX pluginInfoEx =
+{
+ sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
__DESCRIPTION,
@@ -642,7 +642,6 @@ PLUGININFOEX pluginInfoEx = {
CSList* cslist = NULL;
-
// ====[ INIT STUFF ]=========================================================
BOOL WINAPI DllMain( HINSTANCE, DWORD, LPVOID );
@@ -650,7 +649,7 @@ BOOL WINAPI DllMain( HINSTANCE, DWORD, LPVOID );
extern "C" __declspec( dllexport ) PLUGININFOEX* MirandaPluginInfoEx( DWORD );
extern "C" __declspec( dllexport ) const MUUID* MirandaPluginInterfaces( void );
-extern "C" __declspec( dllexport ) int Load( PLUGINLINK* );
+extern "C" __declspec( dllexport ) int Load(void);
extern "C" __declspec( dllexport ) int Unload( void );
diff --git a/plugins/ChangeKeyboardLayout/main.cpp b/plugins/ChangeKeyboardLayout/main.cpp
index 0aa7272bed..039554a019 100644
--- a/plugins/ChangeKeyboardLayout/main.cpp
+++ b/plugins/ChangeKeyboardLayout/main.cpp
@@ -1,6 +1,5 @@
#include "commonheaders.h"
-PLUGINLINK *pluginLink;
int hLangpack;
LPTSTR ptszLayStrings[20];
HANDLE hChangeLayout, hGetLayoutOfText, hChangeTextLayout;
@@ -46,9 +45,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
mir_getLP(&pluginInfoEx);
ZeroMemory(hklLayouts, 20 * sizeof(HKL));
bLayNum = GetKeyboardLayoutList(20,hklLayouts);
diff --git a/plugins/Chat/main.cpp b/plugins/Chat/main.cpp
index 11090d1fc0..4a2963ee08 100644
--- a/plugins/Chat/main.cpp
+++ b/plugins/Chat/main.cpp
@@ -22,7 +22,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//globals
HINSTANCE g_hInst;
-PLUGINLINK *pluginLink;
HANDLE g_hWindowList;
HMENU g_hMenu = NULL;
int hLangpack;
@@ -82,10 +81,9 @@ extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
BOOL bFlag = FALSE;
- pluginLink = link;
// set the memory & utf8 managers
mir_getLP( &pluginInfo );
diff --git a/plugins/ClientChangeNotify/ClientChangeNotify.cpp b/plugins/ClientChangeNotify/ClientChangeNotify.cpp
index 6159f4ea2b..e8b3d07819 100644
--- a/plugins/ClientChangeNotify/ClientChangeNotify.cpp
+++ b/plugins/ClientChangeNotify/ClientChangeNotify.cpp
@@ -34,7 +34,6 @@
HINSTANCE g_hInstance;
HANDLE g_hMainThread;
HANDLE g_hTogglePopupsMenuItem;
-PLUGINLINK *pluginLink;
int hLangpack;
TMyArray<HANDLE> hHooks, hServices;
COptPage *g_PreviewOptPage; // we need to show popup even for the NULL contact if g_PreviewOptPage is not NULL (used for popup preview)
@@ -445,9 +444,8 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam)
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
mir_getLP( &pluginInfo );
hHooks.AddElem(HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded));
diff --git a/plugins/Clist_classic/init.cpp b/plugins/Clist_classic/init.cpp
index 3d97b81e6f..5af2c3b339 100644
--- a/plugins/Clist_classic/init.cpp
+++ b/plugins/Clist_classic/init.cpp
@@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
HINSTANCE g_hInst = 0;
-PLUGINLINK *pluginLink;
CLIST_INTERFACE* pcli = NULL;
HIMAGELIST himlCListClc = NULL;
int hLangpack;
@@ -136,11 +135,8 @@ static INT_PTR GetStatusMode(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
// main clist initialization routine
-extern "C" __declspec(dllexport) int CListInitialise(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int CListInitialise()
{
- pluginLink = link;
-
- // get the internal malloc/free()
mir_getLP( &pluginInfo );
pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst);
@@ -170,7 +166,7 @@ LBL_Error:
/////////////////////////////////////////////////////////////////////////////////////////
// a plugin loader aware of CList exports will never call this.
-extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(void)
{
return 1;
}
diff --git a/plugins/Clist_modern/init.cpp b/plugins/Clist_modern/init.cpp
index 92d0d1dcfd..fc2b6627bf 100644
--- a/plugins/Clist_modern/init.cpp
+++ b/plugins/Clist_modern/init.cpp
@@ -34,7 +34,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define CHECKRES(sub) if (sub!=S_OK) return S_FALSE;
HINSTANCE g_hInst = 0;
-PLUGINLINK * pluginLink=NULL;
CLIST_INTERFACE *pcli=NULL;
CLIST_INTERFACE corecli={0};
CLUIDATA g_CluiData={0};
@@ -89,14 +88,8 @@ PLUGININTERFACE PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
return &pluginInfo;
}
-PLUGININTERFACE int CListInitialise(PLUGINLINK * link)
+PLUGININTERFACE int CListInitialise()
{
- pluginLink=link;
-/*
-#ifdef _DEBUG
- _CrtSetBreakAlloc(11166);
-#endif
-*/
HMODULE hKernel = GetModuleHandleA( "kernel32.dll" );
fnTryEnterCriticalSection = ( pfnTryEnterCriticalSection )GetProcAddress( hKernel, "TryEnterCriticalSection" );
@@ -130,7 +123,7 @@ PLUGININTERFACE int CListInitialise(PLUGINLINK * link)
}
// never called by a newer plugin loader.
-PLUGININTERFACE int Load(PLUGINLINK * link)
+PLUGININTERFACE int Load(void)
{
MessageBoxA(0,"You Running Old Miranda, use " MINIMAL_COREVERSION_STR " version!","Modern Clist",0);
return 1;
diff --git a/plugins/Clist_modern/modern_clcopts.cpp b/plugins/Clist_modern/modern_clcopts.cpp
index 100076f84a..10679d57f0 100644
--- a/plugins/Clist_modern/modern_clcopts.cpp
+++ b/plugins/Clist_modern/modern_clcopts.cpp
@@ -1515,8 +1515,6 @@ static INT_PTR CALLBACK DlgProcClistWindowOpts(HWND hwndDlg, UINT msg, WPARAM wP
extern HINSTANCE g_hInst;
-extern PLUGINLINK *pluginLink;
-extern struct MM_INTERFACE mmi;
char **bkgrList = NULL;
int bkgrCount = 0;
diff --git a/plugins/Clist_modern/modern_cluiframes.cpp b/plugins/Clist_modern/modern_cluiframes.cpp
index aef631a26a..d54c3a715c 100644
--- a/plugins/Clist_modern/modern_cluiframes.cpp
+++ b/plugins/Clist_modern/modern_cluiframes.cpp
@@ -1,8 +1,8 @@
/*
Miranda IM: the free IM client for Microsoft* Windows*
-Copyright 2000-2008 Miranda ICQ/IM project,
-all portions of this codebase are copyrighted to the people
+Copyright 2000-2008 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
listed in contributors.txt.
This program is free software; you can redistribute it and/or
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "hdr/modern_sync.h"
-// ALL THIS MODULE FUNCTION SHOULD BE EXECUTED FROM MAIN THREAD
+// ALL THIS MODULE FUNCTION SHOULD BE EXECUTED FROM MAIN THREAD
#include "hdr/modern_static_cluiframes_service.h" // contain services initialization and proxiation
@@ -40,7 +40,7 @@ FRAMEWND * g_pfwFrames = NULL;
int g_nFramesCount = 0;
int g_nTitleBarHeight = DEFAULT_TITLEBAR_HEIGHT;
-// STATIC
+// STATIC
enum {
frame_menu_lock = 1,
@@ -166,7 +166,7 @@ int SetAlpha(BYTE Alpha)
if (g_CluiData.fOnDesktop)
{
HWND hProgMan=FindWindow(TEXT("Progman"),NULL);
- if (IsWindow(hProgMan))
+ if (IsWindow(hProgMan))
parent=hProgMan;
}
@@ -237,7 +237,7 @@ int CLUIFrames_OnShowHide( HWND hwnd, int mode )
for(i=0;i<g_nFramesCount;i++) {
if (!g_pfwFrames[i].floating && g_pfwFrames[i].OwnerWindow!=(HWND)0 &&g_pfwFrames[i].OwnerWindow!=(HWND)-2)
{
- {
+ {
//Try to avoid crash on exit due to unlock.
HWND owner=g_pfwFrames[i].OwnerWindow;
HWND Frmhwnd=g_pfwFrames[i].hWnd;
@@ -252,12 +252,12 @@ int CLUIFrames_OnShowHide( HWND hwnd, int mode )
if (mode!=SW_HIDE)
{
SetWindowPos(g_pfwFrames[i].OwnerWindow,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
- if (ModernGetSettingByte(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT))
+ if (ModernGetSettingByte(NULL,"CList","OnDesktop",SETTING_ONDESKTOP_DEFAULT))
{
SetWindowPos(g_pfwFrames[i].OwnerWindow,HWND_TOP,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
SetWindowPos(g_pfwFrames[i].OwnerWindow,HWND_TOPMOST,0,0,0,0,SWP_NOMOVE|SWP_NOSIZE|SWP_NOACTIVATE);
}
- else SetWindowPos(g_pfwFrames[i].OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0,SWP_NOACTIVATE|SWP_NOSIZE | SWP_NOMOVE);
+ else SetWindowPos(g_pfwFrames[i].OwnerWindow, HWND_NOTOPMOST, 0, 0, 0, 0,SWP_NOACTIVATE|SWP_NOSIZE | SWP_NOMOVE);
}
}
}
@@ -310,14 +310,14 @@ int QueueAllFramesUpdating(BYTE queue)
{
if (!g_CluiData.fLayered)
{
- if (queue)
+ if (queue)
InvalidateRect(g_pfwFrames[i].hWnd,NULL,FALSE);
else
ValidateRect(g_pfwFrames[i].hWnd,NULL);
}
if (g_pfwFrames[i].PaintCallbackProc)
{
- g_pfwFrames[i].bQueued=queue;
+ g_pfwFrames[i].bQueued=queue;
if (g_pfwFrames[i].UpdateRgn)
{
DeleteObject(g_pfwFrames[i].UpdateRgn);
@@ -555,7 +555,7 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY )
{
DockThumbs( pCurThumb, pThumb, FALSE );
}
- }
+ }
// Lower-left
pt.x = rcThumb.left;
@@ -619,11 +619,11 @@ static void PositionThumb( FRAMEWND *pThumb, short nX, short nY )
nNewY = nNewY > ( sizeScreen.cy - nHeight - nOffs ) ? ( sizeScreen.cy - nHeight ) : nNewY;
- SetWindowPos( pThumb->ContainerWnd,
- HWND_TOPMOST,
- nNewX,
- nNewY,
- 0,
+ SetWindowPos( pThumb->ContainerWnd,
+ HWND_TOPMOST,
+ nNewX,
+ nNewY,
+ 0,
0,
SWP_NOSIZE | SWP_NOZORDER|SWP_NOACTIVATE );
@@ -703,7 +703,7 @@ static int DBLoadFrameSettingsAtPos(int pos,int Frameid)
g_pfwFrames[Frameid].floating =ModernGetSettingByte(0,CLUIFrameModule,AS(buf,"Floating",sadd),0);
g_pfwFrames[Frameid].order =ModernGetSettingWord(0,CLUIFrameModule,AS(buf,"Order",sadd),0);
- g_pfwFrames[Frameid].UseBorder =ModernGetSettingByte(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),g_pfwFrames[Frameid].UseBorder);
+ g_pfwFrames[Frameid].UseBorder =ModernGetSettingByte(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),g_pfwFrames[Frameid].UseBorder);
return 0;
}
@@ -725,7 +725,7 @@ static int DBStoreFrameSettingsAtPos(int pos,int Frameid)
ModernWriteSettingWord(0,CLUIFrameModule,AS(buf,"Height",sadd),(WORD)g_pfwFrames[Frameid].height);
ModernWriteSettingWord(0,CLUIFrameModule,AS(buf,"HeightCollapsed",sadd),(WORD)g_pfwFrames[Frameid].HeightWhenCollapsed);
ModernWriteSettingWord(0,CLUIFrameModule,AS(buf,"Align",sadd),(WORD)g_pfwFrames[Frameid].align);
- //FloatingPos
+ //FloatingPos
ModernWriteSettingWord(0,CLUIFrameModule,AS(buf,"FloatX",sadd),(WORD)g_pfwFrames[Frameid].FloatingPos.x);
ModernWriteSettingWord(0,CLUIFrameModule,AS(buf,"FloatY",sadd),(WORD)g_pfwFrames[Frameid].FloatingPos.y);
ModernWriteSettingWord(0,CLUIFrameModule,AS(buf,"FloatW",sadd),(WORD)g_pfwFrames[Frameid].FloatingSize.x);
@@ -733,25 +733,25 @@ static int DBStoreFrameSettingsAtPos(int pos,int Frameid)
ModernWriteSettingByte(0,CLUIFrameModule,AS(buf,"Floating",sadd),(BYTE)btoint(g_pfwFrames[Frameid].floating));
ModernWriteSettingByte(0,CLUIFrameModule,AS(buf,"UseBorder",sadd),(BYTE)btoint(g_pfwFrames[Frameid].UseBorder));
- ModernWriteSettingWord(0,CLUIFrameModule,AS(buf,"Order",sadd),(WORD)g_pfwFrames[Frameid].order);
+ ModernWriteSettingWord(0,CLUIFrameModule,AS(buf,"Order",sadd),(WORD)g_pfwFrames[Frameid].order);
return 0;
}
static int LocateStorePosition(int Frameid,int maxstored)
{
-
- if(g_pfwFrames[Frameid].Name==NULL)
+
+ if(g_pfwFrames[Frameid].Name==NULL)
return -1;
char settingname[255];
- for ( int i=0;i<maxstored;i++)
+ for ( int i=0;i<maxstored;i++)
{
-
+
mir_snprintf(settingname,SIZEOF(settingname),"Name%d",i);
DBVARIANT dbv={0};
if ( ModernGetSettingTString( NULL, CLUIFrameModule, settingname, &dbv ))
continue;
-
- if ( lstrcmpi( dbv.ptszVal, g_pfwFrames[Frameid].Name ) ==0 )
+
+ if ( lstrcmpi( dbv.ptszVal, g_pfwFrames[Frameid].Name ) ==0 )
{
ModernDBFreeVariant( &dbv );
return i;
@@ -821,14 +821,13 @@ static int CLUIFramesGetalClientFrame(void)
return _nClientFrameId;
}
}
- }
+ }
for(i=0;i<g_nFramesCount;i++)
if(g_pfwFrames[i].align==alClient) {
_nClientFrameId=i;
return i;
}
- //pluginLink
return -1;
}
@@ -991,18 +990,18 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGEN
mi.flags=CMIF_CHILDPOPUP;
mi.pszService=CLUIFRAMESMOVEDOWN;
mi.pszContactOwner=(char *)-1;
- menuid=pfnAdd(&mi);
+ menuid=pfnAdd(&mi);
if(frameid==-1) _hmiPosDown=menuid;
else g_pfwFrames[framepos].MenuHandles.MIPosDown=menuid;
- }
+ }
return 0;
}
static int ModifyMItem(WPARAM wParam,LPARAM lParam)
{
- if ( (int) wParam == -1 ) return 0; // FIXME
+ if ( (int) wParam == -1 ) return 0; // FIXME
return ModifyMenuItemProxy(wParam,lParam);
};
@@ -1154,7 +1153,7 @@ static INT_PTR _us_DoGetFrameOptions(WPARAM wParam,LPARAM lParam)
return -1;
}
-
+
switch(LOWORD(wParam))
{
case FO_FLAGS:
@@ -1168,7 +1167,7 @@ static INT_PTR _us_DoGetFrameOptions(WPARAM wParam,LPARAM lParam)
{
if (!(GetWindowLongPtr(g_pfwFrames[pos].hWnd,GWL_STYLE)&WS_BORDER)) retval|=F_NOBORDER;
}
- else
+ else
if (!g_pfwFrames[pos].UseBorder) retval|=F_NOBORDER;
@@ -1238,7 +1237,7 @@ static int UpdateTBToolTip(int framepos)
ti.uId=(UINT_PTR)g_pfwFrames[framepos].TitleBar.hwnd;
return(SendMessage(g_pfwFrames[framepos].TitleBar.hwndTip,TTM_UPDATETIPTEXT ,(WPARAM)0,(LPARAM)&ti));
- }
+ }
};
//hiword(wParam)=frameid,loword(wParam)=flag
@@ -1297,7 +1296,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
return 0;
}
- case FO_NAME:
+ case FO_NAME:
if(lParam==(LPARAM)NULL) { return -1;}
if(g_pfwFrames[pos].Name!=NULL) mir_free(g_pfwFrames[pos].Name);
if(g_pfwFrames[pos].szName!=NULL) mir_free(g_pfwFrames[pos].szName);
@@ -1315,7 +1314,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
case FO_TBNAME:
if(lParam==(LPARAM)NULL) { return(-1);}
-
+
if(g_pfwFrames[pos].TitleBar.tbname!=NULL) mir_free(g_pfwFrames[pos].TitleBar.tbname);
if(g_pfwFrames[pos].TitleBar.sztbname!=NULL) mir_free(g_pfwFrames[pos].TitleBar.sztbname);
if (bUnicodeText)
@@ -1340,7 +1339,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
{
g_pfwFrames[pos].TitleBar.tooltip=mir_tstrdup((LPTSTR)lParam);
g_pfwFrames[pos].TitleBar.sztooltip=mir_t2a((LPTSTR)lParam);
- }
+ }
else
{
g_pfwFrames[pos].TitleBar.sztooltip=mir_strdup((char*)lParam);
@@ -1356,7 +1355,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
return 0;
case FO_TBEXSTYLE:
- SetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_EXSTYLE,lParam);
+ SetWindowLongPtr(g_pfwFrames[pos].TitleBar.hwnd,GWL_EXSTYLE,lParam);
return 0;
@@ -1367,13 +1366,13 @@ static int _us_DoSetFrameOptions(WPARAM wParam,LPARAM lParam)
case FO_HEIGHT:
if(lParam<0) { return -1;}
-
+
if (g_pfwFrames[pos].collapsed)
{
int oldHeight=g_pfwFrames[pos].height;
retval=g_pfwFrames[pos].height;
g_pfwFrames[pos].height=lParam;
- if (!CLUIFramesFitInSize()) g_pfwFrames[pos].height=retval;
+ if (!CLUIFramesFitInSize()) g_pfwFrames[pos].height=retval;
retval=g_pfwFrames[pos].height;
if (g_pfwFrames[pos].height != oldHeight)
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,(LPARAM)0);
@@ -1478,7 +1477,7 @@ static int _us_DoShowHideFrame(WPARAM wParam,LPARAM lParam)
g_pfwFrames[pos].visible=!g_pfwFrames[pos].visible;
if (g_pfwFrames[pos].OwnerWindow!=(HWND)-2)
{
- if (g_pfwFrames[pos].OwnerWindow)
+ if (g_pfwFrames[pos].OwnerWindow)
CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow,(g_pfwFrames[pos].visible&& g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList))?SW_SHOW/*NOACTIVATE*/:SW_HIDE);
else if (g_pfwFrames[pos].visible)
{
@@ -1546,7 +1545,7 @@ static int _us_DoMoveFrame(WPARAM wParam,LPARAM lParam)
qsort(sd,v,sizeof(SortData),sortfunc);
for (i=0;i<v;i++)
g_pfwFrames[sd[i].realpos].order=i+1; //to be sure that order is incremental
- for (i=0;i<v;i++)
+ for (i=0;i<v;i++)
{
if (sd[i].realpos==pos)
{
@@ -1573,7 +1572,7 @@ static int _us_DoMoveFrame(WPARAM wParam,LPARAM lParam)
if (sd!=NULL){free(sd);};
CLUIFramesStoreFrameSettings(pos);
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
+ CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
}
@@ -1597,7 +1596,7 @@ static int _us_DoSetFrameAlign(WPARAM wParam,LPARAM lParam)
if (_fCluiFramesModuleNotStarted) return -1;
CLUIFrames_SetFrameOptions(MAKEWPARAM(FO_ALIGN,wParam),lParam);
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
+ CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
return(0);
}
static int _us_DoAlignFrameTop(WPARAM wParam,LPARAM lParam)
@@ -1693,7 +1692,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam)
int oldHeight;
// do not collapse/uncollapse client/locked/invisible frames
- if(g_pfwFrames[FrameId].align==alClient&&!(g_pfwFrames[FrameId].Locked||(!g_pfwFrames[FrameId].visible)||g_pfwFrames[FrameId].floating))
+ if(g_pfwFrames[FrameId].align==alClient&&!(g_pfwFrames[FrameId].Locked||(!g_pfwFrames[FrameId].visible)||g_pfwFrames[FrameId].floating))
{
RECT rc;
if(CallService(MS_CLIST_DOCKINGISDOCKED,0,0)) {return 0;};
@@ -1709,7 +1708,7 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam)
else
{
rc.bottom-=rc.top;
- rc.bottom+=g_pfwFrames[FrameId].HeightWhenCollapsed;
+ rc.bottom+=g_pfwFrames[FrameId].HeightWhenCollapsed;
g_pfwFrames[FrameId].collapsed=TRUE;
}
@@ -1775,8 +1774,8 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam)
}
else
{
- //SetWindowPos(Frames[FrameId].hWnd,HWND_TOP,0,0,Frames[FrameId].wndSize.right-Frames[FrameId].wndSize.left,Frames[FrameId].height,SWP_SHOWWINDOW|SWP_NOMOVE);
- SetWindowPos(g_pfwFrames[FrameId].ContainerWnd,HWND_TOP,0,0,g_pfwFrames[FrameId].wndSize.right-g_pfwFrames[FrameId].wndSize.left+6,g_pfwFrames[FrameId].height+DEFAULT_TITLEBAR_HEIGHT+4,SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOMOVE);
+ //SetWindowPos(Frames[FrameId].hWnd,HWND_TOP,0,0,Frames[FrameId].wndSize.right-Frames[FrameId].wndSize.left,Frames[FrameId].height,SWP_SHOWWINDOW|SWP_NOMOVE);
+ SetWindowPos(g_pfwFrames[FrameId].ContainerWnd,HWND_TOP,0,0,g_pfwFrames[FrameId].wndSize.right-g_pfwFrames[FrameId].wndSize.left+6,g_pfwFrames[FrameId].height+DEFAULT_TITLEBAR_HEIGHT+4,SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOMOVE);
};
@@ -1784,21 +1783,21 @@ static int _us_DoCollapseFrame(WPARAM wParam,LPARAM lParam)
}
};//floating test
- //CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
+ //CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
if (!g_pfwFrames[FrameId].floating)
{
- CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
+ CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList,0);
}
else
{
- //SetWindowPos(Frames[FrameId].hWnd,HWND_TOP,0,0,Frames[FrameId].wndSize.right-Frames[FrameId].wndSize.left,Frames[FrameId].height,SWP_SHOWWINDOW|SWP_NOMOVE);
+ //SetWindowPos(Frames[FrameId].hWnd,HWND_TOP,0,0,Frames[FrameId].wndSize.right-Frames[FrameId].wndSize.left,Frames[FrameId].height,SWP_SHOWWINDOW|SWP_NOMOVE);
RECT contwnd;
GetWindowRect(g_pfwFrames[FrameId].ContainerWnd,&contwnd);
contwnd.top=contwnd.bottom-contwnd.top;//height
contwnd.left=contwnd.right-contwnd.left;//width
contwnd.top-=(oldHeight-g_pfwFrames[FrameId].height);//newheight
- SetWindowPos(g_pfwFrames[FrameId].ContainerWnd,HWND_TOP,0,0,contwnd.left,contwnd.top,SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOMOVE);
+ SetWindowPos(g_pfwFrames[FrameId].ContainerWnd,HWND_TOP,0,0,contwnd.left,contwnd.top,SWP_SHOWWINDOW|SWP_NOACTIVATE|SWP_NOMOVE);
};
CLUIFramesStoreAllFrames();
return(0);
@@ -1813,7 +1812,7 @@ static int CLUIFramesLoadMainMenu()
return -1;
if(_hmiRoot!=(HGENMENU)-1) {
- CallService(MS_CLIST_REMOVEMAINMENUITEM,(WPARAM)_hmiRoot,0);
+ CallService(MS_CLIST_REMOVEMAINMENUITEM,(WPARAM)_hmiRoot,0);
_hmiRoot=(HGENMENU)-1;
}
@@ -1909,7 +1908,7 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam)
clfrm->name=mir_strdup(CustomName);
mir_free_and_nill(CustomName);
}
- }
+ }
*/
g_pfwFrames[g_nFramesCount].id=_iNextFrameId++;
g_pfwFrames[g_nFramesCount].align=clfrm->align;
@@ -1973,7 +1972,7 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam)
SetWindowLongPtr(g_pfwFrames[g_nFramesCount].TitleBar.hwnd,GWLP_USERDATA,g_pfwFrames[g_nFramesCount].id);
- g_pfwFrames[g_nFramesCount].TitleBar.hwndTip
+ g_pfwFrames[g_nFramesCount].TitleBar.hwndTip
=CreateWindowExA(0, TOOLTIPS_CLASSA, NULL,
WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP,
CW_USEDEFAULT, CW_USEDEFAULT,
@@ -2042,8 +2041,8 @@ static int _us_DoAddFrame(WPARAM wParam,LPARAM lParam)
if (Upward)
mainRect.top=mainRect.bottom-minHeight;
- else
- mainRect.bottom=mainRect.top+minHeight;
+ else
+ mainRect.bottom=mainRect.top+minHeight;
SetWindowPos(pcli->hwndContactList,NULL,mainRect.left,mainRect.top,mainRect.right-mainRect.left, mainRect.bottom-mainRect.top, SWP_NOZORDER|SWP_NOREDRAW|SWP_NOACTIVATE|SWP_NOSENDCHANGING);
}
GetWindowRect(pcli->hwndContactList,&mainRect);
@@ -2094,7 +2093,7 @@ static int _us_DoRemoveFrame(WPARAM wParam,LPARAM lParam)
if(g_pfwFrames[pos].ContainerWnd && g_pfwFrames[pos].ContainerWnd!=(HWND)-1) DestroyWindow(g_pfwFrames[pos].ContainerWnd);
g_pfwFrames[pos].ContainerWnd=(HWND)-1;
if (g_pfwFrames[pos].TitleBar.hmenu) DestroyMenu(g_pfwFrames[pos].TitleBar.hmenu);
- g_pfwFrames[pos].PaintCallbackProc = NULL;
+ g_pfwFrames[pos].PaintCallbackProc = NULL;
if (g_pfwFrames[pos].UpdateRgn) DeleteObject(g_pfwFrames[pos].UpdateRgn);
if (g_pfwFrames[pos].OwnerWindow!=(HWND)-1
@@ -2122,9 +2121,9 @@ static int CLUIFramesForceUpdateTB(const FRAMEWND *Frame)
static int CLUIFramesForceUpdateFrame(const FRAMEWND *Frame)
{
- if (Frame->hWnd!=0)
+ if (Frame->hWnd!=0)
{
- RedrawWindow(Frame->hWnd,NULL,NULL,RDW_UPDATENOW|RDW_FRAME|RDW_ERASE|RDW_INVALIDATE);
+ RedrawWindow(Frame->hWnd,NULL,NULL,RDW_UPDATENOW|RDW_FRAME|RDW_ERASE|RDW_INVALIDATE);
UpdateWindow(Frame->hWnd);
};
if(Frame->floating)
@@ -2139,7 +2138,7 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame)
{
// we need to show or hide the frame?
if(Frame->visible&&(!Frame->needhide)) {
- if (Frame->OwnerWindow!=(HWND)-2 &&Frame->OwnerWindow)
+ if (Frame->OwnerWindow!=(HWND)-2 &&Frame->OwnerWindow)
{
// CLUI_ShowWindowMod(Frame->OwnerWindow,SW_SHOW);
}
@@ -2147,7 +2146,7 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame)
CLUI_ShowWindowMod(Frame->TitleBar.hwnd,Frame->TitleBar.ShowTitleBar==TRUE?SW_SHOW/*NOACTIVATE*/:SW_HIDE);
}
else {
- if (Frame->OwnerWindow && Frame->OwnerWindow!=(HWND)(-1)&& Frame->OwnerWindow!=(HWND)(-2))
+ if (Frame->OwnerWindow && Frame->OwnerWindow!=(HWND)(-1)&& Frame->OwnerWindow!=(HWND)(-2))
{
CLUI_ShowWindowMod(Frame->OwnerWindow,SW_HIDE);
}
@@ -2156,7 +2155,7 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame)
return(0);
}
- if (Frame->OwnerWindow&&Frame->OwnerWindow!=(HWND)-2 )
+ if (Frame->OwnerWindow&&Frame->OwnerWindow!=(HWND)-2 )
{
RECT pr;
POINT Off={0};
@@ -2185,7 +2184,7 @@ static int CLUIFrameMoveResize(const FRAMEWND *Frame)
Frame->wndSize.right-Frame->wndSize.left,
g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE );
}
- if ( Frame->visible && IsWindowVisible( pcli->hwndContactList ) && Frame->collapsed && Frame->wndSize.bottom-Frame->wndSize.top != 0 )
+ if ( Frame->visible && IsWindowVisible( pcli->hwndContactList ) && Frame->collapsed && Frame->wndSize.bottom-Frame->wndSize.top != 0 )
{
ShowWindow( Frame->OwnerWindow, SW_SHOW );
ShowWindow( Frame->hWnd, SW_SHOW );
@@ -2240,7 +2239,7 @@ int CLUIFrames_GetTotalHeight()
int i;
int sumheight=0;
RECT border;
- if(pcli->hwndContactList==NULL) return 0;
+ if(pcli->hwndContactList==NULL) return 0;
for(i=0;i<g_nFramesCount;i++)
{
@@ -2258,7 +2257,7 @@ int CLUIFrames_GetTotalHeight()
//TODO minsize
sumheight+=g_CluiData.TopClientMargin;
- sumheight+=g_CluiData.BottomClientMargin;
+ sumheight+=g_CluiData.BottomClientMargin;
return max(ModernGetSettingWord(NULL,"CLUI","MinHeight",SETTING_MINHEIGTH_DEFAULT),
(sumheight+border.top+border.bottom));
}
@@ -2268,7 +2267,7 @@ int CLUIFramesGetMinHeight()
int i,tbh,clientfrm,sumheight=0;
RECT border;
int allbord=0;
- if(pcli->hwndContactList==NULL) return 0;
+ if(pcli->hwndContactList==NULL) return 0;
// search for alClient frame and get the titlebar's height
@@ -2281,7 +2280,7 @@ int CLUIFramesGetMinHeight()
{
if ((g_pfwFrames[i].align!=alClient)&&(g_pfwFrames[i].visible)&&(!g_pfwFrames[i].needhide)&&(!g_pfwFrames[i].floating))
{
- RECT wsize;
+ RECT wsize;
GetWindowRect(g_pfwFrames[i].hWnd,&wsize);
sumheight+=(wsize.bottom-wsize.top)+(g_nTitleBarHeight*btoint(g_pfwFrames[i].TitleBar.ShowTitleBar));
@@ -2298,7 +2297,7 @@ int CLUIFramesGetMinHeight()
//TODO minsize
sumheight+=g_CluiData.TopClientMargin;
- sumheight+=g_CluiData.BottomClientMargin;
+ sumheight+=g_CluiData.BottomClientMargin;
return max(ModernGetSettingWord(NULL,"CLUI","MinHeight",SETTING_MINHEIGTH_DEFAULT),
(sumheight+border.top+border.bottom+allbord+tbh) );
}
@@ -2324,7 +2323,7 @@ static int CLUIFramesResizeFrames(const RECT newsize)
GapBetweenFrames=ModernGetSettingDword(NULL,"CLUIFrames","GapBetweenFrames",SETTING_GAPFRAMES_DEFAULT);
sepw=GapBetweenFrames;
- if(g_nFramesCount<1) return 0;
+ if(g_nFramesCount<1) return 0;
newheight=newsize.bottom-newsize.top;
// search for alClient frame and get the titlebar's height
@@ -2437,7 +2436,7 @@ static int CLUIFramesResizeFrames(const RECT newsize)
}
}
for(i=0;i<g_nFramesCount;i++)
- if(g_pfwFrames[i].TitleBar.ShowTitleBar)
+ if(g_pfwFrames[i].TitleBar.ShowTitleBar)
SetRect(&g_pfwFrames[i].TitleBar.wndSize,g_pfwFrames[i].wndSize.left,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar,g_pfwFrames[i].wndSize.right,g_pfwFrames[i].wndSize.top-g_CluiData.nGapBetweenTitlebar);
if (sdarray!=NULL){free(sdarray);sdarray=NULL;};
@@ -2517,7 +2516,7 @@ int CLUIFrames_OnClistResize_mod(WPARAM wParam,LPARAM mode)
GetClientRect(pcli->hwndContactList,&nRect);
nRect.left+=g_CluiData.LeftClientMargin;
- nRect.right-=g_CluiData.RightClientMargin;
+ nRect.right-=g_CluiData.RightClientMargin;
nRect.top+=g_CluiData.TopClientMargin;
nRect.bottom-=g_CluiData.BottomClientMargin;
// g_CluiData.mutexPreventDockMoving=0;
@@ -2547,7 +2546,7 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode)
nRect.right=r->right-r->left;
nRect.bottom=r->bottom-r->top;
nRect.left+=g_CluiData.LeftClientMargin;
- nRect.right-=g_CluiData.RightClientMargin;
+ nRect.right-=g_CluiData.RightClientMargin;
nRect.top+=g_CluiData.TopClientMargin;
nRect.bottom-=g_CluiData.BottomClientMargin;
CLUIFramesResizeFrames(nRect);
@@ -2573,12 +2572,12 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode)
HWND hwnd;
hwnd=GetParent(g_pfwFrames[i].OwnerWindow);
*PosBatch=DeferWindowPos(*PosBatch,g_pfwFrames[i].OwnerWindow,NULL,g_pfwFrames[i].wndSize.left+r->left,g_pfwFrames[i].wndSize.top+r->top,
- g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE);
+ g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE);
SetWindowPos(g_pfwFrames[i].hWnd,NULL,0,0,
- g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE/*|SWP_NOSENDCHANGING*/);
+ g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.bottom-g_pfwFrames[i].wndSize.top,SWP_NOZORDER|SWP_NOACTIVATE/*|SWP_NOSENDCHANGING*/);
}
//Frame
- if(g_pfwFrames[i].TitleBar.ShowTitleBar)
+ if(g_pfwFrames[i].TitleBar.ShowTitleBar)
{
SetWindowPos(g_pfwFrames[i].TitleBar.hwnd,NULL,g_pfwFrames[i].wndSize.left+dx,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar+dy,
g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left,g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE );
@@ -2586,7 +2585,7 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode)
UpdateWindow(g_pfwFrames[i].TitleBar.hwnd);
}
}
- else
+ else
{
if(1)
{
@@ -2599,7 +2598,7 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode)
if(1)
{
// set titlebar position
- if(g_pfwFrames[i].TitleBar.ShowTitleBar)
+ if(g_pfwFrames[i].TitleBar.ShowTitleBar)
{
SetWindowPos(g_pfwFrames[i].TitleBar.hwnd,NULL,g_pfwFrames[i].wndSize.left+dx,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar+dy,
g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left,g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSENDCHANGING );
@@ -2608,13 +2607,13 @@ int SizeFramesByWindowRect(RECT *r, HDWP * PosBatch, int mode)
}
}
UpdateWindow(g_pfwFrames[i].hWnd);
- if(g_pfwFrames[i].TitleBar.ShowTitleBar) UpdateWindow(g_pfwFrames[i].TitleBar.hwnd);
+ if(g_pfwFrames[i].TitleBar.ShowTitleBar) UpdateWindow(g_pfwFrames[i].TitleBar.hwnd);
};
}
- }
+ }
if(GetTickCount()-_dwLastStoreTick>1000)
- {
+ {
CLUIFramesStoreAllFrames();
_dwLastStoreTick=GetTickCount();
};
@@ -2643,16 +2642,16 @@ int CheckFramesPos(RECT *wr)
RECT r;
GetWindowRect(g_pfwFrames[i].hWnd,&r);
if (r.top-wr->top!=g_pfwFrames[i].wndSize.top ||r.left-wr->left!=g_pfwFrames[i].wndSize.left)
- SetWindowPos(g_pfwFrames[i].hWnd,NULL,g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.top,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
+ SetWindowPos(g_pfwFrames[i].hWnd,NULL,g_pfwFrames[i].wndSize.left, g_pfwFrames[i].wndSize.top,0,0,SWP_NOSIZE|SWP_NOZORDER|SWP_NOACTIVATE);
}
- if (g_pfwFrames[i].TitleBar.ShowTitleBar)
+ if (g_pfwFrames[i].TitleBar.ShowTitleBar)
{
RECT r;
GetWindowRect(g_pfwFrames[i].TitleBar.hwnd,&r);
if (r.top-wr->top!=g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar || r.left-wr->left!=g_pfwFrames[i].wndSize.left)
{
SetWindowPos(g_pfwFrames[i].TitleBar.hwnd,NULL,g_pfwFrames[i].wndSize.left+dx,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar+dy,
- g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left,g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE);
+ g_pfwFrames[i].wndSize.right-g_pfwFrames[i].wndSize.left,g_nTitleBarHeight,SWP_NOZORDER|SWP_NOACTIVATE|SWP_NOSIZE);
SetRect(&g_pfwFrames[i].TitleBar.wndSize,g_pfwFrames[i].wndSize.left,g_pfwFrames[i].wndSize.top-g_nTitleBarHeight-g_CluiData.nGapBetweenTitlebar,g_pfwFrames[i].wndSize.right,g_pfwFrames[i].wndSize.top-g_CluiData.nGapBetweenTitlebar);
}
}
@@ -2685,8 +2684,8 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam)
if (Upward)
mainRect.top=mainRect.bottom-minHeight;
- else
- mainRect.bottom=mainRect.top+minHeight;
+ else
+ mainRect.bottom=mainRect.top+minHeight;
SetWindowPos(pcli->hwndContactList,NULL,mainRect.left,mainRect.top,mainRect.right-mainRect.left, mainRect.bottom-mainRect.top, SWP_NOZORDER|SWP_NOREDRAW|SWP_NOACTIVATE|SWP_NOSENDCHANGING);
}
GetWindowRect(pcli->hwndContactList,&mainRect);
@@ -2695,7 +2694,7 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam)
// DebugBreak();
}
GetClientRect(pcli->hwndContactList,&nRect);
- //$$$ Fixed borders
+ //$$$ Fixed borders
if (lParam && lParam!=1 && lParam!=2)
{
RECT oldRect;
@@ -2731,7 +2730,7 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam)
ContactListHeight=nRect.bottom; $$$*/
nRect.left+=g_CluiData.LeftClientMargin;
- nRect.right-=g_CluiData.RightClientMargin;
+ nRect.right-=g_CluiData.RightClientMargin;
nRect.top+=g_CluiData.TopClientMargin;
nRect.bottom-=g_CluiData.BottomClientMargin;
@@ -2747,7 +2746,7 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam)
CLUIFrames_ApplyNewSizes(2);
CLUIFrames_ApplyNewSizes(1);
- //resizing=FALSE;
+ //resizing=FALSE;
tick=GetTickCount()-tick;
@@ -2768,7 +2767,7 @@ int CLUIFramesOnClistResize(WPARAM wParam,LPARAM lParam)
int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam)
{
if (MirandaExiting()) return 0;
- {
+ {
DBVARIANT dbv={0};
AlignCOLLIconToLeft=ModernGetSettingByte(NULL,"FrameTitleBar","AlignCOLLIconToLeft",CLCDEFAULT_COLLICONTOLEFT);
@@ -2789,11 +2788,11 @@ int OnFrameTitleBarBackgroundChange(WPARAM wParam,LPARAM lParam)
backgroundBmpUse=ModernGetSettingWord(NULL,"FrameTitleBar","BkBmpUse",CLCDEFAULT_BKBMPUSE);
}
};
-
+
CLUI__cliInvalidateRect( pcli->hwndContactList, 0, 0 );
RedrawWindow(pcli->hwndContactList,NULL,NULL,RDW_UPDATENOW|RDW_ALLCHILDREN|RDW_ERASE|RDW_INVALIDATE);
-
+
return 0;
}
@@ -2933,7 +2932,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid)
HDC hdcMem;
HFONT hoTTBFont;
RECT rc=*rect;
- HBRUSH hBack,hoBrush;
+ HBRUSH hBack,hoBrush;
HBITMAP b1=NULL,b2=NULL;
hdcMem=CreateCompatibleDC(hdcMem2);
@@ -2942,7 +2941,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid)
ske_ResetTextEffect(hdcMem);
ske_ResetTextEffect(hdcMem2);
hBack=GetSysColorBrush(COLOR_3DFACE);
- hoBrush=(HBRUSH)SelectObject(hdcMem,hBack);
+ hoBrush=(HBRUSH)SelectObject(hdcMem,hBack);
pos=id2pos(Frameid);
@@ -2964,8 +2963,8 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid)
if ( g_pfwFrames[pos].floating && !g_CluiData.fDisableSkinEngine)
{
FillRect(hdcMem,&rc,hBack);
- //SelectObject(hdcMem,hoBrush);
- SkinDrawGlyph(hdcMem,&rc,&rc,"Main,ID=FrameCaption");
+ //SelectObject(hdcMem,hoBrush);
+ SkinDrawGlyph(hdcMem,&rc,&rc,"Main,ID=FrameCaption");
}
else
{
@@ -2977,7 +2976,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid)
// if (GetForegroundWindow()!=pcli->hwndContactList) state=CS_INACTIVE;
xpt_DrawThemeBackground(_hFrameTitleTheme,hdcMem, WP_SMALLCAPTION, state, &rc,&rc);
bThemed=TRUE;
- }
+ }
else
DrawBackGround(g_pfwFrames[pos].TitleBar.hwnd,hdcMem, hBmpBackground, bkColour, backgroundBmpUse);
}
@@ -2989,7 +2988,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid)
SkinDrawGlyph(hdcMem,&rc,&rc,"Main,ID=FrameCaption");
}
if (bThemed)
- SetTextColor(hdcMem,GetSysColor(COLOR_CAPTIONTEXT ));
+ SetTextColor(hdcMem,GetSysColor(COLOR_CAPTIONTEXT ));
else
SetTextColor(hdcMem,SelBkColour);
{
@@ -2997,7 +2996,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid)
if (!AlignCOLLIconToLeft)
{
- if(g_pfwFrames[pos].TitleBar.hicon!=NULL)
+ if(g_pfwFrames[pos].TitleBar.hicon!=NULL)
{
mod_DrawIconEx_helper(hdcMem,rc.left +2,rc.top+((g_nTitleBarHeight>>1)-(GetSystemMetrics(SM_CYSMICON)>>1)),g_pfwFrames[pos].TitleBar.hicon,GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
textrc.left+=GetSystemMetrics(SM_CXSMICON)+4;
@@ -3019,7 +3018,7 @@ int DrawTitleBar(HDC hdcMem2,RECT * rect,int Frameid)
}
if (!AlignCOLLIconToLeft)
- {
+ {
mod_DrawIconEx_helper(hdcMem,g_pfwFrames[pos].TitleBar.wndSize.right-GetSystemMetrics(SM_CXSMICON)-2,rc.top+((g_nTitleBarHeight>>1)-(GetSystemMetrics(SM_CXSMICON)>>1)),g_pfwFrames[pos].collapsed?LoadSkinnedIcon(SKINICON_OTHER_GROUPOPEN):LoadSkinnedIcon(SKINICON_OTHER_GROUPSHUT),GetSystemMetrics(SM_CXSMICON),GetSystemMetrics(SM_CYSMICON),0,NULL,DI_NORMAL);
}
else
@@ -3072,11 +3071,11 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
SendMessage(hwnd,WM_SETFONT,(WPARAM)_hTitleBarFont,0);
return FALSE;
case WM_MEASUREITEM:
- return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
+ return CallService(MS_CLIST_MENUMEASUREITEM,wParam,lParam);
case WM_DRAWITEM:
return CallService(MS_CLIST_MENUDRAWITEM,wParam,lParam);
case WM_USER+100:
- return 1;
+ return 1;
case WM_ENABLE:
if (hwnd!=0) CLUI__cliInvalidateRect(hwnd,NULL,FALSE);
return 0;
@@ -3166,7 +3165,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
}
break;
case WM_LBUTTONDBLCLK:
- {
+ {
Framemod=-1;
s_nLastByPos=-1;s_nOldFrameHeight=-1;ReleaseCapture();
CallService(MS_CLIST_FRAMES_UCOLLFRAME,Frameid,0);
@@ -3176,7 +3175,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
case WM_LBUTTONUP:
{
- if(GetCapture()!=hwnd){break;};
+ if(GetCapture()!=hwnd){break;};
s_nCurDragBar=-1;s_nLastByPos=-1;s_nOldFrameHeight=-1;ReleaseCapture();
break;
};
@@ -3221,7 +3220,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
nTop = (short)rc.top;
};
- SetCapture(hwnd);
+ SetCapture(hwnd);
break;
@@ -3233,7 +3232,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
int pos;
//tbinfo
{
- char TBcapt[255];
+ char TBcapt[255];
pos=id2pos(Frameid);
@@ -3247,7 +3246,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
g_pfwFrames[pos].szName,g_pfwFrames[pos].height,g_pfwFrames[pos].visible,g_pfwFrames[pos].floating,
g_pfwFrames[pos].FloatingPos.x,g_pfwFrames[pos].FloatingPos.y,
g_pfwFrames[pos].FloatingSize.x,g_pfwFrames[pos].FloatingSize.y,
- g_pfwFrames[pos].order
+ g_pfwFrames[pos].order
);
oldflags=CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,g_pfwFrames[pos].id),(LPARAM)0);
@@ -3261,14 +3260,14 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
- }
+ }
//
if ((wParam&MK_LBUTTON)/*&&(wParam&MK_CONTROL)*/)
{
RECT rcMiranda;
RECT rcwnd,rcOverlap;
POINT newpt,ofspt,curpt,newpos;
- //if(GetCapture()!=hwnd){break;};
+ //if(GetCapture()!=hwnd){break;};
//curdragbar=-1;lbypos=-1;oldframeheight=-1;ReleaseCapture();
pos=id2pos(Frameid);
@@ -3299,7 +3298,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
newpt.x=0;newpt.y=0;
ClientToScreen(g_pfwFrames[pos].TitleBar.hwnd,&newpt);
SetCursorPos(newpt.x+ofspt.x,newpt.y+ofspt.y);
- GetCursorPos(&curpt);
+ GetCursorPos(&curpt);
g_pfwFrames[pos].TitleBar.oldpos=curpt;
@@ -3322,7 +3321,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
//IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )
- if (!IntersectRect( &rcOverlap, &rcwnd, &rcMiranda ))
+ if (!IntersectRect( &rcOverlap, &rcwnd, &rcMiranda ))
{
GetCursorPos(&curpt);
GetWindowRect( g_pfwFrames[pos].hWnd, &rcwnd );
@@ -3340,7 +3339,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
g_pfwFrames[pos].FloatingPos.x=newpos.x;
g_pfwFrames[pos].FloatingPos.y=newpos.y;
- CLUIFrames_SetFrameFloat(id,0);
+ CLUIFrames_SetFrameFloat(id,0);
//SetWindowPos(Frames[pos].ContainerWnd,0,newpos.x,newpos.y,0,0,SWP_NOSIZE);
@@ -3365,7 +3364,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
if(wParam&MK_LBUTTON) {
int newh=-1,prevold;
- if(GetCapture()!=hwnd){break;};
+ if(GetCapture()!=hwnd){break;};
pos=id2pos(Frameid);
@@ -3384,8 +3383,8 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
POINT ptNew;
ptNew.x = pt.x;
- ptNew.y = pt.y;
- //ClientToScreen( hwnd, &ptNew );
+ ptNew.y = pt.y;
+ //ClientToScreen( hwnd, &ptNew );
dX = ptNew.x - ptOld.x;
dY = ptNew.y - ptOld.y;
@@ -3399,11 +3398,11 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
}else
{
- SetWindowPos( g_pfwFrames[pos].ContainerWnd,
- HWND_TOPMOST,
- nLeft,
- nTop,
- 0,
+ SetWindowPos( g_pfwFrames[pos].ContainerWnd,
+ HWND_TOPMOST,
+ nLeft,
+ nTop,
+ 0,
0,
SWP_NOSIZE |SWP_NOACTIVATE| SWP_NOZORDER );
};
@@ -3453,7 +3452,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
}
else
{
- // if(GetCapture()!=hwnd){break;};
+ // if(GetCapture()!=hwnd){break;};
};
newh=s_nOldFrameHeight+direction*(ypos-s_nLastByPos);
@@ -3496,19 +3495,19 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam
InvalidateRect(hwnd,NULL,FALSE);
return DefWindowProc(hwnd, msg, wParam, lParam);
}
- case WM_PAINT:
+ case WM_PAINT:
{
HDC paintDC;
if (g_pfwFrames[id2pos(Frameid)].floating || (!g_CluiData.fLayered))
- {
- GetClientRect(hwnd,&rect);
- paintDC = GetDC(hwnd);
+ {
+ GetClientRect(hwnd,&rect);
+ paintDC = GetDC(hwnd);
DrawTitleBar(paintDC,&rect,Frameid);
ReleaseDC(hwnd,paintDC);
ValidateRect(hwnd,NULL);
}
- return DefWindowProc(hwnd, msg, wParam, lParam);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
}
default:return DefWindowProc(hwnd, msg, wParam, lParam);
}
@@ -3547,7 +3546,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos)
//if (Frames[framepos].Locked){return(0);};
g_pfwFrames[framepos].height=height;
CLUI_ShowWindowMod(g_pfwFrames[framepos].TitleBar.hwnd,SW_HIDE);
- SetWindowPos(g_pfwFrames[framepos].hWnd,HWND_TOP,0,0,width,height,SWP_SHOWWINDOW|SWP_NOACTIVATE);
+ SetWindowPos(g_pfwFrames[framepos].hWnd,HWND_TOP,0,0,width,height,SWP_SHOWWINDOW|SWP_NOACTIVATE);
};
// CLUIFramesForceUpdateFrame(&Frames[framepos]);
@@ -3588,12 +3587,12 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP
SnapInfo.hWnd = hwnd;
SnapInfo.wParam = wParam;
SnapInfo.lParam = lParam;
- if (CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,msg)!=0){return(TRUE);};
+ if (CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,msg)!=0){return(TRUE);};
};
};
*/
switch(msg) {
- case WM_ACTIVATE:
+ case WM_ACTIVATE:
{
if(g_bTransparentFlag)
{
@@ -3602,7 +3601,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP
{
HWND hw=lParam?GetParent((HWND)lParam):0;
alpha=ModernGetSettingByte(NULL,"CList","Alpha",SETTING_ALPHA_DEFAULT);
- if (hw) SetWindowPos(hw,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
+ if (hw) SetWindowPos(hw,HWND_TOPMOST,0,0,0,0,SWP_NOSIZE|SWP_NOMOVE|SWP_NOACTIVATE);
CLUI_SmoothAlphaTransition(hwnd, alpha, 1);
}
}
@@ -3610,9 +3609,9 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP
return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_NOTIFY:
- case WM_PARENTNOTIFY:
+ case WM_PARENTNOTIFY:
case WM_SYSCOMMAND:
- return SendMessage(pcli->hwndContactList,msg,wParam,lParam);
+ return SendMessage(pcli->hwndContactList,msg,wParam,lParam);
case WM_MOVE:
if (g_CluiData.fDocked) return 1;
@@ -3658,7 +3657,7 @@ static HWND CreateSubContainerWindow(HWND parent,int x,int y,int width,int heigh
if (g_CluiData.fOnDesktop)
{
HWND hProgMan=FindWindow(TEXT("Progman"),NULL);
- if (IsWindow(hProgMan))
+ if (IsWindow(hProgMan))
SetParent(hwnd,hProgMan);
}
@@ -3687,7 +3686,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP
SnapInfo.hWnd = hwnd;
SnapInfo.wParam = wParam;
SnapInfo.lParam = lParam;
- if (CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,msg)!=0){return(TRUE);};
+ if (CallService("Utils/SnapWindowProc",(WPARAM)&SnapInfo,msg)!=0){return(TRUE);};
};
};
*/
@@ -3741,7 +3740,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP
((LPMINMAXINFO)lParam)->ptMinTrackSize.y=minmax.ptMinTrackSize.y;
((LPMINMAXINFO)lParam)->ptMaxTrackSize.x=minmax.ptMaxTrackSize.x+border.left+border.right;
((LPMINMAXINFO)lParam)->ptMaxTrackSize.y=minmax.ptMaxTrackSize.y+tbh+border.top+border.bottom;
- };
+ };
}
else
@@ -3772,7 +3771,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP
g_pfwFrames[framepos].FloatingSize.x=rect.right-rect.left;
g_pfwFrames[framepos].FloatingSize.y=rect.bottom-rect.top;
- CLUIFramesStoreFrameSettings(framepos);
+ CLUIFramesStoreFrameSettings(framepos);
if ( g_pfwFrames[framepos].floating )
{
@@ -3790,7 +3789,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP
//IntersectRect( &rcOverlap, &rcwnd, &rcMiranda )
- if (IntersectRect( &rcOverlap, &rcwnd, &rcMiranda ))
+ if (IntersectRect( &rcOverlap, &rcwnd, &rcMiranda ))
{
GetCursorPos(&curpt);
GetWindowRect( g_pfwFrames[framepos].hWnd, &rcwnd );
@@ -3808,7 +3807,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP
g_pfwFrames[framepos].FloatingPos.x=newpos.x;
g_pfwFrames[framepos].FloatingPos.y=newpos.y;
- CLUIFrames_SetFrameFloat(Frameid,0);
+ CLUIFrames_SetFrameFloat(Frameid,0);
//SetWindowPos(Frames[pos].ContainerWnd,0,newpos.x,newpos.y,0,0,SWP_NOSIZE);
@@ -3892,7 +3891,7 @@ static HWND CreateContainerWindow(HWND parent,int x,int y,int width,int height)
static int _us_DoSetFrameFloat(WPARAM wParam,LPARAM lParam)
-{
+{
HWND hwndtmp,hwndtooltiptmp;
@@ -4025,7 +4024,7 @@ int CLUIFrameOnModulesUnload(WPARAM wParam,LPARAM lParam)
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiTBVisible, 1 );
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiLock, 1 );
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiColl, 1 );
- CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiFloating, 1 );
+ CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiFloating, 1 );
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiAlignTop, 1 );
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiAlignClient, 1 );
CallService( MS_CLIST_REMOVECONTEXTFRAMEMENUITEM, ( LPARAM )_hmiAlignBottom, 1 );
@@ -4042,13 +4041,13 @@ int CLUIFrameOnModulesUnload(WPARAM wParam,LPARAM lParam)
CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiTBVisible, 1 );
CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiLock, 1 );
CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiColl, 1 );
- CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiFloating, 1 );
+ CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiFloating, 1 );
CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiBorder, 1 );
CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiAlignRoot, 1 );
CallService( MO_REMOVEMENUITEM, ( LPARAM )_hmiPosRoot, 1 );
_hmiVisible=0;
- return 0;
+ return 0;
}
int LoadCLUIFramesModule(void)
@@ -4104,10 +4103,10 @@ int LoadCLUIFramesModule(void)
InitFramesMenus();
- ModernHookEvent(ME_SYSTEM_MODULESLOADED,CLUIFrameOnModulesLoad);
- ModernHookEvent(ME_CLIST_PREBUILDFRAMEMENU,CLUIFramesModifyContextMenuForFrame);
- ModernHookEvent(ME_CLIST_PREBUILDMAINMENU,CLUIFrameOnMainMenuBuild);
- ModernHookEvent(ME_SYSTEM_PRESHUTDOWN, CLUIFrameOnModulesUnload);
+ ModernHookEvent(ME_SYSTEM_MODULESLOADED,CLUIFrameOnModulesLoad);
+ ModernHookEvent(ME_CLIST_PREBUILDFRAMEMENU,CLUIFramesModifyContextMenuForFrame);
+ ModernHookEvent(ME_CLIST_PREBUILDMAINMENU,CLUIFrameOnMainMenuBuild);
+ ModernHookEvent(ME_SYSTEM_PRESHUTDOWN, CLUIFrameOnModulesUnload);
CreateCluiFramesServices();
@@ -4122,8 +4121,8 @@ static INT_PTR UnloadMainMenu()
{
CLUIFrameOnModulesUnload(0,0);
if(_hmiRoot!=(HANDLE)-1)
- {
- CallService(MS_CLIST_REMOVEMAINMENUITEM,(WPARAM)_hmiRoot,0);
+ {
+ CallService(MS_CLIST_REMOVEMAINMENUITEM,(WPARAM)_hmiRoot,0);
_hmiRoot=(HGENMENU)-1;
}
@@ -4142,10 +4141,10 @@ int UnLoadCLUIFramesModule(void)
UnitFramesMenu();
UnloadMainMenu();
- for (i=0;i<g_nFramesCount;i++)
+ for (i=0;i<g_nFramesCount;i++)
{
if (g_pfwFrames[i].hWnd!=pcli->hwndContactTree)
- DestroyWindow(g_pfwFrames[i].hWnd);
+ DestroyWindow(g_pfwFrames[i].hWnd);
g_pfwFrames[i].hWnd=(HWND)-1;
DestroyWindow(g_pfwFrames[i].TitleBar.hwnd);
@@ -4207,14 +4206,14 @@ int CLUIFrames_SetLayeredMode( BOOL fLayeredMode, HWND hwnd )
}
else
{
- if (GetParent(g_pfwFrames[i].hWnd)==g_pfwFrames[i].OwnerWindow)
+ if (GetParent(g_pfwFrames[i].hWnd)==g_pfwFrames[i].OwnerWindow)
{
SetParent(g_pfwFrames[i].hWnd,hwnd);
- if ((INT_PTR)g_pfwFrames[i].OwnerWindow>0)
+ if ((INT_PTR)g_pfwFrames[i].OwnerWindow>0)
{
DestroyWindow(g_pfwFrames[i].OwnerWindow);
g_pfwFrames[i].OwnerWindow=(HWND)-2;
- }
+ }
}
}
}
diff --git a/plugins/Clist_mw/CLUIFrames/cluiframes.cpp b/plugins/Clist_mw/CLUIFrames/cluiframes.cpp
index df70ff4d02..26a8a0cb63 100644
--- a/plugins/Clist_mw/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_mw/CLUIFrames/cluiframes.cpp
@@ -69,7 +69,7 @@ static int sortfunc(const void *a,const void *b)
}
-// == == == == == ==
+//============
#define CLUIFRAMESSETALIGN "CLUIFramesSetAlign"
#define CLUIFRAMESSETALIGNALTOP "CLUIFramesSetAlignalTop"
@@ -626,14 +626,12 @@ int CLUIFramesGetalClientFrame(void)
return i;
}
- //pluginLink
return -1;
}
HMENU CLUIFramesCreateMenuForFrame(int frameid,int root,int popuppos,HGENMENU (*pfnAdd )( CLISTMENUITEM* ))
{
CLISTMENUITEM mi;
- //TMO_MenuItem tmi;
HANDLE menuid;
int framepos = id2pos(frameid);
@@ -1279,7 +1277,7 @@ INT_PTR CLUIFramesSetUnSetBorder(WPARAM wParam,LPARAM lParam)
ulockfrm();
return -1;
}
-
+
boolean flt = oldflags = CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS,MAKEWPARAM(FO_FLAGS,wParam),0);
if (oldflags & F_NOBORDER)
oldflags &= (~F_NOBORDER);
@@ -1376,7 +1374,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam,LPARAM lParam)
sumheight += (Frames[i].height)+(TitleBarH*btoint(Frames[i].TitleBar.ShowTitleBar))+2;
return FALSE;
}
-
+
if (sumheight>ContactListHeight-0-2)
Frames[FrameId].height = (ContactListHeight-0-2)-sumheight;
}
@@ -1624,7 +1622,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam,LPARAM lParam)
Frames[nFramescount].oldstyles = GetWindowLongPtr(Frames[nFramescount].hWnd,GWL_STYLE);
Frames[nFramescount].TitleBar.oldstyles = GetWindowLongPtr(Frames[nFramescount].TitleBar.hwnd,GWL_STYLE);
- //Frames[nFramescount].FloatingPos.x =
+ //Frames[nFramescount].FloatingPos.x =
retval = Frames[nFramescount].id;
Frames[nFramescount].order = nFramescount+1;
@@ -2044,7 +2042,7 @@ void DrawBackGroundTTB(HWND hwnd,HDC mhdc)
hOldBmp = (HBITMAP)SelectObject(hdcMem,hBmpOsb);
oFont = (HFONT)SelectObject(hdcMem,hFont);
SetBkMode(hdcMem,TRANSPARENT);
- {
+ {
HBRUSH hBrush = CreateSolidBrush(bkColour);
HBRUSH hoBrush = (HBRUSH)SelectObject(hdcMem,hBrush);
FillRect(hdcMem,rcPaint,hBrush);
@@ -2268,7 +2266,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
lockfrm();
if (framepos == -1){ulockfrm();break;}
hmenu = CreatePopupMenu();
-
+
AppendMenu(hmenu,MF_STRING|MF_DISABLED|MF_GRAYED,15,Frames[framepos].name);
AppendMenu(hmenu,MF_SEPARATOR,16,_T(""));
@@ -2351,7 +2349,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA
POINT pt,pt2;
RECT wndr;
int pos;
-
+
char TBcapt[255];
lockfrm();
diff --git a/plugins/Clist_mw/init.cpp b/plugins/Clist_mw/init.cpp
index 8664014c83..41197e501e 100644
--- a/plugins/Clist_mw/init.cpp
+++ b/plugins/Clist_mw/init.cpp
@@ -24,7 +24,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
HINSTANCE g_hInst = 0;
-PLUGINLINK * pluginLink;
CLIST_INTERFACE* pcli = NULL;
int hLangpack;
@@ -159,16 +158,16 @@ static ClcCacheEntryBase* fnCreateCacheItem( HANDLE hContact )
return (ClcCacheEntryBase*)p;
}
-extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) CListInitialise()
{
int rc = 0;
- pluginLink = link;
// get the internal malloc/free()
__try {
OutputDebugStringA("CListInitialise ClistMW\r\n");
- mir_getLP( &pluginInfo );
+ mir_getLP( &pluginInfo );
+
pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst);
if ( (INT_PTR)pcli == CALLSERVICE_NOTFOUND ) {
LBL_Error:
@@ -231,11 +230,11 @@ LBL_Error:
}
// never called by a newer plugin loader.
-extern "C" int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) Load(void)
{
OutputDebugStringA("Load ClistMW\r\n");
MessageBoxA(0,"You Running Old Miranda, use >30-10-2004 version!","MultiWindow Clist",0);
- CListInitialise(link);
+ CListInitialise();
return 1;
}
diff --git a/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp b/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp
index 18cd015a8d..0a6d6a0a55 100644
--- a/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp
+++ b/plugins/Clist_nicer/CLUIFrames/cluiframes.cpp
@@ -639,7 +639,6 @@ int CLUIFramesGetalClientFrame(void)
alclientFrame = i;
return i;
}
- //pluginLink
return -1;
}
@@ -2309,7 +2308,7 @@ int CLUIFramesResize(const RECT newsize)
INT_PTR CLUIFramesUpdateFrame(WPARAM wParam, LPARAM lParam)
{
- int pos;
+ int pos;
if (FramesSysNotStarted)
return -1;
if (wParam == -1) {
diff --git a/plugins/Clist_nicer/SRC/init.cpp b/plugins/Clist_nicer/SRC/init.cpp
index c5daa292b4..cef1931bc4 100644
--- a/plugins/Clist_nicer/SRC/init.cpp
+++ b/plugins/Clist_nicer/SRC/init.cpp
@@ -34,7 +34,6 @@
#include "../cluiframes/cluiframes.h"
HINSTANCE g_hInst = 0;
-PLUGINLINK *pluginLink;
CLIST_INTERFACE* pcli = NULL;
int hLangpack;
@@ -214,14 +213,13 @@ static int fnIconFromStatusMode( const char* szProto, int status, HANDLE hContac
{ return IconFromStatusMode( szProto, status, hContact, NULL );
}
-extern "C" int __declspec(dllexport) CListInitialise(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) CListInitialise()
{
int rc = 0;
DBVARIANT dbv;
int i;
char szProfilePath[MAX_PATH];
- pluginLink = link;
mir_getTMI(&tmi);
mir_getLP( &pluginInfo );
@@ -373,7 +371,7 @@ LBL_Error:
}
// a plugin loader aware of CList exports will never call this.
-extern "C" int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) Load(void)
{
return 1;
}
diff --git a/plugins/Clist_nicer/skineditor/main.cpp b/plugins/Clist_nicer/skineditor/main.cpp
index b180316c28..f01fa15cd0 100644
--- a/plugins/Clist_nicer/skineditor/main.cpp
+++ b/plugins/Clist_nicer/skineditor/main.cpp
@@ -41,7 +41,6 @@ PLUGININFOEX pluginInfo = {
};
HINSTANCE g_hInst = 0;
-PLUGINLINK *pluginLink;
int hLangpack;
StatusItems_t *StatusItems;
@@ -943,9 +942,8 @@ static int systemModulesLoaded(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
mir_getLP(&pluginInfo);
return(LoadModule());
}
diff --git a/plugins/Console/init.cpp b/plugins/Console/init.cpp
index 474c48a1a6..4742253c44 100644
--- a/plugins/Console/init.cpp
+++ b/plugins/Console/init.cpp
@@ -23,7 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "commonheaders.h"
-PLUGINLINK *pluginLink;
DWORD mirandaVer;
int hLangpack;
HINSTANCE hInst;
@@ -60,9 +59,8 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
mir_getLP(&pluginInfoEx);
InitCommonControls();
diff --git a/plugins/ContactsPlus/main.cpp b/plugins/ContactsPlus/main.cpp
index b8b86731c0..172d17be53 100644
--- a/plugins/ContactsPlus/main.cpp
+++ b/plugins/ContactsPlus/main.cpp
@@ -26,7 +26,6 @@
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
int hLangpack;
int g_NewProtoAPI = TRUE;
@@ -284,12 +283,11 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
mir_getLP(&pluginInfo);
- InitCommonControls();
- InitI18N();
+ InitCommonControls();
+ InitI18N();
{ // Are we running under unicode Miranda core ?
char szVer[MAX_PATH];
diff --git a/plugins/ContactsPlus/utils.cpp b/plugins/ContactsPlus/utils.cpp
index 3bf63cf139..aad17fe555 100644
--- a/plugins/ContactsPlus/utils.cpp
+++ b/plugins/ContactsPlus/utils.cpp
@@ -1,20 +1,20 @@
// ---------------------------------------------------------------------------
// Contacts+ for Miranda Instant Messenger
// _______________________________________
-//
-// Copyright © 2002 Dominus Procellarum
+//
+// Copyright © 2002 Dominus Procellarum
// Copyright © 2004-2008 Joe Kucera
-//
+//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
-//
+//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -23,40 +23,35 @@
#include "contacts.h"
-
int SRCCallProtoService(const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam)
{
- if (!g_NewProtoAPI)
- {
- char str[MAXMODULELABELLENGTH];
- strcpy(str,szModule);
- strcat(str,szService);
- return CallService(str,wParam,lParam);
- }
- else // this will call pluginLink.CallProtoService (only 0.8.0.8+)
- return CallProtoService(szModule, szService, wParam, lParam);
+ if (!g_NewProtoAPI)
+ {
+ char str[MAXMODULELABELLENGTH];
+ strcpy(str,szModule);
+ strcat(str,szService);
+ return CallService(str,wParam,lParam);
+ }
+ return CallProtoService(szModule, szService, wParam, lParam);
}
-
int SRCCallContactService(HANDLE hContact, const char *szProtoService, WPARAM wParam, LPARAM lParam)
{
- if (!g_NewProtoAPI)
- {
- CCSDATA ccs;
- ccs.hContact=hContact;
- ccs.szProtoService=szProtoService;
- ccs.wParam=wParam;
- ccs.lParam=lParam;
- return CallService(MS_PROTO_CALLCONTACTSERVICE,0,(LPARAM)&ccs);
- }
- else // this will call pluginLink.CallContactService (only 0.8.0.8+)
- return CallContactService(hContact, szProtoService, wParam, lParam);
-}
+ if (!g_NewProtoAPI)
+ {
+ CCSDATA ccs;
+ ccs.hContact=hContact;
+ ccs.szProtoService=szProtoService;
+ ccs.wParam=wParam;
+ ccs.lParam=lParam;
+ return CallService(MS_PROTO_CALLCONTACTSERVICE,0,(LPARAM)&ccs);
+ }
+ return CallContactService(hContact, szProtoService, wParam, lParam);
+}
int utf8_decode(const unsigned char *from, char **to);
-
/* a strlennull() that likes NULL */
size_t __fastcall strlennull(const char *string)
{
@@ -112,19 +107,19 @@ char *GetContactUID(HANDLE hContact, int bTchar)
char *szUid = NULL;
char *szProto = GetContactProto(hContact);
- char *uid = (char*)SRCCallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); // v0.3+ only
+ char *uid = (char*)SRCCallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0); // v0.3+ only
if (((int)uid != CALLSERVICE_NOTFOUND) && uid)
{ // it worked, yeah :)
- if (!DBGetContactSettingT(hContact, szProto, uid, &vrUid))
+ if (!DBGetContactSettingT(hContact, szProto, uid, &vrUid))
{
- if (vrUid.type == DBVT_DWORD)
+ if (vrUid.type == DBVT_DWORD)
{
szUid = (char*)_alloca(17);
szUid[0] = 0; // empty string
_itoa(vrUid.dVal, szUid, 10);
- }
- else if (vrUid.type == DBVT_ASCIIZ)
+ }
+ else if (vrUid.type == DBVT_ASCIIZ)
{
szUid = (char*)_alloca(strlennull(vrUid.pszVal) + 1);
strcpy(szUid, vrUid.pszVal);
@@ -183,12 +178,12 @@ TCHAR* DBGetContactSettingStringT(HANDLE hContact, const char *szModule, const c
{
if (DBGetContactSettingWString(hContact, szModule, szSetting, &dbv))
return strdupT(szDef);
-
+
szRes = strdupT(dbv.ptszVal);
DBFreeVariant(&dbv);
}
else
- {
+ {
if (DBGetContactSettingT(hContact, szModule, szSetting, &dbv))
return strdupT(szDef);
@@ -213,7 +208,7 @@ int DBWriteContactSettingStringT(HANDLE hContact, const char *szModule, const ch
-void DialogAddContactExecute(HWND hwndDlg, HANDLE hNewContact)
+void DialogAddContactExecute(HWND hwndDlg, HANDLE hNewContact)
{
ADDCONTACTSTRUCT acs={0};
@@ -228,7 +223,7 @@ void DrawProtocolIcon(HWND hwndDlg, LPARAM lParam, HANDLE hContact)
{
LPDRAWITEMSTRUCT dis=(LPDRAWITEMSTRUCT)lParam;
- if (dis->hwndItem==GetDlgItem(hwndDlg, IDC_PROTOCOL))
+ if (dis->hwndItem==GetDlgItem(hwndDlg, IDC_PROTOCOL))
{
HICON hIcon = LoadContactProtoIcon(hContact);
if (hIcon)
@@ -248,10 +243,10 @@ void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, char* pszTitleStart)
TCHAR *szStatus;
char *szProto;
- if (hContact)
+ if (hContact)
{
szProto = GetContactProto(hContact);
- if (szProto)
+ if (szProto)
{
TCHAR *uid = GetContactUID(hContact, TRUE);
TCHAR *contactName = GetContactDisplayNameT(hContact);
@@ -284,7 +279,7 @@ void UpdateDialogTitle(HWND hwndDlg, HANDLE hContact, char* pszTitleStart)
void UpdateDialogAddButton(HWND hwndDlg, HANDLE hContact)
{
- int bVisible = DBGetContactSettingByte(hContact,"CList","NotOnList",0);
+ int bVisible = DBGetContactSettingByte(hContact,"CList","NotOnList",0);
ShowWindow(GetDlgItem(hwndDlg, IDC_ADD), bVisible?SW_SHOW:SW_HIDE);
}
@@ -608,11 +603,11 @@ unsigned char *make_utf8_string(const wchar_t *unicode)
c = unicode[index++];
while (c)
{
- if (c < 0x0080)
+ if (c < 0x0080)
size += 1;
- else if (c < 0x0800)
+ else if (c < 0x0800)
size += 2;
- else
+ else
size += 3;
c = unicode[index++];
}
@@ -625,11 +620,11 @@ unsigned char *make_utf8_string(const wchar_t *unicode)
c = unicode[index++];
while (c)
{
- if (c < 0x080)
+ if (c < 0x080)
{
out[out_index++] = (unsigned char)c;
}
- else if (c < 0x800)
+ else if (c < 0x800)
{
out[out_index++] = 0xc0 | (c >> 6);
out[out_index++] = 0x80 | (c & 0x3f);
@@ -659,13 +654,13 @@ WCHAR *make_unicode_string(const unsigned char *utf8)
/* first calculate the size of the target string */
c = utf8[index++];
- while (c)
+ while (c)
{
- if ((c & 0x80) == 0)
+ if ((c & 0x80) == 0)
{
index += 0;
}
- else if ((c & 0xe0) == 0xe0)
+ else if ((c & 0xe0) == 0xe0)
{
index += 2;
}
@@ -685,11 +680,11 @@ WCHAR *make_unicode_string(const unsigned char *utf8)
c = utf8[index++];
while (c)
{
- if ((c & 0x80) == 0)
+ if ((c & 0x80) == 0)
{
out[out_index++] = c;
- }
- else if ((c & 0xe0) == 0xe0)
+ }
+ else if ((c & 0xe0) == 0xe0)
{
out[out_index] = (c & 0x1F) << 12;
c = utf8[index++];
@@ -856,7 +851,7 @@ TCHAR* utf8_to_tchar(const unsigned char* utf)
{
char* szAnsi = NULL;
- if (utf8_decode(utf, &szAnsi))
+ if (utf8_decode(utf, &szAnsi))
return (TCHAR*)szAnsi;
else
return NULL; // Failure
diff --git a/plugins/ContactsPlus/utils.h b/plugins/ContactsPlus/utils.h
index 2b9af014b7..b59364ee81 100644
--- a/plugins/ContactsPlus/utils.h
+++ b/plugins/ContactsPlus/utils.h
@@ -1,20 +1,20 @@
// ---------------------------------------------------------------------------
// Contacts+ for Miranda Instant Messenger
// _______________________________________
-//
-// Copyright © 2002 Dominus Procellarum
+//
+// Copyright © 2002 Dominus Procellarum
// Copyright © 2004-2008 Joe Kucera
-//
+//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
-//
+//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
-//
+//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
@@ -26,7 +26,6 @@
extern HINSTANCE hInst;
-extern PLUGINLINK *pluginLink;
// Compatibility functions
int SRCCallProtoService(const char *szModule, const char *szService, WPARAM wParam, LPARAM lParam);
diff --git a/plugins/CountryFlags/main.cpp b/plugins/CountryFlags/main.cpp
index f39a24ace0..ac35c5ef57 100644
--- a/plugins/CountryFlags/main.cpp
+++ b/plugins/CountryFlags/main.cpp
@@ -21,7 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "version.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
int nCountriesCount;
struct CountryListEntry *countries;
int hLangpack;
@@ -87,9 +86,8 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink=link;
mir_getLP(&pluginInfo);
/* existance of MS_SYSTEM_GETVERSION and MS_LANGPACK_TRANSLATESTRING
diff --git a/plugins/CryptoPP/commonheaders.cpp b/plugins/CryptoPP/commonheaders.cpp
index df04c81dfd..b1d055eb59 100644
--- a/plugins/CryptoPP/commonheaders.cpp
+++ b/plugins/CryptoPP/commonheaders.cpp
@@ -3,7 +3,6 @@
LPCSTR szModuleName = MODULENAME;
LPCSTR szVersionStr = MODULENAME" DLL ("__VERSION_STRING")";
HINSTANCE g_hInst;
-PLUGINLINK *pluginLink;
MUUID interfaces[] = {MIID_CRYPTOPP, MIID_LAST};
HANDLE hPGPPRIV = NULL;
diff --git a/plugins/CryptoPP/commonheaders.h b/plugins/CryptoPP/commonheaders.h
index 0bcc553f64..e64825e1d4 100644
--- a/plugins/CryptoPP/commonheaders.h
+++ b/plugins/CryptoPP/commonheaders.h
@@ -99,7 +99,6 @@ extern BOOL isVista;
// shared vars
extern HINSTANCE g_hInst;
-extern PLUGINLINK *pluginLink;
extern PLUGININFOEX pluginInfoEx;
extern MUUID interfaces[];
diff --git a/plugins/CryptoPP/main.cpp b/plugins/CryptoPP/main.cpp
index 8ef6c310f5..b3adb93153 100644
--- a/plugins/CryptoPP/main.cpp
+++ b/plugins/CryptoPP/main.cpp
@@ -51,9 +51,8 @@ int onModulesLoaded(WPARAM wParam,LPARAM lParam) {
}
-int Load(PLUGINLINK *link) {
-
- pluginLink = link;
+int Load(PLUGINLINK *link)
+{
DisableThreadLibraryCalls(g_hInst);
// get memoryManagerInterface address
@@ -73,7 +72,8 @@ int Load(PLUGINLINK *link) {
}
-int Unload() {
+int Unload()
+{
return 0;
}
diff --git a/plugins/CyrTranslit/main.cpp b/plugins/CyrTranslit/main.cpp
index ed33f8ef2d..6d9249733b 100644
--- a/plugins/CyrTranslit/main.cpp
+++ b/plugins/CyrTranslit/main.cpp
@@ -21,7 +21,6 @@
#include "MirandaContact.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
int hLangpack = 0;
PLUGININFOEX pluginInfoEx={
@@ -56,10 +55,8 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
//------------------------------------------------------------------------------
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- //system inits:
- pluginLink = link;
mir_getLP(&pluginInfoEx);
//plugin inits: PLACE IT ONLY AFTER THIS LINE
diff --git a/plugins/Db3x/commonheaders.h b/plugins/Db3x/commonheaders.h
index a79ca1d357..0391366b60 100644
--- a/plugins/Db3x/commonheaders.h
+++ b/plugins/Db3x/commonheaders.h
@@ -49,7 +49,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "database.h"
#include "resource.h"
-extern PLUGINLINK *pluginLink;
extern HANDLE hDbFile;
extern CRITICAL_SECTION csDbAccess;
extern struct DBHeader dbHeader;
diff --git a/plugins/Db3x/init.cpp b/plugins/Db3x/init.cpp
index cb37f20e81..dfbb290b98 100644
--- a/plugins/Db3x/init.cpp
+++ b/plugins/Db3x/init.cpp
@@ -26,7 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int hLangpack;
HINSTANCE g_hInst=NULL;
-PLUGINLINK *pluginLink;
static PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -115,18 +114,12 @@ static int grokHeader( char * profile, int * error )
}
// returns 0 if all the APIs are injected otherwise, 1
-static int LoadDatabase( char * profile, void * plink )
+static int LoadDatabase( char* profile )
{
- PLUGINLINK *link = (PLUGINLINK *)plink;
-
// don't need thread notifications
strncpy(szDbPath, profile, sizeof(szDbPath));
- // this is like Load()'s pluginLink
- pluginLink=link;
-
- // set the memory, lists & UTF8 manager
- mir_getLP( &pluginInfo );
+ mir_getLP(&pluginInfo);
// inject all APIs and hooks into the core
return LoadDatabaseModule();
@@ -145,7 +138,6 @@ static int getFriendlyName( char * buf, size_t cch, int shortName )
return 0;
}
-
static DATABASELINK dblink = {
sizeof(DATABASELINK),
getCapability,
@@ -178,7 +170,7 @@ extern "C" __declspec(dllexport) const MUUID * MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(void)
{
return 1;
}
diff --git a/plugins/Db3x_mmap/commonheaders.h b/plugins/Db3x_mmap/commonheaders.h
index d5ec770353..6e1d4bcc28 100644
--- a/plugins/Db3x_mmap/commonheaders.h
+++ b/plugins/Db3x_mmap/commonheaders.h
@@ -53,8 +53,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "resource.h"
#include "version.h"
-extern PLUGINLINK *pluginLink;
-
extern CRITICAL_SECTION csDbAccess;
extern struct DBHeader dbHeader;
extern HANDLE hDbFile;
diff --git a/plugins/Db3x_mmap/init.cpp b/plugins/Db3x_mmap/init.cpp
index 7f01840a0e..50beb170e3 100644
--- a/plugins/Db3x_mmap/init.cpp
+++ b/plugins/Db3x_mmap/init.cpp
@@ -42,7 +42,7 @@ static PLUGININFOEX pluginInfo = {
};
HINSTANCE g_hInst=NULL;
-PLUGINLINK *pluginLink;
+
static int getCapability( int flag )
{
@@ -115,16 +115,11 @@ static int grokHeader( char * profile, int * error )
}
// returns 0 if all the APIs are injected otherwise, 1
-static int LoadDatabase( char * profile, void * plink )
+static int LoadDatabase(char * profile)
{
- PLUGINLINK *link = (PLUGINLINK *)plink;
-
// don't need thread notifications
strncpy(szDbPath, profile, sizeof(szDbPath));
- // this is like Load()'s pluginLink
- pluginLink=link;
-
// set the memory, lists & UTF8 manager
mir_getLP( &pluginInfo );
@@ -177,7 +172,7 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(void)
{
return 1;
}
diff --git a/plugins/Db_autobackups/main.cpp b/plugins/Db_autobackups/main.cpp
index cef35ade51..7107b167b9 100644
--- a/plugins/Db_autobackups/main.cpp
+++ b/plugins/Db_autobackups/main.cpp
@@ -3,7 +3,7 @@
#include "m_trigger.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack;
TCHAR* profilePath;
@@ -167,9 +167,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink=link;
+
SysInit();
return 0;
}
diff --git a/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp b/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp
index 4f5c0a18b6..1e7b264efa 100644
--- a/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp
+++ b/plugins/Dbx_mmap_SA/Dbtool/encryption.cpp
@@ -48,12 +48,12 @@ void zero_fill(BYTE * pBuf, size_t bufSize)
void InitSecurity()
{
- HMODULE hLib;
+ HMODULE hLib;
WIN32_FIND_DATAA fd;
- Cryptor* (__stdcall *GetCryptor)();
+ Cryptor* (__stdcall *GetCryptor)();
- {
+ {
TCHAR szMirandaDir[MAX_PATH];
szMirandaDir[ 0 ] = 0;
TCHAR *str2;
@@ -63,30 +63,30 @@ void InitSecurity()
*str2=0;
_tchdir(szMirandaDir);
}
-
- HANDLE hFile = FindFirstFileA(".\\plugins\\cryptors\\*.dll", &fd);
+
+ HANDLE hFile = FindFirstFileA(".\\plugins\\cryptors\\*.dll", &fd);
AddToStatus(STATUS_MESSAGE,TranslateT("Scanning cryptors directory"));
-
+
ModulesCount = 0;
while (hFile != INVALID_HANDLE_VALUE)
- {
+ {
char tmp[MAX_PATH], buf[255];
strcpy(tmp, ".\\plugins\\cryptors\\");
strcat(tmp, fd.cFileName);
-
+
hLib = LoadLibraryA(tmp);
if(hLib){
GetCryptor = (Cryptor* (__stdcall *)()) GetProcAddress(hLib, "GetCryptor");
if(GetCryptor){
TCHAR Name[100], Version[100], DllName[100];
-
+
Modules[ModulesCount] = (CryptoModule*) malloc(sizeof(CryptoModule));
Modules[ModulesCount]->cryptor = GetCryptor();
strcpy(Modules[ModulesCount]->dllname, fd.cFileName);
Modules[ModulesCount]->hLib = hLib;
-
+
_snprintf(buf,SIZEOF(buf),"%d.%d.%d.%d", HIBYTE(HIWORD(Modules[ModulesCount]->cryptor->Version)), LOBYTE(HIWORD(Modules[ModulesCount]->cryptor->Version)), HIBYTE(LOWORD(Modules[ModulesCount]->cryptor->Version)), LOBYTE(LOWORD(Modules[ModulesCount]->cryptor->Version)));
mbstowcs(Name, Modules[ModulesCount]->cryptor->Name, 100);
@@ -94,7 +94,7 @@ void InitSecurity()
mbstowcs(DllName, Modules[ModulesCount]->dllname, 100);
AddToStatus(STATUS_MESSAGE,TranslateT("Cryptor loaded: %s [%s] (%s)"), Name, Version, DllName);
-
+
ModulesCount++;
}else{
FreeLibrary(hLib);
@@ -112,7 +112,7 @@ void UnloadSecurity()
int i;
if(CryptoEngine) CryptoEngine->FreeKey(key);
-
+
for(i = 0; i < ModulesCount; i++)
{
FreeLibrary(Modules[i]->hLib);
@@ -229,11 +229,10 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
case WM_INITDIALOG:
{
HWND hwndCtrl;
-// if(pluginLink && ServiceExists(MS_LANGPACK_TRANSLATEDIALOG))
TranslateDialogDefault(hDlg);
if(lParam && !wrongPass) SetDlgItemTextA(hDlg, IDC_DBNAME, (LPCSTR)lParam);
- if(wrongPass)
+ if(wrongPass)
{
if (wrongPass > 2)
{
@@ -241,7 +240,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
EnableWindow(hwndCtrl, FALSE);
hwndCtrl = GetDlgItem(hDlg, IDOK);
EnableWindow(hwndCtrl, FALSE);
-
+
SetDlgItemText(hDlg, IDC_LOGININFO, TranslateT("Too many errors!"));
}
@@ -278,7 +277,7 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
encryptKeyLength = GetDlgItemTextA(hDlg, IDC_USERPASS, encryptKey, 254);
EndDialog(hDlg,IDOK);
}else{
-
+
}
}else if(uid == IDCANCEL){
EndDialog(hDlg,IDCANCEL);
diff --git a/plugins/Dbx_mmap_SA/Import_SA/main.cpp b/plugins/Dbx_mmap_SA/Import_SA/main.cpp
index ed83861e0f..c86d29f6c6 100644
--- a/plugins/Dbx_mmap_SA/Import_SA/main.cpp
+++ b/plugins/Dbx_mmap_SA/Import_SA/main.cpp
@@ -44,7 +44,7 @@ static HANDLE hImportService = NULL;
INT_PTR CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
static HWND hwndWizard = NULL;
PLUGININFOEX pluginInfo = {
@@ -126,9 +126,9 @@ static int OnExit(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP( &pluginInfo );
hImportService = CreateServiceFunction(IMPORT_SERVICE, ImportCommand);
diff --git a/plugins/Dbx_mmap_SA/commonheaders.h b/plugins/Dbx_mmap_SA/commonheaders.h
index 8596e60821..2fb92e5399 100644
--- a/plugins/Dbx_mmap_SA/commonheaders.h
+++ b/plugins/Dbx_mmap_SA/commonheaders.h
@@ -60,8 +60,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "resource.h"
#include "version.h"
-extern PLUGINLINK *pluginLink;
-
extern CRITICAL_SECTION csDbAccess;
extern struct DBHeader dbHeader;
extern HANDLE hDbFile;
diff --git a/plugins/Dbx_mmap_SA/dialogs.cpp b/plugins/Dbx_mmap_SA/dialogs.cpp
index d8878a2dd1..c5503773ce 100644
--- a/plugins/Dbx_mmap_SA/dialogs.cpp
+++ b/plugins/Dbx_mmap_SA/dialogs.cpp
@@ -363,7 +363,6 @@ BOOL CALLBACK DlgStdInProc(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
case WM_INITDIALOG:
{
HWND hwndCtrl;
-// if(pluginLink && ServiceExists(MS_LANGPACK_TRANSLATEDIALOG))
TranslateDialogDefault(hDlg);
hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON2));
@@ -448,7 +447,6 @@ BOOL CALLBACK DlgStdNewPass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
{
case WM_INITDIALOG:
{
- //if(pluginLink && ServiceExists(MS_LANGPACK_TRANSLATEDIALOG))
TranslateDialogDefault(hDlg);
hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON2));
@@ -534,7 +532,6 @@ BOOL CALLBACK DlgChangePass(HWND hDlg, UINT uMsg,WPARAM wParam,LPARAM lParam)
{
case WM_INITDIALOG:
{
- //if(pluginLink && ServiceExists(MS_LANGPACK_TRANSLATEDIALOG))
TranslateDialogDefault(hDlg);
hIcon = LoadIcon(g_hInst, MAKEINTRESOURCE(IDI_ICON2));
diff --git a/plugins/Dbx_mmap_SA/init.cpp b/plugins/Dbx_mmap_SA/init.cpp
index 0f2cc52ca4..2517b3efab 100644
--- a/plugins/Dbx_mmap_SA/init.cpp
+++ b/plugins/Dbx_mmap_SA/init.cpp
@@ -28,7 +28,7 @@ int hLangpack;
extern char szDbPath[MAX_PATH];
HINSTANCE g_hInst = NULL;
-PLUGINLINK *pluginLink;
+
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -116,18 +116,11 @@ static int grokHeader( char * profile, int * error )
}
// returns 0 if all the APIs are injected otherwise, 1
-static int LoadDatabase( char * profile, void * plink )
+static int LoadDatabase(char *profile)
{
- PLUGINLINK *link = (PLUGINLINK *)plink;
-#ifdef _DEBUG
- _CrtSetDbgFlag( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
-#endif
// don't need thread notifications
strncpy(szDbPath, profile, sizeof(szDbPath));
- // this is like Load()'s pluginLink
- pluginLink=link;
-
// set the memory, lists & UTF8 manager
mir_getLP( &pluginInfo );
@@ -141,14 +134,14 @@ static int LoadDatabase( char * profile, void * plink )
{
// We are running under damn violators
void (*f)();
-
+
MessageBox(0, TranslateT("Running mmap_sa is forbidden under license violating products, sorry"), TranslateT("Warning!"), MB_OK);
-
+
f = NULL;
f();
}
/* end of protected code */
- }
+ }
// inject all APIs and hooks into the core
return LoadDatabaseModule();
@@ -199,7 +192,7 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(void)
{
return 1;
}
diff --git a/plugins/Dbx_tree/DatabaseLink.cpp b/plugins/Dbx_tree/DatabaseLink.cpp
index 36110d141c..f4bb812d0c 100644
--- a/plugins/Dbx_tree/DatabaseLink.cpp
+++ b/plugins/Dbx_tree/DatabaseLink.cpp
@@ -29,7 +29,7 @@ static int getCapability(int);
static int getFriendlyName(char*, size_t, int);
static int makeDatabase(char*, int*);
static int grokHeader(char*, int*);
-static int Load(char*, void*);
+static int Load(char*);
static int Unload(int);
DATABASELINK gDBLink = {
@@ -42,10 +42,8 @@ DATABASELINK gDBLink = {
Unload,
};
-PLUGINLINK *pluginLink = NULL;
HANDLE hSystemModulesLoaded = 0;
-
static int SystemModulesLoaded(WPARAM wParam, LPARAM lParam)
{
Update upd = {0,0,0,0,0,0,0,0,0,0,0,0,0};
@@ -141,12 +139,11 @@ Affect: Tell the database to create all services/hooks that a 3.xx legecy databa
which is a PLUGINLINK structure
Returns: 0 on success, nonzero on failure
*/
-static int Load(char* profile, void* link)
+static int Load(char* profile)
{
if (gDataBase) delete gDataBase;
gDataBase = new CDataBase(profile);
- pluginLink = (PLUGINLINK*)link;
RegisterServices();
CompatibilityRegister();
@@ -158,7 +155,7 @@ static int Load(char* profile, void* link)
/*
Affect: The database plugin should shutdown, unloading things from the core and freeing internal structures
Returns: 0 on success, nonzero on failure
-Note: Unload() might be called even if Load() was never called, wasLoaded is set to 1 if Load() was ever called.
+Note: Unload() might be called even if Load(void) was never called, wasLoaded is set to 1 if Load(void) was ever called.
*/
static int Unload(int wasLoaded)
{
diff --git a/plugins/Dbx_tree/Interface.h b/plugins/Dbx_tree/Interface.h
index b8e72e15ee..438434176a 100644
--- a/plugins/Dbx_tree/Interface.h
+++ b/plugins/Dbx_tree/Interface.h
@@ -36,7 +36,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "m_dbx_tree.h"
extern HINSTANCE hInstance;
-extern PLUGINLINK *pluginLink;
extern DATABASELINK gDBLink;
#endif
diff --git a/plugins/Dbx_tree/init.cpp b/plugins/Dbx_tree/init.cpp
index 8c11e04a9f..6844fa83c8 100644
--- a/plugins/Dbx_tree/init.cpp
+++ b/plugins/Dbx_tree/init.cpp
@@ -61,7 +61,7 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return gInterfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK * Link)
+extern "C" __declspec(dllexport) int Load(void)
{
mir_getLP(&gPluginInfoEx);
return 1;
diff --git a/plugins/ExtraIcons/commons.h b/plugins/ExtraIcons/commons.h
index 84b43008dd..ff854f53dc 100644
--- a/plugins/ExtraIcons/commons.h
+++ b/plugins/ExtraIcons/commons.h
@@ -78,7 +78,6 @@ using namespace std;
// Global Variables
extern HINSTANCE hInst;
-extern PLUGINLINK *pluginLink;
#define MAX_REGS(_A_) ( sizeof(_A_) / sizeof(_A_[0]))
#define FREE(_m_) if (_m_ != NULL) { free(_m_); _m_ = NULL; }
diff --git a/plugins/ExtraIcons/extraicons.cpp b/plugins/ExtraIcons/extraicons.cpp
index 9eaf35b3d3..dccfa023dc 100644
--- a/plugins/ExtraIcons/extraicons.cpp
+++ b/plugins/ExtraIcons/extraicons.cpp
@@ -36,7 +36,7 @@ PLUGININFOEX pluginInfo = {
};
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack;
vector<HANDLE> hHooks;
@@ -81,9 +81,9 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
DWORD ret = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS2, 0);
diff --git a/plugins/FavContacts/src/main.cpp b/plugins/FavContacts/src/main.cpp
index be64692d00..bd53299f63 100644
--- a/plugins/FavContacts/src/main.cpp
+++ b/plugins/FavContacts/src/main.cpp
@@ -20,9 +20,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "headers.h"
-DWORD g_mirandaVersion;
-PLUGINLINK* pluginLink = NULL;
-HINSTANCE g_hInst;
+DWORD g_mirandaVersion;
+HINSTANCE g_hInst;
int hLangpack;
@@ -296,10 +295,8 @@ int ProcessOptInitialise(WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////
-extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
-
if (!CoreCheck()) return 1;
mir_getLP(&pluginInfo);
diff --git a/plugins/FingerPrintModPlus/src/fingerprint.cpp b/plugins/FingerPrintModPlus/src/fingerprint.cpp
index c77539bb3f..7c447cedfe 100644
--- a/plugins/FingerPrintModPlus/src/fingerprint.cpp
+++ b/plugins/FingerPrintModPlus/src/fingerprint.cpp
@@ -67,9 +67,8 @@ BOOL __inline WildCompareProcW(LPWSTR name, LPWSTR mask);
#define WildCompare WildCompareW
#define GetIconsIndexes GetIconsIndexesW
-HINSTANCE g_hInst;
-PLUGINLINK* pluginLink;
-int hLangpack;
+HINSTANCE g_hInst;
+int hLangpack;
BOOL g_bExtraIcon_Register_ServiceExist = FALSE;
BOOL g_bCList_Extra_Set_Icon_ServiceExist = FALSE;
@@ -153,9 +152,9 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces()
return interfaces;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK* link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
hStaticHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/plugins/FirstRun/main.cpp b/plugins/FirstRun/main.cpp
index d67807d8f4..d11d1da31f 100644
--- a/plugins/FirstRun/main.cpp
+++ b/plugins/FirstRun/main.cpp
@@ -1,7 +1,7 @@
#include "commonheaders.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
HANDLE hModulesLoaded;
int hLangpack;
@@ -51,9 +51,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink=link;
+
mir_getLP(&pluginInfo);
hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
return 0;
diff --git a/plugins/FlashAvatars/cflash.cpp b/plugins/FlashAvatars/cflash.cpp
index 8750246c29..d334dee339 100644
--- a/plugins/FlashAvatars/cflash.cpp
+++ b/plugins/FlashAvatars/cflash.cpp
@@ -90,7 +90,7 @@ static int CompareFlashItems(const flash_avatar_item* p1, const flash_avatar_ite
HINSTANCE g_hInst = 0;
-PLUGINLINK *pluginLink;
+
int hLangpack;
HANDLE hNetlibUser;
@@ -654,9 +654,9 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, systemModulesLoaded);
diff --git a/plugins/FloatingContacts/main.cpp b/plugins/FloatingContacts/main.cpp
index d907bc575a..3ba51d5111 100644
--- a/plugins/FloatingContacts/main.cpp
+++ b/plugins/FloatingContacts/main.cpp
@@ -79,7 +79,6 @@ WNDPROC oldMirandaWndProc;
HINSTANCE hInst = NULL;
HMODULE hUserDll = NULL;
-PLUGINLINK *pluginLink = NULL;
HFONT hFont[FLT_FONTIDS] = {NULL};
COLORREF tColor[FLT_FONTIDS] = {0};
HIMAGELIST himl = NULL;
@@ -190,11 +189,11 @@ BOOL WINAPI DllMain( HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved )
return( TRUE );
}
-extern "C" int __declspec(dllexport) Load( PLUGINLINK *link )
+extern "C" int __declspec(dllexport) Load( )
{
SetLastError( 0 );
InitOptions();
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
hevModules = HookEvent( ME_SYSTEM_MODULESLOADED, OnModulesLoded );
diff --git a/plugins/Folders/folders.cpp b/plugins/Folders/folders.cpp
index 88fe12cf77..419e5f8a10 100644
--- a/plugins/Folders/folders.cpp
+++ b/plugins/Folders/folders.cpp
@@ -33,7 +33,7 @@ int hLangpack;
CFoldersList &lstRegisteredFolders = CFoldersList(10); //the list
-PLUGINLINK *pluginLink;
+
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -170,12 +170,12 @@ extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
return interfaces;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
#if _MSC_VER >= 1300
Log("%s", "Entering function " __FUNCTION__);
#endif
- pluginLink = link;
+
mir_getLP(&pluginInfo);
Log("%s", "Creating service functions ...");
diff --git a/plugins/FreeImage/Miranda/main.cpp b/plugins/FreeImage/Miranda/main.cpp
index 39befac6e8..74bfd38a7b 100644
--- a/plugins/FreeImage/Miranda/main.cpp
+++ b/plugins/FreeImage/Miranda/main.cpp
@@ -45,8 +45,6 @@ Last change by : $Author: rainwater $
#include "../Source/libpng/png.h"
-PLUGINLINK *pluginLink = NULL;
-
static const PLUGININFOEX pluginInfoEx = {
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -1228,9 +1226,8 @@ static int IMGSERVICE_Load()
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
return IMGSERVICE_Load();
}
diff --git a/plugins/Gender/main.cpp b/plugins/Gender/main.cpp
index 19de3c2bbf..04069c9525 100644
--- a/plugins/Gender/main.cpp
+++ b/plugins/Gender/main.cpp
@@ -26,7 +26,7 @@
#include "commonheaders.h"
HINSTANCE g_hInst;
-PLUGINLINK *pluginLink;
+
static HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL;
static HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactMenu = NULL;
static HANDLE hContactMenuMale = NULL, hContactMenuFemale = NULL, hContactMenuNotDef = NULL, hHookPrebuildContactMenu = NULL;
@@ -428,9 +428,9 @@ int onSystemOKToExit(WPARAM wParam,LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
diff --git a/plugins/HistoryLinkListPlus/linklist.cpp b/plugins/HistoryLinkListPlus/linklist.cpp
index 67ac47b439..5d216ff7ce 100644
--- a/plugins/HistoryLinkListPlus/linklist.cpp
+++ b/plugins/HistoryLinkListPlus/linklist.cpp
@@ -20,7 +20,7 @@
// Global variables
HINSTANCE hInst;
HINSTANCE hRichEdit;
-PLUGINLINK *pluginLink;
+
HANDLE hWindowList;
HCURSOR splitCursor;
int hLangpack;
@@ -45,12 +45,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
return TRUE;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
CLISTMENUITEM linklistmenuitem;
WNDCLASS wndclass;
- pluginLink = link;
+
mir_getLP(&pluginInfo);
// Load Rich Edit control
hRichEdit = LoadLibrary(_T("RICHED32.DLL"));
diff --git a/plugins/HistorySweeperLight/main.cpp b/plugins/HistorySweeperLight/main.cpp
index 2a55341787..f4c21b8b79 100644
--- a/plugins/HistorySweeperLight/main.cpp
+++ b/plugins/HistorySweeperLight/main.cpp
@@ -23,8 +23,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "version.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
-
static HANDLE hHooks[5];
int hLangpack;
@@ -153,9 +151,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
hHooks[0] = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/plugins/IEView/ieview_main.cpp b/plugins/IEView/ieview_main.cpp
index 3f0aa95289..59b66d6cb5 100644
--- a/plugins/IEView/ieview_main.cpp
+++ b/plugins/IEView/ieview_main.cpp
@@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
char *ieviewModuleName;
HINSTANCE hInstance;
-PLUGINLINK *pluginLink;
+
char *workingDirUtf8;
static int ModulesLoaded(WPARAM wParam, LPARAM lParam);
static int PreShutdown(WPARAM wParam, LPARAM lParam);
@@ -65,7 +65,7 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
char text[_MAX_PATH];
char *p, *q;
@@ -85,7 +85,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
ieviewModuleName = _strdup(p);
_strupr(ieviewModuleName);
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
Utils::hookEvent_Ex(ME_OPT_INITIALISE, IEViewOptInit);
diff --git a/plugins/IgnoreState/main.cpp b/plugins/IgnoreState/main.cpp
index d6a9f04807..69840f4e3b 100644
--- a/plugins/IgnoreState/main.cpp
+++ b/plugins/IgnoreState/main.cpp
@@ -21,7 +21,7 @@
#include "commonheaders.h"
HINSTANCE g_hInst;
-PLUGINLINK *pluginLink;
+
HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL;
HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactSettingChanged = NULL;
HANDLE hPrebuildContactMenu = NULL;
@@ -298,10 +298,11 @@ int onContactSettingChanged(WPARAM wParam,LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink=link;
- mir_getLP(&pluginInfo);
+
+ mir_getLP(&pluginInfo);
+
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit);
hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
diff --git a/plugins/Import/main.cpp b/plugins/Import/main.cpp
index 9f82706367..4818007477 100644
--- a/plugins/Import/main.cpp
+++ b/plugins/Import/main.cpp
@@ -46,7 +46,7 @@ static HANDLE hImportService = NULL;
INT_PTR CALLBACK WizardDlgProc(HWND hdlg,UINT message,WPARAM wParam,LPARAM lParam);
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
static HWND hwndWizard = NULL;
int hLangpack;
@@ -129,9 +129,9 @@ static int OnExit(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP( &pluginInfo );
hImportService = CreateServiceFunction(IMPORT_SERVICE, ImportCommand);
diff --git a/plugins/KeyboardNotify/main.cpp b/plugins/KeyboardNotify/main.cpp
index a563a4764b..6535acdfd8 100644
--- a/plugins/KeyboardNotify/main.cpp
+++ b/plugins/KeyboardNotify/main.cpp
@@ -225,7 +225,7 @@
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack;
DWORD IDThread = 0;
@@ -1139,10 +1139,11 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
- mir_getLP(&pluginInfo);
+
+ mir_getLP(&pluginInfo);
+
GetWindowsVersion();
OpenKeyboardDevice();
hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
diff --git a/plugins/LangMan/main.cpp b/plugins/LangMan/main.cpp
index b7a7609150..dad4afeac0 100644
--- a/plugins/LangMan/main.cpp
+++ b/plugins/LangMan/main.cpp
@@ -23,7 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "version.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
static HANDLE hHookModulesLoaded;
int hLangpack;
@@ -111,9 +111,9 @@ static int LangManModulesLoaded(WPARAM, LPARAM)
return 0;
}
-__declspec(dllexport) int Load(PLUGINLINK *link)
+__declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP( &pluginInfo );
/* existance of MS_SYSTEM_GETVERSION and MS_LANGPACK_TRANSLATESTRING
diff --git a/plugins/ListeningTo/commons.h b/plugins/ListeningTo/commons.h
index d0a9fc5b0c..56fa318a0e 100644
--- a/plugins/ListeningTo/commons.h
+++ b/plugins/ListeningTo/commons.h
@@ -80,7 +80,6 @@ Boston, MA 02111-1307, USA.
// Global Variables
extern HINSTANCE hInst;
-extern PLUGINLINK *pluginLink;
extern BOOL loaded;
diff --git a/plugins/ListeningTo/listeningto.cpp b/plugins/ListeningTo/listeningto.cpp
index a6609486ee..2ce9c8ecc5 100644
--- a/plugins/ListeningTo/listeningto.cpp
+++ b/plugins/ListeningTo/listeningto.cpp
@@ -52,7 +52,7 @@ PLUGININFOEX pluginInfo={
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
static std::vector<HANDLE> hHooks;
static std::vector<HANDLE> hServices;
@@ -130,9 +130,9 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
CHECK_VERSION("Listening To")
diff --git a/plugins/MenuItemEx/main.cpp b/plugins/MenuItemEx/main.cpp
index 58c3f6cc14..0f3e2d4e27 100644
--- a/plugins/MenuItemEx/main.cpp
+++ b/plugins/MenuItemEx/main.cpp
@@ -18,7 +18,7 @@
const int vf_default = VF_VS|VF_HFL|VF_IGN|VF_CID|VF_SHOWID|VF_RECV|VF_STAT|VF_SMNAME|VF_CIDN|VF_CIP;
-PLUGINLINK *pluginLink;
+
MUUID interfaces[] = {MIID_MENUEX, MIID_LAST};
HINSTANCE hinstance;
HANDLE hmenuVis,hmenuOff,hmenuHide,hmenuIgnore,hmenuProto,hmenuAdded,hmenuAuthReq;
@@ -1358,9 +1358,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
hHooks[7] = HookEvent(ME_SYSTEM_MODULESLOADED,PluginInit);
return 0;
diff --git a/plugins/MenuItemEx/menuex.h b/plugins/MenuItemEx/menuex.h
index 9b831ea489..958dc22881 100644
--- a/plugins/MenuItemEx/menuex.h
+++ b/plugins/MenuItemEx/menuex.h
@@ -39,7 +39,6 @@
#define MIIM_STRING 0x00000040
-extern PLUGINLINK *pluginLink;
extern PLUGININFOEX pluginInfoEx;
extern MUUID interfaces[];
diff --git a/plugins/MetaContacts/meta_main.cpp b/plugins/MetaContacts/meta_main.cpp
index d39555c9aa..4c7abebee2 100644
--- a/plugins/MetaContacts/meta_main.cpp
+++ b/plugins/MetaContacts/meta_main.cpp
@@ -106,7 +106,6 @@ PLUGININFOEX pluginInfo={
};
HINSTANCE hInstance; //!< Global reference to the application
-PLUGINLINK *pluginLink; //!< Link between Miranda and this plugin
/** Called by Miranda to get the information associated to this plugin.
* It only returns the PLUGININFO structure, without any test on the version
@@ -154,12 +153,12 @@ BOOL IsUnicodeOS()
/** Initializes the services provided and the link to those needed
* Called when the plugin is loaded into Miranda
*/
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
PROTOCOLDESCRIPTOR pd;
DBVARIANT dbv;
- pluginLink=link;
+
mir_getLP(&pluginInfo);
os_unicode_enabled = IsUnicodeOS();
diff --git a/plugins/MirOTR/MirOTR/dllmain.cpp b/plugins/MirOTR/MirOTR/dllmain.cpp
index dae2e0b959..0e7e818194 100644
--- a/plugins/MirOTR/MirOTR/dllmain.cpp
+++ b/plugins/MirOTR/MirOTR/dllmain.cpp
@@ -7,7 +7,7 @@
HANDLE hEventWindow;
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack;
char* g_metaproto;
@@ -129,10 +129,10 @@ int NewContact(WPARAM wParam, LPARAM lParam) {
return 0;
}
-DLLFUNC int Load(PLUGINLINK *link)
+DLLFUNC int Load(void)
{
DEBUGOUT_T("LOAD MIROTR")
- pluginLink=link;
+
mir_getLP( &pluginInfo );
/* for timezones
mir_getTMI(&tmi); */
diff --git a/plugins/MirOTR/MirOTR/dllmain.h b/plugins/MirOTR/MirOTR/dllmain.h
index 7a99b0580a..b2346859f6 100644
--- a/plugins/MirOTR/MirOTR/dllmain.h
+++ b/plugins/MirOTR/MirOTR/dllmain.h
@@ -6,4 +6,3 @@
#define DLLFUNC extern "C" __declspec(dllexport)
extern HINSTANCE hInst;
-extern PLUGINLINK *pluginLink; \ No newline at end of file
diff --git a/plugins/ModernOpt/main.cpp b/plugins/ModernOpt/main.cpp
index 760a9b16dd..97d97aa77f 100644
--- a/plugins/ModernOpt/main.cpp
+++ b/plugins/ModernOpt/main.cpp
@@ -1,7 +1,7 @@
#include "commonheaders.h"
-PLUGINLINK *pluginLink;
+
HINSTANCE hInst;
int hLangpack;
@@ -38,9 +38,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
int LoadModernOptsModule();
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
LoadModernOptsModule();
diff --git a/plugins/NewAwaySysMod/AwaySys.cpp b/plugins/NewAwaySysMod/AwaySys.cpp
index 2671a3caf7..83c27a139d 100644
--- a/plugins/NewAwaySysMod/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/AwaySys.cpp
@@ -24,8 +24,8 @@
mistag for GamerStatus, BigMuscle for his code to use AAA
Thanx to Tornado, orignal developer of AwaySys.
Please note that some code from the Miranda's original away module (SRAway) is used around
- AwaySys. I tried to mention it wherever possible, but I might have forgotten a few. Kudos to Miranda's authors.
- The Read-Away-Msg part was practically copied from Miranda, not proud of it, but since I really can't see how can I make it better, there
+ AwaySys. i tried to mention it wherever possible, but i might have forgotten a few. Kudos to Miranda's authors.
+ The Read-Away-Msg part was practically copied from Miranda, not proud of it, but since i really can't see how can i make it better, there
was no point in rewriting it all.
*/
@@ -48,9 +48,9 @@
#include <process.h> // needed for MSVC 7 msvcr7*.dll patch
HINSTANCE g_hInstance;
-PLUGINLINK *pluginLink;
+
int hLangpack = 0;
-TMyArray<HANDLE> hHooks, hServices;
+LIST<void> hHooks(5), hServices(5);
HANDLE g_hContactMenuItem = NULL, g_hReadStatMenuItem = NULL, /*g_hTopToolbarbutton = NULL, */g_hToggleSOEMenuItem = NULL, g_hToggleSOEContactMenuItem = NULL, g_hAutoreplyOnContactMenuItem = NULL, g_hAutoreplyOffContactMenuItem = NULL, g_hAutoreplyUseDefaultContactMenuItem = NULL;
bool g_fNoProcessing = false; // tells the status change proc not to do anything
int g_bIsIdle = false;
@@ -189,7 +189,7 @@ int StatusMsgReq(WPARAM wParam, LPARAM lParam, CString &szProto)
}
if (CContactSettings(iMode, hContactForSettings).Ignore)
{
- CallAllowedPS_SETAWAYMSG(szProto, iMode, ""); // currently NULL makes ICQ to ignore _any_ further status message requests until the next PS_SETAWAYMSG, so I can't use it here..
+ CallAllowedPS_SETAWAYMSG(szProto, iMode, ""); // currently NULL makes ICQ to ignore _any_ further status message requests until the next PS_SETAWAYMSG, so i can't use it here..
return 0; // move along, sir
}
@@ -272,10 +272,10 @@ MIRANDAHOOK StatusMsgReqHooks[] = {StatusMsgReq1, StatusMsgReq2, StatusMsgReq3,
int IsAnICQProto(char *szProto)
{
- int I;
- for (I = 0; I < MAXICQACCOUNTS; I++)
+ int i;
+ for (i = 0; i < MAXICQACCOUNTS; i++)
{
- if (ICQProtoList[I] == (const char*)szProto)
+ if (ICQProtoList[i] == (const char*)szProto)
{
return true;
}
@@ -307,13 +307,13 @@ int StatusChanged(WPARAM wParam, LPARAM lParam)
PROTOCOLDESCRIPTOR **proto;
int iProtoCount = 0;
CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&iProtoCount, (LPARAM)&proto);
- int I;
- for (I = 0; I < iProtoCount; I++)
+ int i;
+ for (i = 0; i < iProtoCount; i++)
{
- if (proto[I]->type == PROTOTYPE_PROTOCOL)
+ if (proto[i]->type == PROTOTYPE_PROTOCOL)
{
- Flag1 |= CallProtoService(proto[I]->szName, PS_GETCAPS, PFLAGNUM_1, 0);
- Flag3 |= CallProtoService(proto[I]->szName, PS_GETCAPS, PFLAGNUM_3, 0);
+ Flag1 |= CallProtoService(proto[i]->szName, PS_GETCAPS, PFLAGNUM_1, 0);
+ Flag3 |= CallProtoService(proto[i]->szName, PS_GETCAPS, PFLAGNUM_3, 0);
}
}
}
@@ -326,21 +326,21 @@ int StatusChanged(WPARAM wParam, LPARAM lParam)
SetForegroundWindow(g_SetAwayMsgPage.GetWnd());
return 0;
}
- int I;
- for (I = lengthof(StatusModeList) - 1; I >= 0; I--)
+ int i;
+ for (i = lengthof(StatusModeList) - 1; i >= 0; i--)
{
- if (wParam == StatusModeList[I].Status)
+ if (wParam == StatusModeList[i].Status)
{
break;
}
}
- if (I < 0)
+ if (i < 0)
{
return 0;
}
BOOL bScreenSaverRunning;
SystemParametersInfo(SPI_GETSCREENSAVERRUNNING, 0, &bScreenSaverRunning, 0);
- if (bScreenSaverRunning || g_MoreOptPage.GetDBValueCopy(StatusModeList[I].DontShowDialogCtlID))
+ if (bScreenSaverRunning || g_MoreOptPage.GetDBValueCopy(StatusModeList[i].DontShowDialogCtlID))
{
CProtoSettings((char*)lParam).SetMsgFormat(SMF_PERSONAL, CProtoSettings((char*)lParam).GetMsgFormat(GMF_LASTORDEFAULT));
ChangeProtoMessages((char*)lParam, wParam, TCString());
@@ -368,17 +368,17 @@ int CSStatusChange(WPARAM wParam, LPARAM lParam) // CommonStatus plugins (Startu
return -1;
}
LogMessage("ME_CS_STATUSCHANGEEX event:");
- int I;
- for (I = 0; I < g_CSProtoCount; I++)
+ int i;
+ for (i = 0; i < g_CSProtoCount; i++)
{
- LogMessage("%d: cbSize=%d, szProto=%s, status=%d, lastStatus=%d, szMsg:", I + 1, ps[I]->cbSize, ps[I]->szName ? (char*)ps[I]->szName : "NULL", ps[I]->status, ps[I]->lastStatus, ps[I]->szMsg ? ps[I]->szMsg : "NULL");
- if (ps[I]->status != ID_STATUS_DISABLED)
+ LogMessage("%d: cbSize=%d, szProto=%s, status=%d, lastStatus=%d, szMsg:", i + 1, ps[i]->cbSize, ps[i]->szName ? (char*)ps[i]->szName : "NULL", ps[i]->status, ps[i]->lastStatus, ps[i]->szMsg ? ps[i]->szMsg : "NULL");
+ if (ps[i]->status != ID_STATUS_DISABLED)
{
- if (ps[I]->status != ID_STATUS_CURRENT)
+ if (ps[i]->status != ID_STATUS_CURRENT)
{
- g_ProtoStates[ps[I]->szName].Status = (ps[I]->status == ID_STATUS_LAST) ? ps[I]->lastStatus : ps[I]->status;
+ g_ProtoStates[ps[i]->szName].Status = (ps[i]->status == ID_STATUS_LAST) ? ps[i]->lastStatus : ps[i]->status;
}
- CProtoSettings(ps[I]->szName).SetMsgFormat(SMF_TEMPORARY, ps[I]->szMsg ? ANSI2TCHAR(ps[I]->szMsg) : CProtoSettings(ps[I]->szName).GetMsgFormat(GMF_LASTORDEFAULT));
+ CProtoSettings(ps[i]->szName).SetMsgFormat(SMF_TEMPORARY, ps[i]->szMsg ? ANSI2TCHAR(ps[i]->szMsg) : CProtoSettings(ps[i]->szName).GetMsgFormat(GMF_LASTORDEFAULT));
}
}
return 0;
@@ -417,15 +417,15 @@ int PreBuildContactMenu(WPARAM wParam, LPARAM lParam)
TCHAR szSetStr[256], szReadStr[256];
if (szProto)
{
- int I;
- for (I = lengthof(StatusModeList) - 1; I >= 0; I--)
+ int i;
+ for (i = lengthof(StatusModeList) - 1; i >= 0; i--)
{
- if (iMode == StatusModeList[I].Status)
+ if (iMode == StatusModeList[i].Status)
{
break;
}
}
- if ((Flag1 & PF1_MODEMSGSEND && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iMode)) || ((Flag1 & PF1_IM) == PF1_IM && (I < 0 || !g_AutoreplyOptPage.GetDBValueCopy(StatusModeList[I].DisableReplyCtlID))))
+ if ((Flag1 & PF1_MODEMSGSEND && CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_3, 0) & Proto_Status2Flag(iMode)) || ((Flag1 & PF1_IM) == PF1_IM && (i < 0 || !g_AutoreplyOptPage.GetDBValueCopy(StatusModeList[i].DisableReplyCtlID))))
{ // the protocol supports status message sending for current status, or autoreplying
mir_sntprintf(szSetStr, SIZEOF(szSetStr), TranslateT("Set %s message for the contact"), CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, iMode, GSMDF_TCHAR), CallService(MS_CLIST_GETCONTACTDISPLAYNAME, (WPARAM)hContact, GCDNF_TCHAR));
miSetMsg.ptszName = szSetStr;
@@ -740,12 +740,12 @@ INT_PTR srvVariablesHandler(WPARAM wParam, LPARAM lParam)
COptPage MsgTreeData(g_MsgTreePage);
COptItem_TreeCtrl *TreeCtrl = (COptItem_TreeCtrl*)MsgTreeData.Find(IDV_MSGTREE);
TreeCtrl->DBToMem(CString(MOD_NAME));
- int I;
- for (I = 0; I < TreeCtrl->Value.GetSize(); I++)
+ int i;
+ for (i = 0; i < TreeCtrl->Value.GetSize(); i++)
{
- if (!(TreeCtrl->Value[I].Flags & TIF_GROUP) && !_tcsicmp(TreeCtrl->Value[I].Title, ai->targv[1]))
+ if (!(TreeCtrl->Value[i].Flags & TIF_GROUP) && !_tcsicmp(TreeCtrl->Value[i].Title, ai->targv[1]))
{
- Result = TreeCtrl->Value[I].User_Str1;
+ Result = TreeCtrl->Value[i].User_Str1;
break;
}
}
@@ -836,44 +836,44 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam)
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hMainThread, THREAD_SET_CONTEXT, false, 0);
int iProtoCount = 0;
CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&iProtoCount, (LPARAM)&proto);
- int I;
+ int i;
int CurProtoIndex;
- for (I = 0, CurProtoIndex = 0; I < iProtoCount && CurProtoIndex < MAXICQACCOUNTS; I++)
+ for (i = 0, CurProtoIndex = 0; i < iProtoCount && CurProtoIndex < MAXICQACCOUNTS; i++)
{
- if (proto[I]->type == PROTOTYPE_PROTOCOL)
+ if (proto[i]->type == PROTOTYPE_PROTOCOL)
{
- HANDLE hHook = HookEvent(CString(proto[I]->szName) + ME_ICQ_STATUSMSGREQ, StatusMsgReqHooks[CurProtoIndex]);
+ HANDLE hHook = HookEvent(CString(proto[i]->szName) + ME_ICQ_STATUSMSGREQ, StatusMsgReqHooks[CurProtoIndex]);
if (hHook)
{
- hHooks.AddElem(hHook);
- ICQProtoList[CurProtoIndex] = proto[I]->szName;
+ hHooks.insert(hHook);
+ ICQProtoList[CurProtoIndex] = proto[i]->szName;
CurProtoIndex++;
}
}
}
- hServices.AddElem(CreateServiceFunction(MS_AWAYSYS_SETCONTACTSTATMSG, SetContactStatMsg));
- hServices.AddElem(CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_TOGGLE, ToggleSendOnEvent));
- hServices.AddElem(CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_ON, srvAutoreplyOn));
- hServices.AddElem(CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_OFF, srvAutoreplyOff));
- hServices.AddElem(CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_USEDEFAULT, srvAutoreplyUseDefault));
- hServices.AddElem(CreateServiceFunction(MS_NAS_GETSTATEA, GetStateA));
- hServices.AddElem(CreateServiceFunction(MS_NAS_SETSTATEA, SetStateA));
- hServices.AddElem(CreateServiceFunction(MS_NAS_GETSTATEW, GetStateW));
- hServices.AddElem(CreateServiceFunction(MS_NAS_SETSTATEW, SetStateW));
- hServices.AddElem(CreateServiceFunction(MS_NAS_INVOKESTATUSWINDOW, InvokeStatusWindow));
- hServices.AddElem(CreateServiceFunction(MS_AWAYMSG_GETSTATUSMSG, GetStatusMsg));
+ hServices.insert(CreateServiceFunction(MS_AWAYSYS_SETCONTACTSTATMSG, SetContactStatMsg));
+ hServices.insert(CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_TOGGLE, ToggleSendOnEvent));
+ hServices.insert(CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_ON, srvAutoreplyOn));
+ hServices.insert(CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_OFF, srvAutoreplyOff));
+ hServices.insert(CreateServiceFunction(MS_AWAYSYS_AUTOREPLY_USEDEFAULT, srvAutoreplyUseDefault));
+ hServices.insert(CreateServiceFunction(MS_NAS_GETSTATEA, GetStateA));
+ hServices.insert(CreateServiceFunction(MS_NAS_SETSTATEA, SetStateA));
+ hServices.insert(CreateServiceFunction(MS_NAS_GETSTATEW, GetStateW));
+ hServices.insert(CreateServiceFunction(MS_NAS_SETSTATEW, SetStateW));
+ hServices.insert(CreateServiceFunction(MS_NAS_INVOKESTATUSWINDOW, InvokeStatusWindow));
+ hServices.insert(CreateServiceFunction(MS_AWAYMSG_GETSTATUSMSG, GetStatusMsg));
// and old AwaySysMod service, for compatibility reasons
- hServices.AddElem(CreateServiceFunction(MS_AWAYSYS_SETSTATUSMODE, SetStatusMode));
+ hServices.insert(CreateServiceFunction(MS_AWAYSYS_SETSTATUSMODE, SetStatusMode));
//NightFox: none;
-// hHooks.AddElem(HookEvent(ME_TTB_MODULELOADED, Create_TopToolbar));
- hHooks.AddElem(HookEvent(ME_OPT_INITIALISE, OptsDlgInit));
- hHooks.AddElem(HookEvent(ME_CLIST_STATUSMODECHANGE, StatusChanged));
- hHooks.AddElem(HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChange)); // for compatibility with StartupStatus and AdvancedAutoAway
- hHooks.AddElem(HookEvent(ME_DB_EVENT_FILTER_ADD, MsgEventAdded));
- hHooks.AddElem(HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu));
- hHooks.AddElem(HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged));
- hHooks.AddElem(HookEvent(ME_IDLE_CHANGED, IdleChangeEvent));
- hHooks.AddElem(HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit));
+// hHooks.insert(HookEvent(ME_TTB_MODULELOADED, Create_TopToolbar));
+ hHooks.insert(HookEvent(ME_OPT_INITIALISE, OptsDlgInit));
+ hHooks.insert(HookEvent(ME_CLIST_STATUSMODECHANGE, StatusChanged));
+ hHooks.insert(HookEvent(ME_CS_STATUSCHANGEEX, CSStatusChange)); // for compatibility with StartupStatus and AdvancedAutoAway
+ hHooks.insert(HookEvent(ME_DB_EVENT_FILTER_ADD, MsgEventAdded));
+ hHooks.insert(HookEvent(ME_CLIST_PREBUILDCONTACTMENU, PreBuildContactMenu));
+ hHooks.insert(HookEvent(ME_SKIN_ICONSCHANGED, IconsChanged));
+ hHooks.insert(HookEvent(ME_IDLE_CHANGED, IdleChangeEvent));
+ hHooks.insert(HookEvent(ME_CONTACTSETTINGS_INITIALISE, ContactSettingsInit));
g_hReadWndList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
int SendOnEvent = CContactSettings(g_ProtoStates[(char*)NULL].Status).Autoreply;
@@ -934,7 +934,7 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam)
}
// add that funky thingy (just tweaked a bit, was spotted in Miranda's src code)
// we have to read the status message from contacts too... err
- hServices.AddElem(CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetContactStatMsg));
+ hServices.insert(CreateServiceFunction(MS_AWAYMSG_SHOWAWAYMSG, GetContactStatMsg));
SkinAddNewSoundEx(AWAYSYS_STATUSMSGREQUEST_SOUND, NULL, LPGEN("NewAwaySys: Incoming status message request"));
@@ -955,19 +955,19 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam)
_T(VAR_PREDEFINEDMESSAGE), LPGEN("New Away System\t(x)\tReturns one of your predefined messages by its title: ?nas_predefinedmessage(creepy)"), TRF_FUNCTION,
_T(VAR_PROTOCOL), LPGEN("New Away System\tCurrent protocol name"), TRF_FIELD | TRF_FUNCTION
};
- hServices.AddElem(CreateServiceFunction(MS_AWAYSYS_FREEVARMEM, srvFreeVarMem));
- hServices.AddElem(CreateServiceFunction(MS_AWAYSYS_VARIABLESHANDLER, srvVariablesHandler));
+ hServices.insert(CreateServiceFunction(MS_AWAYSYS_FREEVARMEM, srvFreeVarMem));
+ hServices.insert(CreateServiceFunction(MS_AWAYSYS_VARIABLESHANDLER, srvVariablesHandler));
TOKENREGISTER tr = {0};
tr.cbSize = sizeof(TOKENREGISTER);
tr.szService = MS_AWAYSYS_VARIABLESHANDLER;
tr.szCleanupService = MS_AWAYSYS_FREEVARMEM;
tr.memType = TR_MEM_OWNER;
- int I;
- for (I = 0; I < lengthof(Variables); I++)
+ int i;
+ for (i = 0; i < lengthof(Variables); i++)
{
- tr.flags = Variables[I].Flags | TRF_CALLSVC | TRF_TCHAR;
- tr.tszTokenString = Variables[I].Name;
- tr.szHelpText = Variables[I].Descr;
+ tr.flags = Variables[i].Flags | TRF_CALLSVC | TRF_TCHAR;
+ tr.tszTokenString = Variables[i].Name;
+ tr.szHelpText = Variables[i].Descr;
CallService(MS_VARS_REGISTERTOKEN, 0, (LPARAM)&tr);
}
}
@@ -1000,21 +1000,18 @@ int MirandaLoaded(WPARAM wParam, LPARAM lParam)
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP( &pluginInfo );
- hHooks.AddElem(HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded));
+ hHooks.insert(HookEvent(ME_SYSTEM_MODULESLOADED, MirandaLoaded));
if (DBGetContactSettingString(NULL, "KnownModules", "New Away System", (char*)NULL) == NULL)
DBWriteContactSettingString(NULL, "KnownModules", "New Away System", MOD_NAME);
InitCommonControls();
InitOptions(); // must be called before we hook CallService
- g_OldCallService = pluginLink->CallService; // looks like this hack is currently the only way to handle all calls to PS_SETSTATUS and PS_SETAWAYMSG properly. I must know when someone calls it, and there's no any "standard" way to know the real value passed as wParam to it (protocol module often replaces it by another, _supported_ status; for example, Jabber replaces Occupied by DND), so we're intercepting the service here
-// and we need to know the real wParam value just to set proper status message (an example: changing the global status to Out to lunch makes Jabber go Away. I guess, the user wants Jabber status message to be "I've been having lunch..." too, like for other protocols, rather than the default Away message "Gone since...")
- pluginLink->CallService = MyCallService;
-
+
logservice_register(LOG_ID, LPGENT("New Away System"), _T("NewAwaySys?puts(p,?dbsetting(%subject%,Protocol,p))?if2(_?dbsetting(,?get(p),?pinfo(?get(p),uidsetting)),).log"), TranslateTS(_T("`[`!cdate()-!ctime()`]` ?cinfo(%subject%,display) (?cinfo(%subject%,id)) read your %") _T(VAR_STATDESC) _T("% message:\r\n%extratext%\r\n\r\n")));
if (DBGetContactSettingByte(NULL, MOD_NAME, DB_SETTINGSVER, 0) < 1)
@@ -1042,26 +1039,13 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
extern "C" int __declspec(dllexport) Unload()
{
- _ASSERT(pluginLink->CallService == MyCallService);
- if (pluginLink->CallService == MyCallService)
- {
- pluginLink->CallService = g_OldCallService;
- }
CloseHandle(hMainThread);
- int I;
- for (I = 0; I < hHooks.GetSize(); I++)
- {
- if (hHooks[I])
- {
- UnhookEvent(hHooks[I]);
- }
- }
- for (I = 0; I < hServices.GetSize(); I++)
- {
- if (hServices[I])
- {
- DestroyServiceFunction(hServices[I]);
- }
- }
+ int i;
+ for (i = 0; i < hHooks.getCount(); i++)
+ UnhookEvent(hHooks[i]);
+
+ for (i = 0; i < hServices.getCount(); i++)
+ DestroyServiceFunction(hServices[i]);
+
return 0;
}
diff --git a/plugins/NewAwaySysMod/Common.h b/plugins/NewAwaySysMod/Common.h
index 4c769b4e24..5d687492fa 100644
--- a/plugins/NewAwaySysMod/Common.h
+++ b/plugins/NewAwaySysMod/Common.h
@@ -37,8 +37,7 @@
#include <crtdbg.h>
#include <tchar.h>
#include <stdarg.h>
-#include "AggressiveOptimize.h"
-#include "resource.h"
+
#include "newpluginapi.h"
#include "m_clist.h"
#include "m_system.h"
@@ -52,6 +51,7 @@
#include "m_plugins.h"
#include "m_awaymsg.h"
#include "m_utils.h"
+#include "m_system_cpp.h"
#include "m_history.h"
#include "m_message.h"
#include "m_userinfo.h"
@@ -60,6 +60,8 @@
#include "win2k.h"
#undef THEMEAPI
+#include "resource.h"
+
#include "m_variables.h"
//#include "m_toptoolbar.h"
#include "m_popup.h"
diff --git a/plugins/NewAwaySysMod/Services.cpp b/plugins/NewAwaySysMod/Services.cpp
index 0ff78c693d..c8108eb1a9 100644
--- a/plugins/NewAwaySysMod/Services.cpp
+++ b/plugins/NewAwaySysMod/Services.cpp
@@ -47,12 +47,12 @@ __inline void PSSetStatus(char *szProto, WORD Status, int bNoClistSetStatusMode
/* int ProtoCount;
PROTOCOLDESCRIPTOR **proto;
CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM)&ProtoCount, (LPARAM)&proto);
- int I;
- for (I = 0; I < ProtoCount; I++)
+ int i;
+ for (i = 0; i < ProtoCount; i++)
{
- if (proto[I]->type == PROTOTYPE_PROTOCOL)
+ if (proto[i]->type == PROTOTYPE_PROTOCOL)
{
- CallProtoService(proto[I]->szName, PS_SETSTATUS, Status, 0);
+ CallProtoService(proto[i]->szName, PS_SETSTATUS, Status, 0);
}
}*/
g_fNoProcessing = true;
@@ -68,9 +68,6 @@ INT_PTR GetStatusMsg(WPARAM wParam, LPARAM lParam) // called by GamerStatus and
// MS_AWAYMSG_GETSTATUSMSG "SRAway/GetStatusMessage"
{
LogMessage("MS_AWAYMSG_GETSTATUSMSG called. status=%d", wParam);
- struct MM_INTERFACE mm;
- mm.cbSize = sizeof(mm);
- CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM)&mm);
CString Msg(TCHAR2ANSI(GetDynamicStatMsg(INVALID_HANDLE_VALUE, NULL, 0, wParam)));
char *szMsg;
if (Msg == NULL)
@@ -78,7 +75,7 @@ INT_PTR GetStatusMsg(WPARAM wParam, LPARAM lParam) // called by GamerStatus and
szMsg = NULL;
} else
{
- szMsg = (char*)mm.mmi_malloc(Msg.GetLen() + 1);
+ szMsg = (char*)mir_alloc(Msg.GetLen() + 1);
lstrcpyA(szMsg, Msg);
}
LogMessage("returned szMsg:\n%s", szMsg ? szMsg : "NULL");
@@ -111,45 +108,33 @@ int GetState(WPARAM wParam, LPARAM lParam, int Widechar)
{
NAS_PROTOINFO *pi = (NAS_PROTOINFO*)wParam;
LogMessage("MS_NAS_GETSTATE called with %d items and Widechar=%d:", lParam, Widechar);
- struct MM_INTERFACE mm;
- mm.cbSize = sizeof(mm);
- CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM)&mm);
- int I;
- for (I = 0; I < lParam; I++)
+ for (int i = 0; i < lParam; i++)
{
if (pi->cbSize < sizeof(NAS_PROTOINFO) && pi->cbSize != sizeof(NAS_PROTOINFOv1))
- {
return 1;
- }
+
int Flags = (pi->cbSize > sizeof(NAS_PROTOINFOv1)) ? pi->Flags : 0;
- LogMessage("%d (received): cbSize=%d, status=%d, szProto=%s, Flags=0x%x", I + 1, pi->cbSize, pi->status, pi->szProto ? pi->szProto : "NULL", Flags);
+ LogMessage("%d (received): cbSize=%d, status=%d, szProto=%s, Flags=0x%x", i + 1, pi->cbSize, pi->status, pi->szProto ? pi->szProto : "NULL", Flags);
if ((pi->status >= ID_STATUS_ONLINE && pi->status <= ID_STATUS_OUTTOLUNCH) || !pi->status)
{
TCString Msg(pi->status ? CProtoSettings(pi->szProto, pi->status).GetMsgFormat(GMF_LASTORDEFAULT) : CProtoSettings(pi->szProto).GetMsgFormat(((Flags & PIF_NOTTEMPORARY) ? 0 : GMF_TEMPORARY) | GMF_PERSONAL));
if (Msg != NULL)
{
- pi->szMsg = (char*)mm.mmi_malloc(Msg.GetLen() + 1);
+ pi->szMsg = (char*)mir_alloc(Msg.GetLen() + 1);
_ASSERT(pi->szMsg);
if (Widechar)
- {
lstrcpyW(pi->wszMsg, TCHAR2WCHAR(Msg));
- } else
- {
+ else
lstrcpyA(pi->szMsg, TCHAR2ANSI(Msg));
- }
- } else
- {
- pi->szMsg = NULL;
}
+ else pi->szMsg = NULL;
+
if (!pi->status)
- {
pi->status = g_ProtoStates[pi->szProto].Status;
- }
- } else
- {
- pi->szMsg = NULL;
}
- LogMessage("%d (returned): status=%d, Flags=0x%x, szMsg:\n%s", I + 1, pi->status, (pi->cbSize > sizeof(NAS_PROTOINFOv1)) ? pi->Flags : 0, pi->szMsg ? (Widechar ? WCHAR2ANSI(pi->wszMsg) : pi->szMsg) : "NULL");
+ else pi->szMsg = NULL;
+
+ LogMessage("%d (returned): status=%d, Flags=0x%x, szMsg:\n%s", i + 1, pi->status, (pi->cbSize > sizeof(NAS_PROTOINFOv1)) ? pi->Flags : 0, pi->szMsg ? (Widechar ? WCHAR2ANSI(pi->wszMsg) : pi->szMsg) : "NULL");
*(char**)&pi += pi->cbSize;
}
return 0;
@@ -175,32 +160,24 @@ int SetState(WPARAM wParam, LPARAM lParam, int Widechar)
{
NAS_PROTOINFO *pi = (NAS_PROTOINFO*)wParam;
LogMessage("MS_NAS_SETSTATE called with %d items and Widechar=%d:", lParam, Widechar);
- struct MM_INTERFACE mm;
- mm.cbSize = sizeof(mm);
- CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM)&mm);
- int I;
- for (I = 0; I < lParam; I++)
+ for (int i = 0; i < lParam; i++)
{
_ASSERT(pi->szMsg != (char*)(-1));
if (pi->cbSize < sizeof(NAS_PROTOINFO) && pi->cbSize != sizeof(NAS_PROTOINFOv1))
- {
return 1;
- }
+
int Flags = (pi->cbSize > sizeof(NAS_PROTOINFOv1)) ? pi->Flags : 0;
- LogMessage("%d: cbSize=%d, status=%d, szProto=%s, Flags=0x%x, szMsg:\n%s", I + 1, pi->cbSize, pi->status, pi->szProto ? pi->szProto : "NULL", Flags, pi->szMsg ? (Widechar ? WCHAR2ANSI(pi->wszMsg) : pi->szMsg) : "NULL");
+ LogMessage("%d: cbSize=%d, status=%d, szProto=%s, Flags=0x%x, szMsg:\n%s", i + 1, pi->cbSize, pi->status, pi->szProto ? pi->szProto : "NULL", Flags, pi->szMsg ? (Widechar ? WCHAR2ANSI(pi->wszMsg) : pi->szMsg) : "NULL");
if (pi->status)
- {
PSSetStatus(pi->szProto, pi->status, Flags & PIF_NO_CLIST_SETSTATUSMODE);
- } else
- {
+ else
pi->status = g_ProtoStates[pi->szProto].Status;
- }
+
CProtoSettings(pi->szProto).SetMsgFormat((Flags & PIF_NOTTEMPORARY) ? SMF_PERSONAL : SMF_TEMPORARY, Widechar ? WCHAR2TCHAR(pi->wszMsg) : ANSI2TCHAR(pi->szMsg));
if (pi->szMsg || !(Flags & PIF_NO_CLIST_SETSTATUSMODE))
- {
ChangeProtoMessages(pi->szProto, pi->status, TCString());
- }
- mm.mmi_free(pi->szMsg);
+
+ mir_free(pi->szMsg);
pi->szMsg = (char*)(-1);
*(char**)&pi += pi->cbSize;
}
diff --git a/plugins/NewEventNotify/main.c b/plugins/NewEventNotify/main.c
index e355f7adce..1822c74828 100644
--- a/plugins/NewEventNotify/main.c
+++ b/plugins/NewEventNotify/main.c
@@ -51,7 +51,7 @@ extern PLUGIN_DATA* PopUpList[20];
HINSTANCE hInst;
PLUGIN_OPTIONS pluginOptions;
-PLUGINLINK *pluginLink;
+
int hLangpack;
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -216,11 +216,12 @@ __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-int __declspec(dllexport) Load(PLUGINLINK *link)
+int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
hHookedInit = HookEvent(ME_SYSTEM_MODULESLOADED, HookedInit);
- hHookedOpt = HookEvent(ME_OPT_INITIALISE, HookedOptions); mir_getLP(&pluginInfo);
+ hHookedOpt = HookEvent(ME_OPT_INITIALISE, HookedOptions);
+ mir_getLP(&pluginInfo);
InitI18N();
diff --git a/plugins/NewXstatusNotify/main.cpp b/plugins/NewXstatusNotify/main.cpp
index 2d336b291e..1500d75401 100644
--- a/plugins/NewXstatusNotify/main.cpp
+++ b/plugins/NewXstatusNotify/main.cpp
@@ -28,7 +28,7 @@
#include "xstatus.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
LIST<DBEVENT> eventList( 10 );
LIST<XSTATUSCHANGE> xstatusList( 10 );
@@ -1372,9 +1372,9 @@ int ModulesLoaded(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
//"Service" Hook, used when the DB settings change: we'll monitor the "status" setting.
diff --git a/plugins/Nudge/main.cpp b/plugins/Nudge/main.cpp
index dfac185e14..a66a7b0d5c 100644
--- a/plugins/Nudge/main.cpp
+++ b/plugins/Nudge/main.cpp
@@ -7,7 +7,7 @@
int nProtocol = 0;
static HANDLE g_hEventModulesLoaded = NULL, hEventOptionsInitialize = NULL, g_hIcon = NULL, g_hEventDbWindowEvent = NULL, g_hEventToolbarLoaded = NULL, g_hEventButtonPressed = NULL, g_hEventAccountsChanged = NULL;
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
NudgeElementList *NudgeList = NULL;
CNudgeElement DefaultNudge;
CShake shake;
@@ -493,9 +493,9 @@ int AccListChanged(WPARAM wParam,LPARAM lParam)
}
HANDLE hShakeClist=NULL,hShakeChat=NULL,hNudgeSend=NULL,hNudgeShowMenu=NULL;
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
g_hEventModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
diff --git a/plugins/PackUpdater/Src/PackUpdater.cpp b/plugins/PackUpdater/Src/PackUpdater.cpp
index 611ac05881..203f30d050 100644
--- a/plugins/PackUpdater/Src/PackUpdater.cpp
+++ b/plugins/PackUpdater/Src/PackUpdater.cpp
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.
#include "common.h"
HINSTANCE hInst = NULL;
-PLUGINLINK *pluginLink;
+
HANDLE hOptHook = NULL, hLoadHook = NULL, hPackUpdaterFolder = NULL, hCheckUpdates = NULL, hEmptyFolder = NULL, hOnPreShutdown = NULL;
TCHAR tszRoot[MAX_PATH] = {0};
int hLangpack;
@@ -51,10 +51,10 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
CLISTMENUITEM mi;
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
TCHAR* tszFolder = Utils_ReplaceVarsT(_T("%miranda_userdata%\\"DEFAULT_UPDATES_FOLDER));
lstrcpyn(tszRoot, tszFolder, SIZEOF(tszRoot));
diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp
index 7fecae0141..dd3c683c13 100644
--- a/plugins/Popup/src/config.cpp
+++ b/plugins/Popup/src/config.cpp
@@ -36,7 +36,7 @@ Last change by : $Author: Merlin_de $
HINSTANCE hInst;
HANDLE hMainThread;
//MNOTIFYLINK *notifyLink; //deprecatet
-PLUGINLINK *pluginLink;
+
HANDLE hSemaphore;
BOOL closing = FALSE;
MTEXT_INTERFACE MText = {0};
diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h
index 2f6a25d33e..315cf7f4e3 100644
--- a/plugins/Popup/src/config.h
+++ b/plugins/Popup/src/config.h
@@ -144,7 +144,6 @@ void LoadOptions();
//===== General Plugin =====
extern HINSTANCE hInst;
extern HANDLE hMainThread;
-extern PLUGINLINK *pluginLink;
extern HANDLE hSemaphore;
extern BOOL closing;
extern HANDLE folderId;
diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp
index acd94f3cdc..0e7218ed4e 100644
--- a/plugins/Popup/src/main.cpp
+++ b/plugins/Popup/src/main.cpp
@@ -489,10 +489,10 @@ static int OkToExit(WPARAM wParam, LPARAM lParam)
//===== Load =====
//Initializes the services provided and the link to those needed
//Called when the plugin is loaded into Miranda
-MIRAPI int Load(PLUGINLINK *link)
+MIRAPI int Load(void)
{
char ver[1024];
- pluginLink=link;
+
g_popup.isOsUnicode = (GetVersion() & 0x80000000) == 0;
diff --git a/plugins/ProfileManager/pmanagerEx.cpp b/plugins/ProfileManager/pmanagerEx.cpp
index 65b6b055cd..627b026b2d 100644
--- a/plugins/ProfileManager/pmanagerEx.cpp
+++ b/plugins/ProfileManager/pmanagerEx.cpp
@@ -20,7 +20,7 @@ There is no warranty.
#include "resource.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
TCHAR fn[MAX_PATH];
TCHAR lmn[MAX_PATH];
TCHAR* pathn;
@@ -71,10 +71,10 @@ static INT_PTR LoadPM(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
CLISTMENUITEM mi;
- pluginLink = link;
+
mir_getLP(&pluginInfo);
hLoadPM = CreateServiceFunction("Database/LoadPM", LoadPM);
diff --git a/plugins/QuickMessages/main.cpp b/plugins/QuickMessages/main.cpp
index da0171a8f2..536512c8ea 100644
--- a/plugins/QuickMessages/main.cpp
+++ b/plugins/QuickMessages/main.cpp
@@ -34,7 +34,7 @@ BOOL g_bRClickAuto=0;
BOOL g_bLClickAuto=0;
BOOL g_bQuickMenu=0;
-PLUGINLINK *pluginLink;
+
int hLangpack;
PLUGININFOEX pluginInfo = {
@@ -368,10 +368,10 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
return 1;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink=link;
+
mir_getLP(&pluginInfo);
hEventDbPluginsLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,PluginInit);
diff --git a/plugins/QuickReplies/quickreplies.cpp b/plugins/QuickReplies/quickreplies.cpp
index 82d2ee38ac..af850c4b82 100644
--- a/plugins/QuickReplies/quickreplies.cpp
+++ b/plugins/QuickReplies/quickreplies.cpp
@@ -20,7 +20,6 @@ Boston, MA 02111-1307, USA.
#include "common.h"
HINSTANCE hInstance = NULL;
-PLUGINLINK *pluginLink;
int hLangpack;
HANDLE hOnModulesLoaded;
@@ -53,10 +52,11 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK* link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
- mir_getLP(&pluginInfoEx);
+
+ mir_getLP(&pluginInfoEx);
+
hOnModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
hOnPreShutdown = HookEvent(ME_SYSTEM_PRESHUTDOWN, OnPreShutdown);
diff --git a/plugins/Rate/main.cpp b/plugins/Rate/main.cpp
index be4aae14ed..760d324b84 100644
--- a/plugins/Rate/main.cpp
+++ b/plugins/Rate/main.cpp
@@ -43,7 +43,7 @@
#include "commonheaders.h"
HINSTANCE g_hInst;
-PLUGINLINK *pluginLink;
+
static HANDLE hHookModulesLoaded = NULL, hSystemOKToExit = NULL, hOptInitialise = NULL, hIcoLibIconsChanged = NULL;
static HANDLE hHookExtraIconsRebuild = NULL, hHookExtraIconsApply = NULL, hContactSettingChanged = NULL;
static HANDLE hPrebuildContactMenu = NULL;
@@ -261,10 +261,11 @@ int onContactSettingChanged(WPARAM wParam,LPARAM lParam)
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink=link;
- mir_getLP(&pluginInfo);
+
+ mir_getLP(&pluginInfo);
+
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, onModulesLoaded);
hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit);
hContactSettingChanged = HookEvent(ME_DB_CONTACT_SETTINGCHANGED, onContactSettingChanged);
diff --git a/plugins/RecentContacts/RecentContacts.cpp b/plugins/RecentContacts/RecentContacts.cpp
index 08bd2d5566..ccea08b33b 100644
--- a/plugins/RecentContacts/RecentContacts.cpp
+++ b/plugins/RecentContacts/RecentContacts.cpp
@@ -8,7 +8,6 @@ static const basic_string <char>::size_type npos = -1;
char *szProto;
HINSTANCE hInst = NULL;
-PLUGINLINK *pluginLink = NULL;
int hLangpack = 0;
@@ -634,10 +633,11 @@ INT_PTR ToggleIgnore (WPARAM wParam, LPARAM lParam)
/////////////////////////////////////////////////////////////////////////////////////////
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
- mir_getLP( &pluginInfo );
+
+ mir_getLP( &pluginInfo );
+
CoInitialize(NULL);
hWindowList = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
diff --git a/plugins/SRMM/srmm.cpp b/plugins/SRMM/srmm.cpp
index fc89f36dd9..9fa71527ff 100644
--- a/plugins/SRMM/srmm.cpp
+++ b/plugins/SRMM/srmm.cpp
@@ -23,8 +23,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int LoadSendRecvMessageModule(void);
int SplitmsgShutdown(void);
-PLUGINLINK* pluginLink;
-HINSTANCE g_hInst;
+HINSTANCE g_hInst;
int hLangpack;
TIME_API tmi;
@@ -60,9 +59,9 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getTMI(&tmi);
mir_getLP(&pluginInfo);
diff --git a/plugins/Scriver/srmm.cpp b/plugins/Scriver/srmm.cpp
index d0547d1ad6..ef02512975 100644
--- a/plugins/Scriver/srmm.cpp
+++ b/plugins/Scriver/srmm.cpp
@@ -27,7 +27,7 @@ int OnUnloadModule(void);
TIME_API tmi;
-PLUGINLINK *pluginLink;
+
HINSTANCE g_hInst;
int hLangpack;
@@ -64,9 +64,9 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
// set the memory manager
mir_getTMI(&tmi);
diff --git a/plugins/SecureIM/commonheaders.h b/plugins/SecureIM/commonheaders.h
index 28d2c19354..c654b9e2b6 100644
--- a/plugins/SecureIM/commonheaders.h
+++ b/plugins/SecureIM/commonheaders.h
@@ -143,7 +143,7 @@ extern MUUID interfaces[];
extern "C" {
- DLLEXPORT int Load(PLUGINLINK *);
+ DLLEXPORT int Load(void);
DLLEXPORT PLUGININFOEX *MirandaPluginInfoEx(DWORD);
DLLEXPORT MUUID* MirandaPluginInterfaces(void);
DLLEXPORT int Unload();
diff --git a/plugins/SecureIM/main.cpp b/plugins/SecureIM/main.cpp
index 461d903bd0..7fe9483c11 100644
--- a/plugins/SecureIM/main.cpp
+++ b/plugins/SecureIM/main.cpp
@@ -1,6 +1,6 @@
#include "commonheaders.h"
-PLUGINLINK *pluginLink;
+
int hLangpack = 0;
extern "C" BOOL APIENTRY DllMain(HINSTANCE hInst, DWORD dwReason, LPVOID) {
@@ -79,9 +79,9 @@ HANDLE AddSubItem(HANDLE rootid,LPCSTR name,int pos,int poppos,LPCSTR service,WP
}
-int __cdecl Load(PLUGINLINK *link) {
+int __cdecl Load(void) {
+
- pluginLink = link;
DisableThreadLibraryCalls(g_hInst);
InitializeCriticalSection(&localQueueMutex);
diff --git a/plugins/SeenPlugin/main.cpp b/plugins/SeenPlugin/main.cpp
index 16001e19ac..6acf22cff0 100644
--- a/plugins/SeenPlugin/main.cpp
+++ b/plugins/SeenPlugin/main.cpp
@@ -26,7 +26,7 @@ Last change by : $Author: y_b $
HINSTANCE hInstance;
HANDLE ehdb = NULL, ehproto = NULL, ehmissed = NULL, ehuserinfo = NULL, ehmissed_proto = NULL, hOptInit = NULL, hMainInit = NULL;
-PLUGINLINK *pluginLink;
+
int hLangpack;
PLUGININFOEX pluginInfo={
@@ -123,9 +123,9 @@ BOOL WINAPI DllMain(HINSTANCE hinst, DWORD fdwReason, LPVOID lpvReserved)
return 1;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink=link;
+
mir_getLP(&pluginInfo);
// this isn't required for most events
// but the ME_USERINFO_INITIALISE
diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp
index fc11631847..8d236072ab 100644
--- a/plugins/Sessions/Src/Main.cpp
+++ b/plugins/Sessions/Src/Main.cpp
@@ -57,7 +57,7 @@ DWORD session_list_recovered[255];
int count = 0;
unsigned int ses_count = 0;
-PLUGINLINK *pluginLink;
+
int hLangpack;
int OptionsInit(WPARAM,LPARAM);
@@ -1066,9 +1066,9 @@ BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved)
return 1;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink=link;
+
mir_getLP(&pluginInfo);
hEventDbPluginsLoaded=HookEvent(ME_SYSTEM_MODULESLOADED,PluginInit);
diff --git a/plugins/SimpleAR/Src/Main.cpp b/plugins/SimpleAR/Src/Main.cpp
index 4491918d58..8ec4bc4550 100644
--- a/plugins/SimpleAR/Src/Main.cpp
+++ b/plugins/SimpleAR/Src/Main.cpp
@@ -17,7 +17,7 @@ Copyright (C) 2000-2 Richard Hughes, Roland Rabien & Tristan Van de Vreede
#include "Common.h"
HINSTANCE hinstance;
-PLUGINLINK *pluginLink;
+
HANDLE hPreBuildHook = NULL, hAddEventHook = NULL, hOptHook = NULL, hCheckDefHook = NULL, hOnPreShutdown = NULL, hToggleEnable = NULL, hToggleAutoanswer = NULL;
HANDLE hToggle = NULL, hEnableMenu = NULL;
CLISTMENUITEM mi;
@@ -313,9 +313,9 @@ INT OnPreShutdown(WPARAM wParam, LPARAM lParam)
return 0;
}
-extern "C" int __declspec(dllexport)Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport)Load(void)
{
- pluginLink=link;
+
mir_getLP(&pluginInfoEx);
hToggleEnable = CreateServiceFunction(protocolname"/ToggleEnable", ToggleEnable);
diff --git a/plugins/SimpleStatusMsg/main.cpp b/plugins/SimpleStatusMsg/main.cpp
index 4ed01bfeb0..07b8029842 100644
--- a/plugins/SimpleStatusMsg/main.cpp
+++ b/plugins/SimpleStatusMsg/main.cpp
@@ -22,7 +22,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#include <io.h>
HINSTANCE g_hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack;
PROTOACCOUNTS *accounts;
@@ -2161,9 +2161,9 @@ static INT_PTR sttGetAwayMessage(WPARAM wParam, LPARAM lParam)
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
hwndSAMsgDialog = NULL;
accounts = (PROTOACCOUNTS *)mir_alloc(sizeof(PROTOACCOUNTS));
diff --git a/plugins/SmileyAdd/main.cpp b/plugins/SmileyAdd/main.cpp
index 8c041ea78b..011bfbebeb 100644
--- a/plugins/SmileyAdd/main.cpp
+++ b/plugins/SmileyAdd/main.cpp
@@ -34,7 +34,7 @@ extern LIST<void> menuHandleArray;
char* metaProtoName;
-PLUGINLINK *pluginLink;
+
//static globals
static HANDLE hHooks[7];
@@ -117,9 +117,9 @@ static int MirandaShutdown(WPARAM, LPARAM)
return 0;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
if (ServiceExists(MS_SMILEYADD_REPLACESMILEYS))
diff --git a/plugins/SmileyAdd/smileys.cpp b/plugins/SmileyAdd/smileys.cpp
index f94eb70580..2f16cee51e 100644
--- a/plugins/SmileyAdd/smileys.cpp
+++ b/plugins/SmileyAdd/smileys.cpp
@@ -795,9 +795,7 @@ void SmileyCategoryListType::ClearAndLoadAll(void)
m_pSmileyPackStore->ClearAndFreeAll();
for (int i = 0; i < m_SmileyCategories.getCount(); i++)
- {
m_SmileyCategories[i].Load();
- }
}
@@ -847,9 +845,7 @@ void SmileyCategoryListType::AddAndLoad(const bkstring& name, const bkstring& di
AddCategory(name, displayName, smcExt);
// Load only if other smileys have been loaded already
if (m_SmileyCategories.getCount() > 1)
- {
m_SmileyCategories[m_SmileyCategories.getCount()-1].Load();
- }
}
diff --git a/plugins/SpellChecker/spellchecker.cpp b/plugins/SpellChecker/spellchecker.cpp
index c1f246337e..70154652c0 100644
--- a/plugins/SpellChecker/spellchecker.cpp
+++ b/plugins/SpellChecker/spellchecker.cpp
@@ -58,7 +58,7 @@ static IconStruct iconList[] =
#define HOTKEY_ACTION_TOGGLE 1
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack = 0;
HANDLE hHooks[6];
@@ -153,9 +153,9 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
// hooks
diff --git a/plugins/SplashScreen/src/main.cpp b/plugins/SplashScreen/src/main.cpp
index d2024b8606..2726801b12 100644
--- a/plugins/SplashScreen/src/main.cpp
+++ b/plugins/SplashScreen/src/main.cpp
@@ -26,7 +26,7 @@
#include "headers.h"
HINSTANCE hInst = 0;
-PLUGINLINK *pluginLink;
+
int hLangpack;
static HMODULE hUserDll = NULL;
@@ -392,10 +392,11 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
- mir_getLP(&pluginInfo);
+
+ mir_getLP(&pluginInfo);
+
hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
hSystemOKToExit = HookEvent(ME_SYSTEM_OKTOEXIT,onSystemOKToExit);
diff --git a/plugins/StatusPlugins/AdvancedAutoAway/main.cpp b/plugins/StatusPlugins/AdvancedAutoAway/main.cpp
index cc2887ce96..f2e357e853 100644
--- a/plugins/StatusPlugins/AdvancedAutoAway/main.cpp
+++ b/plugins/StatusPlugins/AdvancedAutoAway/main.cpp
@@ -28,7 +28,7 @@
#define MIID_ADVAUTOAWAY { 0xf0fdf73a, 0x753d, 0x499d, { 0x8d, 0xba, 0x33, 0x6d, 0xb7, 0x9c, 0xdd, 0x41 } }
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
HANDLE hCSModuleLoadedHook;
@@ -71,9 +71,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
// plugin's entry point
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP( &pluginInfoEx );
InitCommonStatus();
diff --git a/plugins/StatusPlugins/KeepStatus/main.cpp b/plugins/StatusPlugins/KeepStatus/main.cpp
index af840be01d..4cd57cbd31 100644
--- a/plugins/StatusPlugins/KeepStatus/main.cpp
+++ b/plugins/StatusPlugins/KeepStatus/main.cpp
@@ -32,7 +32,7 @@ HANDLE hStopRecon = NULL, hEnableProto = NULL, hIsProtoEnabled = NULL, hAnnounce
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
/////////////////////////////////////////////////////////////////////////////////////////
// dll entry point
@@ -78,9 +78,9 @@ INT_PTR EnableProtocolService(WPARAM wParam, LPARAM lParam);
INT_PTR IsProtocolEnabledService(WPARAM wParam, LPARAM lParam);
INT_PTR AnnounceStatusChangeService(WPARAM wParam, LPARAM lParam);
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP( &pluginInfoEx );
InitCommonStatus();
diff --git a/plugins/StatusPlugins/StartupStatus/main.cpp b/plugins/StatusPlugins/StartupStatus/main.cpp
index ece3eef5c9..3e2e9fdeb4 100644
--- a/plugins/StatusPlugins/StartupStatus/main.cpp
+++ b/plugins/StatusPlugins/StartupStatus/main.cpp
@@ -29,7 +29,7 @@ static HANDLE
hGetProfileNameService;
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack = 0;
@@ -73,9 +73,9 @@ static INT_PTR SrvGetProfile( WPARAM wParam, LPARAM lParam )
{ return GetProfile(( int )wParam, *(TSettingsList*)lParam );
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP( &pluginInfoEx );
if ( DBGetContactSettingByte(NULL, MODULENAME, SETTING_SETPROFILE, 1) ||
diff --git a/plugins/StopSpamPlus/src/stopspam.cpp b/plugins/StopSpamPlus/src/stopspam.cpp
index bf91c6b222..6b4f827e16 100644
--- a/plugins/StopSpamPlus/src/stopspam.cpp
+++ b/plugins/StopSpamPlus/src/stopspam.cpp
@@ -23,7 +23,7 @@ PLUGININFOEX pluginInfoEx = {
MIID_STOPSPAM
};
-PLUGINLINK *pluginLink;
+
HINSTANCE hInst;
_inline unsigned int MakeVer(int a,int b,int c,int d)
@@ -42,11 +42,12 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
return TRUE;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
CLISTMENUITEM mi;
- pluginLink = link;
- mir_getLP(&pluginInfoEx);
+
+ mir_getLP(&pluginInfoEx);
+
plSets=new Settings;
hFunc = CreateServiceFunction(MS_STOPSPAM_CONTACTPASSED, IsContactPassed);
diff --git a/plugins/Svc_crshdmp/crshdmp.cpp b/plugins/Svc_crshdmp/crshdmp.cpp
index 13cb675699..91a245d972 100644
--- a/plugins/Svc_crshdmp/crshdmp.cpp
+++ b/plugins/Svc_crshdmp/crshdmp.cpp
@@ -75,7 +75,7 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-PLUGINLINK *pluginLink;
+
HANDLE hHooks[5];
HANDLE hServices[6];
@@ -389,9 +389,9 @@ static int PreShutdown(WPARAM, LPARAM)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
clsdates = DBGetContactSettingByte(NULL, PluginName, "ClassicDates", 1) != 0;
diff --git a/plugins/Svc_dbepp/main.cpp b/plugins/Svc_dbepp/main.cpp
index 2207bbe934..3356556b23 100644
--- a/plugins/Svc_dbepp/main.cpp
+++ b/plugins/Svc_dbepp/main.cpp
@@ -3,7 +3,7 @@
// {A8A417EF-07AA-4f37-869F-7BFD74886534}
#define MIID_DBEDITOR {0xa8a417ef, 0x7aa, 0x4f37, { 0x86, 0x9f, 0x7b, 0xfd, 0x74, 0x88, 0x65, 0x34}}
-PLUGINLINK *pluginLink;
+
HINSTANCE hInst = NULL;
HANDLE hTTBButt = NULL;
@@ -292,9 +292,9 @@ INT_PTR ImportFromFile(WPARAM wParam,LPARAM lParam)
return 0;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
hwnd2mainWindow = 0;
diff --git a/plugins/Svc_vi/main.cpp b/plugins/Svc_vi/main.cpp
index b237142329..c378d56106 100644
--- a/plugins/Svc_vi/main.cpp
+++ b/plugins/Svc_vi/main.cpp
@@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "CVersionInfo.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack;
HICON hiVIIcon;
@@ -84,10 +84,11 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink=link;
- mir_getLP(&pluginInfo);
+
+ mir_getLP(&pluginInfo);
+
InitServices();
HookEvents();
diff --git a/plugins/TabSRMM/chat/main.cpp b/plugins/TabSRMM/chat/main.cpp
index 45b0717f29..b4d40e20ef 100644
--- a/plugins/TabSRMM/chat/main.cpp
+++ b/plugins/TabSRMM/chat/main.cpp
@@ -54,7 +54,7 @@ char *pszActiveWndModule = 0;
* load the group chat module
*/
-int Chat_Load(PLUGINLINK *link)
+int Chat_Load()
{
if(M->GetByte("forceDisableMUC", 0)) {
PluginConfig.m_chat_enabled = false;
diff --git a/plugins/TabSRMM/include/themes.h b/plugins/TabSRMM/include/themes.h
index a714f4040d..38c46e07e3 100644
--- a/plugins/TabSRMM/include/themes.h
+++ b/plugins/TabSRMM/include/themes.h
@@ -263,7 +263,7 @@ public:
}
void Init(bool fStartup = false);
- void Load();
+ void Load(void);
void Unload();
void UnloadAeroTabs();
void setFileName();
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index 6aefbcf8bc..0b72e80ccf 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -37,10 +37,10 @@
extern int LoadSendRecvMessageModule(void);
extern int SplitmsgShutdown(void);
extern void LogErrorMessage(HWND hwndDlg, struct TWindowData *dat, int i, TCHAR *szMsg);
-extern int Chat_Load(PLUGINLINK *link), Chat_Unload();
+extern int Chat_Load(), Chat_Unload();
extern void FreeLogFonts();
-PLUGINLINK *pluginLink;
+
HINSTANCE g_hInst;
LOGFONT lfDefault = {0};
@@ -87,14 +87,14 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK * link)
+extern "C" int __declspec(dllexport) Load(void)
{
if (WinVerMajor() < 5) {
MessageBox(0, _T("This version of tabSRMM requires Windows 2000 or later."), _T("tabSRMM"), MB_OK | MB_ICONERROR);
return 1;
}
- pluginLink = link;
+
mir_getTMI(&tmi);
mir_getLP(&pluginInfo);
@@ -102,7 +102,7 @@ extern "C" int __declspec(dllexport) Load(PLUGINLINK * link)
SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(lfDefault), &lfDefault, FALSE);
- Chat_Load(pluginLink);
+ Chat_Load();
return LoadSendRecvMessageModule();
}
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index dd475d1a19..6ad5700dd0 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -1632,7 +1632,7 @@ create_it:
* it calls ReadItems() to read additional skin information like image items,
* buttons and icons.
*/
-void CSkin::Load()
+void CSkin::Load(void)
{
if(warnToClose() == false)
return;
diff --git a/plugins/TipperYM/common.h b/plugins/TipperYM/common.h
index 317796ed7f..01f2393487 100644
--- a/plugins/TipperYM/common.h
+++ b/plugins/TipperYM/common.h
@@ -94,7 +94,6 @@ Boston, MA 02111-1307, USA.
#define DEFAULT_SKIN_FOLDER "Skins\\Tipper"
extern HMODULE hInst;
-extern PLUGINLINK *pluginLink;
extern HFONT hFontTitle, hFontLabels, hFontValues, hFontTrayTitle;
extern COLORREF colTitle, colLabels, colBg, colValues;
diff --git a/plugins/TipperYM/tipper.cpp b/plugins/TipperYM/tipper.cpp
index 788836da85..a9427fd24a 100644
--- a/plugins/TipperYM/tipper.cpp
+++ b/plugins/TipperYM/tipper.cpp
@@ -27,7 +27,7 @@ Boston, MA 02111-1307, USA.
#include "str_utils.h"
HMODULE hInst;
-PLUGINLINK *pluginLink;
+
char szMetaModuleName[256] = {0};
FontIDT fontTitle, fontLabels, fontValues, fontTrayTitle;
@@ -341,9 +341,9 @@ int Shutdown(WPARAM wParam, LPARAM lParam)
HANDLE hEventPreShutdown, hEventModulesLoaded;
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
CallService(MS_IMG_GETINTERFACE, FI_IF_VERSION, (LPARAM)&fii);
mir_getTMI(&tmi);
diff --git a/plugins/TooltipNotify/src/main.cpp b/plugins/TooltipNotify/src/main.cpp
index a634a012ae..a554819998 100644
--- a/plugins/TooltipNotify/src/main.cpp
+++ b/plugins/TooltipNotify/src/main.cpp
@@ -20,10 +20,6 @@ static int ContactSettingChanged(WPARAM wParam,LPARAM lParam);
static int ProtoAck(WPARAM,LPARAM);
static int ProtoContactIsTyping(WPARAM wParam,LPARAM lParam);
-
-// Globals
-PLUGINLINK *pluginLink; // cannot be static since it is used for mim service calls
-
static HANDLE g_hContactSettingChanged = 0;
static HANDLE g_hOptionsInitialize = 0;
static HANDLE g_hModulesLoaded = 0;
@@ -94,20 +90,16 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &sPluginInfo;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *pLink)
+extern "C" int __declspec(dllexport) Load(void)
{
-
if (!g_bRightModule) return 0;
-
- pluginLink = pLink;
mir_getLP(&sPluginInfo);
g_pTooltipNotify = new CTooltipNotify(g_hInstDLL);
assert(g_pTooltipNotify!=0);
g_hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, ModulesLoaded);
-
return 0;
}
diff --git a/plugins/TopToolBar/main.cpp b/plugins/TopToolBar/main.cpp
index 91b41be6cc..b806c2858c 100644
--- a/plugins/TopToolBar/main.cpp
+++ b/plugins/TopToolBar/main.cpp
@@ -3,7 +3,7 @@
#include "version.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
HANDLE hHookTTBModuleLoaded;
int hLangpack;
@@ -41,9 +41,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
LoadToolbarModule();
diff --git a/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp b/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp
index f401467bce..b97a73dd81 100644
--- a/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp
+++ b/plugins/TranslitSwitcher/Src/TranslitSwitcher.cpp
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.
#include "TranslitSwitcher.h"
HINSTANCE hInst = NULL;
-PLUGINLINK *pluginLink;
+
HANDLE hOnButtonPressed;
int hLangpack;
@@ -183,9 +183,9 @@ int OnModulesLoaded(WPARAM wParam, LPARAM lParam)
//-------------------------------------------------------------------------------------------------------
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
hHook = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/plugins/Updater/common.h b/plugins/Updater/common.h
index 4b7c930bc2..9d98fef1ec 100644
--- a/plugins/Updater/common.h
+++ b/plugins/Updater/common.h
@@ -113,7 +113,6 @@ typedef OBJLIST<FileNameStruct> FilenameMap;
#define MODULE "Updater"
extern HINSTANCE hInst;
-extern PLUGINLINK *pluginLink;
extern PLUGININFOEX pluginInfo;
extern bool is_idle;
diff --git a/plugins/Updater/updater.cpp b/plugins/Updater/updater.cpp
index fc45f42ab2..906296713b 100644
--- a/plugins/Updater/updater.cpp
+++ b/plugins/Updater/updater.cpp
@@ -5,7 +5,7 @@
#include "m_toolbar.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
HANDLE hNetlibUser, hNetlibHttp;
HANDLE hEventOptInit, hEventModulesLoaded, hEventIdleChanged, hToolBarLoaded;
@@ -211,9 +211,9 @@ static int ToolbarModulesLoaded(WPARAM, LPARAM)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
// save global status from clist - will be restored after update check if that option is enabled, or in modules loaded if not
diff --git a/plugins/UserGuide/main.cpp b/plugins/UserGuide/main.cpp
index 3c560ae61c..3cb391cee1 100644
--- a/plugins/UserGuide/main.cpp
+++ b/plugins/UserGuide/main.cpp
@@ -1,7 +1,7 @@
#include "commonheaders.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
HANDLE hModulesLoaded, hShowGuide;
int hLangpack;
@@ -110,9 +110,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfo;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
return 0;
diff --git a/plugins/UserInfoEx/ex_import/tinyxml.h b/plugins/UserInfoEx/ex_import/tinyxml.h
index b8246f4953..34e1c25517 100644
--- a/plugins/UserInfoEx/ex_import/tinyxml.h
+++ b/plugins/UserInfoEx/ex_import/tinyxml.h
@@ -209,7 +209,7 @@ public:
1,1). If the returns values are 0 or less, then the parser does not have
a row and column value.
- Generally, the row and column value will be set when the TiXmlDocument::Load(),
+ Generally, the row and column value will be set when the TiXmlDocument::Load(void),
TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set
when the DOM was created from operator>>.
diff --git a/plugins/UserInfoEx/init.cpp b/plugins/UserInfoEx/init.cpp
index d1a1a47bcc..b7a757be19 100644
--- a/plugins/UserInfoEx/init.cpp
+++ b/plugins/UserInfoEx/init.cpp
@@ -72,7 +72,6 @@ static HANDLE ghModernToolBarLoaded = NULL;
static HANDLE ghShutdownHook = NULL;
static HANDLE ghPrebuildStatusMenu = NULL;
int hLangpack;
-PLUGINLINK* pluginLink = NULL;
/*
============================================================================================
@@ -293,13 +292,13 @@ extern "C" INT __declspec(dllexport) Unload(VOID)
*
* @return 0
**/
-extern "C" INT __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" INT __declspec(dllexport) Load(void)
{
INITCOMMONCONTROLSEX ccEx;
- pluginLink = link;
+
mir_getLP(&pluginInfo);
- if (link && CoreCheck())
+ if (CoreCheck())
{
// init common controls
ccEx.dwSize = sizeof(ccEx);
diff --git a/plugins/Variables/main.cpp b/plugins/Variables/main.cpp
index 6db64cf7ef..880d5e8cd6 100644
--- a/plugins/Variables/main.cpp
+++ b/plugins/Variables/main.cpp
@@ -20,7 +20,7 @@
#include "buildnumber.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
DWORD g_mirandaVersion;
int hLangpack = 0;
@@ -78,9 +78,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
/////////////////////////////////////////////////////////////////////////////////////////
// Load - plugin's entry point
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
if (UnicodeCheck(pluginInfoEx.shortName, FALSE))
return 0;
mir_getLP( &pluginInfoEx );
diff --git a/plugins/W7UI/jumplistbuilder.h b/plugins/W7UI/jumplistbuilder.h
index f0e1cbd438..6a0bde2fd4 100644
--- a/plugins/W7UI/jumplistbuilder.h
+++ b/plugins/W7UI/jumplistbuilder.h
@@ -4,7 +4,7 @@
class CJumpListBuilder
{
public:
- static void Load()
+ static void Load(void)
{
m_instance = new CJumpListBuilder;
}
diff --git a/plugins/W7UI/main.cpp b/plugins/W7UI/main.cpp
index b26124db71..7f48f93070 100644
--- a/plugins/W7UI/main.cpp
+++ b/plugins/W7UI/main.cpp
@@ -26,10 +26,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
int LoadW7UI();
int UnloadW7UI();
-PLUGINLINK* pluginLink;
-HINSTANCE g_hInst;
-
-int hLangpack;
+HINSTANCE g_hInst;
+int hLangpack;
// {3625ACB8-794C-4727-88EA-76DBBAC6D200}
#define MIID_W7UI { 0x3625acb8, 0x794c, 0x4727, { 0x88, 0xea, 0x76, 0xdb, 0xba, 0xc6, 0xd2, 0x0 } }
@@ -67,11 +65,11 @@ extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK * link)
+extern "C" __declspec(dllexport) int Load(void)
{
if (!IsWinVer7Plus()) return 1;
- pluginLink = link;
+
mir_getLP(&pluginInfo);
LoadW7UI();
diff --git a/plugins/WhenWasIt/WhenWasIt.cpp b/plugins/WhenWasIt/WhenWasIt.cpp
index a10b342289..1f30d31cfe 100644
--- a/plugins/WhenWasIt/WhenWasIt.cpp
+++ b/plugins/WhenWasIt/WhenWasIt.cpp
@@ -29,7 +29,7 @@ int hLangpack;
CommonData commonData = {0};
-PLUGINLINK *pluginLink;
+
PLUGININFOEX pluginInfo = {
sizeof(PLUGININFOEX),
@@ -61,10 +61,10 @@ extern "C" __declspec(dllexport) const MUUID *MirandaPluginInterfaces()
#include <commctrl.h>
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
Log("%s", "Entering function " __FUNCTION__);
- pluginLink = link;
+
mir_getLP(&pluginInfo);
INITCOMMONCONTROLSEX icex;
diff --git a/plugins/YAPP/common.h b/plugins/YAPP/common.h
index 51d5b1cd41..9625c55bb3 100644
--- a/plugins/YAPP/common.h
+++ b/plugins/YAPP/common.h
@@ -60,7 +60,6 @@
#define MODULE "YAPP"
extern HMODULE hInst;
-extern PLUGINLINK *pluginLink;
extern HFONT hFontFirstLine, hFontSecondLine, hFontTime;
extern COLORREF colFirstLine, colSecondLine, colBg, colTime, colBorder, colSidebar, colTitleUnderline;
diff --git a/plugins/YAPP/popups2.cpp b/plugins/YAPP/popups2.cpp
index d57a3ace9b..c4630f8984 100644
--- a/plugins/YAPP/popups2.cpp
+++ b/plugins/YAPP/popups2.cpp
@@ -43,7 +43,7 @@ PLUGININFOEX pluginInfo={
{ 0xefd15f16, 0x7ae4, 0x40d7, { 0xa8, 0xe3, 0xa4, 0x11, 0xed, 0x74, 0x7b, 0xd5 } } // {EFD15F16-7AE4-40d7-A8E3-A411ED747BD5}
};
-PLUGINLINK *pluginLink;
+
extern "C" BOOL APIENTRY DllMain( HMODULE hModule, DWORD ul_reason_for_call, LPVOID lpReserved)
@@ -228,8 +228,8 @@ int PreShutdown(WPARAM wParam, LPARAM lParam) {
HANDLE hEventPreShutdown, hEventModulesLoaded;
-extern "C" int POPUPS2_API Load(PLUGINLINK *link) {
- pluginLink = link;
+extern "C" int POPUPS2_API Load(void) {
+
mir_getLP(&pluginInfo);
InitMessagePump();
diff --git a/plugins/ZeroNotification/main.cpp b/plugins/ZeroNotification/main.cpp
index 8dbda00eb2..63e6ddf92c 100644
--- a/plugins/ZeroNotification/main.cpp
+++ b/plugins/ZeroNotification/main.cpp
@@ -14,7 +14,7 @@ http://www.miranda-im.org/
#include "res\resource.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
static HANDLE hEventSoundSettingChange, hEventStatusModeChange, hEventOptionsInitialize, hAckEvent, hSoundMenu;
CLISTMENUITEM mi;
HGENMENU noSoundMenu;
@@ -241,9 +241,9 @@ static INT_PTR NoSoundMenuCommand(WPARAM wParam,LPARAM lParam)
return 0;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
//The menu item - begin
diff --git a/plugins/mTextControl/src/main.cpp b/plugins/mTextControl/src/main.cpp
index 2add659e34..17a500ca0e 100644
--- a/plugins/mTextControl/src/main.cpp
+++ b/plugins/mTextControl/src/main.cpp
@@ -31,7 +31,6 @@ Last change by : $Author: Merlin_de $
#include "headers.h"
HINSTANCE hInst = 0;
-PLUGINLINK *pluginLink = 0;
int hLangpack;
HMODULE hMsfteditDll = 0;
@@ -66,9 +65,9 @@ extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD miranda
return &pluginInfoEx;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
//6.0A SDK is missing RichEd20.lib for x64
diff --git a/plugins/mTextControl/src/services.cpp b/plugins/mTextControl/src/services.cpp
index 3d2a9c0bee..33a92cb9a1 100644
--- a/plugins/mTextControl/src/services.cpp
+++ b/plugins/mTextControl/src/services.cpp
@@ -89,7 +89,7 @@ void MText_InitFormatting1(TextObject *text) {
// thus enabling devs to fully utilize the mtextcontrol API.
// All functions will be exported as miranda services for compatibility.
//
-// the interface is populated during the Load(PLUGINLINK *link) handler, so you can assume it is ready when Miranda
+// the interface is populated during the Load(void) handler, so you can assume it is ready when Miranda
// throw the ME_SYSTEM_MODULESLOADED event and you can generate a warning in your ModulesLoaded() when
// it depends on the mtextcontrol interface and the mtextcontrol plugin is missing.
//
diff --git a/plugins/testplugin/testplug.c b/plugins/testplugin/testplug.c
index d5bc9665d8..dbdd08492c 100644
--- a/plugins/testplugin/testplug.c
+++ b/plugins/testplugin/testplug.c
@@ -13,7 +13,6 @@ There is no warranty.
#include <m_skin.h>
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
@@ -59,7 +58,6 @@ int __declspec(dllexport) Load(PLUGINLINK *link)
{
CLISTMENUITEM mi;
- pluginLink=link;
CreateServiceFunction("TestPlug/MenuCommand",PluginMenuCommand);
ZeroMemory(&mi,sizeof(mi));
mi.cbSize=sizeof(mi);
diff --git a/protocols/AimOscar/aim.cpp b/protocols/AimOscar/aim.cpp
index 655fd0e42c..857d8481be 100644
--- a/protocols/AimOscar/aim.cpp
+++ b/protocols/AimOscar/aim.cpp
@@ -21,7 +21,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
char AIM_CAP_MIRANDA[16] = "MirandaA";
-PLUGINLINK *pluginLink;
+
int hLangpack;
HINSTANCE hInstance;
@@ -108,9 +108,9 @@ static int protoUninit(PROTO_INTERFACE* ppro)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
hMooduleLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
diff --git a/protocols/FacebookRM/main.cpp b/protocols/FacebookRM/main.cpp
index e287712d0c..0aca6c6a40 100644
--- a/protocols/FacebookRM/main.cpp
+++ b/protocols/FacebookRM/main.cpp
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "common.h"
// TODO: Make following as "globals" structure?
-PLUGINLINK *pluginLink;
+
CLIST_INTERFACE* pcli;
int hLangpack;
@@ -120,9 +120,9 @@ int OnModulesLoaded(WPARAM,LPARAM)
static HANDLE g_hEvents[1];
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
pcli = reinterpret_cast<CLIST_INTERFACE*>( CallService(
diff --git a/protocols/GTalkExt/GTalkExt.cpp b/protocols/GTalkExt/GTalkExt.cpp
index fa1752e0b1..f5ba3ea918 100644
--- a/protocols/GTalkExt/GTalkExt.cpp
+++ b/protocols/GTalkExt/GTalkExt.cpp
@@ -28,7 +28,7 @@
#include "avatar.h"
#include "menu.h"
-PLUGINLINK *pluginLink;
+
int hLangpack;
#define MIID_PLUGINIFACE {0x08B86253, 0xEC6E, 0x4d09, { 0xB7, 0xA9, 0x64, 0xAC, 0xDF, 0x06, 0x27, 0xB8 }}
@@ -71,11 +71,11 @@ extern "C" int __declspec(dllexport) Unload(void)
HICON g_hPopupIcon = 0;
extern HINSTANCE hInst;
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
g_hPopupIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_POPUP));
- pluginLink = link;
+
mir_getLP(&pluginInfo);
if (
!mir_getXI(&xi) ||
diff --git a/protocols/Gadu-Gadu/gg.c b/protocols/Gadu-Gadu/gg.c
index 778f62eeb1..07e1e0b05b 100644
--- a/protocols/Gadu-Gadu/gg.c
+++ b/protocols/Gadu-Gadu/gg.c
@@ -42,7 +42,7 @@ static const MUUID interfaces[] = {MIID_PROTOCOL, MIID_LAST};
// Other variables
HINSTANCE hInstance;
-PLUGINLINK *pluginLink;
+
XML_API xi;
SSL_API si;
CLIST_INTERFACE *pcli;
@@ -562,12 +562,12 @@ static int gg_proto_uninit(PROTO_INTERFACE *proto)
//////////////////////////////////////////////////////////
// When plugin is loaded
-int __declspec(dllexport) Load(PLUGINLINK * link)
+int __declspec(dllexport) Load(void)
{
WSADATA wsaData;
PROTOCOLDESCRIPTOR pd;
- pluginLink = link;
+
mir_getXI(&xi);
mir_getLP(&pluginInfo);
diff --git a/protocols/Gadu-Gadu/gg.h b/protocols/Gadu-Gadu/gg.h
index 79abb3190e..7f247c553f 100644
--- a/protocols/Gadu-Gadu/gg.h
+++ b/protocols/Gadu-Gadu/gg.h
@@ -354,7 +354,6 @@ typedef void (__cdecl GGThreadFunc)(void*, void*);
/////////////////////////////////////////////////
extern HINSTANCE hInstance;
-extern PLUGINLINK *pluginLink;
extern CLIST_INTERFACE *pcli;
extern list_t g_Instances;
diff --git a/protocols/IRCG/main.cpp b/protocols/IRCG/main.cpp
index b94e26d614..c90a91ae32 100644
--- a/protocols/IRCG/main.cpp
+++ b/protocols/IRCG/main.cpp
@@ -22,8 +22,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "irc.h"
#include "version.h"
-PLUGINLINK* pluginLink;
-HINSTANCE hInst = NULL;
+HINSTANCE hInst = NULL;
int hLangpack;
@@ -94,9 +93,9 @@ static int ircProtoUninit( CIrcProto* ppro )
return 0;
}
-extern "C" int __declspec(dllexport) Load( PLUGINLINK *link )
+extern "C" int __declspec(dllexport) Load( )
{
- pluginLink = link;
+
mir_getLP( &pluginInfo );
AddIcons();
diff --git a/protocols/IcqOscarJ/init.cpp b/protocols/IcqOscarJ/init.cpp
index db0af2db23..c876fef7b2 100644
--- a/protocols/IcqOscarJ/init.cpp
+++ b/protocols/IcqOscarJ/init.cpp
@@ -38,7 +38,6 @@
#include "m_extraicons.h"
HINSTANCE hInst;
-PLUGINLINK* pluginLink;
int hLangpack;
DWORD MIRANDA_VERSION;
@@ -104,9 +103,9 @@ static int OnModulesLoaded( WPARAM, LPARAM )
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP( &pluginInfo );
// Get Miranda version
diff --git a/protocols/JabberG/jabber.cpp b/protocols/JabberG/jabber.cpp
index a5f21e2613..a325778bcd 100644
--- a/protocols/JabberG/jabber.cpp
+++ b/protocols/JabberG/jabber.cpp
@@ -41,7 +41,7 @@ Last change by : $Author: borkra $
#include "m_extraicons.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack;
int g_cbCountries;
@@ -224,9 +224,9 @@ static int jabberProtoUninit( CJabberProto* ppro )
return 0;
}
-extern "C" int __declspec( dllexport ) Load( PLUGINLINK *link )
+extern "C" int __declspec( dllexport ) Load( )
{
- pluginLink = link;
+
// set the memory, lists & utf8 managers
mir_getXI( &xi );
diff --git a/protocols/MRA/Mra.cpp b/protocols/MRA/Mra.cpp
index 0cf1e55d46..4b476ed62f 100644
--- a/protocols/MRA/Mra.cpp
+++ b/protocols/MRA/Mra.cpp
@@ -1,6 +1,6 @@
#include "Mra.h"
-PLUGINLINK *pluginLink;
+
MRA_SETTINGS masMraSettings;
int hLangpack;
@@ -62,7 +62,7 @@ extern "C" MRA_API const MUUID* MirandaPluginInterfaces()
}
-extern "C" MRA_API int Load(PLUGINLINK *link)
+extern "C" MRA_API int Load(void)
{
SIZE_T dwBuffLen;
WCHAR szBuff[MAX_FILEPATH];
@@ -70,8 +70,9 @@ extern "C" MRA_API int Load(PLUGINLINK *link)
LPWSTR lpwszFileName;
PROTOCOLDESCRIPTOR pd={0};
- pluginLink=link;
- mir_getLP(&pluginInfoEx);
+
+ mir_getLP(&pluginInfoEx);
+
// Get module name from DLL file name
if (GetModuleFileName(masMraSettings.hInstance,szBuff,MAX_FILEPATH))
diff --git a/protocols/MSN/msn.cpp b/protocols/MSN/msn.cpp
index 16b11dedaa..2e9200bc59 100644
--- a/protocols/MSN/msn.cpp
+++ b/protocols/MSN/msn.cpp
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "version.h"
HINSTANCE hInst;
-PLUGINLINK *pluginLink;
+
int hLangpack;
TIME_API tmi;
@@ -112,9 +112,9 @@ static int msnProtoUninit(CMsnProto* ppro)
/////////////////////////////////////////////////////////////////////////////////////////
// Performs a primary set of actions upon plugin loading
-extern "C" int __declspec(dllexport) Load(PLUGINLINK* link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getTMI(&tmi);
mir_getLP(&pluginInfo);
diff --git a/protocols/NewsAggregator/Src/NewsAggregator.cpp b/protocols/NewsAggregator/Src/NewsAggregator.cpp
index 694eb46bea..61583d1890 100644
--- a/protocols/NewsAggregator/Src/NewsAggregator.cpp
+++ b/protocols/NewsAggregator/Src/NewsAggregator.cpp
@@ -20,7 +20,7 @@ Boston, MA 02111-1307, USA.
#include "Common.h"
HINSTANCE hInst = NULL;
-PLUGINLINK *pluginLink;
+
int hLangpack;
HANDLE hOptHook = NULL, hLoadHook = NULL, hOnPreShutdown = NULL, hPrebuildMenuHook = NULL, hPackUpdaterFolder = NULL;
HANDLE hProtoService[7];
@@ -65,11 +65,12 @@ extern "C" __declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
return interfaces;
}
-extern "C" __declspec(dllexport) int Load(PLUGINLINK *link)
+extern "C" __declspec(dllexport) int Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
- mir_getXI(&xi);
+ mir_getXI(&xi);
+
if (ServiceExists(MS_FOLDERS_REGISTER_PATH))
{
hPackUpdaterFolder = FoldersRegisterCustomPathT("News Aggregator", "Avatars", MIRANDA_USERDATAT _T("\\Avatars\\")_T(DEFAULT_AVATARS_FOLDER));
diff --git a/protocols/Omegle/main.cpp b/protocols/Omegle/main.cpp
index c3413f38fe..7ae6faf53c 100644
--- a/protocols/Omegle/main.cpp
+++ b/protocols/Omegle/main.cpp
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "common.h"
// TODO: Make following as "globals" structure?
-PLUGINLINK *pluginLink;
+
CLIST_INTERFACE* pcli;
int hLangpack;
@@ -120,9 +120,9 @@ int OnModulesLoaded(WPARAM,LPARAM)
static HANDLE g_hEvents[1];
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
pcli = reinterpret_cast<CLIST_INTERFACE*>( CallService(
diff --git a/protocols/Quotes/Forex.cpp b/protocols/Quotes/Forex.cpp
index f7df776ee2..47c258b259 100644
--- a/protocols/Quotes/Forex.cpp
+++ b/protocols/Quotes/Forex.cpp
@@ -31,7 +31,6 @@
#include "m_Quotes.h"
#include "version.h"
-PLUGINLINK* pluginLink = NULL;
int hLangpack;
HANDLE g_hEventWorkThreadStop;
@@ -435,9 +434,9 @@ extern "C"
return interfaces;
}
- int __declspec(dllexport) Load(PLUGINLINK *link)
+ int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&Global_pluginInfo);
// if ((mirandaVersion >= 0x0800) && (1 == mir_getXI(&xi)))
// {
diff --git a/protocols/Twitter/main.cpp b/protocols/Twitter/main.cpp
index cc9ddc95c2..c035271b34 100644
--- a/protocols/Twitter/main.cpp
+++ b/protocols/Twitter/main.cpp
@@ -23,7 +23,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include "m_updater.h"
-PLUGINLINK *pluginLink;
+
CLIST_INTERFACE* pcli;
HINSTANCE g_hInstance;
@@ -114,9 +114,9 @@ int OnModulesLoaded(WPARAM,LPARAM)
static HANDLE g_hEvents[1];
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
- pluginLink = link;
+
mir_getLP(&pluginInfo);
pcli = reinterpret_cast<CLIST_INTERFACE*>( CallService(
diff --git a/protocols/Weather/weather.cpp b/protocols/Weather/weather.cpp
index 94d2e77881..426e37b483 100644
--- a/protocols/Weather/weather.cpp
+++ b/protocols/Weather/weather.cpp
@@ -58,7 +58,7 @@ BOOL ThreadRunning;
BOOL ModuleLoaded;
-PLUGINLINK *pluginLink;
+
// plugin info
// VER = version, AUTH = author, defined in weather.h
@@ -213,12 +213,12 @@ extern "C" int __declspec(dllexport) Unload(void)
return 0;
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
PROTOCOLDESCRIPTOR pd = {0};
DWORD lastver;
- pluginLink = link;
+
mir_getLP(&pluginInfoEx);
// initialize global variables
diff --git a/protocols/YAMN/main.cpp b/protocols/YAMN/main.cpp
index f2385036a8..7fb6248768 100644
--- a/protocols/YAMN/main.cpp
+++ b/protocols/YAMN/main.cpp
@@ -33,7 +33,7 @@ HANDLE hAccountFolder;
HINSTANCE *hDllPlugins;
static int iDllPlugins = 0;
-PLUGINLINK *pluginLink;
+
YAMN_VARIABLES YAMNVar;
int hLangpack;
@@ -398,12 +398,13 @@ static void LoadPlugins()
}
}
-extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport) Load(void)
{
int i, k;
- pluginLink = link;
- mir_getLP(&pluginInfo);
+
+ mir_getLP(&pluginInfo);
+
YAMN_STATUS = ID_STATUS_OFFLINE;
// we get the Miranda Root Path
diff --git a/protocols/Yahoo/main.cpp b/protocols/Yahoo/main.cpp
index 222c4d6723..d9b7278102 100644
--- a/protocols/Yahoo/main.cpp
+++ b/protocols/Yahoo/main.cpp
@@ -21,7 +21,6 @@
* Global Variables
*/
HINSTANCE hInstance;
-PLUGINLINK* pluginLink;
HANDLE g_hNetlibUser;
@@ -66,7 +65,7 @@ extern "C" BOOL WINAPI DllMain(HINSTANCE hinst,DWORD /*fdwReason*/,LPVOID /*lpvR
//=====================================================
// Name : Load
-// Parameters: PLUGINLINK *link
+// Parameters:
// Returns : int
// Description : Called when plugin is loaded into Miranda
//=====================================================
@@ -95,13 +94,8 @@ static int yahooProtoUninit( CYahooProto* ppro )
return 0;
}
-extern "C" int __declspec(dllexport)Load(PLUGINLINK *link)
+extern "C" int __declspec(dllexport)Load(void)
{
- pluginLink = link;
-
- /**
- * Grab the interface handles (through pluginLink)
- */
mir_getLP( &pluginInfo );
PROTOCOLDESCRIPTOR pd = { 0 };
diff --git a/protocols/Yahoo/yahoo.h b/protocols/Yahoo/yahoo.h
index 552f40cc46..efe3b9cf2f 100644
--- a/protocols/Yahoo/yahoo.h
+++ b/protocols/Yahoo/yahoo.h
@@ -15,11 +15,6 @@
#define MIRANDA_VER 0x0A00
-extern "C"
-{
- extern struct tagPLUGINLINK* pluginLink;
-};
-
#ifdef _MSC_VER
#define snprintf _snprintf
#endif
diff --git a/src/core/modules.cpp b/src/core/modules.cpp
index 8dbbf54e63..977a50d4f8 100644
--- a/src/core/modules.cpp
+++ b/src/core/modules.cpp
@@ -134,7 +134,7 @@ int LoadDefaultModules(void)
if ( LoadContactsModule()) return 1;
if ( LoadContactListModule()) return 1;
if ( LoadAddContactModule()) return 1;
- if ( LoadNewPluginsModule()) return 1; // will call Load() on everything, clist will load first
+ if ( LoadNewPluginsModule()) return 1; // will call Load(void) on everything, clist will load first
LangPackDropUnusedItems();
diff --git a/src/modules/database/database.cpp b/src/modules/database/database.cpp
index c8743b3b30..94adf17742 100644
--- a/src/modules/database/database.cpp
+++ b/src/modules/database/database.cpp
@@ -428,7 +428,7 @@ static int FindDbPluginForProfile(const char*, DATABASELINK * dblink, LPARAM lPa
int err = 0;
if (dblink->grokHeader(szProfile, &err) == 0) {
// added APIs?
- if ( !dblink->Load(szProfile, &pluginCoreLink)) {
+ if ( !dblink->Load(szProfile)) {
fillProfileName(tszProfile);
res = DBPE_DONE;
}
@@ -465,7 +465,7 @@ static int FindDbPluginAutoCreate(const char*, DATABASELINK * dblink, LPARAM lPa
char *szProfile = makeFileName(tszProfile);
if (dblink->makeDatabase(szProfile, &err) == 0) {
dbCreated = true;
- if ( !dblink->Load(szProfile, &pluginCoreLink)) {
+ if ( !dblink->Load(szProfile)) {
fillProfileName(tszProfile);
res = DBPE_DONE;
}
diff --git a/src/modules/plugins/newplugins.cpp b/src/modules/plugins/newplugins.cpp
index 391e76408d..dcef628238 100644
--- a/src/modules/plugins/newplugins.cpp
+++ b/src/modules/plugins/newplugins.cpp
@@ -296,7 +296,7 @@ void Plugin_Uninit(pluginEntry* p, bool bDynamic)
if (p->pclass & PCLASS_DB)
p->bpi.dblink->Unload(p->pclass & PCLASS_OK);
- // if the basic API check had passed, call Unload if Load() was ever called
+ // if the basic API check had passed, call Unload if Load(void) was ever called
if (p->pclass & PCLASS_LOADED)
p->bpi.Unload();
@@ -660,7 +660,7 @@ int LoadNewPluginsModule(void)
Plugin_Uninit(pluginList_freeimg);
} }
- // first load the clist cos alot of plugins need that to be present at Load()
+ // first load the clist cos alot of plugins need that to be present at Load(void)
for (useWhiteList = 1; useWhiteList >= 0 && clist == NULL; useWhiteList--)
clist=getCListModule(exe, slice, useWhiteList);
/* the loop above will try and get one clist DLL to work, if all fail then just bail now */
@@ -748,7 +748,7 @@ int LoadNewPluginsModuleInfos(void)
// the database will select which db plugin to use, or fail if no profile is selected
if (LoadDatabaseModule()) return 1;
InitIni();
- // could validate the plugin entries here but internal modules arent loaded so can't call Load() in one pass
+ // could validate the plugin entries here but internal modules arent loaded so can't call Load(void) in one pass
return 0;
}
diff --git a/src/modules/plugins/plugins.h b/src/modules/plugins/plugins.h
index fe6de60b8c..aa0251ab97 100644
--- a/src/modules/plugins/plugins.h
+++ b/src/modules/plugins/plugins.h
@@ -37,7 +37,7 @@ typedef struct { // can all be NULL
#define PCLASS_DB 0x4 // has DatabasePluginInfo() and is valid as can be, and PCLASS_BASICAPI has to be set too
#define PCLASS_LAST 0x8 // this plugin should be unloaded after everything else
#define PCLASS_OK 0x10 // plugin should be loaded, if DB means nothing
-#define PCLASS_LOADED 0x20 // Load() has been called, Unload() should be called.
+#define PCLASS_LOADED 0x20 // Load(void) has been called, Unload() should be called.
#define PCLASS_STOPPED 0x40 // wasn't loaded cos plugin name not on white list
#define PCLASS_CLIST 0x80 // a CList implementation
#define PCLASS_SERVICE 0x100 // has Service Mode implementation