summaryrefslogtreecommitdiff
path: root/plugins/AutoRun
diff options
context:
space:
mode:
authorKirill Volinsky <mataes2007@gmail.com>2012-05-18 22:02:50 +0000
committerKirill Volinsky <mataes2007@gmail.com>2012-05-18 22:02:50 +0000
commitf920ef497f3299ae24fe783ce03bdd93b419f764 (patch)
treebdaa9197c08d29ab141a6adfdd6cc0a68ddd3996 /plugins/AutoRun
parent6c3b0571f0678da0512069869afaa284c054377e (diff)
plugins folders renaming
git-svn-id: http://svn.miranda-ng.org/main/trunk@60 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/AutoRun')
-rw-r--r--plugins/AutoRun/autorun.h15
-rw-r--r--plugins/AutoRun/autorun.rc83
-rw-r--r--plugins/AutoRun/autorun.sln26
-rw-r--r--plugins/AutoRun/autorun.txt50
-rw-r--r--plugins/AutoRun/autorun.vcxproj225
-rw-r--r--plugins/AutoRun/autorun.vcxproj.filters40
-rw-r--r--plugins/AutoRun/main.c167
-rw-r--r--plugins/AutoRun/resource.h15
8 files changed, 621 insertions, 0 deletions
diff --git a/plugins/AutoRun/autorun.h b/plugins/AutoRun/autorun.h
new file mode 100644
index 0000000000..a991061066
--- /dev/null
+++ b/plugins/AutoRun/autorun.h
@@ -0,0 +1,15 @@
+#define IDD_OPT_AUTORUN 101
+#define IDC_AUTORUN 102
+
+#define MIRANDA_VER 0x0A00
+#define SUB_KEY "Software\\Microsoft\\Windows\\CurrentVersion\\Run"
+#define ModuleName "Autorun"
+
+// Plugin UUID for New plugin loader
+// req. 0.7.18+ core
+// {EB0465E2-CEEE-11DB-83EF-C1BF55D89593}
+
+#define MIID_AUTORUN {0xeb0465e2, 0xceee, 0x11db, { 0x83, 0xef, 0xc1, 0xbf, 0x55, 0xd8, 0x95, 0x93}}
+
+HKEY ROOT_KEY = HKEY_CURRENT_USER;
+
diff --git a/plugins/AutoRun/autorun.rc b/plugins/AutoRun/autorun.rc
new file mode 100644
index 0000000000..b643834124
--- /dev/null
+++ b/plugins/AutoRun/autorun.rc
@@ -0,0 +1,83 @@
+//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "autorun.h"
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Russian resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_RUS)
+#ifdef _WIN32
+LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
+#pragma code_page(1251)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT_AUTORUN DIALOGEX 0, 0, 200, 90
+STYLE DS_3DLOOK | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg"
+BEGIN
+ GROUPBOX "Autorun",0,3,3,193,60
+ CONTROL "Launch Miranda IM at system startup",IDC_AUTORUN,"Button",
+ BS_AUTOCHECKBOX | BS_FLAT | WS_TABSTOP,15,20,165,10
+ LTEXT "Note: At startup Miranda IM will use current profile",
+ IDC_STATIC,15,35,165,20,NOT WS_GROUP
+END
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""autorun.h""\r\n"
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // Russian resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/plugins/AutoRun/autorun.sln b/plugins/AutoRun/autorun.sln
new file mode 100644
index 0000000000..7bddde4299
--- /dev/null
+++ b/plugins/AutoRun/autorun.sln
@@ -0,0 +1,26 @@
+
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "autorun", "autorun.vcxproj", "{6E46F54C-0614-0AF1-B236-D338DAD6DC00}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Debug|x64 = Debug|x64
+ Release|Win32 = Release|Win32
+ Release|x64 = Release|x64
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {6E46F54C-0614-0AF1-B236-D338DAD6DC00}.Debug|Win32.ActiveCfg = Debug|Win32
+ {6E46F54C-0614-0AF1-B236-D338DAD6DC00}.Debug|Win32.Build.0 = Debug|Win32
+ {6E46F54C-0614-0AF1-B236-D338DAD6DC00}.Debug|x64.ActiveCfg = Debug|x64
+ {6E46F54C-0614-0AF1-B236-D338DAD6DC00}.Debug|x64.Build.0 = Debug|x64
+ {6E46F54C-0614-0AF1-B236-D338DAD6DC00}.Release|Win32.ActiveCfg = Release|Win32
+ {6E46F54C-0614-0AF1-B236-D338DAD6DC00}.Release|Win32.Build.0 = Release|Win32
+ {6E46F54C-0614-0AF1-B236-D338DAD6DC00}.Release|x64.ActiveCfg = Release|x64
+ {6E46F54C-0614-0AF1-B236-D338DAD6DC00}.Release|x64.Build.0 = Release|x64
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/plugins/AutoRun/autorun.txt b/plugins/AutoRun/autorun.txt
new file mode 100644
index 0000000000..cec7052075
--- /dev/null
+++ b/plugins/AutoRun/autorun.txt
@@ -0,0 +1,50 @@
+Autorun 0.1.0.0
+
+Written by and copyright (c) Sergey V. Gershovich a.k.a. Jazzy$, March 2003
+ e-mail: jazzy@arcticsu.ru
+
+This plugin is a simple way to enable/disable to launch Miranda IM
+with system startup.
+
+
+***** DISCLAIMER OF WARRANTY *****
+
+This software and the accompanying files are presented "AS IS" and without
+warranties whether expressed or implied. Use it at your own risk.
+
+**********************************
+
+Usage
+------
+Goto: Options->Plugins->Autorun
+
+
+Version history
+----------------------
+0.1.0.0: - Preparation for 0.8.x.x plugin loader
+ MIID_AUTORUN {EB0465E2-CEEE-11DB-83EF-C1BF55D89593}
+0.0.0.3: - Decrease size of plugin to 3 kb
+ - Change image base address to: 0x30040000
+ - Miranda IM v0.3alpha build 040303 or higher is required!
+ - Language strings updated
+
+0.0.0.2: - Some bugfix with long path & DB-filename
+
+0.0.0.1: - Initial release
+
+
+Translation
+-----------
+"Autorun" can be translated with the Miranda IM language files
+
+
+;; == Autorun v0.0.0.3 ==
+
+;Name of plugin
+;[Autorun]
+
+;Options page string
+;[Launch Miranda IM at system startup]
+
+;Options page string
+;[Note: At startup Miranda IM will use current profile] \ No newline at end of file
diff --git a/plugins/AutoRun/autorun.vcxproj b/plugins/AutoRun/autorun.vcxproj
new file mode 100644
index 0000000000..ec0b722ae7
--- /dev/null
+++ b/plugins/AutoRun/autorun.vcxproj
@@ -0,0 +1,225 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup Label="ProjectConfigurations">
+ <ProjectConfiguration Include="Debug|Win32">
+ <Configuration>Debug</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Debug|x64">
+ <Configuration>Debug</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|Win32">
+ <Configuration>Release</Configuration>
+ <Platform>Win32</Platform>
+ </ProjectConfiguration>
+ <ProjectConfiguration Include="Release|x64">
+ <Configuration>Release</Configuration>
+ <Platform>x64</Platform>
+ </ProjectConfiguration>
+ </ItemGroup>
+ <PropertyGroup Label="Globals">
+ <SccProjectName />
+ <SccLocalPath />
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ <WholeProgramOptimization>true</WholeProgramOptimization>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
+ <ConfigurationType>DynamicLibrary</ConfigurationType>
+ <CharacterSet>MultiByte</CharacterSet>
+ </PropertyGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
+ <ImportGroup Label="ExtensionSettings">
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="PropertySheets">
+ <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
+ <Import Project="$(VCTargetsPath)Microsoft.Cpp.UpgradeFromVC60.props" />
+ </ImportGroup>
+ <PropertyGroup Label="UserMacros" />
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <OutDir>$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir>$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <OutDir>$(SolutionDir)$(Configuration)/Plugins\</OutDir>
+ <IntDir>$(SolutionDir)$(Configuration)/Obj/$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir>$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <OutDir>$(SolutionDir)$(Configuration)64/Plugins\</OutDir>
+ <IntDir>$(SolutionDir)$(Configuration)64/Obj/$(ProjectName)\</IntDir>
+ </PropertyGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Full</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>true</MinimalRebuild>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;autorun_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <IntrinsicFunctions>false</IntrinsicFunctions>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ </ClCompile>
+ <Midl>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <TypeLibraryName>.\Debug\autorun.tlb</TypeLibraryName>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ </Midl>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Bscmake />
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ <OptimizeReferences>true</OptimizeReferences>
+ <EnableCOMDATFolding>true</EnableCOMDATFolding>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Disabled</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <MinimalRebuild>true</MinimalRebuild>
+ <DebugInformationFormat>EditAndContinue</DebugInformationFormat>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;autorun_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ </ClCompile>
+ <Midl>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <TypeLibraryName>.\Debug\autorun.tlb</TypeLibraryName>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ <TargetEnvironment>Win32</TargetEnvironment>
+ </Midl>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Bscmake />
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Full</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;autorun_EXPORTS;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>Default</BasicRuntimeChecks>
+ <InlineFunctionExpansion>OnlyExplicitInline</InlineFunctionExpansion>
+ <FavorSizeOrSpeed>Size</FavorSizeOrSpeed>
+ <DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
+ </ClCompile>
+ <Midl>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <TypeLibraryName>.\Debug\autorun.tlb</TypeLibraryName>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ </Midl>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Bscmake />
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <ClCompile>
+ <RuntimeLibrary>MultiThreadedDebug</RuntimeLibrary>
+ <FunctionLevelLinking>false</FunctionLevelLinking>
+ <Optimization>Disabled</Optimization>
+ <WarningLevel>Level3</WarningLevel>
+ <AdditionalIncludeDirectories>../../include;../ExternalAPI;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
+ <PreprocessorDefinitions>WIN64;_DEBUG;_WINDOWS;_USRDLL;autorun_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <BasicRuntimeChecks>EnableFastChecks</BasicRuntimeChecks>
+ </ClCompile>
+ <Midl>
+ <SuppressStartupBanner>true</SuppressStartupBanner>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ <TypeLibraryName>.\Debug\autorun.tlb</TypeLibraryName>
+ <MkTypLibCompatible>true</MkTypLibCompatible>
+ </Midl>
+ <ResourceCompile>
+ <PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
+ </ResourceCompile>
+ <Bscmake />
+ <Link>
+ <LinkDLL>true</LinkDLL>
+ <GenerateDebugInformation>true</GenerateDebugInformation>
+ <SubSystem>Windows</SubSystem>
+ <BaseAddress>0x30040000</BaseAddress>
+ <AdditionalDependencies>odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
+ <ImportLibrary>$(IntDir)$(TargetName).lib</ImportLibrary>
+ </Link>
+ </ItemDefinitionGroup>
+ <ItemGroup>
+ <ClCompile Include="main.c" />
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="autorun.h" />
+ <ClInclude Include="resource.h" />
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="autorun.rc" />
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="hsp.ico" />
+ </ItemGroup>
+ <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
+ <ImportGroup Label="ExtensionTargets">
+ </ImportGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/AutoRun/autorun.vcxproj.filters b/plugins/AutoRun/autorun.vcxproj.filters
new file mode 100644
index 0000000000..2977fdc693
--- /dev/null
+++ b/plugins/AutoRun/autorun.vcxproj.filters
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+ <ItemGroup>
+ <Filter Include="Source Files">
+ <UniqueIdentifier>{08a21636-368d-4feb-8d0d-0a27f237e1a2}</UniqueIdentifier>
+ <Extensions>cpp;c;cxx;rc;def;r;odl;idl;hpj;bat</Extensions>
+ </Filter>
+ <Filter Include="Header Files">
+ <UniqueIdentifier>{9e6f20dc-3391-4299-9f74-e91d4f984ad3}</UniqueIdentifier>
+ <Extensions>h;hpp;hxx;hm;inl</Extensions>
+ </Filter>
+ <Filter Include="Resource Files">
+ <UniqueIdentifier>{18fd6180-ebb2-4558-b945-c4dac823f11b}</UniqueIdentifier>
+ <Extensions>ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe</Extensions>
+ </Filter>
+ </ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="autorun.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ <ClInclude Include="resource.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
+ <ItemGroup>
+ <ResourceCompile Include="autorun.rc">
+ <Filter>Resource Files</Filter>
+ </ResourceCompile>
+ </ItemGroup>
+ <ItemGroup>
+ <CustomBuild Include="hsp.ico">
+ <Filter>Resource Files</Filter>
+ </CustomBuild>
+ </ItemGroup>
+ <ItemGroup>
+ <ClCompile Include="main.c">
+ <Filter>Source Files</Filter>
+ </ClCompile>
+ </ItemGroup>
+</Project> \ No newline at end of file
diff --git a/plugins/AutoRun/main.c b/plugins/AutoRun/main.c
new file mode 100644
index 0000000000..31eb9790cd
--- /dev/null
+++ b/plugins/AutoRun/main.c
@@ -0,0 +1,167 @@
+#include <windows.h>
+#include "autorun.h"
+
+#include "newpluginapi.h"
+#include "m_langpack.h"
+#include "m_options.h"
+#include "m_database.h"
+#pragma hdrstop
+
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+HANDLE hHookOptionInit = NULL;
+int hLangpack;
+
+PLUGININFOEX pluginInfoEx=
+{ // about plugin
+ sizeof(PLUGININFOEX),
+ "Autorun",
+ PLUGIN_MAKE_VERSION(0,1,0,1),
+ "This plugin is a simple way to enable/disable to launch Miranda IM with system startup.",
+ "Sergey V. Gershovich a.k.a. Jazzy$ (fixed by Wolfram3D)",
+ "",
+ "Copyright © 2002-2007 Sergey V. Gershovich a.k.a. Jazzy$",
+ "http://miranda-im.org/download/index.php?action=viewfile&id=285",
+ 0, 0,
+ MIID_AUTORUN
+};
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ // plugin entry point
+ if (fdwReason == DLL_PROCESS_ATTACH)
+ {
+ hInst = hinstDLL;
+ DisableThreadLibraryCalls(hinstDLL);
+ }
+ return TRUE;
+}
+void GetProfilePath(char *res)
+{
+ char dbname[MAX_PATH], dbpath[MAX_PATH], exename[MAX_PATH];
+ CallService(MS_DB_GETPROFILENAME,sizeof(dbname),(LPARAM)(char*) dbname);
+ CallService(MS_DB_GETPROFILEPATH,sizeof(dbpath),(LPARAM)(char*) dbpath);
+ GetModuleFileName(NULL,exename,sizeof(exename));
+ lstrcat(dbpath,"\\");
+ lstrcpyn(dbpath+lstrlen(dbpath),dbname,lstrlen(dbname)-3);
+ strcat(dbpath, "\\");
+ strcat(dbpath, dbname); // path + profile name
+ wsprintf(res,"\"%s\" \"%s\"",exename, dbpath);
+}
+
+static void SetAutorun(BOOL autorun)
+{
+ HKEY hKey;
+ DWORD dw;
+ switch (autorun)
+ {
+ case TRUE:
+ if (RegCreateKeyEx(ROOT_KEY, SUB_KEY,0,NULL,0,KEY_CREATE_SUB_KEY|KEY_SET_VALUE,NULL,&hKey,&dw) == ERROR_SUCCESS)
+ {
+ char result[MAX_PATH];
+ GetProfilePath (result);
+ RegSetValueEx(hKey,"MirandaIM",0,REG_SZ,result,lstrlen(result)+1);
+ RegCloseKey(hKey);
+ break;
+ }
+ case FALSE:
+ if (RegOpenKey(ROOT_KEY,SUB_KEY,&hKey) == ERROR_SUCCESS)
+ {
+ RegDeleteValue(hKey,"MirandaIM");
+ RegCloseKey(hKey);
+ break;
+ }
+ }
+}
+
+
+static BOOL CmpCurrentAndRegistry()
+{
+ HKEY hKey;
+ DWORD dwBufLen = MAX_PATH;
+ char result[MAX_PATH], dbpath[MAX_PATH];
+ GetProfilePath (result);
+
+ if (RegOpenKeyEx(ROOT_KEY, SUB_KEY, 0, KEY_QUERY_VALUE, &hKey) == ERROR_SUCCESS)
+ {
+ if (RegQueryValueEx(hKey,"MirandaIM",NULL,NULL,(LPBYTE)dbpath,&dwBufLen) == ERROR_SUCCESS)
+ {
+ return (lstrcmpi(result,dbpath) == 0 ? TRUE : FALSE);
+ }
+ else
+ return FALSE;
+ }
+ else
+ return FALSE;
+}
+
+static INT_PTR CALLBACK DlgProcAutorunOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg)
+ {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg,IDC_AUTORUN,CmpCurrentAndRegistry()); // Check chekbox if Registry value exists
+ return TRUE;
+ case WM_COMMAND:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); // Send message to activate "Apply" button
+ return TRUE;
+ break;
+ case WM_NOTIFY:
+ switch(((LPNMHDR)lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR)lParam)->code)
+ {
+ case PSN_APPLY: // if "Apply" pressed then...
+ SetAutorun(IsDlgButtonChecked(hwndDlg,IDC_AUTORUN)); //Save changes to registry;
+ return TRUE;
+ }
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+
+static int AutorunOptInitialise(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+ odp.cbSize=sizeof(odp);
+ odp.position=100100000;
+ odp.hInstance=hInst;
+ odp.pszTemplate=MAKEINTRESOURCE(IDD_OPT_AUTORUN);
+ odp.pszTitle=Translate(ModuleName);
+ odp.pszGroup=Translate("Plugins");
+ odp.pfnDlgProc=DlgProcAutorunOpts;
+ odp.flags=ODPF_BOLDGROUPS;
+ CallService(MS_OPT_ADDPAGE,wParam,(LPARAM)&odp);
+ return 0;
+}
+//==========================================================================
+__declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion)
+{
+ return &pluginInfoEx;
+}
+
+static const MUUID interfaces[] = {MIID_AUTORUN, MIID_LAST};
+__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+ mir_getLP(&pluginInfoEx);
+ hHookOptionInit = HookEvent(ME_OPT_INITIALISE,AutorunOptInitialise);
+ return 0;
+}
+
+int __declspec(dllexport) Unload(void)
+{
+ if (hHookOptionInit)
+ UnhookEvent(hHookOptionInit);
+ return 0;
+} \ No newline at end of file
diff --git a/plugins/AutoRun/resource.h b/plugins/AutoRun/resource.h
new file mode 100644
index 0000000000..c5b53f192c
--- /dev/null
+++ b/plugins/AutoRun/resource.h
@@ -0,0 +1,15 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by autorun.rc
+//
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 101
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1000
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif