From 48540940b6c28bb4378abfeb500ec45a625b37b6 Mon Sep 17 00:00:00 2001 From: Vadim Dashevskiy Date: Tue, 15 May 2012 10:38:20 +0000 Subject: initial commit git-svn-id: http://svn.miranda-ng.org/main/trunk@2 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/FirstRun/main.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 plugins/FirstRun/main.c (limited to 'plugins/FirstRun/main.c') diff --git a/plugins/FirstRun/main.c b/plugins/FirstRun/main.c new file mode 100644 index 0000000000..6447bf6854 --- /dev/null +++ b/plugins/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 -- cgit v1.2.3