From ec9a2431e23bed5e99c54f554c1486810389af72 Mon Sep 17 00:00:00 2001 From: mataes2007 Date: Wed, 4 May 2011 19:34:06 +0000 Subject: added Langman added profile manager added UserGuide git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@70 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb --- UserGuide/UserGuide.dsp | 111 ++++++++++++++++++ UserGuide/UserGuide.dsw | 29 +++++ UserGuide/UserGuide_9.vcproj | 264 +++++++++++++++++++++++++++++++++++++++++++ UserGuide/commonheaders.h | 10 ++ UserGuide/main.c | 130 +++++++++++++++++++++ 5 files changed, 544 insertions(+) create mode 100644 UserGuide/UserGuide.dsp create mode 100644 UserGuide/UserGuide.dsw create mode 100644 UserGuide/UserGuide_9.vcproj create mode 100644 UserGuide/commonheaders.h create mode 100644 UserGuide/main.c (limited to 'UserGuide') diff --git a/UserGuide/UserGuide.dsp b/UserGuide/UserGuide.dsp new file mode 100644 index 0000000..d3bd991 --- /dev/null +++ b/UserGuide/UserGuide.dsp @@ -0,0 +1,111 @@ +# Microsoft Developer Studio Project File - Name="UserGuide" - Package Owner=<4> +# Microsoft Developer Studio Generated Build File, Format Version 6.00 +# ** DO NOT EDIT ** + +# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 + +CFG=UserGuide - Win32 Debug +!MESSAGE This is not a valid makefile. To build this project using NMAKE, +!MESSAGE use the Export Makefile command and run +!MESSAGE +!MESSAGE NMAKE /f "UserGuide.mak". +!MESSAGE +!MESSAGE You can specify a configuration when running NMAKE +!MESSAGE by defining the macro CFG on the command line. For example: +!MESSAGE +!MESSAGE NMAKE /f "UserGuide.mak" CFG="UserGuide - Win32 Debug" +!MESSAGE +!MESSAGE Possible choices for configuration are: +!MESSAGE +!MESSAGE "UserGuide - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE "UserGuide - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") +!MESSAGE + +# Begin Project +# PROP AllowPerConfigDependencies 0 +# PROP Scc_ProjName "" +# PROP Scc_LocalPath "" +CPP=cl.exe +MTL=midl.exe +RSC=rc.exe + +!IF "$(CFG)" == "UserGuide - Win32 Release" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 0 +# PROP BASE Output_Dir "Release" +# PROP BASE Intermediate_Dir "Release" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 0 +# PROP Output_Dir "Release" +# PROP Intermediate_Dir "Release" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UserGuide_EXPORTS" /YX /FD /c +# ADD CPP /nologo /MD /W3 /GX /O2 /I "D:\Мои Документы\Projects\Source_Miranda-Im.Org\miranda\include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UserGuide_EXPORTS" /FR /YX /FD /c +# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x419 /d "NDEBUG" +# ADD RSC /l 0x419 /d "NDEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 + +!ELSEIF "$(CFG)" == "UserGuide - Win32 Debug" + +# PROP BASE Use_MFC 0 +# PROP BASE Use_Debug_Libraries 1 +# PROP BASE Output_Dir "Debug" +# PROP BASE Intermediate_Dir "Debug" +# PROP BASE Target_Dir "" +# PROP Use_MFC 0 +# PROP Use_Debug_Libraries 1 +# PROP Output_Dir "Debug" +# PROP Intermediate_Dir "Debug" +# PROP Ignore_Export_Lib 0 +# PROP Target_Dir "" +# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UserGuide_EXPORTS" /YX /FD /GZ /c +# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "D:\Мои Документы\Projects\Source_Miranda-Im.Org\miranda\include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "UserGuide_EXPORTS" /FR /YX /FD /GZ /c +# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32 +# ADD BASE RSC /l 0x419 /d "_DEBUG" +# ADD RSC /l 0x419 /d "_DEBUG" +BSC32=bscmake.exe +# ADD BASE BSC32 /nologo +# ADD BSC32 /nologo +LINK32=link.exe +# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept +# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../Miranda/Plugins/UserGuide.dll" /pdbtype:sept + +!ENDIF + +# Begin Target + +# Name "UserGuide - Win32 Release" +# Name "UserGuide - Win32 Debug" +# Begin Group "Source Files" + +# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat" +# Begin Source File + +SOURCE=.\main.c +# End Source File +# End Group +# Begin Group "Header Files" + +# PROP Default_Filter "h;hpp;hxx;hm;inl" +# Begin Source File + +SOURCE=.\commonheaders.h +# End Source File +# End Group +# Begin Group "Resource Files" + +# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe" +# End Group +# End Target +# End Project diff --git a/UserGuide/UserGuide.dsw b/UserGuide/UserGuide.dsw new file mode 100644 index 0000000..9f3ae31 --- /dev/null +++ b/UserGuide/UserGuide.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00 +# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! + +############################################################################### + +Project: "UserGuide"=".\UserGuide.dsp" - Package Owner=<4> + +Package=<5> +{{{ +}}} + +Package=<4> +{{{ +}}} + +############################################################################### + +Global: + +Package=<5> +{{{ +}}} + +Package=<3> +{{{ +}}} + +############################################################################### + diff --git a/UserGuide/UserGuide_9.vcproj b/UserGuide/UserGuide_9.vcproj new file mode 100644 index 0000000..90c5993 --- /dev/null +++ b/UserGuide/UserGuide_9.vcproj @@ -0,0 +1,264 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/UserGuide/commonheaders.h b/UserGuide/commonheaders.h new file mode 100644 index 0000000..4f7479c --- /dev/null +++ b/UserGuide/commonheaders.h @@ -0,0 +1,10 @@ +#include +#include +#include +#include +#include +#include +#include +#include + +#define MIID_USERGUIDE {0x297ec1e7, 0x41b7, 0x41f9, { 0xbb, 0x91, 0xef, 0xa9, 0x50, 0x28, 0xf1, 0x6c }} //297ec1e7-41b7-41f9-bb91-efa95028f16c diff --git a/UserGuide/main.c b/UserGuide/main.c new file mode 100644 index 0000000..9cd0f93 --- /dev/null +++ b/UserGuide/main.c @@ -0,0 +1,130 @@ +#include "commonheaders.h" + +struct MM_INTERFACE mmi; +HINSTANCE hInst; +PLUGINLINK *pluginLink; +HANDLE hModulesLoaded; + +PLUGININFOEX pluginInfo={ + sizeof(PLUGININFOEX), + "User Guide Plugin (AlfaMaR)", + PLUGIN_MAKE_VERSION(0,0,0,1), + "This plug-in adds the main menu item used to view miranda-im pack user guide", + "Yasnovidyashii", + "yasnovidyashii@gmail.com", + "© 2009 Mikhail Yuriev", + "http://miranda-im.org/", + 0, //not transient + 0, //doesn't replace anything built-in + // Generate your own unique id for your plugin. + // Do not use this UUID! + // Use uuidgen.exe to generate the uuuid + MIID_USERGUIDE +}; + +static int ShowGuideFile(WPARAM wParam,LPARAM lParam) +{ + DBVARIANT dbv = {0}; + int iRes; + + LPCSTR pszEmptySting=""; + LPSTR pszDirName, pszDirNameEx, pszFileName,pszDivider; + + REPLACEVARSDATA dat = {0}; + dat.cbSize = sizeof( dat ); + dat.dwFlags = 0; + + pszDirName=(LPSTR)mir_alloc(250*sizeof(CHAR)); + pszFileName=(LPSTR)mir_alloc(250*sizeof(CHAR)); + + iRes = DBGetContactSettingString(NULL,"UserGuide","PathToHelpFile",&dbv); + + if (iRes!=0) + { + strcpy(pszDirName, "%miranda_path%\\Plugins"); + strcpy(pszFileName, "UserGuide.chm"); + } + else + if(strcmp((dbv.pszVal),pszEmptySting)==0) + { + strcpy(pszDirName, "%miranda_path%\\Plugins"); + strcpy(pszFileName, "UserGuide.chm"); + mir_free(dbv.pszVal); + } + else + { + pszDivider = strrchr(dbv.pszVal, '\\'); + if (pszDivider == NULL) + { + pszDirName = ""; + strncpy(pszFileName, dbv.pszVal, strlen(dbv.pszVal) ); + } + else + { + strncpy(pszFileName, pszDivider+1, strlen(dbv.pszVal)-strlen(pszDivider)-1); + pszFileName[strlen(dbv.pszVal)-strlen(pszDivider)-1] = 0; + strncpy(pszDirName, dbv.pszVal, pszDivider-dbv.pszVal); + pszDirName[pszDivider-dbv.pszVal] = 0; + } + mir_free(dbv.pszVal); + } + if (ServiceExists(MS_UTILS_REPLACEVARS)) + pszDirNameEx = (char *) CallService(MS_UTILS_REPLACEVARS,(WPARAM)pszDirName,(LPARAM)&dat); + else + pszDirNameEx = mir_strdup(pszDirName); + + ShellExecuteA(NULL,"open",pszFileName,NULL,pszDirNameEx,SW_SHOW); + mir_free(pszDirName); + mir_free(pszFileName); + mir_free(pszDirNameEx); + return 0; +} + +int ModulesLoaded(WPARAM wParam,LPARAM lParam) +{ + CLISTMENUITEM mi; + + CreateServiceFunction("UserGuide/ShowGuide",ShowGuideFile); + ZeroMemory(&mi,sizeof(mi)); + mi.cbSize=sizeof(mi); + mi.position=500000; + mi.flags=0; + mi.hIcon=LoadSkinnedIcon(SKINICON_OTHER_HELP); + mi.pszName=LPGEN("User Guide"); + mi.pszService="UserGuide/ShowGuide"; + CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi); + + return 0; +} + +BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + hInst=hinstDLL; + return TRUE; +} + + +__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfo; +} + +static const MUUID interfaces[] = {MIID_USERGUIDE, MIID_LAST}; +__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void) +{ + return interfaces; +} + +int __declspec(dllexport) Load(PLUGINLINK *link) +{ + pluginLink=link; + mir_getMMI(&mmi); + hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded); + return 0; +} + +int __declspec(dllexport) Unload(void) +{ + UnhookEvent(hModulesLoaded); + return 0; +} \ No newline at end of file -- cgit v1.2.3