From f677c23f055fb75e6a7da00c4109b0515e151d1c Mon Sep 17 00:00:00 2001 From: Kirill Volinsky Date: Thu, 28 Jun 2012 20:15:16 +0000 Subject: WhoUsesMyFiles: compilation fix git-svn-id: http://svn.miranda-ng.org/main/trunk@674 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WhoUsesMyFiles/Makefile | 122 ------------------------------------ plugins/WhoUsesMyFiles/wumf.c | 6 +- plugins/WhoUsesMyFiles/wumf.h | 3 +- plugins/WhoUsesMyFiles/wumf.vcxproj | 106 +++++++------------------------ plugins/WhoUsesMyFiles/wumfplug.c | 45 ++++++------- 5 files changed, 51 insertions(+), 231 deletions(-) delete mode 100644 plugins/WhoUsesMyFiles/Makefile (limited to 'plugins/WhoUsesMyFiles') diff --git a/plugins/WhoUsesMyFiles/Makefile b/plugins/WhoUsesMyFiles/Makefile deleted file mode 100644 index 5cd7a604d9..0000000000 --- a/plugins/WhoUsesMyFiles/Makefile +++ /dev/null @@ -1,122 +0,0 @@ -!IF "$(CFG)" == "" -CFG=Release -#CFG=Debug - -!MESSAGE No configuration specified. Defaulting to $(CFG) -!ENDIF - -CPP=cl.exe -MTL=midl.exe -RSC=rc.exe -LINK32=link.exe - -out=../../bin/Debug/Plugins -obj=obj -LIBS = user32.lib netapi32.lib comdlg32.lib shlwapi.lib - - -LINK32_OBJS= \ - "$(obj)\resource.res" \ - "$(obj)\wumfplug.obj" \ - "$(obj)\list.obj" \ - "$(obj)\resizer.obj" \ - "$(obj)\wumf.obj" - - -all : "$(out)\wumfplug.dll" test - -$(obj): - if not exist $(obj) mkdir $(obj) - - -$(out): - if not exist "$(out)/$(NULL)" mkdir "$(out)" - -!IF "$(CFG)" == "Release" - -CPP_PROJ=/nologo /MT /W3 /GX /O2 /D "WIN32" /D "_WIN32_WINNT" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Fp"$(obj)/wumfplug.pch" /YX /Fo"$(obj)/" /Fd"$(obj)/" /FD /c -MTL_PROJ=/nologo /D "NDEBUG" /mktyplib203 /win32 -RSC_PROJ=/l 0x809 /fo"$(obj)\resource.res" /d "NDEBUG" -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(obj)\wumfplug.bsc" -BSC32_SBRS= \ - -LINK32_FLAGS= $(LIBS) /nologo /dll /incremental:no /pdb:"$(obj)\wumfplug.pdb" /machine:I386 /out:"$(out)/wumfplug.dll" /implib:"$(obj)/wumfplug.lib" - -!ELSEIF "$(CFG)" == "Debug" - -CPP_PROJ=/nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_WIN32_WINNT" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /Fp"$(obj)\wumfplug.pch" /YX /Fo"$(obj)\\" /Fd"$(obj)\\" /FD /GZ /c -MTL_PROJ=/nologo /D "_DEBUG" /mktyplib203 /win32 -RSC_PROJ=/l 0x809 /fo"$(obj)/resource.res" /d "_DEBUG" -BSC32=bscmake.exe -BSC32_FLAGS=/nologo /o"$(obj)/wumfplug.bsc" -BSC32_SBRS= \ - -LINK32_FLAGS=$(LIBS) /nologo /dll /incremental:yes /pdb:"$(obj)\wumfplug.pdb" /debug /machine:I386 /out:"$(out)\wumfplug.dll" /implib:"$(obj)/wumfplug.lib" /pdbtype:sept - -!ENDIF - -"$(out)\wumfplug.dll" : "$(out)" $(DEF_FILE) $(LINK32_OBJS) - $(LINK32) @<< - $(LINK32_FLAGS) $(LINK32_OBJS) -<< - - -.c{$(obj)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(obj)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(obj)}.obj:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.c{$(obj)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cpp{$(obj)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -.cxx{$(obj)}.sbr:: - $(CPP) @<< - $(CPP_PROJ) $< -<< - -$(obj)/wumfplug.obj: wumfplug.c $(obj) wumf.h - -$(obj)/wumf.obj: wumf.c $(obj) wumf.h - -$(obj)/resizer.obj: resizer.c $(obj) wumf.h - - -$(obj)/resource.res: resource.rc $(obj) - $(RSC) $(RSC_PROJ) resource.rc - -clean: - rm -f $(obj)/*.* $(out)/wumfplug.* *.aps - -yPER: $(out)/wumfplug.dll - yPER $(out)/wumfplug.dll /REALIGN_NORMAL - -distr: zip - -zip: $(out)/wumfplug.dll yPER res/wumf.readme.txt - pkzip25 -add -max wumf.zip $(out)/wumfplug.dll res/wumf.readme.txt - -src: - rar a -ag wumf-src.rar *.c *.h *.hm *.txt Makefile *.rc res/*.* - -re: clean all - -test: - "C:\Documents and Settings\Nike.Neosoft\Application Data\Microsoft\Internet Explorer\Quick Launch\miranda32dbg.exe.lnk" diff --git a/plugins/WhoUsesMyFiles/wumf.c b/plugins/WhoUsesMyFiles/wumf.c index 98f741bdd1..524648185e 100644 --- a/plugins/WhoUsesMyFiles/wumf.c +++ b/plugins/WhoUsesMyFiles/wumf.c @@ -33,7 +33,7 @@ void AddToList(HWND hList, PWumf w) lvi.iItem=ListView_GetItemCount(hList)+1; lvi.mask= LVIF_PARAM|LVIF_TEXT; lvi.pszText = w->szID; - lvi.cchTextMax = strlen(w->szID); + lvi.cchTextMax = (int)_tcslen(w->szID); lvi.lParam = (LPARAM)w; ListView_InsertItem(hList,&lvi); } @@ -196,8 +196,8 @@ void LogWumf(PWumf w) GetDateFormat(LOCALE_USER_DEFAULT,DATE_SHORTDATE, &time,NULL, lpDateStr, 20); GetTimeFormat(LOCALE_USER_DEFAULT,TIME_FORCE24HOURFORMAT|TIME_NOTIMEMARKER, &time,NULL, lpTimeStr, 20); wsprintf(str ,"%s %s %20s\t%s\r\n\0",lpDateStr, lpTimeStr, w->szUser, w->szPath); - SetFilePointer (hLog, 0, NULL, FILE_END) ; ; - WriteFile(hLog, str ,strlen(str),&bytes,NULL); + SetFilePointer (hLog, 0, NULL, FILE_END); + WriteFile(hLog, str, (DWORD)_tcslen(str), &bytes, NULL); } /* diff --git a/plugins/WhoUsesMyFiles/wumf.h b/plugins/WhoUsesMyFiles/wumf.h index 026e8974cf..b256ccb405 100644 --- a/plugins/WhoUsesMyFiles/wumf.h +++ b/plugins/WhoUsesMyFiles/wumf.h @@ -15,6 +15,7 @@ #include "m_utils.h" #include "m_skin.h" #include "m_popup.h" + #include "m_toptoolbar.h" #include "resource.h" @@ -124,7 +125,6 @@ void process_file(SESSION_INFO_1 s_info, FILE_INFO_3 f_info); void printError(DWORD res); #define msg(X) MessageBox(NULL, X, "WUMF", MB_OK|MB_ICONSTOP) -#define __EXP __declspec(dllexport) #define MS_WUMF_SWITCHPOPUP "WUMF/SwitchPopup" #define MS_WUMF_CONNECTIONSSHOW "WUMF/ShowConnections" @@ -164,4 +164,3 @@ typedef struct { } UTILRESIZEDIALOG; #endif - diff --git a/plugins/WhoUsesMyFiles/wumf.vcxproj b/plugins/WhoUsesMyFiles/wumf.vcxproj index b59b02122d..c6044637fa 100644 --- a/plugins/WhoUsesMyFiles/wumf.vcxproj +++ b/plugins/WhoUsesMyFiles/wumf.vcxproj @@ -20,31 +20,25 @@ {F29CCB9B-79CF-4341-AA05-3626A036D3E3} - wumf - Win32Proj - WumfPlug + WhoUsesMyFiles DynamicLibrary - false MultiByte true DynamicLibrary - false MultiByte true DynamicLibrary - false MultiByte DynamicLibrary - false MultiByte @@ -69,161 +63,107 @@ $(SolutionDir)$(Configuration)64\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - true - true - true - false - false $(SolutionDir)$(Configuration)\Plugins\ $(SolutionDir)$(Configuration)64\Plugins\ $(SolutionDir)$(Configuration)\Obj\$(ProjectName)\ $(SolutionDir)$(Configuration)64\Obj\$(ProjectName)\ - true - true - false - false - false - false + true Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - false + WIN32;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks - MultiThreadedDebug - - + MultiThreadedDebugDLL Level3 - ProgramDatabase + EditAndContinue ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - - false - user32.lib;netapi32.lib;comdlg32.lib;shlwapi.lib;%(AdditionalDependencies) - true true - true Windows - - - DllMain - MachineX86 $(IntDir)$(TargetName).lib + false + $(SolutionDir)\lib ..\..\include\msapi + _DEBUG;%(PreprocessorDefinitions) Disabled - WIN32;_DEBUG;_WINDOWS;%(PreprocessorDefinitions) - false + WIN64;_DEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) EnableFastChecks - MultiThreadedDebug - - + MultiThreadedDebugDLL Level3 - ProgramDatabase ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) - - false - user32.lib;netapi32.lib;comdlg32.lib;shlwapi.lib;%(AdditionalDependencies) - true true - true Windows - - - DllMain $(IntDir)$(TargetName).lib + false + $(SolutionDir)\lib ..\..\include\msapi + _DEBUG;%(PreprocessorDefinitions) - WIN32;NDEBUG;_WINDOWS;_WIN32;_WINNT;_MBCS;_USRDLL;%(PreprocessorDefinitions) - - - MultiThreadedDLL + WIN32;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) false - false - false - - Level3 - ProgramDatabase - CompileAsC ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) Full OnlyExplicitInline Size - - false - user32.lib;netapi32.lib;comdlg32.lib;shlwapi.lib;%(AdditionalDependencies) - false true Windows - - + true true - - - MachineX86 $(IntDir)$(TargetName).lib + false + $(SolutionDir)\lib ..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) - WIN32;NDEBUG;_WINDOWS;_WIN32;_WINNT;_MBCS;_USRDLL;%(PreprocessorDefinitions) - - - MultiThreadedDLL + WIN64;NDEBUG;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) false - false - false - - Level3 - ProgramDatabase - CompileAsC ..\..\include;..\ExternalAPI;%(AdditionalIncludeDirectories) Full OnlyExplicitInline Size - - false - user32.lib;netapi32.lib;comdlg32.lib;shlwapi.lib;%(AdditionalDependencies) - false true Windows - - + true true $(IntDir)$(TargetName).lib + false + $(SolutionDir)\lib ..\..\include\msapi + NDEBUG;%(PreprocessorDefinitions) diff --git a/plugins/WhoUsesMyFiles/wumfplug.c b/plugins/WhoUsesMyFiles/wumfplug.c index 3e278e224e..bcb7fd122f 100644 --- a/plugins/WhoUsesMyFiles/wumfplug.c +++ b/plugins/WhoUsesMyFiles/wumfplug.c @@ -1,7 +1,6 @@ #include "wumf.h" HINSTANCE hInst; -PLUGINLINK *pluginLink; WUMF_OPTIONS WumfOptions = { 0 }; const char ModuleName[] = "WUMF Plugin"; HANDLE hMenuItem = 0; @@ -9,9 +8,10 @@ extern HANDLE hLog; static HWND hDlg; static int hWumfBut; extern PWumf list; +int hLangpack; -static PLUGININFO pluginInfo = { - sizeof(PLUGININFO), +static PLUGININFOEX pluginInfo = { + sizeof(PLUGININFOEX), "WUMF: Who Use My Files?", PLUGIN_MAKE_VERSION(0,1,0,1), "Scans for network users of your shared files and notify you with popups. Uses PopUps Interoperability by Luca Santarelli. PopUps plugin must be activated!", @@ -19,8 +19,10 @@ static PLUGININFO pluginInfo = { "nike000@users.sf.net", "© 2003 Nike. Freeware. Please mail me all bugs & your suggestions.", "http://miranda-im.org", + UNICODE_AWARE, 0, - 0 + // {80DCA515-973A-4A7E-8B85-5D8EC88FC5A7} + { 0x80dca515, 0x973a, 0x4a7e, { 0x8b, 0x85, 0x5d, 0x8e, 0xc8, 0x8f, 0xc5, 0xa7 } } }; void LoadOptions() @@ -257,7 +259,7 @@ DWORD WINAPI ThreadProc(LPVOID lpParameter) } -static int WumfShowConnections(WPARAM wParam,LPARAM lParam) +static INT_PTR WumfShowConnections(WPARAM wParam,LPARAM lParam) { DWORD threadID = 0; CloseHandle(CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)ThreadProc, (LPVOID)NULL,0,&threadID)); @@ -266,7 +268,7 @@ static int WumfShowConnections(WPARAM wParam,LPARAM lParam) return 0; } -static int WumfMenuCommand(WPARAM wParam,LPARAM lParam) +static INT_PTR WumfMenuCommand(WPARAM wParam,LPARAM lParam) { BOOL MajorTo0121 = FALSE; int iResult = 0; @@ -291,7 +293,7 @@ static int WumfMenuCommand(WPARAM wParam,LPARAM lParam) return iResult; } -__EXP PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion) +__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) { return &pluginInfo; } @@ -352,7 +354,7 @@ void ChooseFile(HWND hDlg) }; -BOOL CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lparam) +INT_PTR CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lparam) { WORD wControlId = LOWORD(wparam); WORD wNotifyCode = HIWORD(wparam); @@ -546,20 +548,21 @@ BOOL CALLBACK OptionsDlgProc(HWND hwndDlg,UINT msg,WPARAM wparam,LPARAM lparam) } return 0; } + int InitTopToolbar(WPARAM wparam,LPARAM lparam) { TTBButton ttb = { 0 }; char buttonname[] = "WUMF: Show connections list"; ttb.cbSize = sizeof(ttb); - ttb.hbBitmapUp = LoadBitmap(hInst, MAKEINTRESOURCE(IDB_DRIVE)); - ttb.hbBitmapDown = ttb.hbBitmapUp; - ttb.pszServiceUp = MS_WUMF_CONNECTIONSSHOW; - ttb.pszServiceDown = MS_WUMF_CONNECTIONSSHOW;; - ttb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP|TTBBF_DRAWBORDER; + ttb.hIconUp = LoadIcon(hInst, MAKEINTRESOURCE(IDB_DRIVE)); + ttb.hIconDn = ttb.hIconUp; + ttb.pszService = MS_WUMF_CONNECTIONSSHOW; + ttb.dwFlags = TTBBF_VISIBLE|TTBBF_SHOWTOOLTIP; ttb.name = buttonname; hWumfBut = CallService(MS_TTB_ADDBUTTON, (WPARAM)&ttb,(LPARAM)0); return 0; } + int OptionsInit(WPARAM wparam,LPARAM lparam) { OPTIONSDIALOGPAGE odp = { 0 }; @@ -573,22 +576,22 @@ int OptionsInit(WPARAM wparam,LPARAM lparam) odp.pfnDlgProc=OptionsDlgProc; odp.pszGroup=Translate("Plugins"); odp.flags=ODPF_BOLDGROUPS; - CallService(MS_OPT_ADDPAGE,wparam,(LPARAM)&odp); + Options_AddPage(wparam, &odp); return 0; } -int __EXP Load(PLUGINLINK *link) +__declspec(dllexport) int Load(void) { CLISTMENUITEM mi = { 0 }; - pluginLink=link; + mir_getLP(&pluginInfo); ZeroMemory(&mi, sizeof(mi)); mi.cbSize = sizeof(mi); LoadOptions(); - CreateServiceFunction(MS_WUMF_SWITCHPOPUP,WumfMenuCommand); - CreateServiceFunction(MS_WUMF_CONNECTIONSSHOW,WumfShowConnections); + CreateServiceFunction(MS_WUMF_SWITCHPOPUP, WumfMenuCommand); + CreateServiceFunction(MS_WUMF_CONNECTIONSSHOW, WumfShowConnections); if (WumfOptions.PopupsEnabled == FALSE) { mi.pszName = Translate("Enable WUMF popups"); @@ -602,14 +605,14 @@ int __EXP Load(PLUGINLINK *link) mi.pszService = MS_WUMF_SWITCHPOPUP; mi.popupPosition = 1999990000; mi.pszPopupName = Translate("PopUps"); - hMenuItem = (HANDLE)CallService(MS_CLIST_ADDMAINMENUITEM, (WPARAM)0, (LPARAM)&mi); + hMenuItem = (HANDLE)Menu_AddMainMenuItem(&mi); mi.pszName = Translate("WUMF: Show connections"); mi.hIcon = LoadIcon(hInst,MAKEINTRESOURCE(IDI_DRIVE)); mi.pszService = MS_WUMF_CONNECTIONSSHOW; mi.popupPosition = 1999990000; mi.pszPopupName = NULL; - CallService(MS_CLIST_ADDMAINMENUITEM, (WPARAM)0, (LPARAM)&mi); + Menu_AddMainMenuItem(&mi); HookEvent(ME_OPT_INITIALISE,OptionsInit); HookEvent(ME_TTB_MODULELOADED, InitTopToolbar); @@ -620,7 +623,7 @@ int __EXP Load(PLUGINLINK *link) } -int __EXP Unload(void) +__declspec(dllexport) int Unload(void) { KillTimer(NULL, 777); CloseHandle(hLog); -- cgit v1.2.3