diff options
Diffstat (limited to 'plugins/WhoUsesMyFiles')
-rw-r--r-- | plugins/WhoUsesMyFiles/src/list.cpp | 136 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/src/wumf.cpp | 310 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/src/wumf.h | 112 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/src/wumfplug.cpp | 616 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/wumf_10.vcxproj | 1 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/wumf_10.vcxproj.filters | 3 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/wumf_11.vcxproj | 1 | ||||
-rw-r--r-- | plugins/WhoUsesMyFiles/wumf_11.vcxproj.filters | 3 |
8 files changed, 492 insertions, 690 deletions
diff --git a/plugins/WhoUsesMyFiles/src/list.cpp b/plugins/WhoUsesMyFiles/src/list.cpp index cbc36318cc..fbf898f566 100644 --- a/plugins/WhoUsesMyFiles/src/list.cpp +++ b/plugins/WhoUsesMyFiles/src/list.cpp @@ -9,33 +9,23 @@ PWumf new_wumf( DWORD dwID, DWORD dwPerm,
DWORD dwAttr)
{
- //TCHAR szID[10];
+ PWumf w = (PWumf)mir_calloc(sizeof(Wumf));
+ if (!w)
+ return NULL;
- PWumf w = (PWumf)malloc(sizeof(Wumf));
- if(!w)return NULL;
-
- //#define SCPY(X) if(X){w->X = (LPTSTR)malloc(1+_tcslen(X));if(!w->X)return NULL;_tcscpy(w->X, X);} else { w->X = NULL;}
- //#define SCPYW(X) if(X){w->X = (LPTSTR)malloc(1+lstrlenW((LPWSTR)X));if(!w->X)return NULL;wsprintfA(w->X, "%S", X);} else { w->X = NULL;}
+ w->szUser = mir_tstrdup(szUser);
+ w->szPath = mir_tstrdup(szPath);
+ w->szComp = mir_tstrdup(szComp);
+ w->szUNC = mir_tstrdup(szUNC);
- //#define SCCPY(X, Y) w->X = (LPSTR)malloc(1+strlen(Y));if(!w->X)return NULL;strcpy(w->X, Y)
-
- _tcscpy(w->szUser, szUser);
- _tcscpy(w->szPath, szPath);
- _tcscpy(w->szComp, szComp);
- _tcscpy(w->szUNC, szUNC);
-
- switch(dwPerm)
- {
- case PERM_FILE_READ: _tcscpy(w->szPerm, _T("Read"));break;
+ switch(dwPerm) {
+ case PERM_FILE_READ: _tcscpy(w->szPerm, _T("Read"));break;
case PERM_FILE_WRITE: _tcscpy(w->szPerm, _T("Write"));break;
case PERM_FILE_CREATE: _tcscpy(w->szPerm, _T("Create"));break;
- default: _tcscpy(w->szPerm, _T("Execute"));//w->szPerm = NULL;
- };
+ default: _tcscpy(w->szPerm, _T("Execute"));
+ }
wsprintf(w->szID, _T("%i"), dwID);
- //_tcscpy(w->szID, szID);
- //SCPY(szID);
- //#undef SCPY
w->dwID = dwID;
w->dwSess = dwSess;
w->dwAttr = dwAttr;
@@ -47,28 +37,22 @@ PWumf new_wumf( DWORD dwID, BOOL del_wumf(PWumf w)
{
- if(!w) return FALSE;
- free(w->szUser);
- free(w->szPath);
- free(w->szComp);
- free(w->szUNC);
- free(w->szID);
- free(w->szPerm);
- free(w);
+ if (!w) return FALSE;
+ mir_free(w->szUser);
+ mir_free(w->szPath);
+ mir_free(w->szComp);
+ mir_free(w->szUNC);
+ mir_free(w);
return TRUE;
}
-BOOL add_cell(PWumf* l, PWumf w)
+BOOL add_cell(PWumf* l, PWumf w)
{
- PWumf p;
- if(!w || !l)return FALSE;
- if(!(*l))
- {
+ if (!w || !l)return FALSE;
+ if (!(*l))
*l = w;
- }
- else
- {
- p = *l;
+ else {
+ PWumf p = *l;
while(p->next) p = p->next;
p->next = w;
}
@@ -76,41 +60,37 @@ BOOL add_cell(PWumf* l, PWumf w) return TRUE;
}
-BOOL del_cell(PWumf *l, PWumf w)
+BOOL del_cell(PWumf *l, PWumf w)
{
- PWumf p;
- if(!l || !*l || !w)return FALSE;
- p = *l;
- if(w == *l)
+ if (!l || !*l || !w)return FALSE;
+ PWumf p = *l;
+ if (w == *l)
*l = p->next;
- else
- {
+ else {
while(p && p->next != w) p = p->next;
- if(!p) return FALSE;
+ if (!p) return FALSE;
p->next = w->next;
}
return del_wumf(w);
-
-};
+}
-BOOL cpy_cell(PWumf *l, PWumf w)
+BOOL cpy_cell(PWumf *l, PWumf w)
{
- PWumf w1;
- w1 = new_wumf(w->dwID, w->szUser, w->szPath, w->szComp,w->szUNC, w->dwSess, w->dwPerm, w->dwAttr);
- if(!w1) return FALSE;
+ PWumf w1 = new_wumf(w->dwID, w->szUser, w->szPath, w->szComp,w->szUNC, w->dwSess, w->dwPerm, w->dwAttr);
+ if (!w1)
+ return FALSE;
w1->mark = w->mark;
return add_cell(l, w1);
-};
+}
PWumf cpy_list(PWumf *l)
{
PWumf w, p = NULL;
- if(!l || !*l) return NULL;
+ if (!l || !*l) return NULL;
w = *l;
- while(w)
- {
- if(!cpy_cell(&p, w))return NULL;
+ while(w) {
+ if (!cpy_cell(&p, w))return NULL;
w = w->next;
}
return p;
@@ -118,44 +98,38 @@ PWumf cpy_list(PWumf *l) PWumf fnd_cell(PWumf *l, DWORD dwID)
{
- PWumf w;
- if(!l || !*l)return NULL;
- w = *l;
+ if (!l || !*l)return NULL;
+ PWumf w = *l;
while(w && w->dwID != dwID) w = w->next;
return w;
}
-
+
BOOL del_all(PWumf *l)
{
- PWumf w, p;
- if(!l || !*l) return FALSE;
- w = *l;
- while(w)
- {
- p = w->next;
- if(!del_cell(l, w))
- {
+ if (!l || !*l) return FALSE;
+ PWumf w = *l;
+ while(w) {
+ PWumf p = w->next;
+ if (!del_cell(l, w))
return FALSE;
- }
+
w = p;
}
*l = NULL;
-
return TRUE;
}
BOOL del_marked(PWumf *l)
{
PWumf w, p;
- if(!l)return FALSE;
+ if (!l)return FALSE;
w = *l;
- while(w)
- {
+ while(w) {
p = w->next;
- if(w->mark)
- {
- if(!del_cell(l, w)) return FALSE;
- };
+ if (w->mark)
+ if (!del_cell(l, w))
+ return FALSE;
+
w = p;
}
return TRUE;
@@ -163,10 +137,8 @@ BOOL del_marked(PWumf *l) void mark_all(PWumf *l, BOOL mark)
{
- PWumf w;
- w = *l;
- while(w)
- {
+ PWumf w = *l;
+ while(w) {
w->mark = mark;
w = w->next;
}
diff --git a/plugins/WhoUsesMyFiles/src/wumf.cpp b/plugins/WhoUsesMyFiles/src/wumf.cpp index fbca6874df..9b88a75155 100644 --- a/plugins/WhoUsesMyFiles/src/wumf.cpp +++ b/plugins/WhoUsesMyFiles/src/wumf.cpp @@ -11,23 +11,22 @@ static PWumf lst = NULL; HANDLE hLog = INVALID_HANDLE_VALUE;
BOOL wumf();
-static int DlgResizer(HWND hwndDlg,LPARAM lParam,UTILRESIZECONTROL *urc) {
+static int DlgResizer(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL *urc)
+{
switch(urc->wId) {
- case IDC_CONNLIST:
- return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT;
- case IDOK:
- return RD_ANCHORX_RIGHT|RD_ANCHORY_BOTTOM;
+ case IDC_CONNLIST:
+ return RD_ANCHORX_WIDTH|RD_ANCHORY_HEIGHT;
+ case IDOK:
+ return RD_ANCHORX_RIGHT|RD_ANCHORY_BOTTOM;
}
return RD_ANCHORX_LEFT|RD_ANCHORY_TOP;
}
-
-
void AddToList(HWND hList, PWumf w)
{
LVITEM lvi = { 0 };
- lvi.iItem=ListView_GetItemCount(hList)+1;
- lvi.mask= LVIF_PARAM|LVIF_TEXT;
+ lvi.iItem = ListView_GetItemCount(hList)+1;
+ lvi.mask = LVIF_PARAM|LVIF_TEXT;
lvi.pszText = w->szID;
lvi.cchTextMax = (int)_tcslen(w->szID);
lvi.lParam = (LPARAM)w;
@@ -36,10 +35,8 @@ void AddToList(HWND hList, PWumf w) void ShowList(PWumf l, HWND hList)
{
- PWumf w;
- w = l;
- while(w)
- {
+ PWumf w = l;
+ while(w) {
AddToList(hList,w);
w = w->next;
}
@@ -47,107 +44,101 @@ void ShowList(PWumf l, HWND hList) VOID OnGetDispInfo(NMLVDISPINFO *plvdi)
{
- PWumf w;
- w = (PWumf)(plvdi->item.lParam);
- switch (plvdi->item.iSubItem)
- {
- case 0:
- plvdi->item.pszText = w->szID;
- break;
- case 1:
- plvdi->item.pszText = w->szUser;
- break;
- case 2:
- plvdi->item.pszText = w->szPath;
- break;
- case 3:
- plvdi->item.pszText = w->szPerm;
- break;
- default:
- break;
+ PWumf w = (PWumf)(plvdi->item.lParam);
+ switch (plvdi->item.iSubItem) {
+ case 0:
+ plvdi->item.pszText = w->szID;
+ break;
+ case 1:
+ plvdi->item.pszText = w->szUser;
+ break;
+ case 2:
+ plvdi->item.pszText = w->szPath;
+ break;
+ case 3:
+ plvdi->item.pszText = w->szPerm;
+ break;
}
}
-
INT_PTR CALLBACK ConnDlgProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
{
- switch( Msg )
- {
- case WM_INITDIALOG:
- {
- HWND hList = GetDlgItem(hWnd, IDC_CONNLIST);
-// ListView_DeleteAllItems(hList);
- ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT);
- LV_COLUMN lvc = { 0 };
- lvc.mask = LVCF_TEXT|LVCF_FMT|LVCF_WIDTH;
- lvc.fmt = LVCFMT_LEFT;
- lvc.cx = 40;
- lvc.pszText = TranslateT("ID");
- ListView_InsertColumn(hList, 0, &lvc);
- lvc.cx = 50;
- lvc.pszText = TranslateT("User");
- ListView_InsertColumn(hList, 1, &lvc);
- lvc.cx = 250;
- lvc.pszText = TranslateT("File");
- ListView_InsertColumn(hList, 2, &lvc);
- lvc.cx = 50;
- lvc.pszText = TranslateT("Access");
- ListView_InsertColumn(hList, 3, &lvc);
- KillTimer(NULL, 777);
- lst = cpy_list(&list);
- if (IsUserAnAdmin()) {
- SetTimer(NULL, 777, TIME, TimerProc);
- } else {
- MessageBox(NULL, TranslateT("Plugin WhoUsesMyFiles requires admin privileges in order to work."), _T("Miranda NG"), MB_OK);
- }
- ShowList(lst, hList);
- }
- Utils_RestoreWindowPosition(hWnd, NULL, ModuleName,"conn");
- break;
- case WM_CLOSE:
- PostMessage( hWnd, WM_COMMAND, IDCANCEL, 0l );
- break;
- case WM_COMMAND:
- switch( LOWORD(wParam) )
- {
- case IDOK:
- case IDCANCEL:
- PostMessage( hWnd, WM_DESTROY, 0, 0l );
- break;
- }
- break;
- case WM_SIZE:
- {
- UTILRESIZEDIALOG urd={0};
- urd.cbSize=sizeof(urd);
- urd.hwndDlg=hWnd;
- urd.hInstance=hInst;
- urd.lpTemplate = MAKEINTRESOURCEA(IDD_CONNLIST);
- urd.lParam=(LPARAM)NULL;
- urd.pfnResizer=DlgResizer;
- ResizeDialog(0,(LPARAM)&urd);
- }
- Utils_SaveWindowPosition(hWnd, NULL, ModuleName,"conn");
- return TRUE;
- case WM_MOVE:
- Utils_SaveWindowPosition(hWnd, NULL, ModuleName,"conn");
- break;
- case WM_NOTIFY:
- switch (((LPNMHDR) lParam)->code)
- {
- case LVN_GETDISPINFO:
- OnGetDispInfo((NMLVDISPINFO *) lParam);
- break;
- }
- break;
- case WM_DESTROY:
- del_all(&lst);
- PostQuitMessage(0);
+ switch( Msg ) {
+ case WM_INITDIALOG:
+ {
+ HWND hList = GetDlgItem(hWnd, IDC_CONNLIST);
+
+ ListView_SetExtendedListViewStyle(hList, LVS_EX_FULLROWSELECT);
+ LV_COLUMN lvc = { 0 };
+ lvc.mask = LVCF_TEXT|LVCF_FMT|LVCF_WIDTH;
+ lvc.fmt = LVCFMT_LEFT;
+ lvc.cx = 40;
+ lvc.pszText = TranslateT("ID");
+ ListView_InsertColumn(hList, 0, &lvc);
+ lvc.cx = 50;
+ lvc.pszText = TranslateT("User");
+ ListView_InsertColumn(hList, 1, &lvc);
+ lvc.cx = 250;
+ lvc.pszText = TranslateT("File");
+ ListView_InsertColumn(hList, 2, &lvc);
+ lvc.cx = 50;
+ lvc.pszText = TranslateT("Access");
+ ListView_InsertColumn(hList, 3, &lvc);
+ KillTimer(NULL, 777);
+ lst = cpy_list(&list);
+ if (IsUserAnAdmin())
+ SetTimer(NULL, 777, TIME, TimerProc);
+ else
+ MessageBox(NULL, TranslateT("Plugin WhoUsesMyFiles requires admin privileges in order to work."), _T("Miranda NG"), MB_OK);
+ ShowList(lst, hList);
+ }
+ Utils_RestoreWindowPosition(hWnd, NULL, MODULENAME,"conn");
+ return TRUE;
+
+ case WM_CLOSE:
+ PostMessage( hWnd, WM_COMMAND, IDCANCEL, 0l );
+ break;
+
+ case WM_COMMAND:
+ switch( LOWORD(wParam)) {
+ case IDOK:
+ case IDCANCEL:
+ PostMessage(hWnd, WM_DESTROY, 0, 0);
break;
- default:
- return FALSE;
- }
- return TRUE;
+ }
+ break;
+
+ case WM_SIZE:
+ {
+ UTILRESIZEDIALOG urd = { sizeof(urd) };
+ urd.hwndDlg = hWnd;
+ urd.hInstance = hInst;
+ urd.lpTemplate = MAKEINTRESOURCEA(IDD_CONNLIST);
+ urd.lParam = (LPARAM)NULL;
+ urd.pfnResizer = DlgResizer;
+ CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM)&urd);
+ }
+ Utils_SaveWindowPosition(hWnd, NULL, MODULENAME,"conn");
+ return TRUE;
+
+ case WM_MOVE:
+ Utils_SaveWindowPosition(hWnd, NULL, MODULENAME,"conn");
+ break;
+
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->code) {
+ case LVN_GETDISPINFO:
+ OnGetDispInfo((NMLVDISPINFO*)lParam);
+ break;
+ }
+ break;
+
+ case WM_DESTROY:
+ del_all(&lst);
+ PostQuitMessage(0);
+ break;
+ }
+ return FALSE;
}
void LogWumf(PWumf w)
@@ -159,12 +150,12 @@ void LogWumf(PWumf w) SYSTEMTIME time;
DWORD bytes;
- if(!WumfOptions.LogFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
+ if (!WumfOptions.LogFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
- if(hLog == INVALID_HANDLE_VALUE || hLog == NULL)
+ if (hLog == INVALID_HANDLE_VALUE || hLog == NULL)
{
hLog = CreateFile(WumfOptions.LogFile, GENERIC_WRITE, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
- if(hLog == INVALID_HANDLE_VALUE)
+ if (hLog == INVALID_HANDLE_VALUE)
{
FormatMessage(
FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
@@ -186,109 +177,54 @@ void LogWumf(PWumf w) WriteFile(hLog, str, (DWORD)_tcslen(str), &bytes, NULL);
}
-/*
-BOOL wumf()
-{
- FILE_INFO_3 *buf, *cur;
- SESSION_INFO_0 *sinfo;
- DWORD read, total, resumeh, rc, i, sess = 0L;
- wchar_t server[20];
- char user[512], path[512], comp[512];
- char* UNC = NULL;
- PWumf w = NULL;
-
- mbstowcs( server, "\\\\.", 8);
- resumeh = 0;
-
- mark_all(&list, TRUE);
- do
- {
- buf = NULL;
- rc = NetFileEnum( (LPWSTR)server,
- NULL,
- NULL, 3,
- (BYTE **) &buf, 2048, &read, &total, &resumeh );
- if ( rc != ERROR_MORE_DATA && rc != ERROR_SUCCESS )
- break;
- for ( i = 0, cur = buf; i < read; ++ i, ++ cur)
- {
- w = fnd_cell(&list, cur->fi3_id);
- if(!w)
- {
- wcstombs(user, (wchar_t *) cur->fi3_username, 512);
- wcstombs(path, (wchar_t *) cur->fi3_pathname, 512);
-
- w = new_wumf(cur->fi3_id, user, path, comp, UNC, sess, cur->fi3_permissions,GetFileAttributes(path));
- w->mark = FALSE;
- if(!add_cell(&list, w)){
- msg("Error memory allocation");
- return FALSE;
- };
-
- if(WumfOptions.PopupsEnabled) ShowWumfPopUp(w);
- if(WumfOptions.LogToFile) LogWumf(w);
- }
- else
- w->mark = FALSE;
- }
- if(buf != NULL) NetApiBufferFree( buf );
- } while(rc == ERROR_MORE_DATA);
- return del_marked(&list);
-};*/
-
BOOL wumf()
{
LPSESSION_INFO_1 s_info = NULL;
- DWORD ent_read = 0, ent_total = 0, res_handle = 0, i = 0;
+ DWORD ent_read = 0, ent_total = 0, res_handle = 0;
NET_API_STATUS res = NERR_Success;
- if( (res = NetSessionEnum(NULL, NULL, NULL, 1, (LPBYTE *)&s_info, MAX_PREFERRED_LENGTH, &ent_read, &ent_total, &res_handle)) == NERR_Success ||
+ if ((res = NetSessionEnum(NULL, NULL, NULL, 1, (LPBYTE *)&s_info, MAX_PREFERRED_LENGTH, &ent_read, &ent_total, &res_handle)) == NERR_Success ||
res == ERROR_MORE_DATA)
{
mark_all(&list, TRUE);
- for(i = 0; i < ent_read; i++)
- {
+ for(unsigned i = 0; i < ent_read; i++)
process_session(s_info[ i ]);
- }
+
NetApiBufferFree(s_info);
- } else {
- printError(res);
}
+ else printError(res);
+
return del_marked(&list);
-};
+}
void process_session(SESSION_INFO_1 s_info)
{
LPFILE_INFO_3 f_info = NULL;
- DWORD ent_read = 0, ent_total = 0, res_handle = 0, i = 0;
+ DWORD ent_read = 0, ent_total = 0, res_handle = 0;
NET_API_STATUS res = NERR_Success;
- if( (res = NetFileEnum(NULL, NULL, s_info.sesi1_username, 3, (LPBYTE *)&f_info, MAX_PREFERRED_LENGTH, &ent_read, &ent_total, (PDWORD_PTR)&res_handle)) == NERR_Success ||
- res == ERROR_MORE_DATA)
+ if ((res = NetFileEnum(NULL, NULL, s_info.sesi1_username, 3, (LPBYTE *)&f_info, MAX_PREFERRED_LENGTH, &ent_read, &ent_total, (PDWORD_PTR)&res_handle)) == NERR_Success ||
+ res == ERROR_MORE_DATA)
{
- for(i = 0; i < ent_read; i++)
- {
+ for(unsigned i=0; i < ent_read; i++)
process_file(s_info, f_info[ i ]);
- }
+
NetApiBufferFree(f_info);
- } else {
- printError(res);
}
+ else printError(res);
}
void process_file(SESSION_INFO_1 s_info, FILE_INFO_3 f_info)
{
PWumf w = fnd_cell(&list, f_info.fi3_id);
- if(!w)
- {
+ if (!w) {
w = new_wumf(f_info.fi3_id, f_info.fi3_username, f_info.fi3_pathname, s_info.sesi1_cname, NULL, 0, f_info.fi3_permissions, GetFileAttributes(f_info.fi3_pathname));
w->mark = FALSE;
- if(!add_cell(&list, w)){
+ if (!add_cell(&list, w))
msg(TranslateT("Error memory allocation"));
- };
- if(WumfOptions.PopupsEnabled) ShowWumfPopUp(w);
- if(WumfOptions.LogToFile) LogWumf(w);
- } else {
- w->mark = FALSE;
+
+ if (WumfOptions.PopupsEnabled) ShowWumfPopUp(w);
+ if (WumfOptions.LogToFile) LogWumf(w);
}
+ else w->mark = FALSE;
}
void printError(DWORD res)
@@ -302,11 +238,11 @@ void printError(DWORD res) VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT_PTR idEvent, DWORD dwTime)
{
- if(!wumf())
+ if (!wumf())
KillTimer(NULL, 777);
};
void FreeAll()
{
del_all(&list);
-};
+}
diff --git a/plugins/WhoUsesMyFiles/src/wumf.h b/plugins/WhoUsesMyFiles/src/wumf.h index 1b7e6d85b0..f1fac9ab4b 100644 --- a/plugins/WhoUsesMyFiles/src/wumf.h +++ b/plugins/WhoUsesMyFiles/src/wumf.h @@ -18,7 +18,7 @@ #include "resource.h"
#include "Version.h"
-#define ModuleName "WUMF Plugin"
+#define MODULENAME "WUMF Plugin"
#define LIFETIME_MAX 60
#define LIFETIME_MIN 1
@@ -50,46 +50,48 @@ #define IDM_SHOW 0x0405
#define IDM_EXIT 0x0404
-typedef struct
+struct WUMF_OPTIONS
{
- BOOL PopupsEnabled;
-
- BOOL UseWinColor;
- BOOL UseDefColor;
- BOOL SelectColor;
- COLORREF ColorText;
- COLORREF ColorBack;
- BOOL DelayInf;
- BOOL DelayDef;
- BOOL DelaySet;
- int DelaySec;
-
- BOOL LogToFile;
- BOOL LogFolders;
- BOOL AlertFolders;
- BOOL LogUNC;
- BOOL AlertUNC;
- BOOL LogComp;
- BOOL AlertComp;
-
- TCHAR LogFile[255];
-} WUMF_OPTIONS;
-
-typedef struct _WUMF{
- DWORD dwID;
- LPTSTR szID;
+ BOOL PopupsEnabled;
+ BOOL UseWinColor;
+ BOOL UseDefColor;
+ BOOL SelectColor;
+ BOOL DelayInf;
+ BOOL DelayDef;
+ BOOL DelaySet;
+ int DelaySec;
+
+ BOOL LogToFile;
+ BOOL LogFolders;
+ BOOL AlertFolders;
+ BOOL LogUNC;
+ BOOL AlertUNC;
+ BOOL LogComp;
+ BOOL AlertComp;
+
+ COLORREF ColorText;
+ COLORREF ColorBack;
+
+ TCHAR LogFile[255];
+};
+
+struct Wumf
+{
+ DWORD dwID;
+ TCHAR szID[10], szPerm[10];
LPTSTR szUser;
LPTSTR szPath;
LPTSTR szComp;
LPTSTR szUNC;
- LPTSTR szPerm;
- DWORD dwSess;
- DWORD dwLocks;
- DWORD dwAttr;
- DWORD dwPerm;
- BOOL mark;
- struct _WUMF* next;
-} Wumf, *PWumf;
+ DWORD dwSess;
+ DWORD dwLocks;
+ DWORD dwAttr;
+ DWORD dwPerm;
+ BOOL mark;
+ Wumf *next;
+};
+
+typedef Wumf *PWumf;
PWumf new_wumf(
DWORD dwID,
@@ -119,7 +121,6 @@ extern PWumf list; void FreeAll();
VOID CALLBACK TimerProc(HWND, UINT, UINT_PTR, DWORD);
INT_PTR CALLBACK ConnDlgProc(HWND, UINT, WPARAM, LPARAM);
-int ResizeDialog(WPARAM wParam,LPARAM lParam);
void ShowThePopUp(PWumf w, LPTSTR, LPTSTR);
void ShowWumfPopUp(PWumf w);
@@ -131,40 +132,3 @@ void printError(DWORD res); #define msg(X) MessageBox(NULL, X, _T("WUMF"), MB_OK|MB_ICONSTOP)
#define MS_WUMF_SWITCHPOPUP "WUMF/SwitchPopup"
#define MS_WUMF_CONNECTIONSSHOW "WUMF/ShowConnections"
-
-#define malloc(size) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, size)
-#define free(something) HeapFree(GetProcessHeap(), 0, something)
-
-#ifndef RD_ANCHORX_CUSTOM
-#define RD_ANCHORX_CUSTOM 0 //function did everything required to the x axis, do no more processing
-#define RD_ANCHORX_LEFT 0 //move the control to keep it constant distance from the left edge of the dialog
-#define RD_ANCHORX_RIGHT 1 //move the control to keep it constant distance from the right edge of the dialog
-#define RD_ANCHORX_WIDTH 2 //size the control to keep it constant distance from both edges of the dialog
-#define RD_ANCHORX_CENTRE 4 //move the control to keep it constant distance from the centre of the dialog
-#define RD_ANCHORY_CUSTOM 0
-#define RD_ANCHORY_TOP 0
-#define RD_ANCHORY_BOTTOM 8
-#define RD_ANCHORY_HEIGHT 16
-#define RD_ANCHORY_CENTRE 32
-
-typedef struct {
- int cbSize;
- UINT wId; //control ID
- RECT rcItem; //original control rectangle, relative to dialog
- //modify in-place to specify the new position
- SIZE dlgOriginalSize; //size of dialog client area in template
- SIZE dlgNewSize; //current size of dialog client area
-} UTILRESIZECONTROL;
-
-typedef int (*DIALOGRESIZERPROC)(HWND hwndDlg,LPARAM lParam,UTILRESIZECONTROL *urc);
-
-typedef struct {
- int cbSize;
- HWND hwndDlg;
- HINSTANCE hInstance; //module containing the dialog template
- LPCTSTR lpTemplate; //dialog template
- LPARAM lParam; //caller-defined
- DIALOGRESIZERPROC pfnResizer;
-} UTILRESIZEDIALOG;
-
-#endif
diff --git a/plugins/WhoUsesMyFiles/src/wumfplug.cpp b/plugins/WhoUsesMyFiles/src/wumfplug.cpp index 757d39ffcd..662d922fc2 100644 --- a/plugins/WhoUsesMyFiles/src/wumfplug.cpp +++ b/plugins/WhoUsesMyFiles/src/wumfplug.cpp @@ -6,7 +6,8 @@ HGENMENU hMenuItem = 0; int hLangpack;
HWND hDlg;
-static PLUGININFOEX pluginInfo = {
+static PLUGININFOEX pluginInfo =
+{
sizeof(PLUGININFOEX),
__PLUGIN_NAME,
PLUGIN_MAKE_VERSION(__MAJOR_VERSION, __MINOR_VERSION, __RELEASE_NUM, __BUILD_NUM),
@@ -25,145 +26,121 @@ void LoadOptions() DBVARIANT dbv = { 0 };
dbv.type = DBVT_TCHAR;
ZeroMemory(&WumfOptions, sizeof(WumfOptions));
- if (db_get(NULL, ModuleName, OPT_FILE, &dbv) == 0)
+ if (db_get(NULL, MODULENAME, OPT_FILE, &dbv) == 0)
_tcsncpy(WumfOptions.LogFile, dbv.ptszVal, 255);
else
WumfOptions.LogFile[0] = '\0';
- WumfOptions.PopupsEnabled = db_get_b(NULL,ModuleName, POPUPS_ENABLED, TRUE);
+ WumfOptions.PopupsEnabled = db_get_b(NULL, MODULENAME, POPUPS_ENABLED, TRUE);
- WumfOptions.UseDefColor = db_get_b(NULL,ModuleName, COLOR_DEF, TRUE);
- WumfOptions.UseWinColor = db_get_b(NULL,ModuleName, COLOR_WIN, FALSE);
- WumfOptions.SelectColor = db_get_b(NULL,ModuleName, COLOR_SET, FALSE);
+ WumfOptions.UseDefColor = db_get_b(NULL, MODULENAME, COLOR_DEF, TRUE);
+ WumfOptions.UseWinColor = db_get_b(NULL, MODULENAME, COLOR_WIN, FALSE);
+ WumfOptions.SelectColor = db_get_b(NULL, MODULENAME, COLOR_SET, FALSE);
- WumfOptions.ColorText = db_get_dw(NULL,ModuleName, COLOR_TEXT, RGB(0,0,0));
- WumfOptions.ColorBack = db_get_dw(NULL,ModuleName, COLOR_BACK, RGB(255,255,255));
-
- WumfOptions.DelayDef = db_get_b(NULL,ModuleName, DELAY_DEF, TRUE);
- WumfOptions.DelayInf = db_get_b(NULL,ModuleName, DELAY_INF, FALSE);
- WumfOptions.DelaySet = db_get_b(NULL,ModuleName, DELAY_SET, FALSE);
- WumfOptions.DelaySec = db_get_b(NULL,ModuleName, DELAY_SEC, 0);
- if( !ServiceExists(MS_POPUP_ADDPOPUP)) {
+ WumfOptions.ColorText = db_get_dw(NULL, MODULENAME, COLOR_TEXT, RGB(0,0,0));
+ WumfOptions.ColorBack = db_get_dw(NULL, MODULENAME, COLOR_BACK, RGB(255,255,255));
+
+ WumfOptions.DelayDef = db_get_b(NULL, MODULENAME, DELAY_DEF, TRUE);
+ WumfOptions.DelayInf = db_get_b(NULL, MODULENAME, DELAY_INF, FALSE);
+ WumfOptions.DelaySet = db_get_b(NULL, MODULENAME, DELAY_SET, FALSE);
+ WumfOptions.DelaySec = db_get_b(NULL, MODULENAME, DELAY_SEC, 0);
+ if (!ServiceExists(MS_POPUP_ADDPOPUP)) {
WumfOptions.DelayDef = TRUE;
WumfOptions.DelaySet = FALSE;
WumfOptions.DelayInf = FALSE;
}
- WumfOptions.LogToFile = db_get_b(NULL,ModuleName, LOG_INTO_FILE, FALSE);
- WumfOptions.LogFolders = db_get_b(NULL,ModuleName, LOG_FOLDER, TRUE);
- WumfOptions.AlertFolders = db_get_b(NULL,ModuleName, ALERT_FOLDER, TRUE);
- WumfOptions.LogUNC = db_get_b(NULL,ModuleName, LOG_UNC, FALSE);
- WumfOptions.AlertUNC = db_get_b(NULL,ModuleName, ALERT_UNC, FALSE);
- WumfOptions.LogComp = db_get_b(NULL,ModuleName, LOG_COMP, FALSE);
- WumfOptions.AlertComp = db_get_b(NULL,ModuleName, ALERT_COMP, FALSE);
- return;
+ WumfOptions.LogToFile = db_get_b(NULL, MODULENAME, LOG_INTO_FILE, FALSE);
+ WumfOptions.LogFolders = db_get_b(NULL, MODULENAME, LOG_FOLDER, TRUE);
+ WumfOptions.AlertFolders = db_get_b(NULL, MODULENAME, ALERT_FOLDER, TRUE);
+ WumfOptions.LogUNC = db_get_b(NULL, MODULENAME, LOG_UNC, FALSE);
+ WumfOptions.AlertUNC = db_get_b(NULL, MODULENAME, ALERT_UNC, FALSE);
+ WumfOptions.LogComp = db_get_b(NULL, MODULENAME, LOG_COMP, FALSE);
+ WumfOptions.AlertComp = db_get_b(NULL, MODULENAME, ALERT_COMP, FALSE);
}
-
void ExecuteMenu(HWND hWnd)
{
- POINT point;
-
- HMENU hMenu=CreatePopupMenu();
- if(!hMenu)
- {
+ HMENU hMenu = CreatePopupMenu();
+ if (!hMenu) {
msg(TranslateT("Error crerating menu"));
return;
- };
+ }
AppendMenu(hMenu, MF_STRING, IDM_ABOUT, _T("About\0"));
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);//------------------
AppendMenu(hMenu, MF_STRING, IDM_SHOW, _T("Show connections\0"));
AppendMenu(hMenu, MF_SEPARATOR, 0, NULL);//------------------
AppendMenu(hMenu, MF_STRING, IDM_EXIT, _T("Dismiss popup\0"));
- GetCursorPos (&point);
- SetForegroundWindow (hWnd);
-
- TrackPopupMenu (hMenu, TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RIGHTALIGN | TPM_TOPALIGN,
- point.x, point.y, 0, hWnd, NULL);
-
- PostMessage (hWnd, WM_USER, 0, 0);
+ POINT point;
+ GetCursorPos(&point);
+ SetForegroundWindow(hWnd);
+ TrackPopupMenu(hMenu, TPM_LEFTBUTTON | TPM_RIGHTBUTTON | TPM_RIGHTALIGN | TPM_TOPALIGN, point.x, point.y, 0, hWnd, NULL);
+ PostMessage(hWnd, WM_USER, 0, 0);
DestroyMenu(hMenu);
}
static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
-// PWumf w = NULL;
switch(message) {
- case WM_COMMAND:
- switch (LOWORD(wParam))
- {
- case IDM_ABOUT:
- break;
- case IDM_EXIT:
- PUDeletePopUp(hWnd);
- break;
- case IDM_SHOW:
- CallService(MS_WUMF_CONNECTIONSSHOW, (WPARAM)0, (LPARAM)0);
- return TRUE;
- }
- switch (HIWORD(wParam))
- {
- case STN_CLICKED:
- PUDeletePopUp(hWnd);
- return TRUE;
- }
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDM_ABOUT:
break;
- case WM_CONTEXTMENU:
-// ExecuteMenu(hWnd);
- CallService(MS_WUMF_CONNECTIONSSHOW, (WPARAM)0, (LPARAM)0);
- break;
- case UM_FREEPLUGINDATA: {
-/* w = (PWumf)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)w);
- if(w) free(w);*/
- return TRUE; //TRUE or FALSE is the same, it gets ignored.
+ case IDM_EXIT:
+ PUDeletePopUp(hWnd);
+ break;
+ case IDM_SHOW:
+ CallService(MS_WUMF_CONNECTIONSSHOW, (WPARAM)0, (LPARAM)0);
+ return TRUE;
}
- default:
- break;
+
+ switch (HIWORD(wParam)) {
+ case STN_CLICKED:
+ PUDeletePopUp(hWnd);
+ return TRUE;
+ }
+ break;
+
+ case WM_CONTEXTMENU:
+ CallService(MS_WUMF_CONNECTIONSSHOW, (WPARAM)0, (LPARAM)0);
+ break;
+
+ case UM_FREEPLUGINDATA:
+ return TRUE; //TRUE or FALSE is the same, it gets ignored.
}
return DefWindowProc(hWnd, message, wParam, lParam);
-};
+}
void ShowWumfPopUp(PWumf w)
{
TCHAR text[512], title[512];
- if(!WumfOptions.AlertFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
+ if (!WumfOptions.AlertFolders && (w->dwAttr & FILE_ATTRIBUTE_DIRECTORY)) return;
mir_sntprintf(title, SIZEOF(title), _T("%s (%s)"), w->szComp, w->szUser);
mir_sntprintf(text, SIZEOF(text), _T("%s (%s)"), w->szPath, w->szPerm);
- ShowThePopUp(w, title, text);
+ ShowThePopUp(w, title, text);
}
+
void ShowThePopUp(PWumf w, LPTSTR title, LPTSTR text)
{
POPUPDATAT ppd = {0};
ppd.lchContact = NULL;
ppd.lchIcon = LoadIcon(hInst, MAKEINTRESOURCE(IDI_DRIVE));
- if(WumfOptions.DelayInf)
- {
+ if (WumfOptions.DelayInf)
ppd.iSeconds = -1;
- }
- else if(WumfOptions.DelayDef)
- {
+ else if (WumfOptions.DelayDef)
ppd.iSeconds = 0;
- }
- else if(WumfOptions.DelaySet)
- {
+ else if (WumfOptions.DelaySet)
ppd.iSeconds = WumfOptions.DelaySec;
- }
lstrcpyn(ppd.lptzContactName, title, MAX_CONTACTNAME);
lstrcpyn(ppd.lptzText, text, MAX_SECONDLINE);
- if(WumfOptions.UseWinColor)
- {
+ if (WumfOptions.UseWinColor) {
ppd.colorBack = GetSysColor(COLOR_WINDOW);
ppd.colorText = GetSysColor(COLOR_WINDOWTEXT);
}
- else if(WumfOptions.UseDefColor)
- {
- ppd.colorBack = ppd.colorText = 0;
- }
- else if(WumfOptions.SelectColor)
- {
+ else if (WumfOptions.SelectColor) {
ppd.colorBack = WumfOptions.ColorBack;
ppd.colorText = WumfOptions.ColorText;
}
@@ -175,13 +152,12 @@ void ShowThePopUp(PWumf w, LPTSTR title, LPTSTR text) void ShowThePreview()
{
- if( !ServiceExists(MS_POPUP_ADDPOPUPT)) {
+ if ( !ServiceExists(MS_POPUP_ADDPOPUPT)) {
MessageBox(NULL, TranslateT("PopUp plugin not found!"), TranslateT("WUMF plugin"), MB_OK|MB_ICONSTOP);
return;
}
- if(WumfOptions.AlertFolders)
- {
+ if (WumfOptions.AlertFolders) {
ShowThePopUp(NULL, _T("Guest"), _T("C:\\My Share"));
Sleep(300);
ShowThePopUp(NULL, _T("Guest"), _T("C:\\My Share\\Photos"));
@@ -189,8 +165,7 @@ void ShowThePreview() }
ShowThePopUp(NULL, _T("Guest"), _T("C:\\Share\\My Photos\\photo.jpg"));
Sleep(300);
- if(WumfOptions.AlertFolders)
- {
+ if (WumfOptions.AlertFolders) {
ShowThePopUp(NULL, _T("User"), _T("C:\\My Share"));
Sleep(300);
ShowThePopUp(NULL, _T("User"), _T("C:\\My Share\\Movies"));
@@ -198,17 +173,14 @@ void ShowThePreview() }
ShowThePopUp(NULL, _T("User"), _T("C:\\My Share\\Movies\\The Two Towers.avi"));
Sleep(300);
- if(WumfOptions.AlertFolders)
- {
+ if (WumfOptions.AlertFolders) {
ShowThePopUp(NULL, _T("Administrator"), _T("C:\\Distributives"));
Sleep(300);
ShowThePopUp(NULL, _T("Administrator"), _T("C:\\Distributives\\Win2k"));
Sleep(300);
}
ShowThePopUp(NULL, _T("Administrator"), _T("C:\\Distributives\\Win2k\\setup.exe"));
-};
-
-
+}
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
{
@@ -216,34 +188,29 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) return TRUE;
}
-DWORD WINAPI ThreadProc(LPVOID lpParameter)
+void ThreadProc(LPVOID)
{
- MSG msg; //Message pump.
- if(hDlg)
- {
+ if (hDlg) {
ShowWindow(hDlg, SW_SHOWNORMAL);
SetForegroundWindow(hDlg);
- return (int)(1);
+ return;
}
+
hDlg = CreateDialog(hInst, MAKEINTRESOURCE(IDD_CONNLIST), NULL, ConnDlgProc);
SendMessage(hDlg, WM_SETICON, ICON_SMALL, (LPARAM)LoadIcon(hInst,MAKEINTRESOURCE(IDI_DRIVE)));
ShowWindow(hDlg, SW_SHOW);
- while(GetMessage(&msg, NULL, 0, 0) == TRUE)
- {
+
+ MSG msg;
+ while(GetMessage(&msg, NULL, 0, 0) == TRUE) {
TranslateMessage(&msg);
DispatchMessage(&msg);
}
hDlg = NULL;
- ExitThread(0);
-
- return (int)(1);
}
static INT_PTR WumfShowConnections(WPARAM wParam,LPARAM lParam)
{
- DWORD threadID = 0;
- CloseHandle(CreateThread(NULL, 0, ThreadProc, NULL,0,&threadID));
- Sleep(100);
+ mir_forkthread(ThreadProc, NULL);
CallService(MS_TTB_SETBUTTONSTATE, (WPARAM)hWumfBut, TTBST_RELEASED);
return 0;
}
@@ -264,7 +231,7 @@ static INT_PTR WumfMenuCommand(WPARAM,LPARAM) mi.pszName = LPGEN("Disable WUMF popups");
mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP));
}
- db_set_b(NULL, ModuleName, POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
+ db_set_b(NULL, MODULENAME, POPUPS_ENABLED, (BYTE)WumfOptions.PopupsEnabled);
mi.flags = CMIM_NAME | CMIM_ICON;
Menu_ModifyItem(hMenuItem, &mi);
return 0;
@@ -287,41 +254,35 @@ void DisableDelayOptions(HWND hwndDlg) EnableWindow(GetDlgItem(hwndDlg, IDC_TX_DELAY_SEC), FALSE);
EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY_NOTE), TRUE);
}
+
void ChooseFile(HWND hDlg)
{
- OPENFILENAME ofn = {0}; // common dialog box structure
- TCHAR szFile[260]; // buffer for filename
+ TCHAR szFile[MAX_PATH]; szFile[0]=0;
+
// Initialize OPENFILENAME
+ OPENFILENAME ofn = {0}; // common dialog box structure
ofn.lStructSize = sizeof(OPENFILENAME);
ofn.hwndOwner = hDlg;
- szFile[0]=0;
ofn.lpstrFile = szFile;
ofn.nMaxFile = 260;
ofn.lpstrFilter = _T("All files (*.*)\0*.*\0Text files (*.txt)\0*.txt\0Log files (*.log)\0*.log\0\0");
ofn.nFilterIndex = 2;
- ofn.lpstrFileTitle = NULL;
- ofn.nMaxFileTitle = 0;
- ofn.lpstrInitialDir = NULL;
ofn.Flags = OFN_CREATEPROMPT;
// Display the Open dialog box.
- if (GetSaveFileName(&ofn)==TRUE)
- {
+ if (GetSaveFileName(&ofn) == TRUE) {
HANDLE hf = CreateFile(ofn.lpstrFile,GENERIC_WRITE,0,NULL,OPEN_ALWAYS,FILE_ATTRIBUTE_NORMAL, NULL);
- if(hf!=INVALID_HANDLE_VALUE)
- {
+ if (hf != INVALID_HANDLE_VALUE) {
SetDlgItemText(hDlg,IDC_FILE,ofn.lpstrFile);
lstrcpyn(WumfOptions.LogFile, ofn.lpstrFile, 255);
CloseHandle(hf);
}
}
- else if(CommDlgExtendedError()!=0L)
- {
+ else if (CommDlgExtendedError() != 0) {
TCHAR str[256];
mir_sntprintf(str, SIZEOF(str), TranslateT("Common Dialog Error 0x%lx"), CommDlgExtendedError());
MessageBox(hDlg, str, TranslateT("Wumf plugin"), MB_OK | MB_ICONSTOP);
- };
-
-};
+ }
+}
INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lparam)
{
@@ -329,197 +290,179 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lpara WORD wNotifyCode = HIWORD(wparam);
int seconds;
- switch(msg)
- {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- CheckDlgButton(hwndDlg, IDC_COLOR_WIN, WumfOptions.UseWinColor?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_COLOR_DEF, WumfOptions.UseDefColor?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_COLOR_SET, WumfOptions.SelectColor?BST_CHECKED:BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BACK), WumfOptions.SelectColor);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_TEXT), WumfOptions.SelectColor);
- if(WumfOptions.SelectColor) {
+ switch(msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_COLOR_WIN, WumfOptions.UseWinColor?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_COLOR_DEF, WumfOptions.UseDefColor?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_COLOR_SET, WumfOptions.SelectColor?BST_CHECKED:BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BACK), WumfOptions.SelectColor);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_TEXT), WumfOptions.SelectColor);
+ if (WumfOptions.SelectColor) {
+ SendDlgItemMessage(hwndDlg,IDC_COLOR_BACK,CPM_SETCOLOUR,0,WumfOptions.ColorBack);
+ SendDlgItemMessage(hwndDlg,IDC_COLOR_TEXT,CPM_SETCOLOUR,0,WumfOptions.ColorText);
+ }
+ if ( !ServiceExists(MS_POPUP_ADDPOPUP)) {
+ DisableDelayOptions(hwndDlg);
+ break;
+ }
+ CheckDlgButton(hwndDlg, IDC_DELAY_INF, WumfOptions.DelayInf?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DELAY_DEF, WumfOptions.DelayDef?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DELAY_SET, WumfOptions.DelaySet?BST_CHECKED:BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY_SEC), WumfOptions.DelaySet);
+ SetDlgItemInt(hwndDlg, IDC_DELAY_SEC, WumfOptions.DelaySec, FALSE);
+ //Logging & alerts
+ CheckDlgButton(hwndDlg, IDC_LOG_FOLDER, WumfOptions.LogFolders?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALERT_FOLDER, WumfOptions.AlertFolders?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_LOG_UNC, WumfOptions.LogUNC?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALERT_UNC, WumfOptions.AlertUNC?BST_CHECKED:BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_LOG_COMP, WumfOptions.LogComp?BST_CHECKED:BST_UNCHECKED);
+
+ if (WumfOptions.LogToFile) {
+ CheckDlgButton(hwndDlg,IDC_LOG_INTO_FILE,BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SEL_FILE), TRUE);
+ SetDlgItemText(hwndDlg,IDC_FILE,WumfOptions.LogFile);
+ }
+ else {
+ CheckDlgButton(hwndDlg,IDC_LOG_INTO_FILE,BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SEL_FILE), FALSE);
+ SetDlgItemText(hwndDlg, IDC_FILE, _T(""));
+ }
+ break;
+
+ case WM_COMMAND:
+ switch(wNotifyCode) {
+ case BN_CLICKED :
+ switch(wControlId) {
+ case IDC_DELAY_SET:
+ case IDC_DELAY_DEF:
+ case IDC_DELAY_INF:
+ WumfOptions.DelaySet = (IsDlgButtonChecked(hwndDlg, IDC_DELAY_SET) == BST_CHECKED);
+ WumfOptions.DelayDef = (IsDlgButtonChecked(hwndDlg, IDC_DELAY_DEF) == BST_CHECKED);
+ WumfOptions.DelayInf = (IsDlgButtonChecked(hwndDlg, IDC_DELAY_INF) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY_SEC), WumfOptions.DelaySet);
+ SetDlgItemInt(hwndDlg, IDC_DELAY_SEC, WumfOptions.DelaySec, TRUE);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_COLOR_SET:
+ case IDC_COLOR_DEF:
+ case IDC_COLOR_WIN:
+ WumfOptions.SelectColor = (IsDlgButtonChecked(hwndDlg, IDC_COLOR_SET) == BST_CHECKED);
+ WumfOptions.UseDefColor = (IsDlgButtonChecked(hwndDlg, IDC_COLOR_DEF) == BST_CHECKED);
+ WumfOptions.UseWinColor = (IsDlgButtonChecked(hwndDlg, IDC_COLOR_WIN) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BACK),WumfOptions.SelectColor);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_TEXT), WumfOptions.SelectColor);
SendDlgItemMessage(hwndDlg,IDC_COLOR_BACK,CPM_SETCOLOUR,0,WumfOptions.ColorBack);
SendDlgItemMessage(hwndDlg,IDC_COLOR_TEXT,CPM_SETCOLOUR,0,WumfOptions.ColorText);
- }
- if( !ServiceExists(MS_POPUP_ADDPOPUP)) {
- DisableDelayOptions(hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ /* not implemented */
+ case IDC_LOG_COMP:
+ case IDC_ALERT_COMP:
+ case IDC_LOG_UNC:
+ case IDC_ALERT_UNC:
+ MessageBox(NULL, TranslateT("Not implemented yet..."), _T("WUMF"), MB_OK | MB_ICONINFORMATION);
+ break;
+ /* end */
+ case IDC_LOG_INTO_FILE:
+ WumfOptions.LogToFile = (IsDlgButtonChecked(hwndDlg, IDC_LOG_INTO_FILE) == BST_CHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), WumfOptions.LogToFile);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SEL_FILE), WumfOptions.LogToFile);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_SEL_FILE:
+ ChooseFile(hwndDlg);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_LOG_FOLDER:
+ WumfOptions.LogFolders = (IsDlgButtonChecked(hwndDlg, IDC_LOG_FOLDER) == BST_CHECKED);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_ALERT_FOLDER:
+ WumfOptions.AlertFolders = (IsDlgButtonChecked(hwndDlg, IDC_ALERT_FOLDER) == BST_CHECKED);
+ break;
+ case IDC_PREVIEW:
+ ShowThePreview();
+ break;
+ case IDC_CONN:
+ CallService(MS_WUMF_CONNECTIONSSHOW, (WPARAM)0, (LPARAM)0);
break;
}
- CheckDlgButton(hwndDlg, IDC_DELAY_INF, WumfOptions.DelayInf?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DELAY_DEF, WumfOptions.DelayDef?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_DELAY_SET, WumfOptions.DelaySet?BST_CHECKED:BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY_SEC), WumfOptions.DelaySet);
- SetDlgItemInt(hwndDlg, IDC_DELAY_SEC, WumfOptions.DelaySec, FALSE);
- //Logging & alerts
- CheckDlgButton(hwndDlg, IDC_LOG_FOLDER, WumfOptions.LogFolders?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALERT_FOLDER, WumfOptions.AlertFolders?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_LOG_UNC, WumfOptions.LogUNC?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_ALERT_UNC, WumfOptions.AlertUNC?BST_CHECKED:BST_UNCHECKED);
- CheckDlgButton(hwndDlg, IDC_LOG_COMP, WumfOptions.LogComp?BST_CHECKED:BST_UNCHECKED);
-
- if(WumfOptions.LogToFile)
- {
- CheckDlgButton(hwndDlg,IDC_LOG_INTO_FILE,BST_CHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), TRUE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SEL_FILE), TRUE);
- SetDlgItemText(hwndDlg,IDC_FILE,WumfOptions.LogFile);
- }
- else
- {
- CheckDlgButton(hwndDlg,IDC_LOG_INTO_FILE,BST_UNCHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), FALSE);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SEL_FILE), FALSE);
- SetDlgItemText(hwndDlg, IDC_FILE, _T(""));
- };
+ break;
+ case CPN_COLOURCHANGED:
+ WumfOptions.ColorText = SendDlgItemMessage(hwndDlg,IDC_COLOR_TEXT,CPM_GETCOLOUR,0,0);
+ WumfOptions.ColorBack = SendDlgItemMessage(hwndDlg,IDC_COLOR_BACK,CPM_GETCOLOUR,0,0);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
break;
- case WM_COMMAND:
- switch(wNotifyCode)
- {
- case BN_CLICKED :
- switch(wControlId)
- {
- case IDC_DELAY_SET:
- case IDC_DELAY_DEF:
- case IDC_DELAY_INF:
- WumfOptions.DelaySet = (IsDlgButtonChecked(hwndDlg, IDC_DELAY_SET) == BST_CHECKED);
- WumfOptions.DelayDef = (IsDlgButtonChecked(hwndDlg, IDC_DELAY_DEF) == BST_CHECKED);
- WumfOptions.DelayInf = (IsDlgButtonChecked(hwndDlg, IDC_DELAY_INF) == BST_CHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_DELAY_SEC), WumfOptions.DelaySet);
- SetDlgItemInt(hwndDlg, IDC_DELAY_SEC, WumfOptions.DelaySec, TRUE);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_COLOR_SET:
- case IDC_COLOR_DEF:
- case IDC_COLOR_WIN:
- WumfOptions.SelectColor = (IsDlgButtonChecked(hwndDlg, IDC_COLOR_SET) == BST_CHECKED);
- WumfOptions.UseDefColor = (IsDlgButtonChecked(hwndDlg, IDC_COLOR_DEF) == BST_CHECKED);
- WumfOptions.UseWinColor = (IsDlgButtonChecked(hwndDlg, IDC_COLOR_WIN) == BST_CHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_BACK),WumfOptions.SelectColor);
- EnableWindow(GetDlgItem(hwndDlg, IDC_COLOR_TEXT), WumfOptions.SelectColor);
- SendDlgItemMessage(hwndDlg,IDC_COLOR_BACK,CPM_SETCOLOUR,0,WumfOptions.ColorBack);
- SendDlgItemMessage(hwndDlg,IDC_COLOR_TEXT,CPM_SETCOLOUR,0,WumfOptions.ColorText);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- /* not implemented */
- case IDC_LOG_COMP:
- case IDC_ALERT_COMP:
- case IDC_LOG_UNC:
- case IDC_ALERT_UNC:
- MessageBox(NULL, TranslateT("Not implemented yet..."), _T("WUMF"), MB_OK | MB_ICONINFORMATION);
- break;
- /* end */
- case IDC_LOG_INTO_FILE:
- WumfOptions.LogToFile = (IsDlgButtonChecked(hwndDlg, IDC_LOG_INTO_FILE) == BST_CHECKED);
- EnableWindow(GetDlgItem(hwndDlg, IDC_FILE), WumfOptions.LogToFile);
- EnableWindow(GetDlgItem(hwndDlg, IDC_SEL_FILE), WumfOptions.LogToFile);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_SEL_FILE:
- ChooseFile(hwndDlg);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_LOG_FOLDER:
- WumfOptions.LogFolders = (IsDlgButtonChecked(hwndDlg, IDC_LOG_FOLDER) == BST_CHECKED);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_ALERT_FOLDER:
- WumfOptions.AlertFolders = (IsDlgButtonChecked(hwndDlg, IDC_ALERT_FOLDER) == BST_CHECKED);
- break;
-/* case IDC_LOG_COMP:
- WumfOptions.LogComp = (IsDlgButtonChecked(hwndDlg, IDC_LOG_COMP) == BST_CHECKED);
- break;
- case IDC_ALERT_COMP:
- WumfOptions.AlertComp = (IsDlgButtonChecked(hwndDlg, IDC_ALERT_COMP) == BST_CHECKED);
- break;
- case IDC_LOG_UNC:
- WumfOptions.LogUNC = (IsDlgButtonChecked(hwndDlg, IDC_LOG_UNC) == BST_CHECKED);
- break;
- case IDC_ALERT_UNC:
- WumfOptions.AlertUNC = (IsDlgButtonChecked(hwndDlg, IDC_ALERT_UNC) == BST_CHECKED);
- break;
-*/ case IDC_PREVIEW:
- ShowThePreview();
- break;
- case IDC_CONN:
- CallService(MS_WUMF_CONNECTIONSSHOW, (WPARAM)0, (LPARAM)0);
- break;
- }
- break;
- case CPN_COLOURCHANGED:
- WumfOptions.ColorText = SendDlgItemMessage(hwndDlg,IDC_COLOR_TEXT,CPM_GETCOLOUR,0,0);
- WumfOptions.ColorBack = SendDlgItemMessage(hwndDlg,IDC_COLOR_BACK,CPM_GETCOLOUR,0,0);
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case EN_CHANGE:
- switch(wControlId)
- {
- case IDC_DELAY_SEC:
- seconds = GetDlgItemInt(hwndDlg, IDC_DELAY_SEC, NULL, FALSE);
- if (seconds > LIFETIME_MAX)
- WumfOptions.DelaySec = LIFETIME_MAX;
- else if (seconds < LIFETIME_MIN)
- WumfOptions.DelaySec = LIFETIME_MIN;
- else if (seconds <= LIFETIME_MAX || seconds >= LIFETIME_MIN)
- WumfOptions.DelaySec = seconds;
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- case IDC_FILE:
- GetDlgItemText(hwndDlg,IDC_FILE,WumfOptions.LogFile, sizeof(WumfOptions.LogFile));
- SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
- break;
- }
- break;
- case EN_KILLFOCUS:
- switch(wControlId)
- {
- case IDC_DELAY_SEC:
- SetDlgItemInt(hwndDlg, IDC_DELAY_SEC, WumfOptions.DelaySec, FALSE);
- break;
- };
- break;
+
+ case EN_CHANGE:
+ switch(wControlId) {
+ case IDC_DELAY_SEC:
+ seconds = GetDlgItemInt(hwndDlg, IDC_DELAY_SEC, NULL, FALSE);
+ if (seconds > LIFETIME_MAX)
+ WumfOptions.DelaySec = LIFETIME_MAX;
+ else if (seconds < LIFETIME_MIN)
+ WumfOptions.DelaySec = LIFETIME_MIN;
+ else if (seconds <= LIFETIME_MAX || seconds >= LIFETIME_MIN)
+ WumfOptions.DelaySec = seconds;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case IDC_FILE:
+ GetDlgItemText(hwndDlg,IDC_FILE,WumfOptions.LogFile, sizeof(WumfOptions.LogFile));
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
}
- break;
- case WM_NOTIFY:
- switch(((LPNMHDR)lparam)->idFrom) {
- case 0:
- switch (((LPNMHDR)lparam)->code) {
- case PSN_RESET:
- LoadOptions();
- return TRUE;
- case PSN_APPLY:
- db_set_b(NULL,ModuleName, COLOR_DEF, (BYTE)WumfOptions.UseDefColor);
- db_set_b(NULL,ModuleName, COLOR_WIN, (BYTE)WumfOptions.UseWinColor);
- db_set_b(NULL,ModuleName, COLOR_SET, (BYTE)WumfOptions.SelectColor );
- db_set_dw(NULL,ModuleName, COLOR_TEXT, (DWORD)WumfOptions.ColorText);
- db_set_dw(NULL,ModuleName, COLOR_BACK, (DWORD)WumfOptions.ColorBack);
- db_set_b(NULL,ModuleName, DELAY_DEF, (BYTE)WumfOptions.DelayDef);
- db_set_b(NULL,ModuleName, DELAY_INF, (BYTE)WumfOptions.DelayInf);
- db_set_b(NULL,ModuleName, DELAY_SET, (BYTE)WumfOptions.DelaySet);
- db_set_b(NULL,ModuleName, DELAY_SEC, (BYTE)WumfOptions.DelaySec);
- db_set_b(NULL,ModuleName, LOG_INTO_FILE, (BYTE)WumfOptions.LogToFile);
- db_set_b(NULL,ModuleName, LOG_FOLDER, (BYTE)WumfOptions.LogFolders);
- db_set_b(NULL,ModuleName, ALERT_FOLDER, (BYTE)WumfOptions.AlertFolders);
- db_set_b(NULL,ModuleName, LOG_UNC, (BYTE)WumfOptions.LogUNC);
- db_set_b(NULL,ModuleName, ALERT_UNC, (BYTE)WumfOptions.AlertUNC);
- db_set_b(NULL,ModuleName, LOG_COMP, (BYTE)WumfOptions.LogComp);
- db_set_b(NULL,ModuleName, ALERT_COMP, (BYTE)WumfOptions.AlertComp);
- GetDlgItemText(hwndDlg, IDC_FILE, WumfOptions.LogFile, 255);
- db_set_ts(NULL, ModuleName, OPT_FILE, WumfOptions.LogFile);
- break;
- }
- break;
+ break;
+ case EN_KILLFOCUS:
+ switch(wControlId) {
+ case IDC_DELAY_SEC:
+ SetDlgItemInt(hwndDlg, IDC_DELAY_SEC, WumfOptions.DelaySec, FALSE);
+ break;
}
break;
+ }
+ break;
+
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lparam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lparam)->code) {
+ case PSN_RESET:
+ LoadOptions();
+ return TRUE;
+
+ case PSN_APPLY:
+ db_set_dw(NULL, MODULENAME, COLOR_TEXT, (DWORD)WumfOptions.ColorText);
+ db_set_dw(NULL, MODULENAME, COLOR_BACK, (DWORD)WumfOptions.ColorBack);
+ db_set_b(NULL, MODULENAME, COLOR_DEF, (BYTE)WumfOptions.UseDefColor);
+ db_set_b(NULL, MODULENAME, COLOR_WIN, (BYTE)WumfOptions.UseWinColor);
+ db_set_b(NULL, MODULENAME, COLOR_SET, (BYTE)WumfOptions.SelectColor );
+ db_set_b(NULL, MODULENAME, DELAY_DEF, (BYTE)WumfOptions.DelayDef);
+ db_set_b(NULL, MODULENAME, DELAY_INF, (BYTE)WumfOptions.DelayInf);
+ db_set_b(NULL, MODULENAME, DELAY_SET, (BYTE)WumfOptions.DelaySet);
+ db_set_b(NULL, MODULENAME, DELAY_SEC, (BYTE)WumfOptions.DelaySec);
+ db_set_b(NULL, MODULENAME, LOG_INTO_FILE, (BYTE)WumfOptions.LogToFile);
+ db_set_b(NULL, MODULENAME, LOG_FOLDER, (BYTE)WumfOptions.LogFolders);
+ db_set_b(NULL, MODULENAME, ALERT_FOLDER, (BYTE)WumfOptions.AlertFolders);
+ db_set_b(NULL, MODULENAME, LOG_UNC, (BYTE)WumfOptions.LogUNC);
+ db_set_b(NULL, MODULENAME, ALERT_UNC, (BYTE)WumfOptions.AlertUNC);
+ db_set_b(NULL, MODULENAME, LOG_COMP, (BYTE)WumfOptions.LogComp);
+ db_set_b(NULL, MODULENAME, ALERT_COMP, (BYTE)WumfOptions.AlertComp);
+ GetDlgItemText(hwndDlg, IDC_FILE, WumfOptions.LogFile, 255);
+ db_set_ts(NULL, MODULENAME, OPT_FILE, WumfOptions.LogFile);
+ }
+ }
+ break;
}
return 0;
}
int InitTopToolbar(WPARAM,LPARAM)
{
- TTBButton ttb = { 0 };
- ttb.cbSize = sizeof(ttb);
+ TTBButton ttb = { sizeof(ttb) };
ttb.hIconUp = LoadIcon(hInst, MAKEINTRESOURCE(IDI_DRIVE));
ttb.pszService = MS_WUMF_CONNECTIONSSHOW;
ttb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP;
@@ -530,17 +473,15 @@ int InitTopToolbar(WPARAM,LPARAM) int OptionsInit(WPARAM wparam, LPARAM)
{
- OPTIONSDIALOGPAGE odp = {0};
-
- odp.cbSize = sizeof(odp);
- odp.position = 945000000;
- odp.hInstance = hInst;
- odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
- odp.pszTitle = LPGEN("Wumf");
- odp.pfnDlgProc = OptionsDlgProc;
+ OPTIONSDIALOGPAGE odp = { sizeof(odp) };
+ odp.position = 945000000;
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPTIONS);
+ odp.pszTitle = LPGEN("Wumf");
+ odp.pfnDlgProc = OptionsDlgProc;
odp.pszGroup = LPGEN("Services");
odp.flags = ODPF_BOLDGROUPS;
- Options_AddPage(wparam, &odp);
+ Options_AddPage(wparam, &odp);
return 0;
}
@@ -552,47 +493,44 @@ extern "C" __declspec(dllexport) int Load(void) CreateServiceFunction(MS_WUMF_SWITCHPOPUP, WumfMenuCommand);
CreateServiceFunction(MS_WUMF_CONNECTIONSSHOW, WumfShowConnections);
- {
- CLISTMENUITEM mi = { sizeof(mi) };
- if (WumfOptions.PopupsEnabled == FALSE) {
- mi.pszName = LPGEN("Enable WUMF popups");
- mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP));
- }
- else {
- mi.pszName = LPGEN("Disable WUMF popups");
- mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP));
- }
- mi.pszService = MS_WUMF_SWITCHPOPUP;
- mi.popupPosition = 1999990000;
- mi.pszPopupName = LPGEN("PopUps");
- hMenuItem = Menu_AddMainMenuItem(&mi);
-
- mi.pszName = LPGEN("WUMF: Show connections");
- mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_DRIVE));
- mi.pszService = MS_WUMF_CONNECTIONSSHOW;
- mi.popupPosition = 1999990000;
- mi.pszPopupName = NULL;
- Menu_AddMainMenuItem(&mi);
+
+ CLISTMENUITEM mi = { sizeof(mi) };
+ if (WumfOptions.PopupsEnabled == FALSE) {
+ mi.pszName = LPGEN("Enable WUMF popups");
+ mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_NOPOPUP));
+ }
+ else {
+ mi.pszName = LPGEN("Disable WUMF popups");
+ mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_POPUP));
}
+ mi.pszService = MS_WUMF_SWITCHPOPUP;
+ mi.popupPosition = 1999990000;
+ mi.pszPopupName = LPGEN("PopUps");
+ hMenuItem = Menu_AddMainMenuItem(&mi);
+
+ mi.pszName = LPGEN("WUMF: Show connections");
+ mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_DRIVE));
+ mi.pszService = MS_WUMF_CONNECTIONSSHOW;
+ mi.popupPosition = 1999990000;
+ mi.pszPopupName = NULL;
+ Menu_AddMainMenuItem(&mi);
HookEvent(ME_OPT_INITIALISE,OptionsInit);
HookEvent(ME_TTB_MODULELOADED, InitTopToolbar);
- setlocale( LC_ALL, ".ACP");
-// _setmbcp(_MB_CP_ANSI);
- if (IsUserAnAdmin()) {
+ setlocale( LC_ALL, ".ACP");
+
+ if (IsUserAnAdmin())
SetTimer(NULL, 777, TIME, TimerProc);
- } else {
+ else
MessageBox(NULL, TranslateT("Plugin WhoUsesMyFiles requires admin privileges in order to work."), _T("Miranda NG"), MB_OK);
- }
-
return 0;
}
extern "C" __declspec(dllexport) int Unload(void)
{
- KillTimer(NULL, 777);
- CloseHandle(hLog);
+ KillTimer(NULL, 777);
+ CloseHandle(hLog);
FreeAll();
return 0;
-}
\ No newline at end of file +}
diff --git a/plugins/WhoUsesMyFiles/wumf_10.vcxproj b/plugins/WhoUsesMyFiles/wumf_10.vcxproj index f9fc424bcd..3f1496d181 100644 --- a/plugins/WhoUsesMyFiles/wumf_10.vcxproj +++ b/plugins/WhoUsesMyFiles/wumf_10.vcxproj @@ -189,7 +189,6 @@ </ItemGroup>
<ItemGroup>
<ClCompile Include="src\list.cpp" />
- <ClCompile Include="src\resizer.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
diff --git a/plugins/WhoUsesMyFiles/wumf_10.vcxproj.filters b/plugins/WhoUsesMyFiles/wumf_10.vcxproj.filters index b280af44ec..18a9a28b71 100644 --- a/plugins/WhoUsesMyFiles/wumf_10.vcxproj.filters +++ b/plugins/WhoUsesMyFiles/wumf_10.vcxproj.filters @@ -37,9 +37,6 @@ <ClCompile Include="src\list.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\resizer.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\wumf.cpp">
<Filter>Source Files</Filter>
</ClCompile>
diff --git a/plugins/WhoUsesMyFiles/wumf_11.vcxproj b/plugins/WhoUsesMyFiles/wumf_11.vcxproj index 8028750f00..f537f46ac3 100644 --- a/plugins/WhoUsesMyFiles/wumf_11.vcxproj +++ b/plugins/WhoUsesMyFiles/wumf_11.vcxproj @@ -194,7 +194,6 @@ </ItemGroup>
<ItemGroup>
<ClCompile Include="src\list.cpp" />
- <ClCompile Include="src\resizer.cpp" />
<ClCompile Include="src\stdafx.cpp">
<PrecompiledHeader>Create</PrecompiledHeader>
</ClCompile>
diff --git a/plugins/WhoUsesMyFiles/wumf_11.vcxproj.filters b/plugins/WhoUsesMyFiles/wumf_11.vcxproj.filters index b280af44ec..18a9a28b71 100644 --- a/plugins/WhoUsesMyFiles/wumf_11.vcxproj.filters +++ b/plugins/WhoUsesMyFiles/wumf_11.vcxproj.filters @@ -37,9 +37,6 @@ <ClCompile Include="src\list.cpp">
<Filter>Source Files</Filter>
</ClCompile>
- <ClCompile Include="src\resizer.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
<ClCompile Include="src\wumf.cpp">
<Filter>Source Files</Filter>
</ClCompile>
|