diff options
-rw-r--r-- | plugins/WhoUsesMyFiles/wumf.c | 6 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/wumfplug.c | 14 |
2 files changed, 12 insertions, 8 deletions
diff --git a/plugins/WhoUsesMyFiles/wumf.c b/plugins/WhoUsesMyFiles/wumf.c index 524648185e..03aa576d38 100644 --- a/plugins/WhoUsesMyFiles/wumf.c +++ b/plugins/WhoUsesMyFiles/wumf.c @@ -109,7 +109,11 @@ int CALLBACK ConnDlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam) ListView_InsertColumn(hList, 3, &lvc);
KillTimer(NULL, 777);
lst = cpy_list(&list);
- SetTimer(NULL, 777, TIME,(TIMERPROC) TimerProc);
+ if (IsUserAnAdmin()) {
+ SetTimer(NULL, 777, TIME,(TIMERPROC) TimerProc);
+ } else {
+ MessageBox(NULL, "Plugin WhoUsesMyFiles requires admin privileges in order to work.", "Miranda IM", MB_OK);
+ }
ShowList(lst, hList);
Utils_RestoreWindowPosition(hWnd, NULL, ModuleName,"conn");
break;
diff --git a/plugins/WhoUsesMyFiles/wumfplug.c b/plugins/WhoUsesMyFiles/wumfplug.c index 9bcb59540b..8c54f36990 100644 --- a/plugins/WhoUsesMyFiles/wumfplug.c +++ b/plugins/WhoUsesMyFiles/wumfplug.c @@ -294,11 +294,6 @@ static INT_PTR WumfMenuCommand(WPARAM wParam,LPARAM lParam) __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
{
- if (!IsUserAnAdmin()) {
- MessageBox(NULL, "Plugin WhoUsesMyFiles cannot be loaded. It requires admin privileges.", "Miranda IM", MB_OK);
- return NULL;
- }
-
return &pluginInfo;
}
@@ -622,9 +617,14 @@ __declspec(dllexport) int Load(void) HookEvent(ME_TTB_MODULELOADED, InitTopToolbar);
setlocale( LC_ALL, ".ACP");
// _setmbcp(_MB_CP_ANSI);
- SetTimer(NULL, 777, TIME,(TIMERPROC) TimerProc);
- return 0;
+ if (IsUserAnAdmin()) {
+ SetTimer(NULL, 777, TIME,(TIMERPROC) TimerProc);
+ } else {
+ MessageBox(NULL, "Plugin WhoUsesMyFiles requires admin privileges in order to work.", "Miranda IM", MB_OK);
+ }
+
+ return 0;
}
__declspec(dllexport) int Unload(void)
|