diff options
Diffstat (limited to 'plugins/FirstRun/src/main.cpp')
-rw-r--r-- | plugins/FirstRun/src/main.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
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 |