diff options
author | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2006-11-01 14:56:49 +0000 |
---|---|---|
committer | sje <sje@4f64403b-2f21-0410-a795-97e2b3489a10> | 2006-11-01 14:56:49 +0000 |
commit | 75c65a6f461f71e2c94aac46d3e08e4475e4a450 (patch) | |
tree | f7f37cfcd36e546f5ce56b6a166c5d2200d87cd5 | |
parent | ec0c8066c6ecfbc5e56c453c59527661ec439d20 (diff) |
git-svn-id: https://server.scottellis.com.au/svn/mim_plugs@22 4f64403b-2f21-0410-a795-97e2b3489a10
-rw-r--r-- | window_timeout/list.c | 112 | ||||
-rw-r--r-- | window_timeout/list.h | 5 | ||||
-rw-r--r-- | window_timeout/options.c | 72 | ||||
-rw-r--r-- | window_timeout/resource.h | 19 | ||||
-rw-r--r-- | window_timeout/resources.rc | 101 | ||||
-rw-r--r-- | window_timeout/windowtimeout.c | 125 | ||||
-rw-r--r-- | window_timeout/windowtimeout.dsp | 127 | ||||
-rw-r--r-- | window_timeout/windowtimeout.dsw | 29 | ||||
-rw-r--r-- | window_timeout/windowtimeout.h | 61 | ||||
-rw-r--r-- | window_timeout/windowtimeout.plg | 68 |
10 files changed, 719 insertions, 0 deletions
diff --git a/window_timeout/list.c b/window_timeout/list.c new file mode 100644 index 0000000..1ba076e --- /dev/null +++ b/window_timeout/list.c @@ -0,0 +1,112 @@ +#include "windowtimeout.h"
+
+#define BASE_TIMER_ID 10000
+
+struct Entry *list_head = 0;
+
+BOOL me_typing;
+
+VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime);
+
+struct Entry *get_entry(HANDLE hContact) {
+ struct Entry *current = list_head;
+ while(current) {
+ if(current->hContact == hContact)
+ return current;
+ current = current->next;
+ }
+ return 0;
+}
+
+struct Entry *get_entry_for_timer(UINT timer_id) {
+ struct Entry *current = list_head;
+ char buff[128];
+ sprintf(buff, "get_entry_for_timerid. timer_id = %d", timer_id);
+ msg(buff);
+ while(current) {
+ sprintf(buff, "checking entry with timer_id %d", current->timer_id);
+ msg(buff);
+ if(current->timer_id == timer_id)
+ return current;
+ current = current->next;
+ }
+ return 0;
+}
+
+void add_entry(HANDLE hContact) {
+ struct Entry *entry = get_entry(hContact);
+ if(!entry) {
+ char buff[128];
+ entry = mir_alloc(sizeof(struct Entry));
+
+ sprintf(buff, "added entry. hcontact = %d", hContact);
+ msg(buff);
+
+ entry->hContact = hContact;
+ entry->hwnd = 0;
+
+ entry->next = list_head;
+ entry->prev = 0;
+ if(list_head) list_head->prev = entry;
+ list_head = entry;
+
+ entry->timer_id = 0;
+ entry->typing = FALSE;
+ }
+}
+
+void set_window_handle(HANDLE hContact, HWND hwnd) {
+ struct Entry *entry = get_entry(hContact);
+ if(entry) {
+ msg("set window handle");
+ entry->hwnd = hwnd;
+ }
+}
+
+void set_typing(BOOL typing) {
+ me_typing = typing;
+}
+
+void remove_entry(HANDLE hContact) {
+ struct Entry *entry = get_entry(hContact);
+ if(entry) {
+ msg("remove entry");
+ if(entry->prev) entry->prev->next = entry->next;
+ if(entry->next) entry->next->prev = entry->prev;
+
+ if(list_head == entry) list_head = list_head->next;
+
+ KillTimer(0, entry->timer_id);
+
+ mir_free(entry);
+ }
+}
+
+void reset_timer(HANDLE hContact) {
+ struct Entry *entry = get_entry(hContact);
+ if(entry) {
+ msg("reset timer");
+ if(entry->timer_id) KillTimer(0, entry->timer_id);
+ entry->timer_id = SetTimer(0, 0, options.timeout * 1000, TimerProc);
+ }
+}
+
+VOID CALLBACK TimerProc(HWND hwnd, UINT uMsg, UINT idEvent, DWORD dwTime) {
+ struct Entry *entry;
+ char buff[128];
+
+ KillTimer(0, idEvent);
+ entry = get_entry_for_timer(idEvent);
+
+ sprintf(buff, "timer. id = %d", idEvent);
+ msg(buff);
+ if(entry && entry->hwnd != 0) {
+ if(me_typing) {
+ entry->timer_id = SetTimer(0, 0, TYPING_CHECK_DELAY, TimerProc);
+ } else {
+ msg("timer: close window");
+ SendMessage(entry->hwnd, WM_CLOSE, 0, 0);
+ remove_entry(entry->hContact);
+ }
+ }
+}
\ No newline at end of file diff --git a/window_timeout/list.h b/window_timeout/list.h new file mode 100644 index 0000000..0e638dc --- /dev/null +++ b/window_timeout/list.h @@ -0,0 +1,5 @@ +#ifndef _LIST_H
+#define _LIST_H
+
+
+#endif
diff --git a/window_timeout/options.c b/window_timeout/options.c new file mode 100644 index 0000000..396e3e8 --- /dev/null +++ b/window_timeout/options.c @@ -0,0 +1,72 @@ +#include "windowtimeout.h"
+
+Options options;
+
+void load_options() {
+ options.timeout = DBGetContactSettingDword(0, PLUG, "Timeout", 300);
+ options.monitor_recv_only = DBGetContactSettingByte(0, PLUG, "RecvOnly", 0);
+}
+
+void save_options() {
+ DBWriteContactSettingDword(0, PLUG, "Timeout", options.timeout);
+ DBWriteContactSettingByte(0, PLUG, "RecvOnly", (BYTE)(options.monitor_recv_only ? 1 : 0));
+}
+
+BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ HWND hw;
+ char buff[512];
+
+ switch ( msg ) {
+ case WM_INITDIALOG:
+ {
+ TranslateDialogDefault( hwndDlg );
+ itoa(options.timeout, buff, 10);
+ SetDlgItemText(hwndDlg, IDC_ED_TIMEOUT, buff);
+ CheckDlgButton(hwndDlg, IDC_CHK_RECVONLY, options.monitor_recv_only ? TRUE : FALSE);
+ }
+ return TRUE;
+ case WM_COMMAND:
+ if ( HIWORD( wParam ) == BN_CLICKED ) {
+ switch( LOWORD( wParam )) {
+ case IDC_CHK_RECVONLY:
+ SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
+ break;
+ }
+ } else if ( HIWORD( wParam ) == EN_CHANGE && ( HWND )lParam == GetFocus()) {
+ SendMessage( GetParent( hwndDlg ), PSM_CHANGED, 0, 0 );
+ }
+ return TRUE;
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->code == PSN_APPLY ) {
+ hw = GetDlgItem(hwndDlg, IDC_ED_TIMEOUT);
+ GetWindowText(hw, buff, 512);
+ if(strlen(buff) > 0)
+ options.timeout = atoi(buff);
+ options.monitor_recv_only = IsDlgButtonChecked(hwndDlg, IDC_CHK_RECVONLY);
+ save_options();
+ return TRUE;
+ }
+ break;
+ }
+
+ return FALSE;
+}
+
+int OptInit(WPARAM wParam, LPARAM lParam) {
+ OPTIONSDIALOGPAGE odp;
+ ZeroMemory(&odp, sizeof(odp));
+ odp.cbSize = sizeof(odp);
+ odp.position = -790000000;
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT);
+ odp.pszTitle = Translate("Window Timeout");
+ odp.pszGroup = Translate("Events");
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.nIDBottomSimpleControl = 0;
+ odp.pfnDlgProc = DlgProcOpts;
+ CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+
+ return 0;
+}
+
diff --git a/window_timeout/resource.h b/window_timeout/resource.h new file mode 100644 index 0000000..c6b3da5 --- /dev/null +++ b/window_timeout/resource.h @@ -0,0 +1,19 @@ +//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by resources.rc
+//
+#define IDD_DIALOG1 101
+#define IDD_OPT 101
+#define IDC_ED_TIMEOUT 1000
+#define IDC_CHK_RECVONLY 1001
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 102
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1002
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/window_timeout/resources.rc b/window_timeout/resources.rc new file mode 100644 index 0000000..2a7ca93 --- /dev/null +++ b/window_timeout/resources.rc @@ -0,0 +1,101 @@ +//Microsoft Developer Studio generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (Australia) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENA)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_AUS
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT DIALOG DISCARDABLE 0, 0, 263, 197
+STYLE WS_CHILD
+FONT 8, "MS Sans Serif"
+BEGIN
+ LTEXT "Window Timeout:",IDC_STATIC,37,67,90,9
+ EDITTEXT IDC_ED_TIMEOUT,133,65,40,14,ES_RIGHT | ES_AUTOHSCROLL |
+ ES_NUMBER
+ LTEXT "seconds",IDC_STATIC,181,67,49,8
+ GROUPBOX "Options",IDC_STATIC,23,41,215,82
+ CONTROL "Delay close for received events only",IDC_CHK_RECVONLY,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,55,94,166,10
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO DISCARDABLE
+BEGIN
+ IDD_OPT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 256
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 190
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE DISCARDABLE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+#endif // English (Australia) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+
diff --git a/window_timeout/windowtimeout.c b/window_timeout/windowtimeout.c new file mode 100644 index 0000000..d5bf05e --- /dev/null +++ b/window_timeout/windowtimeout.c @@ -0,0 +1,125 @@ +#include "windowtimeout.h"
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+struct MM_INTERFACE mmi;
+
+PLUGININFO pluginInfo={
+ sizeof(PLUGININFO),
+ PLUG,
+ PLUGIN_MAKE_VERSION(0,0,0,3),
+ "Hides message windows after a specified period of inactivity",
+ "Scott Ellis",
+ "mail@scottellis.com.au",
+ "© 2005 Scott Ellis",
+ "http://www.scottellis.com.au/",
+ 0, //not transient
+ 0 //doesn't replace anything built-in
+};
+
+BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst=hinstDLL;
+ return TRUE;
+}
+
+__declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+HANDLE hook_idle, hook_dbevent, hook_dbcontact, hook_window, hook_typing;
+
+int OnIdleChanged(WPARAM wParam, LPARAM lParam) {
+ return 0;
+}
+
+int OnWindowEvent(WPARAM wParam, LPARAM lParam) {
+ MessageWindowEventData *mwed = (MessageWindowEventData *)lParam;
+ if(mwed->uType == MSG_WINDOW_EVT_OPENING || mwed->uType == MSG_WINDOW_EVT_OPEN) {
+ add_entry(mwed->hContact);
+ set_window_handle(mwed->hContact, mwed->hwndWindow);
+ } else if(mwed->uType == MSG_WINDOW_EVT_CLOSING || mwed->uType == MSG_WINDOW_EVT_CLOSE)
+ remove_entry(mwed->hContact);
+ return 0;
+}
+
+int OnDbEvent(WPARAM wParam, LPARAM lParam) {
+ HANDLE hContact = (HANDLE)wParam;
+ if(options.monitor_recv_only == FALSE) {
+ add_entry(hContact);
+ reset_timer(hContact);
+ } else {
+ DBEVENTINFO *dbe = (HANDLE)lParam;
+ if(dbe->flags & DBEF_SENT) {
+ struct Entry *entry = get_entry(hContact);
+ msg("sent event");
+ if(entry && entry->timer_id == 0) {
+ msg("closing window");
+ SendMessage(entry->hwnd, WM_CLOSE, 0, 0);
+ }
+ return 0;
+ }
+ if(dbe->flags & DBEF_READ) {
+ msg("read event");
+ return 0;
+ }
+
+ add_entry(hContact);
+ reset_timer(hContact);
+ }
+ return 0;
+}
+
+
+int OnTyping(WPARAM wParam, LPARAM lParam) {
+ if(lParam) reset_timer((HANDLE)wParam);
+
+ return 0;
+}
+
+int OnContactDeleted(WPARAM wParam, LPARAM lParam) {
+ HANDLE hContact = (HANDLE)wParam;
+ remove_entry(hContact);
+ return 0;
+}
+
+int OnModulesLoaded(WPARAM wParam, LPARAM lParam) {
+ hook_idle = HookEvent(ME_IDLE_CHANGED, OnIdleChanged);
+ hook_dbevent = HookEvent(ME_DB_EVENT_FILTER_ADD, OnDbEvent);
+ hook_window = HookEvent(ME_MSG_WINDOWEVENT, OnWindowEvent);
+ hook_dbcontact = HookEvent(ME_DB_CONTACT_DELETED, OnContactDeleted);
+ hook_typing = HookEvent(ME_PROTO_CONTACTISTYPING, OnTyping);
+ return 0;
+}
+
+int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ PROTOCOLDESCRIPTOR pd;
+ HANDLE hContact;
+
+ pluginLink = link;
+
+ CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM)&mmi);
+
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ HookEvent(ME_OPT_INITIALISE, OptInit);
+
+ load_options();
+ return 0;
+}
+
+int __declspec(dllexport) Unload(void)
+{
+ if(hook_idle) UnhookEvent(hook_idle);
+ if(hook_dbevent) UnhookEvent(hook_dbevent);
+ if(hook_window) UnhookEvent(hook_window);
+ if(hook_dbcontact) UnhookEvent(hook_dbcontact);
+ if(hook_typing) UnhookEvent(hook_typing);
+ return 0;
+}
+
+
+void msg(char *msg) {
+ //MessageBox(0, msg, "Message", MB_OK);
+}
\ No newline at end of file diff --git a/window_timeout/windowtimeout.dsp b/window_timeout/windowtimeout.dsp new file mode 100644 index 0000000..3b5fedd --- /dev/null +++ b/window_timeout/windowtimeout.dsp @@ -0,0 +1,127 @@ +# Microsoft Developer Studio Project File - Name="windowtimeout" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=windowtimeout - Win32 Debug
+!MESSAGE This is not a valid makefile. To build this project using NMAKE,
+!MESSAGE use the Export Makefile command and run
+!MESSAGE
+!MESSAGE NMAKE /f "windowtimeout.mak".
+!MESSAGE
+!MESSAGE You can specify a configuration when running NMAKE
+!MESSAGE by defining the macro CFG on the command line. For example:
+!MESSAGE
+!MESSAGE NMAKE /f "windowtimeout.mak" CFG="windowtimeout - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "windowtimeout - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "windowtimeout - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE
+
+# Begin Project
+# PROP AllowPerConfigDependencies 0
+# PROP Scc_ProjName ""
+# PROP Scc_LocalPath ""
+CPP=cl.exe
+MTL=midl.exe
+RSC=rc.exe
+
+!IF "$(CFG)" == "windowtimeout - Win32 Release"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 0
+# PROP BASE Output_Dir "Release"
+# PROP BASE Intermediate_Dir "Release"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 0
+# PROP Output_Dir "Release"
+# PROP Intermediate_Dir "Release"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINDOWTIMEOUT_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MT /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINDOWTIMEOUT_EXPORTS" /YX /FD /c
+# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "NDEBUG"
+# ADD RSC /l 0x809 /d "NDEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386 /out:"../../bin/release/plugins/windowtimeout.dll"
+
+!ELSEIF "$(CFG)" == "windowtimeout - Win32 Debug"
+
+# PROP BASE Use_MFC 0
+# PROP BASE Use_Debug_Libraries 1
+# PROP BASE Output_Dir "Debug"
+# PROP BASE Intermediate_Dir "Debug"
+# PROP BASE Target_Dir ""
+# PROP Use_MFC 0
+# PROP Use_Debug_Libraries 1
+# PROP Output_Dir "Debug"
+# PROP Intermediate_Dir "Debug"
+# PROP Ignore_Export_Lib 0
+# PROP Target_Dir ""
+# ADD BASE CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINDOWTIMEOUT_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINDOWTIMEOUT_EXPORTS" /YX /FD /GZ /c
+# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
+# ADD BASE RSC /l 0x809 /d "_DEBUG"
+# ADD RSC /l 0x809 /d "_DEBUG"
+BSC32=bscmake.exe
+# ADD BASE BSC32 /nologo
+# ADD BSC32 /nologo
+LINK32=link.exe
+# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug/plugins/windowtimeout.dll" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "windowtimeout - Win32 Release"
+# Name "windowtimeout - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\list.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\options.c
+# End Source File
+# Begin Source File
+
+SOURCE=.\windowtimeout.c
+# End Source File
+# End Group
+# Begin Group "Header Files"
+
+# PROP Default_Filter "h;hpp;hxx;hm;inl"
+# Begin Source File
+
+SOURCE=.\resource.h
+# End Source File
+# Begin Source File
+
+SOURCE=.\windowtimeout.h
+# End Source File
+# End Group
+# Begin Group "Resource Files"
+
+# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+# Begin Source File
+
+SOURCE=.\resources.rc
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/window_timeout/windowtimeout.dsw b/window_timeout/windowtimeout.dsw new file mode 100644 index 0000000..fed71ef --- /dev/null +++ b/window_timeout/windowtimeout.dsw @@ -0,0 +1,29 @@ +Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "windowtimeout"=".\windowtimeout.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/window_timeout/windowtimeout.h b/window_timeout/windowtimeout.h new file mode 100644 index 0000000..3d001a9 --- /dev/null +++ b/window_timeout/windowtimeout.h @@ -0,0 +1,61 @@ +#ifndef _WINDOWTIMEOUT_H
+#define _WINDOWTIMEOUT_H
+
+#include <windows.h>
+#include <newpluginapi.h>
+#include <stdio.h>
+
+#include "resource.h"
+
+#define PLUG "WindowTimeout"
+
+#include "../include/m_system.h"
+#include "../include/m_idle.h"
+#include "../include/m_skin.h"
+#include "../include/m_database.h"
+#include "../include/m_options.h"
+#include "../include/m_langpack.h"
+#include "../include/m_message.h"
+#include "../include/m_protocols.h"
+#include "../include/m_protosvc.h"
+#include "../include/m_protomod.h"
+
+
+#define TYPING_CHECK_DELAY 100 // ms
+
+typedef struct Entry {
+ HANDLE hContact;
+ HWND hwnd;
+ UINT timer_id;
+ struct Entry *next, *prev;
+ BOOL typing;
+} tag_Entry;
+
+
+void add_entry(HANDLE hContact);
+void set_window_handle(HANDLE hContact, HWND hwnd);
+void set_typing(BOOL typing);
+void remove_entry(HANDLE hContact);
+void reset_timer(HANDLE hContact);
+struct Entry *get_entry(HANDLE hContact);
+
+typedef struct {
+ int timeout;
+ BOOL monitor_recv_only;
+} Options;
+
+extern HINSTANCE hInst;
+extern PLUGINLINK *pluginLink;
+extern struct MM_INTERFACE mmi;
+
+#define mir_alloc(x) mmi.mmi_malloc(x)
+#define mir_free(x) mmi.mmi_free(x)
+
+extern Options options;
+int OptInit(WPARAM wParam, LPARAM lParam);
+
+void load_options();
+
+void msg(char *msg);
+
+#endif
diff --git a/window_timeout/windowtimeout.plg b/window_timeout/windowtimeout.plg new file mode 100644 index 0000000..595eb0b --- /dev/null +++ b/window_timeout/windowtimeout.plg @@ -0,0 +1,68 @@ +<html>
+<body>
+<pre>
+<h1>Build Log</h1>
+<h3>
+--------------------Configuration: windowtimeout - Win32 Release--------------------
+</h3>
+<h3>Command Lines</h3>
+Creating temporary file "C:\DOCUME~1\sje\LOCALS~1\Temp\RSP164.tmp" with contents
+[
+/nologo /MT /W3 /GX /O2 /I "../../include" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINDOWTIMEOUT_EXPORTS" /Fp"Release/windowtimeout.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
+"C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\WindowTimeout\list.c"
+"C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\WindowTimeout\windowtimeout.c"
+]
+Creating command line "cl.exe @C:\DOCUME~1\sje\LOCALS~1\Temp\RSP164.tmp"
+Creating temporary file "C:\DOCUME~1\sje\LOCALS~1\Temp\RSP165.tmp" with contents
+[
+kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:no /pdb:"Release/windowtimeout.pdb" /machine:I386 /out:"../../bin/release/plugins/windowtimeout.dll" /implib:"Release/windowtimeout.lib"
+".\Release\list.obj"
+".\Release\options.obj"
+".\Release\windowtimeout.obj"
+".\Release\resources.res"
+]
+Creating command line "link.exe @C:\DOCUME~1\sje\LOCALS~1\Temp\RSP165.tmp"
+<h3>Output Window</h3>
+Compiling...
+list.c
+windowtimeout.c
+Linking...
+ Creating library Release/windowtimeout.lib and object Release/windowtimeout.exp
+
+
+
+<h3>Results</h3>
+windowtimeout.dll - 0 error(s), 0 warning(s)
+<h3>
+--------------------Configuration: windowtimeout - Win32 Debug--------------------
+</h3>
+<h3>Command Lines</h3>
+Creating temporary file "C:\DOCUME~1\sje\LOCALS~1\Temp\RSP169.tmp" with contents
+[
+/nologo /MTd /W3 /Gm /GX /ZI /Od /I "../../include" /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "WINDOWTIMEOUT_EXPORTS" /Fp"Debug/windowtimeout.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
+"C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\WindowTimeout\list.c"
+"C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\WindowTimeout\windowtimeout.c"
+]
+Creating command line "cl.exe @C:\DOCUME~1\sje\LOCALS~1\Temp\RSP169.tmp"
+Creating temporary file "C:\DOCUME~1\sje\LOCALS~1\Temp\RSP16A.tmp" with contents
+[
+kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /incremental:yes /pdb:"Debug/windowtimeout.pdb" /debug /machine:I386 /out:"../../bin/debug/plugins/windowtimeout.dll" /implib:"Debug/windowtimeout.lib" /pdbtype:sept
+".\Debug\list.obj"
+".\Debug\options.obj"
+".\Debug\windowtimeout.obj"
+".\Debug\resources.res"
+]
+Creating command line "link.exe @C:\DOCUME~1\sje\LOCALS~1\Temp\RSP16A.tmp"
+<h3>Output Window</h3>
+Compiling...
+list.c
+windowtimeout.c
+Linking...
+
+
+
+<h3>Results</h3>
+windowtimeout.dll - 0 error(s), 0 warning(s)
+</pre>
+</body>
+</html>
|