summaryrefslogtreecommitdiff
path: root/plugins/FirstRun/src/main.cpp
blob: 853086ef847bb4fe7c16fb8ca72badb4c7420c9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#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-ng.org/",
	UNICODE_AWARE,
	//{49c2cf54-7898-44de-be3a-6d2e4ef90079}
	{0x49c2cf54, 0x7898, 0x44de, { 0xbe, 0x3a, 0x6d, 0x2e, 0x4e, 0xf9, 0x0, 0x79 }} 
};

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, 0);

	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;
}