Esempio n. 1
0
extern "C" int __declspec(dllexport) Load(void)
{
	mir_getLP(&pluginInfo);
	INITCOMMONCONTROLSEX icex;

	icex.dwSize = sizeof(icex);
	icex.dwICC = ICC_DATE_CLASSES;

	InitCommonControlsEx(&icex);

	if ((hUxTheme = LoadLibraryA("uxtheme.dll")) != 0)
		MyEnableThemeDialogTexture = (BOOL(WINAPI *)(HANDLE, DWORD))GetProcAddress(hUxTheme, "EnableThemeDialogTexture");

	/// all initialization here
	hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_HISTORYICON));
	hOpenWindowsList = WindowList_Create();

	InitServices();

	/// menu items
	CMenuItem mi;
	mi.name.t = LPGENT("View &history");
	mi.flags = CMIF_TCHAR;
	mi.position = 1000090000;
	mi.hIcolibItem = hIcon;
	mi.pszService = MS_HISTORY_SHOWCONTACTHISTORY;
	Menu_AddContactMenuItem(&mi);

	/// @todo (White-Tiger#1#08/19/14): fully implement System History someday^^
	mi.name.t = LPGENT("&System History");
	Menu_AddMainMenuItem(&mi);

	HookEvents();
	return 0;
}
Esempio n. 2
0
extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
{
#if _MSC_VER >= 1300
	Log("%s", "Entering function " __FUNCTION__);
#endif
	pluginLink = link;
	mir_getLP(&pluginInfo);
	mir_getMMI(&mmi);
	
	Log("%s", "Creating service functions ...");
	InitServices();
	InitEvents();
	
#ifdef _DEBUG	
	hTestPlugin = CreateServiceFunction(MS_FOLDERS_TEST_PLUGIN, TestPlugin);
	CLISTMENUITEM mi = {0};
	
	mi.cbSize=sizeof(mi);
	mi.position=300050000;
	mi.flags=0;
	mi.hIcon=0;
	mi.pszName=Translate("Test folders");
	mi.pszService=MS_FOLDERS_TEST_PLUGIN;
	CallService(MS_CLIST_ADDMAINMENUITEM,0,(LPARAM)&mi);
#endif
#if _MSC_VER >= 1300
	Log("%s", "Hooking events ...");	
#endif
	HookEvents();
#if _MSC_VER >= 1300
	Log("%s", "Leaving function " __FUNCTION__);
#endif
	return 0;
}
Esempio n. 3
0
int CMPlugin::Load()
{
	hiMailIcon = LoadIcon(g_plugin.getInst(), MAKEINTRESOURCE(IDI_MAIL));
	InitServices();
	HookEvents();
	return 0;
}
Esempio n. 4
0
int Chat_Load()
{
	InitializeCriticalSection(&cs);
	g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU));
	TranslateMenu(g_hMenu);
	HookEvents();
	CreateServiceFunctions();
	CreateHookableEvents();
	return 0;
}
Esempio n. 5
0
extern "C" int __declspec(dllexport) Load(void)
{
	mir_getLP(&pluginInfo);
 	mir_getCLI();

	if (InitServer())
		MessageBox(0, TranslateT("Could not initialize CmdLine plugin property"), TranslateT("Error"), MB_ICONEXCLAMATION | MB_OK);

	HookEvents();
	return 0;
}
Esempio n. 6
0
int __declspec(dllexport) Load(PLUGINLINK *link)
{
    BOOL bFlag = FALSE;
    HINSTANCE hDll;

#ifndef NDEBUG //mem leak detector :-) Thanks Tornado!
    int flag = _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG); // Get current flag
    flag |= _CRTDBG_LEAK_CHECK_DF; // Turn on leak-checking bit
    _CrtSetDbgFlag(flag); // Set flag to the new value
#endif

    pluginLink = link;

    // set the memory & utf8 managers
    mir_getMMI( &memoryManagerInterface );
    mir_getUTFI( &utfi );
    mir_getLP( &pluginInfo );

    hDll = LoadLibraryA("riched20.dll");
    if ( hDll ) {
        char modulePath[MAX_PATH];
        if (GetModuleFileNameA(hDll, modulePath, MAX_PATH)) {
            DWORD dummy;
            VS_FIXEDFILEINFO* vsInfo;
            UINT vsInfoSize;
            DWORD size = GetFileVersionInfoSizeA(modulePath, &dummy);
            BYTE* buffer = (BYTE*) mir_alloc(size);

            if (GetFileVersionInfoA(modulePath, 0, size, buffer))
                if (VerQueryValueA(buffer, "\\", (LPVOID*) &vsInfo, &vsInfoSize))
                    if (LOWORD(vsInfo->dwFileVersionMS) != 0)
                        bFlag= TRUE;
            mir_free(buffer);
        }
    }

    if ( !bFlag ) {
        if (IDYES == MessageBox(0, TranslateT("Miranda could not load the Chat plugin because Microsoft Rich Edit v 3 is missing.\nIf you are using Windows 95/98/NT or WINE please upgrade your Rich Edit control.\n\nDo you want to download an update now?."),TranslateT("Information"),MB_YESNO|MB_ICONINFORMATION))
            CallService(MS_UTILS_OPENURL, 1, (LPARAM) "http://members.chello.se/matrix/re3/richupd.exe");
        FreeLibrary(GetModuleHandleA("riched20.dll"));
        return 1;
    }

    UpgradeCheck();

    g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU));
    InitREOleCallback();
    HookEvents();
    CreateServiceFunctions();
    CreateHookableEvents();
    OptionsInit();
    TabsInit();
    return 0;
}
Esempio n. 7
0
extern "C" int __declspec(dllexport) Load()
{
	mir_getLP(&pluginInfo);
	mir_getCLI();

	currentCodePage = Langpack_GetDefaultCodePage();
	
	InitServices();
	
	HookEvents();
	
	return 0;
}
int Chat_Load(PLUGINLINK *link)
{
	if(M->GetByte("forceDisableMUC", 0)) {
		PluginConfig.m_chat_enabled = false;
		return(0);
	}
	g_hMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENU));
	if(CreateServiceFunctions()) {
		HookEvents();
		CreateHookableEvents();
		OptionsInit();
	}
	return 0;
}
Esempio n. 9
0
extern "C" int __declspec(dllexport) Load()
{
//	Log("%s", "Entering function " __FUNCTION__);
	//pluginLink = link;
	mir_getLP( &pluginInfo );
//	Log("%s", "Initialising miranda memory functions");
//	InitializeMirandaMemFunctions();
	hiMailIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_MAIL));
