From a197d77bd256a1ebe58454a34315e252d5441edc Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Sun, 12 May 2013 13:31:34 +0000 Subject: wbOSD adopted, initial version git-svn-id: http://svn.miranda-ng.org/main/trunk@4638 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/wbOSD/main.cpp | 99 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 plugins/wbOSD/main.cpp (limited to 'plugins/wbOSD/main.cpp') diff --git a/plugins/wbOSD/main.cpp b/plugins/wbOSD/main.cpp new file mode 100644 index 0000000000..d4d4cc260a --- /dev/null +++ b/plugins/wbOSD/main.cpp @@ -0,0 +1,99 @@ +/* +Wannabe OSD +This plugin tries to become miranda's standard OSD ;-) + +(C) 2005 Andrej Krutak + +Distributed under GNU's GPL 2 or later +*/ + +#include "wbOSD.h" +#include "buildnumber.h" + +HINSTANCE hI; + +HWND hwnd=0; +HANDLE hservosda; +int hLangpack = 0; +HANDLE hHookedNewEvent, hHookedInit, hProtoAck, hContactSettingChanged, hHookContactStatusChanged, hContactStatusChanged, hpluginShutDown; +HINSTANCE hUser32; +BOOL (WINAPI*pSetLayeredWindowAttributes)(HWND, COLORREF, BYTE, DWORD); + +void logmsg2(char *str); +int MainInit(WPARAM,LPARAM); + +///////////////////////////////////////////////////////////////////////////////////////// + +static PLUGININFOEX pluginInfo = { + sizeof(PLUGININFOEX), + "WannaBe OSD", + __VERSION_DWORD, + "Show new message/status change info using onscreen display", + "Andrej Krutak", + "andree182 {at} gmail (dot) com", + "©2005 Andrej Krutak", + "http://urtax.ms.mff.cuni.cz/~andree/", + UNICODE_AWARE, + { 0xfc718bc7, 0xabc8, 0x43cd, { 0xaa, 0xd9, 0x76, 0x16, 0x14, 0x61, 0x77, 0x38 } } // {FC718BC7-ABC8-43CD-AAD9-761614617738} +}; + +extern "C" __declspec(dllexport) PLUGININFOEX *MirandaPluginInfoEx(DWORD) +{ + return &pluginInfo; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +extern "C" __declspec(dllexport) int Load() +{ + mir_getLP(&pluginInfo); + + logmsg("Load"); + pSetLayeredWindowAttributes=0; + +#ifndef FORCE_9XDRAWING + hUser32=LoadLibrary(_T("user32.dll")); +#else + hUser32=0; +#endif + + if (hUser32) { + pSetLayeredWindowAttributes=(BOOL(WINAPI*)(HWND, COLORREF, BYTE, DWORD))GetProcAddress(hUser32, "SetLayeredWindowAttributes"); + if (!pSetLayeredWindowAttributes) { + FreeLibrary(hUser32); + hUser32=0; + } + } + + hHookedInit = HookEvent(ME_SYSTEM_MODULESLOADED, MainInit); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +extern "C" __declspec(dllexport) int Unload() +{ + logmsg("Unload"); + UnhookEvent(hpluginShutDown); + UnhookEvent(hProtoAck); + UnhookEvent(hContactSettingChanged); + UnhookEvent(hContactStatusChanged); + UnhookEvent(hHookedNewEvent); + UnhookEvent(hHookedInit); + + if (hUser32) + FreeLibrary(hUser32); + pSetLayeredWindowAttributes=0; + + DestroyServiceFunction(hservosda); + DestroyHookableEvent(hHookContactStatusChanged); + return 0; +} + +///////////////////////////////////////////////////////////////////////////////////////// + +BOOL WINAPI DllMain(HINSTANCE hinst,DWORD fdwReason,LPVOID lpvReserved) +{ + hI = hinst; + return TRUE; +} -- cgit v1.2.3