summaryrefslogtreecommitdiff
path: root/MySpace/MySpace.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'MySpace/MySpace.cpp')
-rw-r--r--MySpace/MySpace.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/MySpace/MySpace.cpp b/MySpace/MySpace.cpp
index c06690d..e9c9276 100644
--- a/MySpace/MySpace.cpp
+++ b/MySpace/MySpace.cpp
@@ -16,6 +16,8 @@ PLUGINLINK *pluginLink;
HANDLE mainThread;
int code_page;
+char MODULE[256];
+
PLUGININFOEX pluginInfo={
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
@@ -116,6 +118,22 @@ extern "C" __declspec (dllexport) int Load(PLUGINLINK *link) {
code_page = (int)CallService(MS_LANGPACK_GETCODEPAGE, 0, 0);
+
+ // Get module name from DLL file name
+ {
+ char* str1;
+ char str2[MAX_PATH];
+
+ GetModuleFileNameA(hInst, str2, MAX_PATH);
+ str1 = strrchr(str2, '\\');
+ if (str1 != NULL && strlen(str1+1) > 4) {
+ strncpy(MODULE, str1+1, strlen(str1+1)-4);
+ MODULE[strlen(str1+1)-3] = 0;
+ }
+ CharUpperA(MODULE);
+ }
+
+
if(ServiceExists(MS_DB_SETSETTINGRESIDENT)) { // 0.6+
char buff[256];
mir_snprintf(buff, 256, "%s/%s", MODULE, "Status");