summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--justtabs/docs/licence_JustTabs.txt6
-rw-r--r--justtabs/justtabs.cpp208
-rw-r--r--justtabs/justtabs.dsp123
-rw-r--r--justtabs/justtabs.dsw29
-rw-r--r--justtabs/justtabs.mdsp95
-rw-r--r--justtabs/justtabs.plg72
-rw-r--r--justtabs/justtabs.sln20
-rw-r--r--justtabs/justtabs.vcproj309
-rw-r--r--justtabs/main.h0
-rw-r--r--justtabs/options.cpp72
-rw-r--r--justtabs/options.h15
-rw-r--r--justtabs/resource.h22
-rw-r--r--justtabs/resource.rc117
-rw-r--r--justtabs/win.cpp683
-rw-r--r--justtabs/win.h45
15 files changed, 1816 insertions, 0 deletions
diff --git a/justtabs/docs/licence_JustTabs.txt b/justtabs/docs/licence_JustTabs.txt
new file mode 100644
index 0000000..d0a5045
--- /dev/null
+++ b/justtabs/docs/licence_JustTabs.txt
@@ -0,0 +1,6 @@
+The JustTabs plugin for Miranda-IM is Copyright (c) 2006 Scott Ellis (mail@scottellis.com.au)
+
+http://www.scottellis.com.au
+
+It is released under the General Public Licence, available here:
+http://www.gnu.org/copyleft/gpl.html \ No newline at end of file
diff --git a/justtabs/justtabs.cpp b/justtabs/justtabs.cpp
new file mode 100644
index 0000000..68ec7bd
--- /dev/null
+++ b/justtabs/justtabs.cpp
@@ -0,0 +1,208 @@
+/*
+Miranda plugin template, originally by Richard Hughes
+http://miranda-icq.sourceforge.net/
+
+This file is placed in the public domain. Anybody is free to use or
+modify it as they wish with no restriction.
+There is no warranty.
+*/
+
+#include "win.h"
+#include "options.h"
+
+HINSTANCE hInst;
+PLUGINLINK *pluginLink;
+MM_INTERFACE memoryManagerInterface;
+
+HANDLE hEventClistDblClick, hEventWindow, hEventIconChanged;
+
+typedef LRESULT (CALLBACK *WNDPROC)(HWND, UINT, WPARAM, LPARAM);
+
+PLUGININFO pluginInfo={
+ sizeof(PLUGININFO),
+ MODULE,
+ PLUGIN_MAKE_VERSION(0,0,1,0),
+ "Put SRMM windows into a single frame",
+ "Scott Ellis",
+ "mail@scottellis.com.au",
+ "© 2004 Scott Ellis",
+ "http://scottellis.com.au",
+ 0, //not transient
+ 0 //doesn't replace anything built-in
+};
+
+extern "C" BOOL WINAPI DllMain(HINSTANCE hinstDLL,DWORD fdwReason,LPVOID lpvReserved)
+{
+ hInst=hinstDLL;
+ return TRUE;
+}
+
+extern "C" __declspec(dllexport) PLUGININFO* MirandaPluginInfo(DWORD mirandaVersion)
+{
+ return &pluginInfo;
+}
+
+
+static int CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
+{
+ switch(message) {
+ case WM_COMMAND:
+ if (HIWORD(wParam) == STN_CLICKED) { //It was a click on the Popup.
+ PUDeletePopUp(hWnd);
+ return TRUE;
+ }
+ break;
+ case UM_FREEPLUGINDATA: {
+ //MY_PLUGIN_DATA * mpd = NULL;
+ //mpd = (MY_PLUGIN_DATA*)CallService(MS_POPUP_GETPLUGINDATA, (WPARAM)hWnd,(LPARAM)mpd);
+ //if (mdp > 0) free(mpd);
+ return TRUE; //TRUE or FALSE is the same, it gets ignored.
+ }
+ default:
+ break;
+ }
+ return DefWindowProc(hWnd, message, wParam, lParam);
+}
+
+void ShowPopup(HANDLE hContact, const char *msg) {
+ if(ServiceExists(MS_POPUP_ADDPOPUP)) {
+ POPUPDATAEX ppd;
+ char *lpzContactName;
+
+ ZeroMemory(&ppd, sizeof(ppd)); //This is always a good thing to do.
+ ppd.lchContact = hContact; //Be sure to use a GOOD handle, since this will not be checked.
+ ppd.lchIcon = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
+
+ lpzContactName = (char *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact,0);
+
+ lstrcpy(ppd.lpzContactName, lpzContactName);
+ lstrcpy(ppd.lpzText, msg);
+ ppd.colorBack = GetSysColor(COLOR_BTNFACE);;
+ ppd.colorText = RGB(0,0,0);
+ ppd.PluginWindowProc = (WNDPROC)PopupDlgProc;
+ ppd.PluginData = 0;
+ ppd.iSeconds = 3;
+
+ //Now that every field has been filled, we want to see the popup.
+ CallService(MS_POPUP_ADDPOPUPEX, (WPARAM)&ppd, 0);
+ }
+}
+
+int WindowEvent(WPARAM wParam, LPARAM lParam) {
+ MessageWindowEventData *ed = (MessageWindowEventData *)lParam;
+
+ char *proto = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)ed->hContact, 0);
+ if(proto && DBGetContactSettingByte(ed->hContact, proto, "ChatRoom", 0)) return 0; // ignore chat room contacts
+
+ switch(ed->uType) {
+ case MSG_WINDOW_EVT_OPENING:
+ SendMessage(pluginwind, WM_PREADDCHILD, (WPARAM)ed->hwndWindow, (LPARAM)ed->hContact);
+ break;
+ case MSG_WINDOW_EVT_OPEN:
+ PostMessage(pluginwind, WM_ADDCHILD, (WPARAM)ed->hwndWindow, (LPARAM)ed->hContact);
+ break;
+ case MSG_WINDOW_EVT_CLOSING:
+ SendMessage(pluginwind, WM_REMCHILD, (WPARAM)ed->hwndWindow, (LPARAM)ed->hContact);
+ break;
+ }
+
+ return 0;
+}
+
+int ClistDblClick(WPARAM wParam, LPARAM lParam) {
+ PostMessage(pluginwind, WM_SHOWCONTACTWND, wParam, 0);
+ return 0;
+}
+
+int ContactIconChanged(WPARAM wParam, LPARAM lParam) {
+ PostMessage(pluginwind, WM_RESETTABICONS, wParam, lParam);
+ return 0;
+}
+
+static int MainInit(WPARAM wParam,LPARAM lParam) {
+ if(ServiceExists(MS_UPDATE_REGISTER)) {
+ // register with updater
+ Update update = {0};
+ char szVersion[16];
+
+ update.cbSize = sizeof(Update);
+
+ update.szComponentName = pluginInfo.shortName;
+ update.pbVersion = (BYTE *)CreateVersionString(pluginInfo.version, szVersion);
+ update.cpbVersion = strlen((char *)update.pbVersion);
+
+ update.szUpdateURL = UPDATER_AUTOREGISTER;
+
+ // these are the three lines that matter - the archive, the page containing the version string, and the text (or data)
+ // before the version that we use to locate it on the page
+ // (note that if the update URL and the version URL point to standard file listing entries, the backend xml
+ // data will be used to check for updates rather than the actual web page - this is not true for beta urls)
+ update.szBetaUpdateURL = "http://www.scottellis.com.au/miranda_plugins/justtabs.zip";
+ update.szBetaVersionURL = "http://www.scottellis.com.au/miranda_plugins/ver_justtabs.html";
+ update.pbBetaVersionPrefix = (BYTE *)MODULE " version ";
+
+ update.cpbBetaVersionPrefix = strlen((char *)update.pbBetaVersionPrefix);
+
+ CallService(MS_UPDATE_REGISTER, 0, (WPARAM)&update);
+ }
+
+ // plugin only works for srmm classic
+ if(GetModuleHandle("srmm")) {
+ CreateFrame((HWND)CallService(MS_CLUI_GETHWND, 0, 0), hInst);
+ hEventWindow = HookEvent(ME_MSG_WINDOWEVENT, WindowEvent);
+ hEventClistDblClick = HookEvent(ME_CLIST_DOUBLECLICKED, ClistDblClick);
+ hEventIconChanged = HookEvent(ME_CLIST_CONTACTICONCHANGED, ContactIconChanged);
+ }
+
+ return 0;
+}
+
+static int MainDeInit(WPARAM wParam, LPARAM lParam) {
+ if(hEventWindow) UnhookEvent(hEventWindow);
+ if(hEventClistDblClick) UnhookEvent(hEventClistDblClick);
+ if(hEventIconChanged) UnhookEvent(hEventIconChanged);
+ if(pluginwind) {
+ DestroyWindow(pluginwind);
+ pluginwind = 0;
+ }
+ return 0;
+}
+
+static int DbEventAdded(WPARAM wParam, LPARAM lParam) {
+ DBEVENTINFO dbei;
+
+ ZeroMemory(&dbei, sizeof(dbei));
+ dbei.cbSize = sizeof(dbei);
+ dbei.cbBlob = 0;
+ CallService(MS_DB_EVENT_GET, lParam, (LPARAM) & dbei);
+
+ if((dbei.flags & DBEF_READ) || (dbei.flags & DBEF_SENT))
+ return 0;
+
+ SendMessage(pluginwind, WM_HIGHLIGHTCONTACTWND, wParam, 0);
+ //SendMessage(pluginwind, WM_SHOWCONTACTWND, wParam, 0);
+
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Load(PLUGINLINK *link)
+{
+ pluginLink = link;
+
+ CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM)&memoryManagerInterface);
+
+ HookEvent(ME_SYSTEM_MODULESLOADED,MainInit);
+ HookEvent(ME_SYSTEM_PRESHUTDOWN, MainDeInit);
+
+ HookEvent(ME_DB_EVENT_ADDED, DbEventAdded);
+
+ InitOptions();
+
+ return 0;
+}
+
+extern "C" int __declspec(dllexport) Unload(void)
+{
+ return 0;
+}
+
diff --git a/justtabs/justtabs.dsp b/justtabs/justtabs.dsp
new file mode 100644
index 0000000..e1beefd
--- /dev/null
+++ b/justtabs/justtabs.dsp
@@ -0,0 +1,123 @@
+# Microsoft Developer Studio Project File - Name="justtabs" - Package Owner=<4>
+# Microsoft Developer Studio Generated Build File, Format Version 6.00
+# ** DO NOT EDIT **
+
+# TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102
+
+CFG=justtabs - 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 "justtabs.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 "justtabs.mak" CFG="justtabs - Win32 Debug"
+!MESSAGE
+!MESSAGE Possible choices for configuration are:
+!MESSAGE
+!MESSAGE "justtabs - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library")
+!MESSAGE "justtabs - 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)" == "justtabs - 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 2
+# 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 "JUSTTABS_EXPORTS" /YX /FD /c
+# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JUSTTABS_EXPORTS" /D "_WINDLL" /D "_AFXDLL" /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" /d "_AFXDLL"
+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 gdi32.lib user32.lib opengl32.lib glu32.lib comctl32.lib /nologo /dll /machine:I386 /out:"../../bin/release/plugins/justtabs.dll"
+
+!ELSEIF "$(CFG)" == "justtabs - 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 2
+# 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 "JUSTTABS_EXPORTS" /YX /FD /GZ /c
+# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JUSTTABS_EXPORTS" /D "_WINDLL" /D "_AFXDLL" /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" /d "_AFXDLL"
+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 gdi32.lib user32.lib opengl32.lib glu32.lib comctl32.lib /nologo /dll /debug /machine:I386 /out:"../../bin/debug/plugins/justtabs.dll" /pdbtype:sept
+
+!ENDIF
+
+# Begin Target
+
+# Name "justtabs - Win32 Release"
+# Name "justtabs - Win32 Debug"
+# Begin Group "Source Files"
+
+# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+# Begin Source File
+
+SOURCE=.\justtabs.cpp
+# End Source File
+# Begin Source File
+
+SOURCE=.\win.cpp
+# 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=.\win.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=.\resource.rc
+# End Source File
+# End Group
+# End Target
+# End Project
diff --git a/justtabs/justtabs.dsw b/justtabs/justtabs.dsw
new file mode 100644
index 0000000..513121b
--- /dev/null
+++ b/justtabs/justtabs.dsw
@@ -0,0 +1,29 @@
+Microsoft Developer Studio Workspace File, Format Version 6.00
+# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
+
+###############################################################################
+
+Project: "testplug"=".\justtabs.dsp" - Package Owner=<4>
+
+Package=<5>
+{{{
+}}}
+
+Package=<4>
+{{{
+}}}
+
+###############################################################################
+
+Global:
+
+Package=<5>
+{{{
+}}}
+
+Package=<3>
+{{{
+}}}
+
+###############################################################################
+
diff --git a/justtabs/justtabs.mdsp b/justtabs/justtabs.mdsp
new file mode 100644
index 0000000..385f6bf
--- /dev/null
+++ b/justtabs/justtabs.mdsp
@@ -0,0 +1,95 @@
+[Project]
+name=justtabs
+type=2
+defaultConfig=0
+
+
+[Debug]
+// compiler
+workingDirectory=
+arguments=
+intermediateFilesDirectory=Debug
+outputFilesDirectory=Debug
+compilerPreprocessor=
+extraCompilerOptions=
+compilerIncludeDirectory=..\..\include
+noWarning=0
+defaultWarning=0
+allWarning=1
+extraWarning=0
+isoWarning=0
+warningsAsErrors=0
+debugType=1
+debugLevel=2
+exceptionEnabled=1
+runtimeTypeEnabled=1
+optimizeLevel=0
+
+// linker
+libraryPath=
+outputFilename=Debug\justtabs.dll
+libraries=gdi32, comctl32
+extraLinkerOptions=
+ignoreStartupFile=0
+ignoreDefaultLibs=0
+stripExecutableFile=0
+
+// archive
+extraArchiveOptions=
+
+//resource
+resourcePreprocessor=
+resourceIncludeDirectory=
+extraResourceOptions=
+
+[Release]
+// compiler
+workingDirectory=
+arguments=
+intermediateFilesDirectory=Release
+outputFilesDirectory=Release
+compilerPreprocessor=
+extraCompilerOptions=
+compilerIncludeDirectory=..\..\include
+noWarning=0
+defaultWarning=0
+allWarning=1
+extraWarning=0
+isoWarning=0
+warningAsErrors=0
+debugType=0
+debugLevel=1
+exceptionEnabled=0
+runtimeTypeEnabled=0
+optimizeLevel=4
+
+// linker
+libraryPath=
+outputFilename=Release\justtabs.dll
+libraries=gdi32, comctl32
+extraLinkerOptions=
+ignoreStartupFile=0
+ignoreDefaultLibs=0
+stripExecutableFile=1
+
+// archive
+extraArchiveOptions=
+
+//resource
+resourcePreprocessor=
+resourceIncludeDirectory=
+extraResourceOptions=
+
+[Source]
+1=justtabs.cpp
+2=win.cpp
+3=options.cpp
+[Header]
+1=resource.h
+2=win.h
+3=options.h
+[Resource]
+1=resource.rc
+[Other]
+[History]
+justtabs.cpp,555
diff --git a/justtabs/justtabs.plg b/justtabs/justtabs.plg
new file mode 100644
index 0000000..16b8a14
--- /dev/null
+++ b/justtabs/justtabs.plg
@@ -0,0 +1,72 @@
+<html>
+<body>
+<pre>
+<h1>Build Log</h1>
+<h3>
+--------------------Configuration: justtabs - Win32 Release--------------------
+</h3>
+<h3>Command Lines</h3>
+Creating temporary file "C:\DOCUME~1\sje\LOCALS~1\Temp\RSP2C8.tmp" with contents
+[
+/nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JUSTTABS_EXPORTS" /D "_WINDLL" /D "_AFXDLL" /Fp"Release/justtabs.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c
+"C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\justtabs\win.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\sje\LOCALS~1\Temp\RSP2C8.tmp"
+Creating temporary file "C:\DOCUME~1\sje\LOCALS~1\Temp\RSP2C9.tmp" with contents
+[
+gdi32.lib user32.lib opengl32.lib glu32.lib comctl32.lib /nologo /dll /incremental:no /pdb:"Release/justtabs.pdb" /machine:I386 /out:"../../bin/release/plugins/justtabs.dll" /implib:"Release/justtabs.lib"
+".\Release\justtabs.obj"
+".\Release\win.obj"
+".\Release\resource.res"
+]
+Creating command line "link.exe @C:\DOCUME~1\sje\LOCALS~1\Temp\RSP2C9.tmp"
+<h3>Output Window</h3>
+Compiling...
+win.cpp
+Linking...
+ Creating library Release/justtabs.lib and object Release/justtabs.exp
+LINK : warning LNK4089: all references to "KERNEL32.dll" discarded by /OPT:REF
+
+
+
+<h3>Results</h3>
+justtabs.dll - 0 error(s), 1 warning(s)
+<h3>
+--------------------Configuration: justtabs - Win32 Debug--------------------
+</h3>
+<h3>Command Lines</h3>
+Creating temporary file "C:\DOCUME~1\sje\LOCALS~1\Temp\RSP2CD.tmp" with contents
+[
+/nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /D "_USRDLL" /D "JUSTTABS_EXPORTS" /D "_WINDLL" /D "_AFXDLL" /Fp"Debug/justtabs.pch" /YX /Fo"Debug/" /Fd"Debug/" /FD /GZ /c
+"C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\justtabs\win.cpp"
+]
+Creating command line "cl.exe @C:\DOCUME~1\sje\LOCALS~1\Temp\RSP2CD.tmp"
+Creating temporary file "C:\DOCUME~1\sje\LOCALS~1\Temp\RSP2CE.tmp" with contents
+[
+gdi32.lib user32.lib opengl32.lib glu32.lib comctl32.lib /nologo /dll /incremental:yes /pdb:"Debug/justtabs.pdb" /debug /machine:I386 /out:"../../bin/debug/plugins/justtabs.dll" /implib:"Debug/justtabs.lib" /pdbtype:sept
+".\Debug\justtabs.obj"
+".\Debug\win.obj"
+".\Debug\resource.res"
+]
+Creating command line "link.exe @C:\DOCUME~1\sje\LOCALS~1\Temp\RSP2CE.tmp"
+<h3>Output Window</h3>
+Compiling...
+win.cpp
+C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\justtabs\win.cpp(11) : warning C4786: 'std::reverse_bidirectional_iterator<std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::iterator,std::pair<HWND__ * const,void *>,std::pair<HWND__ * const,void *> &,std::pair<HWND__ * const,void *> *,int>' : identifier was truncated to '255' characters in the debug information
+C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\justtabs\win.cpp(11) : warning C4786: 'std::reverse_bidirectional_iterator<std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::const_iterator,std::pair<HWND__ * const,void *>,std::pair<HWND__ * const,void *> const &,std::pair<HWND__ * const,void *> const *,int>' : identifier was truncated to '255' characters in the debug information
+C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\justtabs\win.cpp(11) : warning C4786: 'std::pair<std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::iterator,std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::iterator>' : identifier was truncated to '255' characters in the debug information
+C:\Documents and Settings\sje\My Documents\MyProjects\miranda\plugins\justtabs\win.cpp(11) : warning C4786: 'std::pair<std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::const_iterator,std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::const_iterator>' : identifier was truncated to '255' characters in the debug information
+c:\program files\microsoft visual studio\vc98\include\xtree(182) : warning C4786: 'std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::~_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >' : identifier was truncated to '255' characters in the debug information
+c:\program files\microsoft visual studio\vc98\include\xtree(162) : warning C4786: 'std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >' : identifier was truncated to '255' characters in the debug information
+c:\program files\microsoft visual studio\vc98\include\xtree(236) : warning C4786: '__ehhandler$?insert@?$_Tree@PAUHWND__@@U?$pair@QAUHWND__@@PAX@std@@U_Kfn@?$map@PAUHWND__@@PAXU?$less@PAUHWND__@@@std@@V?$allocator@PAX@3@@3@U?$less@PAUHWND__@@@3@V?$allocator@PAX@3@@std@@QAE?AU?$pair@Viterator@?$_Tree@PAUHWND__@@U?$pair@QAUHWND__@@PAX@std@@U_Kfn@?$map@PAUHWND__@@PAXU?$less@PAUHWND__@@@std@@V?$allocator@PAX@3@@3@U?$less@PAUHWND__@@@3@V?$allocator@PAX@3@@std@@_N@2@ABU?$pair@QAUHWND__@@PAX@2@@Z' : identifier was truncated to '255' characters in the debug information
+c:\program files\microsoft visual studio\vc98\include\xtree(236) : warning C4786: '__unwindfunclet$?insert@?$_Tree@PAUHWND__@@U?$pair@QAUHWND__@@PAX@std@@U_Kfn@?$map@PAUHWND__@@PAXU?$less@PAUHWND__@@@std@@V?$allocator@PAX@3@@3@U?$less@PAUHWND__@@@3@V?$allocator@PAX@3@@std@@QAE?AU?$pair@Viterator@?$_Tree@PAUHWND__@@U?$pair@QAUHWND__@@PAX@std@@U_Kfn@?$map@PAUHWND__@@PAXU?$less@PAUHWND__@@@std@@V?$allocator@PAX@3@@3@U?$less@PAUHWND__@@@3@V?$allocator@PAX@3@@std@@_N@2@ABU?$pair@QAUHWND__@@PAX@2@@Z$0' : identifier was truncated to '255' characters in the debug information
+c:\program files\microsoft visual studio\vc98\include\utility(21) : warning C4786: 'std::pair<std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::iterator,bool>::pair<std::_Tree<HWND__ *,std::pair<HWND__ * const,void *>,std::map<HWND__ *,void *,std::less<HWND__ *>,std::allocator<void *> >::_Kfn,std::less<HWND__ *>,std::allocator<void *> >::iterator,bool>' : identifier was truncated to '255' characters in the debug information
+Linking...
+
+
+
+<h3>Results</h3>
+justtabs.dll - 0 error(s), 9 warning(s)
+</pre>
+</body>
+</html>
diff --git a/justtabs/justtabs.sln b/justtabs/justtabs.sln
new file mode 100644
index 0000000..73d7f43
--- /dev/null
+++ b/justtabs/justtabs.sln
@@ -0,0 +1,20 @@
+
+Microsoft Visual Studio Solution File, Format Version 9.00
+# Visual Studio 2005
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "justtabs", "justtabs.vcproj", "{3B858A66-7A23-4EB1-9440-605B96717F06}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Win32 = Debug|Win32
+ Release|Win32 = Release|Win32
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {3B858A66-7A23-4EB1-9440-605B96717F06}.Debug|Win32.ActiveCfg = Debug|Win32
+ {3B858A66-7A23-4EB1-9440-605B96717F06}.Debug|Win32.Build.0 = Debug|Win32
+ {3B858A66-7A23-4EB1-9440-605B96717F06}.Release|Win32.ActiveCfg = Release|Win32
+ {3B858A66-7A23-4EB1-9440-605B96717F06}.Release|Win32.Build.0 = Release|Win32
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+EndGlobal
diff --git a/justtabs/justtabs.vcproj b/justtabs/justtabs.vcproj
new file mode 100644
index 0000000..081f2a3
--- /dev/null
+++ b/justtabs/justtabs.vcproj
@@ -0,0 +1,309 @@
+<?xml version="1.0" encoding="Windows-1252"?>
+<VisualStudioProject
+ ProjectType="Visual C++"
+ Version="8.00"
+ Name="justtabs"
+ ProjectGUID="{3B858A66-7A23-4EB1-9440-605B96717F06}"
+ RootNamespace="justtabs"
+ Keyword="MFCProj"
+ >
+ <Platforms>
+ <Platform
+ Name="Win32"
+ />
+ </Platforms>
+ <ToolFiles>
+ </ToolFiles>
+ <Configurations>
+ <Configuration
+ Name="Release|Win32"
+ OutputDirectory=".\Release"
+ IntermediateDirectory=".\Release"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="2"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="NDEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Release/justtabs.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="2"
+ InlineFunctionExpansion="1"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;JUSTTABS_EXPORTS"
+ StringPooling="true"
+ RuntimeLibrary="0"
+ EnableFunctionLevelLinking="true"
+ PrecompiledHeaderFile=".\Release/justtabs.pch"
+ AssemblerListingLocation=".\Release/"
+ ObjectFile=".\Release/"
+ ProgramDataBaseFileName=".\Release/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="NDEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="gdi32.lib user32.lib opengl32.lib glu32.lib comctl32.lib"
+ OutputFile="../../bin/release/plugins/justtabs.dll"
+ LinkIncremental="1"
+ SuppressStartupBanner="true"
+ ProgramDatabaseFile=".\Release/justtabs.pdb"
+ ImportLibrary=".\Release/justtabs.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Release/justtabs.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ <Configuration
+ Name="Debug|Win32"
+ OutputDirectory=".\Debug"
+ IntermediateDirectory=".\Debug"
+ ConfigurationType="2"
+ InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC60.vsprops"
+ UseOfMFC="2"
+ ATLMinimizesCRunTimeLibraryUsage="false"
+ CharacterSet="2"
+ >
+ <Tool
+ Name="VCPreBuildEventTool"
+ />
+ <Tool
+ Name="VCCustomBuildTool"
+ />
+ <Tool
+ Name="VCXMLDataGeneratorTool"
+ />
+ <Tool
+ Name="VCWebServiceProxyGeneratorTool"
+ />
+ <Tool
+ Name="VCMIDLTool"
+ PreprocessorDefinitions="_DEBUG"
+ MkTypLibCompatible="true"
+ SuppressStartupBanner="true"
+ TargetEnvironment="1"
+ TypeLibraryName=".\Debug/justtabs.tlb"
+ HeaderFileName=""
+ />
+ <Tool
+ Name="VCCLCompilerTool"
+ Optimization="0"
+ AdditionalIncludeDirectories="../../include"
+ PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;JUSTTABS_EXPORTS"
+ MinimalRebuild="true"
+ BasicRuntimeChecks="3"
+ RuntimeLibrary="1"
+ PrecompiledHeaderFile=".\Debug/justtabs.pch"
+ AssemblerListingLocation=".\Debug/"
+ ObjectFile=".\Debug/"
+ ProgramDataBaseFileName=".\Debug/"
+ WarningLevel="3"
+ SuppressStartupBanner="true"
+ DebugInformationFormat="4"
+ DisableSpecificWarnings="4996"
+ />
+ <Tool
+ Name="VCManagedResourceCompilerTool"
+ />
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions="_DEBUG"
+ Culture="2057"
+ />
+ <Tool
+ Name="VCPreLinkEventTool"
+ />
+ <Tool
+ Name="VCLinkerTool"
+ AdditionalDependencies="gdi32.lib user32.lib opengl32.lib glu32.lib comctl32.lib"
+ OutputFile="../../bin/debug/plugins/justtabs.dll"
+ LinkIncremental="2"
+ SuppressStartupBanner="true"
+ GenerateDebugInformation="true"
+ ProgramDatabaseFile=".\Debug/justtabs.pdb"
+ ImportLibrary=".\Debug/justtabs.lib"
+ TargetMachine="1"
+ />
+ <Tool
+ Name="VCALinkTool"
+ />
+ <Tool
+ Name="VCManifestTool"
+ />
+ <Tool
+ Name="VCXDCMakeTool"
+ />
+ <Tool
+ Name="VCBscMakeTool"
+ SuppressStartupBanner="true"
+ OutputFile=".\Debug/justtabs.bsc"
+ />
+ <Tool
+ Name="VCFxCopTool"
+ />
+ <Tool
+ Name="VCAppVerifierTool"
+ />
+ <Tool
+ Name="VCWebDeploymentTool"
+ />
+ <Tool
+ Name="VCPostBuildEventTool"
+ />
+ </Configuration>
+ </Configurations>
+ <References>
+ </References>
+ <Files>
+ <Filter
+ Name="Source Files"
+ Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
+ >
+ <File
+ RelativePath="justtabs.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ <File
+ RelativePath=".\options.cpp"
+ >
+ </File>
+ <File
+ RelativePath="win.cpp"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCCLCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ <Filter
+ Name="Header Files"
+ Filter="h;hpp;hxx;hm;inl"
+ >
+ <File
+ RelativePath=".\options.h"
+ >
+ </File>
+ <File
+ RelativePath="resource.h"
+ >
+ </File>
+ <File
+ RelativePath="win.h"
+ >
+ </File>
+ </Filter>
+ <Filter
+ Name="Resource Files"
+ Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
+ >
+ <File
+ RelativePath="resource.rc"
+ >
+ <FileConfiguration
+ Name="Release|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ <FileConfiguration
+ Name="Debug|Win32"
+ >
+ <Tool
+ Name="VCResourceCompilerTool"
+ PreprocessorDefinitions=""
+ />
+ </FileConfiguration>
+ </File>
+ </Filter>
+ </Files>
+ <Globals>
+ </Globals>
+</VisualStudioProject>
diff --git a/justtabs/main.h b/justtabs/main.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/justtabs/main.h
diff --git a/justtabs/options.cpp b/justtabs/options.cpp
new file mode 100644
index 0000000..d7cafc5
--- /dev/null
+++ b/justtabs/options.cpp
@@ -0,0 +1,72 @@
+#include "win.h"
+#include "options.h"
+
+Options options;
+
+void EnableTitleBar() {
+ if(!pluginwind) return;
+
+ bool visible = IsWindowVisible(pluginwind) ? true : false;
+
+ SetWindowLong(pluginwind, GWL_STYLE, (options.show_titlebar ? STYLE_TITLE : STYLE_NOTITLE) | (visible ? WS_VISIBLE : 0));
+ SetWindowPos(pluginwind, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE | SWP_FRAMECHANGED);
+}
+
+void ResetTabIcons() {
+ PostMessage(pluginwind, WM_RESETTABICONS, 0, 0);
+}
+
+static BOOL CALLBACK DlgProcOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) {
+
+ switch ( msg ) {
+ case WM_INITDIALOG: {
+ TranslateDialogDefault( hwndDlg );
+ CheckDlgButton(hwndDlg, IDC_CHK_TITLE, options.show_titlebar ? FALSE : TRUE);
+ CheckDlgButton(hwndDlg, IDC_CHK_TABICON, options.tab_icon ? TRUE : FALSE);
+ return TRUE;
+ }
+ case WM_COMMAND:
+ if(HIWORD(wParam) == BN_CLICKED) {
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ return TRUE;
+ case WM_NOTIFY:
+ if (((LPNMHDR)lParam)->code == (unsigned)PSN_APPLY ) {
+ options.show_titlebar = IsDlgButtonChecked(hwndDlg, IDC_CHK_TITLE) ? false : true;
+ DBWriteContactSettingByte(0, MODULE, "EnableTitle", options.show_titlebar ? 1 : 0);
+ EnableTitleBar();
+
+ options.tab_icon = IsDlgButtonChecked(hwndDlg, IDC_CHK_TABICON) ? true : false;
+ DBWriteContactSettingByte(0, MODULE, "TabIcon", options.tab_icon ? 1 : 0);
+ ResetTabIcons();
+ }
+ return TRUE;
+ }
+
+ return FALSE;
+}
+
+
+int OptInit(WPARAM wParam,LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp = { 0 };
+ odp.cbSize = sizeof(odp);
+ odp.position = -790000000;
+ odp.hInstance = hInst;
+ odp.pszTemplate = MAKEINTRESOURCE(IDD_OPT1);
+ odp.pszTitle = Translate("Messaging Tabs");
+ odp.pszGroup = Translate("Events");
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.nIDBottomSimpleControl = 0;
+ odp.pfnDlgProc = DlgProcOpts;
+ CallService( MS_OPT_ADDPAGE, wParam,( LPARAM )&odp );
+
+ return 0;
+}
+
+void InitOptions() {
+ options.show_titlebar = (DBGetContactSettingByte(0, MODULE, "EnableTitle", 1) == 1);
+ options.tab_icon = (DBGetContactSettingByte(0, MODULE, "TabIcon", 0) == 1);
+
+ HookEvent(ME_OPT_INITIALISE, OptInit);
+}
diff --git a/justtabs/options.h b/justtabs/options.h
new file mode 100644
index 0000000..e073cff
--- /dev/null
+++ b/justtabs/options.h
@@ -0,0 +1,15 @@
+#ifndef _OPTIONS_INC
+#define _OPTIONS_INC
+
+typedef struct {
+ bool show_titlebar;
+ bool tab_icon;
+} Options;
+
+extern Options options;
+
+void InitOptions();
+
+void EnableTitleBar();
+
+#endif
diff --git a/justtabs/resource.h b/justtabs/resource.h
new file mode 100644
index 0000000..9231138
--- /dev/null
+++ b/justtabs/resource.h
@@ -0,0 +1,22 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Visual C++ generated include file.
+// Used by resource.rc
+//
+#define IDD_DIALOG1 101
+#define IDD_OPT1 101
+#define IDD_CONTAINER 103
+#define IDC_CHK_TITLE 1007
+#define IDC_CHK_TABICON 1008
+#define IDC_TAB1 1008
+#define IDC_TABS 1008
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 104
+#define _APS_NEXT_COMMAND_VALUE 40001
+#define _APS_NEXT_CONTROL_VALUE 1009
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/justtabs/resource.rc b/justtabs/resource.rc
new file mode 100644
index 0000000..109fd2c
--- /dev/null
+++ b/justtabs/resource.rc
@@ -0,0 +1,117 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include "afxres.h"
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// Neutral resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_NEU)
+#ifdef _WIN32
+LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_OPT1 DIALOGEX 0, 0, 246, 179
+STYLE DS_SETFONT | WS_POPUP
+FONT 8, "MS Sans Serif", 0, 0, 0x0
+BEGIN
+ CONTROL "No titlebar",IDC_CHK_TITLE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,49,91,10
+ CONTROL "Show contact icon on tabs",IDC_CHK_TABICON,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,83,66,113,10
+END
+
+IDD_CONTAINER DIALOGEX 0, 0, 360, 249
+STYLE DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
+EXSTYLE WS_EX_ACCEPTFILES
+CAPTION "Message Session"
+FONT 8, "MS Shell Dlg", 400, 0, 0x1
+BEGIN
+ CONTROL "",IDC_TABS,"SysTabControl32",TCS_MULTILINE | TCS_FOCUSNEVER,0,0,360,249
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_OPT1, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 239
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 172
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+#endif // Neutral resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+/////////////////////////////////////////////////////////////////////////////
+// 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
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include ""afxres.h""\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+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/justtabs/win.cpp b/justtabs/win.cpp
new file mode 100644
index 0000000..75cb408
--- /dev/null
+++ b/justtabs/win.cpp
@@ -0,0 +1,683 @@
+#include "win.h"
+#include "options.h"
+
+HWND pluginwind = 0;
+bool first_show = true;
+
+HWND tab_ctrl;
+HIMAGELIST clist_imagelist;
+HWND active_window;
+int message_icon_index = 0;
+
+#ifdef _WIN32
+#define STATUSCLASSNAMEW L"msctls_statusbar32"
+#define STATUSCLASSNAMEA "msctls_statusbar32"
+
+#ifdef UNICODE
+#define STATUSCLASSNAME STATUSCLASSNAMEW
+#else
+#define STATUSCLASSNAME STATUSCLASSNAMEA
+#endif
+
+#else
+#define STATUSCLASSNAME "msctls_statusbar"
+#endif
+
+#define EM_SUBCLASSED (WM_USER+0x101)
+#define EM_UNSUBCLASSED (WM_USER+0x102)
+
+#define WMU_SETTAB (WM_USER+0x300)
+
+HANDLE window_list = 0;
+
+typedef struct TabCtrlDataStruct
+{
+ int lastClickTime;
+ WPARAM clickWParam;
+ LPARAM clickLParam;
+ POINT mouseLBDownPos;
+ int lastClickTab;
+ HIMAGELIST hDragImageList;
+ int bDragging;
+ int bDragged;
+ int destTab;
+ int srcTab;
+} TabCtrlData;
+
+typedef struct {
+ POINT p;
+ bool moving;
+} WindowData;
+
+typedef struct {
+ HWND hwndMsg;
+ HANDLE hContact;
+} TabData;
+
+int GetTabFromHWND(HWND tabs, HWND child)
+{
+ TCITEM tci;
+ int l, i;
+ l = TabCtrl_GetItemCount(tabs);
+ for (i = 0; i < l; i++) {
+ tci.mask = TCIF_PARAM;
+ TabCtrl_GetItem(tabs, i, &tci);
+ if (((TabData *) tci.lParam)->hwndMsg == child) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+int GetTabFromContact(HWND tabs, HANDLE hContact)
+{
+ TCITEM tci;
+ int l, i;
+ l = TabCtrl_GetItemCount(tabs);
+ for (i = 0; i < l; i++) {
+ tci.mask = TCIF_PARAM;
+ TabCtrl_GetItem(tabs, i, &tci);
+ if (((TabData *) tci.lParam)->hContact == hContact) {
+ return i;
+ }
+ }
+ return -1;
+}
+
+
+static WNDPROC OldTabCtrlProc;
+BOOL CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+
+void SubclassTabCtrl(HWND hwnd) {
+ OldTabCtrlProc = (WNDPROC) SetWindowLong(hwnd, GWL_WNDPROC, (LONG) TabCtrlProc);
+ SendMessage(hwnd, EM_SUBCLASSED, 0, 0);
+}
+
+void UnsubclassTabCtrl(HWND hwnd) {
+ SendMessage(hwnd, EM_UNSUBCLASSED, 0, 0);
+ SetWindowLong(hwnd, GWL_WNDPROC, (LONG) OldTabCtrlProc);
+}
+
+//LRESULT CALLBACK FrameProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+BOOL CALLBACK FrameProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) {
+ switch(msg) {
+
+ //case WM_CREATE:
+ case WM_INITDIALOG:
+ {
+ WindowData *data = new WindowData;
+ SetWindowLong(hwnd, GWL_USERDATA, (LONG)data);
+ data->moving = false;
+
+ RECT r;
+ GetClientRect(hwnd, &r);
+ //tab_imagelist = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), IsWinVerXPPlus()? ILC_COLOR32 | ILC_MASK : ILC_COLOR16 | ILC_MASK, 0, 1);
+ //ImageList_AddIcon(tab_imagelist, LoadSkinnedIcon(SKINICON_OTHER_MIRANDA));
+ //HICON hIconMsg = LoadSkinnedIcon(SKINICON_EVENT_MESSAGE);
+ //ImageList_AddIcon(tab_imagelist, hIconMsg);
+
+ //tab_ctrl = CreateWindow(WC_TABCONTROL, "", WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | TCS_MULTILINE | TCS_FOCUSNEVER, 0, 0, r.right, r.bottom, hwnd, NULL, NULL, NULL);
+ tab_ctrl = GetDlgItem(hwnd, IDC_TABS);
+ //TabCtrl_SetImageList(tab_ctrl, tab_imagelist);
+
+ TabCtrl_SetImageList(tab_ctrl, clist_imagelist);
+
+ LOGFONT lf;
+ SystemParametersInfo(SPI_GETICONTITLELOGFONT, sizeof(LOGFONT), &lf, FALSE);
+ lf.lfHeight = -12;
+ HFONT hFont = CreateFontIndirect(&lf);
+ SendMessage(tab_ctrl, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(TRUE, 0));
+
+ SubclassTabCtrl(tab_ctrl);
+ active_window = 0;
+ return FALSE;
+ }
+
+ case WM_SHOWWINDOW:
+ if((BOOL)wParam == TRUE && first_show) {
+ first_show = false;
+ Utils_RestoreWindowPosition(hwnd, 0, MODULE, "MainWin");
+ }
+ break;
+
+ case WM_SIZE:
+ {
+ RECT rc;
+
+ // Calculate the display rectangle, assuming the
+ // tab control is the size of the client area.
+ GetClientRect(hwnd, &rc);
+
+ // Size the tab control to fit the client area.
+ //SetWindowPos(tab_ctrl, NULL, 0, 5, rc.right + 3, rc.bottom + 3, SWP_NOMOVE | SWP_NOZORDER | SWP_NOACTIVATE);
+ rc.top += 2;
+ rc.right += 2;
+ rc.bottom += 2;
+
+ MoveWindow(tab_ctrl, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, FALSE);
+ RedrawWindow(tab_ctrl, 0, 0, RDW_INVALIDATE | RDW_FRAME | RDW_ERASE);
+
+ TabCtrl_AdjustRect(tab_ctrl, FALSE, &rc);
+ // Position and size the static control to fit the
+ // tab control's display area, and make sure the
+ // static control is in front of the tab control.
+ if(active_window)
+ SetWindowPos(active_window, HWND_TOP, rc.left - 3, rc.top - 1, rc.right - rc.left + 4, rc.bottom - rc.top + 2, 0);
+ }
+
+ break;
+
+ case WM_DESTROY:
+ //SendMessage(hwnd, WM_CLOSE, 0, 0);
+ {
+ TCITEM tci;
+ int l, i;
+ l = TabCtrl_GetItemCount(tab_ctrl);
+ for (i = 0; i < l; i++) {
+ tci.mask = TCIF_PARAM;
+ TabCtrl_GetItem(tab_ctrl, i, &tci);
+ delete (TabData *)tci.lParam;
+ }
+ UnsubclassTabCtrl(tab_ctrl);
+ WindowData *window_data = (WindowData *)GetWindowLong(hwnd, GWL_USERDATA);
+ delete window_data;
+
+ ImageList_Destroy(clist_imagelist);
+ }
+ break;
+
+ case WM_PREADDCHILD:
+ {
+ HWND child = (HWND)wParam;
+ LONG style = GetWindowLong(child, GWL_STYLE);
+ style &= ~(WS_THICKFRAME | WS_POPUP | WS_SYSMENU | WS_CAPTION);
+ style |= WS_CHILD;
+ SetWindowLong(child, GWL_STYLE, style);
+ SetParent(child, hwnd);
+ }
+ return TRUE;
+ case WM_ADDCHILD:
+ {
+ HWND child = (HWND)wParam;
+ HANDLE hContact = (HANDLE)lParam;
+
+ if(WindowList_Find(window_list, hContact) == 0) {
+ WindowList_Add(window_list, child, hContact);
+
+ TCHAR *contactName = (TCHAR *)CallService(MS_CLIST_GETCONTACTDISPLAYNAME,(WPARAM)hContact, (LPARAM)GCDNF_TCHAR);
+
+ TCITEM tie;
+ tie.mask = TCIF_TEXT | TCIF_IMAGE | TCIF_PARAM;
+ tie.iImage = options.tab_icon ? (int)CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0) : -1;
+ tie.pszText = contactName;
+ TabData *td = new TabData;
+ td->hContact = hContact;
+ td->hwndMsg = child;
+ tie.lParam = (LPARAM)td;
+
+ int count = TabCtrl_GetItemCount(tab_ctrl);
+ TabCtrl_InsertItem(tab_ctrl, count, &tie);
+ TabCtrl_SetCurSel(tab_ctrl, count);
+ SendMessage(hwnd, WMU_SETTAB, 0, 0);
+
+ ShowWindow(hwnd, SW_SHOW);
+ }
+ }
+ return TRUE;
+ case WM_REMCHILD:
+ {
+ HWND child = (HWND)wParam;
+ int l, i = GetTabFromHWND(tab_ctrl, child);
+
+ TCITEM tie;
+ tie.mask = TCIF_PARAM;
+ SendMessage(tab_ctrl, TCM_GETITEM, (WPARAM)i, (LPARAM)&tie);
+
+ TabCtrl_DeleteItem(tab_ctrl, i);
+ WindowList_Remove(window_list, child);
+
+ delete (TabData *)tie.lParam;
+
+ l = TabCtrl_GetItemCount(tab_ctrl);
+ if(l == 0)
+ SendMessage(hwnd, WM_CLOSE, 0, 0);
+ else {
+ if(i >= l) i = l - 1;
+ TabCtrl_SetCurSel(tab_ctrl, i);
+ SendMessage(hwnd, WMU_SETTAB, 0, 0);
+ }
+ }
+ return TRUE;
+ case WMU_SETTAB:
+ {
+ int iPage = TabCtrl_GetCurSel(tab_ctrl);
+ TCHAR tbuff[128];
+
+ TCITEM tie;
+ tie.pszText = tbuff;
+ tie.cchTextMax = sizeof(tbuff) / sizeof(TCHAR);
+ tie.mask = TCIF_PARAM | TCIF_TEXT | TCIF_IMAGE;
+ SendMessage(tab_ctrl, TCM_GETITEM, (WPARAM)iPage, (LPARAM)&tie);
+ SetWindowText(hwnd, tie.pszText);
+
+ HWND child = ((TabData *)tie.lParam)->hwndMsg;
+ HANDLE hContact = ((TabData *)tie.lParam)->hContact;
+ if(active_window == child) return TRUE;
+
+ // use GETCONTACTICON service instead of tie.iImage, because tie.iImage may be -1 depending on options
+ HANDLE hIcon = ImageList_GetIcon(clist_imagelist, (int)CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0), 0);
+ SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
+ SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
+
+ if(active_window) {
+ SetWindowPos(active_window, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);
+ ShowWindow(active_window, SW_HIDE);
+ }
+ active_window = child;
+
+ RECT rc;
+ GetClientRect(hwnd, &rc);
+ rc.top += 2;
+ rc.right += 2;
+ rc.bottom += 2;
+ TabCtrl_AdjustRect(tab_ctrl, FALSE, &rc);
+ SetWindowPos(active_window, HWND_TOP, rc.left - 3, rc.top - 1, rc.right - rc.left + 4, rc.bottom - rc.top + 2, SWP_SHOWWINDOW);
+
+ tie.mask = TCIF_IMAGE;
+ tie.iImage = options.tab_icon ? (int)CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0) : -1;
+ SendMessage(tab_ctrl, TCM_SETITEM, (WPARAM)iPage, (LPARAM)&tie);
+ SetFocus(active_window);
+ }
+ return TRUE;
+ case WM_NOTIFY:
+ {
+ NMHDR *nmhdr = (NMHDR *)lParam;
+ switch (nmhdr->code) {
+ case 0: // menu command processing
+ break;
+
+ case TCN_SELCHANGE:
+ SendMessage(hwnd, WMU_SETTAB, 0, 0);
+ break;
+ }
+ }
+ break;
+ case WM_CLOSE:
+ {
+ Utils_SaveWindowPosition(hwnd, 0, MODULE, "MainWin");
+ active_window = 0;
+ SetFocus(tab_ctrl); // crash if focus is in typing window when srmm closed (EN_KILLFOCUS command, null dat)
+ WindowList_Broadcast(window_list, WM_CLOSE, 0, 0);
+ ShowWindow(hwnd, SW_HIDE);
+ }
+ return TRUE;
+ case WM_HIGHLIGHTCONTACTWND:
+ {
+ HANDLE hContact = (HANDLE)wParam;
+ HWND child = WindowList_Find(window_list, hContact);
+ if(child) {
+ int t = GetTabFromHWND(tab_ctrl, child);
+ if(TabCtrl_GetCurSel(tab_ctrl) != t) {
+ //TabCtrl_HighlightItem(tab_ctrl, t, 1);
+ TCITEM tie;
+ tie.mask = TCIF_IMAGE;
+ tie.iImage = message_icon_index;
+ SendMessage(tab_ctrl, TCM_SETITEM, (WPARAM)t, (LPARAM)&tie);
+ }
+ }
+ }
+ return TRUE;
+ case WM_SHOWCONTACTWND:
+ {
+ HANDLE hContact = (HANDLE)wParam;
+ HWND child = WindowList_Find(window_list, hContact);
+ if(child) {
+ int t = GetTabFromHWND(tab_ctrl, child);
+ TabCtrl_SetCurSel(tab_ctrl, t);
+ SendMessage(hwnd, WMU_SETTAB, 0, 0);
+ ShowWindow(hwnd, SW_SHOWNORMAL);
+ }
+ }
+ return TRUE;
+ case WM_MOUSEMOVE:
+ if(wParam & MK_LBUTTON) {
+ SetCapture(hwnd);
+
+ POINT newp;
+ newp.x = (short)LOWORD(lParam);
+ newp.y = (short)HIWORD(lParam);
+
+ ClientToScreen(hwnd, &newp);
+
+ WindowData *window_data = (WindowData *)GetWindowLong(hwnd, GWL_USERDATA);
+ if(!window_data->moving) {
+ window_data->moving = true;
+ } else {
+ RECT r;
+ GetWindowRect(hwnd, &r);
+
+ SetWindowPos(hwnd, 0, r.left + (newp.x - window_data->p.x), r.top + (newp.y - window_data->p.y), 0, 0, SWP_NOSIZE | SWP_NOZORDER);
+ }
+ window_data->p.x = newp.x;
+ window_data->p.y = newp.y;
+ } else {
+ ReleaseCapture();
+ WindowData *window_data = (WindowData *)GetWindowLong(hwnd, GWL_USERDATA);
+ window_data->moving = false;
+ }
+ return TRUE;
+ case WM_RESETTABICONS:
+ {
+ HANDLE hContact = (HANDLE)wParam;
+ TCITEM tci;
+ if(hContact) {
+ // wParam contains clist image list icon index from contact icon changed event - but that could be e.g. flashing online notification
+ // so we get the contact icon in ici, which is just the proto icon
+ int t = GetTabFromContact(tab_ctrl, hContact), ici = (int)CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0);
+ if(t != -1) {
+ tci.mask = TCIF_IMAGE;
+ tci.iImage = options.tab_icon ? ici : -1;
+ SendMessage(tab_ctrl, TCM_SETITEM, (WPARAM)t, (LPARAM)&tci);
+
+ if(t == TabCtrl_GetCurSel(tab_ctrl)) {
+ // use GETCONTACTICON service instead of tie.iImage, because tie.iImage may be -1 depending on options
+ HANDLE hIcon = ImageList_GetIcon(clist_imagelist, ici, 0);
+ SendMessage(hwnd, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
+ SendMessage(hwnd, WM_SETICON, ICON_BIG, (LPARAM)hIcon);
+ }
+ }
+ } else {
+ int l, i;
+ HANDLE hContact;
+ l = TabCtrl_GetItemCount(tab_ctrl);
+ for (i = 0; i < l; i++) {
+ tci.mask = TCIF_PARAM;
+ TabCtrl_GetItem(tab_ctrl, i, &tci);
+ hContact = ((TabData *)tci.lParam)->hContact;
+
+ tci.mask = TCIF_IMAGE;
+ tci.iImage = options.tab_icon ? (int)CallService(MS_CLIST_GETCONTACTICON, (WPARAM)hContact, 0) : -1;
+ SendMessage(tab_ctrl, TCM_SETITEM, (WPARAM)i, (LPARAM)&tci);
+ }
+ }
+ }
+ return TRUE;
+ }
+
+ //return DefWindowProc(hwnd, msg, wParam, lParam);
+ return 0;
+}
+
+int CreateFrame(HWND parent, HINSTANCE hInst) {
+ InitCommonControls();
+
+ /*
+ WNDCLASS wndclass;
+ wndclass.style = 0; //CS_HREDRAW | CS_VREDRAW;
+ wndclass.lpfnWndProc = FrameProc;
+ wndclass.cbClsExtra = 0;
+ wndclass.cbWndExtra = 0;
+ wndclass.hInstance = hInst;
+ wndclass.hIcon = NULL;
+ wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
+ wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE+1);
+ wndclass.lpszMenuName = NULL;
+ wndclass.lpszClassName = _T("TabFrame");
+ RegisterClass(&wndclass);
+ */
+
+ window_list = (HANDLE)CallService(MS_UTILS_ALLOCWINDOWLIST, 0, 0);
+
+ //clist_imagelist = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ HIMAGELIST iml = (HIMAGELIST)CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ clist_imagelist = ImageList_Duplicate(iml);
+ message_icon_index = ImageList_ReplaceIcon(clist_imagelist, 0, LoadSkinnedIcon(SKINICON_EVENT_MESSAGE));
+
+ /*
+ pluginwind = CreateWindowEx(WS_EX_APPWINDOW, _T("TabFrame"),"",
+ 0,//options.show_titlebar ? STYLE_TITLE : STYLE_NOTITLE,
+ 0, 0, 800, 600, parent, NULL, hInst, NULL);
+ */
+ pluginwind = CreateDialogParam(hInst, MAKEINTRESOURCE(IDD_CONTAINER), 0, FrameProc, 0);
+
+ EnableTitleBar();
+
+ return 0;
+}
+
+BOOL CALLBACK TabCtrlProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ TabCtrlData *dat;
+ dat = (TabCtrlData *) GetWindowLong(hwnd, GWL_USERDATA);
+ switch(msg) {
+ case EM_SUBCLASSED:
+ dat = (TabCtrlData *) mir_alloc(sizeof(TabCtrlData));
+ SetWindowLong(hwnd, GWL_USERDATA, (LONG) dat);
+ dat->bDragging = FALSE;
+ return 0;
+ case WM_MBUTTONDOWN:
+ {
+ TCITEM tci;
+ int tabId;
+ TabData *mwtd;
+ TCHITTESTINFO thinfo;
+ thinfo.pt.x = (lParam<<16)>>16;
+ thinfo.pt.y = lParam>>16;
+ tabId = TabCtrl_HitTest(hwnd, &thinfo);
+ if (tabId >= 0) {
+ tci.mask = TCIF_PARAM;
+ TabCtrl_GetItem(hwnd, tabId, &tci);
+ mwtd = (TabData *) tci.lParam;
+ if (mwtd) SendMessage(mwtd->hwndMsg, WM_CLOSE, 0, 0);
+ }
+ return 0;
+ }
+ case WM_LBUTTONDBLCLK:
+ {
+ TCITEM tci;
+ TCHITTESTINFO thinfo;
+ int tabId;
+ TabData *mwtd;
+ thinfo.pt.x = (lParam<<16)>>16;
+ thinfo.pt.y = lParam>>16;
+ tabId = TabCtrl_HitTest(hwnd, &thinfo);
+ if (tabId >=0 ) {
+ tci.mask = TCIF_PARAM;
+ TabCtrl_GetItem(hwnd, tabId, &tci);
+ mwtd = (TabData *) tci.lParam;
+ if (mwtd) SendMessage(mwtd->hwndMsg, WM_CLOSE, 0, 0);
+ }
+ dat->lastClickTab = -1;//Child = NULL;
+ }
+ break;
+ case WM_LBUTTONDOWN:
+ {
+ if (!dat->bDragging) {
+ FILETIME ft;
+ TCHITTESTINFO thinfo;
+ GetSystemTimeAsFileTime(&ft);
+ thinfo.pt.x = (lParam<<16)>>16;
+ thinfo.pt.y = lParam>>16;
+ dat->srcTab = dat->destTab = TabCtrl_HitTest(hwnd, &thinfo);
+ if (dat->srcTab >=0 ) {
+ dat->lastClickTab = dat->srcTab; //Child = GetChildFromTab(hwnd, dat->srcTab)->hwnd;
+ } else {
+ dat->lastClickTab = -1;//Child = NULL;
+ }
+ dat->bDragging = TRUE;
+ dat->bDragged = FALSE;
+ dat->clickLParam = lParam;
+ dat->clickWParam = wParam;
+ dat->lastClickTime = ft.dwLowDateTime;
+ dat->mouseLBDownPos.x = thinfo.pt.x;
+ dat->mouseLBDownPos.y = thinfo.pt.y;
+ SetCapture(hwnd);
+ return 0;
+ }
+ }
+ break;
+ case WM_CAPTURECHANGED:
+ case WM_LBUTTONUP:
+ if (dat->bDragging) {
+ TCHITTESTINFO thinfo;
+ thinfo.pt.x = (lParam<<16)>>16;
+ thinfo.pt.y = lParam>>16;
+ if (dat->bDragged) {
+ ImageList_DragLeave(GetDesktopWindow());
+ ImageList_EndDrag();
+ ImageList_Destroy(dat->hDragImageList);
+ SetCursor(LoadCursor(NULL, IDC_ARROW));
+ dat->destTab = TabCtrl_HitTest(hwnd, &thinfo);
+ if (thinfo.flags != TCHT_NOWHERE && dat->destTab != dat->srcTab) {
+ NMHDR nmh;
+ TCHAR sBuffer[501];
+ TCITEM item;
+ int curSel;
+ curSel = TabCtrl_GetCurSel(hwnd);
+ item.mask = TCIF_IMAGE | TCIF_PARAM | TCIF_TEXT;
+ item.pszText = sBuffer;
+ item.cchTextMax = sizeof(sBuffer)/sizeof(TCHAR);
+ TabCtrl_GetItem(hwnd, dat->srcTab, &item);
+ sBuffer[sizeof(sBuffer)/sizeof(TCHAR)-1] = '\0';
+ if (curSel == dat->srcTab) {
+ curSel = dat->destTab;
+ } else {
+ if (curSel > dat->srcTab && curSel <= dat->destTab) {
+ curSel--;
+ } else if (curSel < dat->srcTab && curSel >= dat->destTab) {
+ curSel++;
+ }
+ }
+ TabCtrl_DeleteItem(hwnd, dat->srcTab);
+ TabCtrl_InsertItem(hwnd, dat->destTab, &item );
+ TabCtrl_SetCurSel(hwnd, curSel);
+ nmh.hwndFrom = hwnd;
+ nmh.idFrom = GetDlgCtrlID(hwnd);
+ nmh.code = TCN_SELCHANGE;
+ SendMessage(GetParent(hwnd), WM_NOTIFY, nmh.idFrom, (LPARAM)&nmh);
+ UpdateWindow(hwnd);
+ } else if (GetKeyState(VK_CONTROL) & 0x8000) {
+ /*
+ MessageWindowTabData *mwtd;
+ TCITEM tci;
+ POINT pt;
+ NewMessageWindowLParam newData = { 0 };
+ tci.mask = TCIF_PARAM;
+ TabCtrl_GetItem(hwnd, dat->srcTab, &tci);
+ mwtd = (MessageWindowTabData *) tci.lParam;
+ if (mwtd != NULL) {
+ HWND hChild = mwtd->hwnd;
+ HANDLE hContact = mwtd->hContact;
+ HWND hParent;
+ GetCursorPos(&pt);
+ hParent = WindowFromPoint(pt);
+ while (GetParent(hParent) != NULL) {
+ hParent = GetParent(hParent);
+ }
+ hParent = WindowList_Find(g_dat->hParentWindowList, hParent);
+ if ((hParent != NULL && hParent != GetParent(hwnd)) || (hParent == NULL && mwtd->parent->childrenCount > 1)) {
+ if (hParent == NULL) {
+ MONITORINFO mi;
+ HMONITOR hMonitor;
+ RECT rc, rcDesktop;
+ newData.hContact = hContact;
+ hParent = (HWND)CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_MSGWIN), NULL, DlgProcParentWindow, (LPARAM) & newData);
+ GetWindowRect(hParent, &rc);
+ rc.right = (rc.right - rc.left);
+ rc.bottom = (rc.bottom - rc.top);
+ rc.left = pt.x - rc.right / 2;
+ rc.top = pt.y - rc.bottom / 2;
+ hMonitor = MonitorFromRect(&rc, MONITOR_DEFAULTTONEAREST);
+ mi.cbSize = sizeof(mi);
+ GetMonitorInfo(hMonitor, &mi);
+ rcDesktop = mi.rcWork;
+ if (rc.left < rcDesktop.left) {
+ rc.left = rcDesktop.left;
+ }
+ if (rc.top < rcDesktop.top) {
+ rc.top = rcDesktop.top;
+ }
+ MoveWindow(hParent, rc.left, rc.top, rc.right, rc.bottom, FALSE);
+
+ }
+ SetParent(hChild, hParent);
+ SendMessage(GetParent(hwnd), CM_REMOVECHILD, 0, (LPARAM) hChild);
+ SendMessage(hChild, DM_SETPARENT, 0, (LPARAM) hParent);
+ SendMessage(hParent, CM_ADDCHILD, (WPARAM)hChild, (LPARAM) hContact);
+ SendMessage(hParent, CM_ACTIVATECHILD, 0, (LPARAM) hChild);
+ NotifyLocalWinEvent(hContact, hChild, MSG_WINDOW_EVT_CLOSING);
+ NotifyLocalWinEvent(hContact, hChild, MSG_WINDOW_EVT_CLOSE);
+ NotifyLocalWinEvent(hContact, hChild, MSG_WINDOW_EVT_OPENING);
+ NotifyLocalWinEvent(hContact, hChild, MSG_WINDOW_EVT_OPEN);
+ ShowWindow(hParent, SW_SHOWNA);
+ }
+ }
+ */
+ }
+ } else {
+ SendMessage(hwnd, WM_LBUTTONDOWN, dat->clickWParam, dat->clickLParam);
+ }
+ dat->bDragged = FALSE;
+ dat->bDragging = FALSE;
+ ReleaseCapture();
+ }
+ break;
+ case WM_MOUSEMOVE:
+ if (!(wParam & MK_LBUTTON)) break;
+ if (dat->bDragging) {
+ FILETIME ft;
+ TCHITTESTINFO thinfo;
+ GetSystemTimeAsFileTime(&ft);
+ thinfo.pt.x = (lParam<<16)>>16;
+ thinfo.pt.y = lParam>>16;
+ if (!dat->bDragged) {
+ if ((abs(thinfo.pt.x-dat->mouseLBDownPos.x)<3 && abs(thinfo.pt.y-dat->mouseLBDownPos.y)<3)
+ || (ft.dwLowDateTime - dat->lastClickTime) < 10*1000*150)
+ break;
+ }
+ if (!dat->bDragged) {
+ POINT pt;
+ RECT rect;
+ RECT rect2;
+ HDC hDC, hMemDC;
+ HBITMAP hBitmap, hOldBitmap;
+ HBRUSH hBrush = CreateSolidBrush(RGB(255,0,254));
+ GetCursorPos(&pt);
+ TabCtrl_GetItemRect(hwnd, dat->srcTab, &rect);
+ rect.right -= rect.left-1;
+ rect.bottom -= rect.top-1;
+ rect2.left = 0; rect2.right = rect.right; rect2.top = 0; rect2.bottom = rect.bottom;
+ dat->hDragImageList = ImageList_Create(rect.right, rect.bottom, ILC_COLOR | ILC_MASK, 0, 1);
+ hDC = GetDC(hwnd);
+ hMemDC = CreateCompatibleDC(hDC);
+ hBitmap = CreateCompatibleBitmap(hDC, rect.right, rect.bottom);
+ hOldBitmap = (HBITMAP)SelectObject(hMemDC, hBitmap);
+ FillRect(hMemDC, &rect2, hBrush);
+ SetWindowOrgEx (hMemDC, rect.left, rect.top, NULL);
+ SendMessage(hwnd, WM_PRINTCLIENT, (WPARAM)hMemDC, PRF_CLIENT);
+ SelectObject(hMemDC, hOldBitmap);
+ ImageList_AddMasked(dat->hDragImageList, hBitmap, RGB(255,0,254));
+ DeleteObject(hBitmap);
+ DeleteObject(hBrush);
+ ReleaseDC(hwnd, hDC);
+ DeleteDC(hMemDC);
+ ImageList_BeginDrag(dat->hDragImageList, 0, dat->mouseLBDownPos.x - rect.left, dat->mouseLBDownPos.y - rect.top);
+ ImageList_DragEnter(GetDesktopWindow(), pt.x, pt.y);
+ SetCursor(LoadCursor(0, IDC_HAND));
+ dat->mouseLBDownPos.x = thinfo.pt.x;
+ dat->mouseLBDownPos.y = thinfo.pt.y;
+ } else {
+ POINT pt;
+ GetCursorPos(&pt);
+ ImageList_DragMove(pt.x, pt.y);
+ }
+ dat->bDragged = TRUE;
+ return 0;
+ }
+ break;
+ case EM_UNSUBCLASSED:
+ mir_free(dat);
+ return 0;
+ }
+ return CallWindowProc(OldTabCtrlProc, hwnd, msg, wParam, lParam);
+}
diff --git a/justtabs/win.h b/justtabs/win.h
new file mode 100644
index 0000000..3a4f813
--- /dev/null
+++ b/justtabs/win.h
@@ -0,0 +1,45 @@
+#ifndef _JT_WIN_H
+#define _JT_WIN_H
+
+#define _WIN32_IE 0x400
+
+#include <windows.h>
+#include <commctrl.h>
+
+#include "resource.h"
+#include <stdio.h>
+
+#include <newpluginapi.h>
+#include <m_system.h>
+#include <m_database.h>
+#include <m_options.h>
+#include <m_langpack.h>
+#include <m_popup.h>
+#include <m_skin.h>
+#include <m_clist.h>
+#include <m_clui.h>
+#include <m_message.h>
+#include <m_utils.h>
+#include <m_protocols.h>
+#include <m_updater.h>
+#include <win2k.h>
+
+#define MODULE "JustTabs"
+
+extern HWND pluginwind;
+extern HINSTANCE hInst;
+
+#define WM_PREADDCHILD (WM_USER + 0x1FF)
+#define WM_ADDCHILD (WM_USER + 0x200)
+#define WM_REMCHILD (WM_USER + 0x201)
+#define WM_SHOWCONTACTWND (WM_USER + 0x202)
+#define WM_HIGHLIGHTCONTACTWND (WM_USER + 0x203)
+#define WM_RESETTABICONS (WM_USER + 0x204)
+
+#define STYLE_TITLE ((DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME) & ~WS_VISIBLE)
+#define STYLE_NOTITLE ((DS_SETFONT | DS_3DLOOK | DS_FIXEDSYS | WS_THICKFRAME) & ~WS_VISIBLE)
+
+LRESULT CALLBACK FrameWindowProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
+int CreateFrame(HWND parent, HINSTANCE hInst);
+
+#endif