From 70d04c9b21955c34070ee466693403e2b00870e1 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Wed, 18 Jul 2012 07:52:13 +0000 Subject: FirstRun, FlashAvatars, FloatingContacts: changed folder structure git-svn-id: http://svn.miranda-ng.org/main/trunk@1008 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FirstRun/src/commonheaders.h | 11 +++++++ plugins/FirstRun/src/main.cpp | 62 ++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) create mode 100644 plugins/FirstRun/src/commonheaders.h create mode 100644 plugins/FirstRun/src/main.cpp (limited to 'plugins/FirstRun/src') diff --git a/plugins/FirstRun/src/commonheaders.h b/plugins/FirstRun/src/commonheaders.h new file mode 100644 index 0000000000..1839f53fc1 --- /dev/null +++ b/plugins/FirstRun/src/commonheaders.h @@ -0,0 +1,11 @@ +#define MIRANDA_VER 0x0A00 +#define _CRT_SECURE_NO_WARNINGS + +#include +#include +#include +#include +#include +#include + +#define MIID_FIRSTRUN {0x49c2cf54, 0x7898, 0x44de, { 0xbe, 0x3a, 0x6d, 0x2e, 0x4e, 0xf9, 0x0, 0x79 }} //{49c2cf54-7898-44de-be3a-6d2e4ef90079} \ No newline at end of file diff --git a/plugins/FirstRun/src/main.cpp b/plugins/FirstRun/src/main.cpp new file mode 100644 index 0000000000..cbe3b18f9d --- /dev/null +++ b/plugins/FirstRun/src/main.cpp @@ -0,0 +1,62 @@ +#include "commonheaders.h" + +HINSTANCE hInst; + +HANDLE hModulesLoaded; +int hLangpack; + +PLUGININFOEX pluginInfo={ + sizeof(PLUGININFOEX), + "First Run Plugin", + PLUGIN_MAKE_VERSION(0,0,0,2), + "Displays the Accounts window at the first start.", + "Yasnovidyashii", + "yasnovidyashii@gmail.com", + "© 2008 Mikhail Yuriev", + "http://miranda-im.org/", + UNICODE_AWARE, + MIID_FIRSTRUN +}; + +int ModulesLoaded(WPARAM wParam,LPARAM lParam) +{ + TCHAR* ptszDllName; + TCHAR ptszDllPath[MAX_PATH]; + + GetModuleFileName(hInst, ptszDllPath, MAX_PATH); + ptszDllName = _tcslwr(_tcsrchr(ptszDllPath, '\\')); + + if (ptszDllName!=NULL) + ptszDllName=ptszDllName + 1; + + CallService(MS_PROTO_SHOWACCMGR, (WPARAM) NULL, (LPARAM)NULL); + + DBWriteContactSettingByte(NULL, "PluginDisable", _T2A(ptszDllName), 1); + + return 0; +} + +BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved) +{ + hInst=hinstDLL; + return TRUE; +} + +extern "C" __declspec(dllexport) PLUGININFOEX* MirandaPluginInfoEx(DWORD mirandaVersion) +{ + return &pluginInfo; +} + +extern "C" __declspec(dllexport) int Load(void) +{ + + mir_getLP(&pluginInfo); + hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded); + return 0; +} + +extern "C" __declspec(dllexport) int Unload(void) +{ + UnhookEvent(hModulesLoaded); + return 0; +} \ No newline at end of file -- cgit v1.2.3