summaryrefslogtreecommitdiff
path: root/isee_tweaker/main.c
blob: 2894c25865a8cfae29b77701838cf5122b8e06ef (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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/*
Miranda IM ISee Tweaker plugin
Copyright (C) 2005  Sergey V. Gershovich

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
*/

#include <windows.h>
#include "isee_tweaker.h"

#include "../../include/newpluginapi.h"
#include "../../include/m_system.h"
#include "../../include/m_langpack.h"
#include "../../include/m_options.h"
#include "../../include/m_database.h"
//#include "../../include/m_clist.h"
#pragma hdrstop


// Switch off all unnecessary in Release Build. 
// to decrease dll size
#ifdef NDEBUG
  #pragma comment(linker,"/MERGE:.rdata=.text")
  #pragma comment(linker,"/FILEALIGN:512 /SECTION:.text,EWRX /IGNORE:4078")
  #pragma comment(linker,"/ENTRY:DllMain")
  #pragma comment(linker,"/NODEFAULTLIB")
#endif

HINSTANCE hInst;
PLUGINLINK *pluginLink; 

MIRANDAHOOK hHookOptionInit = NULL;
//MIRANDAHOOK hEventOkToExit = NULL;


PLUGININFO pluginInfo={ // about plugin
	sizeof(PLUGININFO),
		ModuleName,
		PLUGIN_MAKE_VERSION(0,1,0,0),
		"This plugin can tweak some hidden ISee settings",
		"Sergey V. Gershovich a.k.a. Jazzy$",
		"sir-jazzy@yandex.ru",
		"© 2005 Jazzy$",
		"http://jazzy.ws/miranda/",
		0, 0
};

BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
{// plugin entry point
	hInst=hinstDLL;
	DisableThreadLibraryCalls(hInst);
	return TRUE;
}
//==========================================================================
__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
{// Tell Miranda IM about plugin
	return &pluginInfo;
}

int __declspec(dllexport) Load(PLUGINLINK *link)
{// on load: create services, hook events...  if need :)
	pluginLink = link;
	hHookOptionInit = HookEvent(ME_OPT_INITIALISE,OptInitialise);
	return 0;
}

int __declspec(dllexport) Unload(void)
{ //on unload: unhook hooked events...  if need :)
	if (hHookOptionInit)
		UnhookEvent(hHookOptionInit);
	return 0;
}