diff options
author | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-11-20 17:35:43 +0000 |
---|---|---|
committer | mataes2007 <mataes2007@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb> | 2011-11-20 17:35:43 +0000 |
commit | 532c574af6a0ab2a44b0062b7b2176dde01eca40 (patch) | |
tree | 3cd8e47813027655f73c99372488445b50be47ff /FirstRun/main.c | |
parent | 42c9ab27dffe5edacb9a0aea641d0ab8db8c9cf7 (diff) |
added FirstRun
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@189 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'FirstRun/main.c')
-rw-r--r-- | FirstRun/main.c | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/FirstRun/main.c b/FirstRun/main.c new file mode 100644 index 0000000..6447bf6 --- /dev/null +++ b/FirstRun/main.c @@ -0,0 +1,70 @@ +#include "commonheaders.h"
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+HANDLE hModulesLoaded;
+
+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/",
+ 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_FIRSTRUN
+};
+
+int ModulesLoaded(WPARAM wParam,LPARAM lParam)
+{
+ char* ptszDllName;
+ char ptszDllPath[MAX_PATH];
+
+ GetModuleFileName(hInst, ptszDllPath, MAX_PATH);
+ ptszDllName = _strlwr(strrchr(ptszDllPath, '\\'));
+
+ if (ptszDllName!=NULL)
+ ptszDllName=ptszDllName + 1;
+
+ CallService(MS_PROTO_SHOWACCMGR, (WPARAM) NULL, (LPARAM)NULL);
+ DBWriteContactSettingByte(NULL,"PluginDisable",ptszDllName,1);
+
+ 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_FIRSTRUN, MIID_LAST};
+__declspec(dllexport) const MUUID* MirandaPluginInterfaces(void)
+{
+ return interfaces;
+}
+
+int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ pluginLink=link;
+ hModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED,ModulesLoaded);
+ return 0;
+}
+
+int __declspec(dllexport) Unload(void)
+{
+ UnhookEvent(hModulesLoaded);
+ return 0;
+}
\ No newline at end of file |