//	Log("%s", "Creating service functions ...");
	InitServices();
//	Log("%s", "Hooking events ...");	
	HookEvents();
	return 0;
}
Esempio n. 10
0
extern "C" int __declspec(dllexport) Load(void)
{
	mir_getLP(&pluginInfo);

	YAMN_STATUS = ID_STATUS_OFFLINE;

	//	we get the Miranda Root Path
	PathToAbsoluteT( _T("."), szMirandaDir);

	// retrieve the current profile name
	CallService(MS_DB_GETPROFILENAMET, (WPARAM)_countof(ProfileName), (LPARAM)ProfileName);	//not to pass entire array to fcn
	TCHAR *fc = _tcsrchr(ProfileName, '.');
	if ( fc != NULL ) *fc = 0;

	//	we get the user path where our yamn-account.book.ini is stored from mirandaboot.ini file
	GetProfileDirectory(UserDirectory, _countof(UserDirectory));

	// Enumerate all the code pages available for the System Locale
	EnumSystemCodePages(EnumSystemCodePagesProc, CP_INSTALLED);
	CodePageNamesSupp = new _tcptable[CPLENSUPP];
	for (int i = 0, k = 0; i < CPLENALL; i++) {
		if (CodePageNamesAll[i].isValid) {
			CodePageNamesSupp[k] = CodePageNamesAll[i];
			k++;
	}	}

	// Registering YAMN as protocol
	PROTOCOLDESCRIPTOR pd = { PROTOCOLDESCRIPTOR_V3_SIZE };
	pd.szName = YAMN_DBMODULE;
	pd.type = PROTOTYPE_VIRTUAL;
	Proto_RegisterModule(&pd);

	InitializeCriticalSection(&AccountStatusCS);
	InitializeCriticalSection(&FileWritingCS);
	InitializeCriticalSection(&PluginRegCS);

	if (NULL == (NoWriterEV = CreateEvent(NULL, TRUE, TRUE, NULL)))
		return 1;
	if (NULL == (WriteToFileEV = CreateEvent(NULL, FALSE, FALSE, NULL)))
		return 1;
	if (NULL == (ExitEV = CreateEvent(NULL, TRUE, FALSE, NULL)))
		return 1;

	PosX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBPOSX, 0);
	PosY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBPOSY, 0);
	SizeX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBSIZEX, 800);
	SizeY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBSIZEY, 200);

	HeadPosX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSX, 0);
	HeadPosY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSY, 0);
	HeadSizeX = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEX, 690);
	HeadSizeY = db_get_dw(NULL, YAMN_DBMODULE, YAMN_DBMSGSIZEY, 300);
	HeadSplitPos = db_get_w(NULL, YAMN_DBMODULE, YAMN_DBMSGPOSSPLIT, 250);

	optDateTime = db_get_b(NULL, YAMN_DBMODULE, YAMN_DBTIMEOPTIONS, optDateTime);

	// Create new window queues for broadcast messages
	YAMNVar.MessageWnds = WindowList_Create();
	YAMNVar.NewMailAccountWnd = WindowList_Create();
	YAMNVar.Shutdown = FALSE;

	hCurSplitNS = LoadCursor(NULL, IDC_SIZENS);
	hCurSplitWE = LoadCursor(NULL, IDC_SIZEWE);

#ifdef _DEBUG
	InitDebug();
#endif

	CreateServiceFunctions();

	SkinAddNewSoundEx(YAMN_NEWMAILSOUND, YAMN_DBMODULE, YAMN_NEWMAILSNDDESC);
	SkinAddNewSoundEx(YAMN_CONNECTFAILSOUND, YAMN_DBMODULE, YAMN_CONNECTFAILSNDDESC);

	HookEvents();

	LoadIcons();
	LoadPlugins();

	HOTKEYDESC hkd = {0};
	hkd.cbSize = sizeof(hkd);
	hkd.pszName = "YAMN_hotkey";
	hkd.pszService = MS_YAMN_FORCECHECK;
	hkd.pszSection = YAMN_DBMODULE;
	hkd.pszDescription = LPGEN("Check mail");
	hkd.DefHotKey = HOTKEYCODE(HOTKEYF_CONTROL, VK_F11);
	Hotkey_Register(&hkd);

	//Create thread that will be executed every second
	if (!(SecTimer = SetTimer(NULL, 0, 1000, TimerProc)))
		return 1;

	return 0;
}