summaryrefslogtreecommitdiff
path: root/miranda-wine/plugins/clist
diff options
context:
space:
mode:
authorwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-04-21 14:14:52 +0000
committerwatcherhd <watcherhd@e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb>2011-04-21 14:14:52 +0000
commitcb4a46e7fbe62d788e66ed6121c717a2d22a4d7c (patch)
tree30df260fdc5a1b5a7049c2f8cac8b7ef17513d6d /miranda-wine/plugins/clist
parent19b6f534d2e784a1e120bf52c4aa07004798f473 (diff)
svn.miranda.im is moving to a new home!
git-svn-id: http://miranda-plugins.googlecode.com/svn/trunk@7 e753b5eb-9565-29b2-b5c5-2cc6f99dfbcb
Diffstat (limited to 'miranda-wine/plugins/clist')
-rw-r--r--miranda-wine/plugins/clist/clc.h83
-rw-r--r--miranda-wine/plugins/clist/clcopts.c923
-rw-r--r--miranda-wine/plugins/clist/clcpaint.c590
-rw-r--r--miranda-wine/plugins/clist/clist.h30
-rw-r--r--miranda-wine/plugins/clist/clistmenus.c947
-rw-r--r--miranda-wine/plugins/clist/clistopts.c353
-rw-r--r--miranda-wine/plugins/clist/cluiopts.c346
-rw-r--r--miranda-wine/plugins/clist/commonheaders.c1
-rw-r--r--miranda-wine/plugins/clist/commonheaders.h96
-rw-r--r--miranda-wine/plugins/clist/forkthread.c94
-rw-r--r--miranda-wine/plugins/clist/forkthread.h63
-rw-r--r--miranda-wine/plugins/clist/init.c175
-rw-r--r--miranda-wine/plugins/clist/res/blank.icobin0 -> 318 bytes
-rw-r--r--miranda-wine/plugins/clist/res/delete.icobin0 -> 1406 bytes
-rw-r--r--miranda-wine/plugins/clist/res/dragcopy.curbin0 -> 326 bytes
-rw-r--r--miranda-wine/plugins/clist/res/dropuser.curbin0 -> 1086 bytes
-rw-r--r--miranda-wine/plugins/clist/res/hyperlin.curbin0 -> 326 bytes
-rw-r--r--miranda-wine/plugins/clist/res/rename.icobin0 -> 1406 bytes
-rw-r--r--miranda-wine/plugins/clist/resource.h554
-rw-r--r--miranda-wine/plugins/clist/resource.rc706
20 files changed, 4961 insertions, 0 deletions
diff --git a/miranda-wine/plugins/clist/clc.h b/miranda-wine/plugins/clist/clc.h
new file mode 100644
index 0000000..7b825dd
--- /dev/null
+++ b/miranda-wine/plugins/clist/clc.h
@@ -0,0 +1,83 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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.
+*/
+
+#define FONTID_LAST 7
+
+struct ClcContact {
+ BYTE type;
+ BYTE flags;
+ union {
+ struct {
+ WORD iImage;
+ HANDLE hContact;
+ };
+ struct {
+ WORD groupId;
+ struct ClcGroup *group;
+ };
+ };
+ BYTE iExtraImage[MAXEXTRACOLUMNS];
+ TCHAR szText[120-MAXEXTRACOLUMNS];
+ char * proto; // MS_PROTO_GETBASEPROTO
+};
+
+struct ClcData {
+ struct ClcGroup list;
+ int rowHeight;
+ int yScroll;
+ int selection;
+ struct ClcFontInfo fontInfo[FONTID_MAX+1];
+ int scrollTime;
+ HIMAGELIST himlHighlight;
+ int groupIndent;
+ TCHAR szQuickSearch[128];
+ int iconXSpace;
+ HWND hwndRenameEdit;
+ COLORREF bkColour,selBkColour,selTextColour,hotTextColour,quickSearchColour;
+ int iDragItem,iInsertionMark;
+ int dragStage;
+ POINT ptDragStart;
+ int dragAutoScrolling;
+ int dragAutoScrollHeight;
+ int leftMargin;
+ int insertionMarkHitHeight;
+ HBITMAP hBmpBackground;
+ int backgroundBmpUse,bkChanged;
+ int iHotTrack;
+ int gammaCorrection;
+ DWORD greyoutFlags; //see m_clc.h
+ DWORD offlineModes;
+ DWORD exStyle;
+ POINT ptInfoTip;
+ int infoTipTimeout;
+ HANDLE hInfoTipItem;
+ HIMAGELIST himlExtraColumns;
+ int extraColumnsCount;
+ int extraColumnSpacing;
+ int checkboxSize;
+ int showSelAlways;
+ int showIdle;
+ int noVScrollbar;
+ int useWindowsColours;
+ int needsResort;
+};
diff --git a/miranda-wine/plugins/clist/clcopts.c b/miranda-wine/plugins/clist/clcopts.c
new file mode 100644
index 0000000..81f4950
--- /dev/null
+++ b/miranda-wine/plugins/clist/clcopts.c
@@ -0,0 +1,923 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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 "commonheaders.h"
+
+#define DBFONTF_BOLD 1
+#define DBFONTF_ITALIC 2
+#define DBFONTF_UNDERLINE 4
+
+struct CheckBoxToStyleEx_t
+{
+ int id;
+ DWORD flag;
+ int not;
+}
+
+static const checkBoxToStyleEx[] = {
+ {IDC_DISABLEDRAGDROP, CLS_EX_DISABLEDRAGDROP, 0},
+ {IDC_NOTEDITLABELS, CLS_EX_EDITLABELS, 1},
+ {IDC_SHOWSELALWAYS, CLS_EX_SHOWSELALWAYS, 0},
+ {IDC_TRACKSELECT, CLS_EX_TRACKSELECT, 0},
+ {IDC_SHOWGROUPCOUNTS, CLS_EX_SHOWGROUPCOUNTS, 0},
+ {IDC_HIDECOUNTSWHENEMPTY, CLS_EX_HIDECOUNTSWHENEMPTY, 0},
+ {IDC_DIVIDERONOFF, CLS_EX_DIVIDERONOFF, 0},
+ {IDC_NOTNOTRANSLUCENTSEL, CLS_EX_NOTRANSLUCENTSEL, 1},
+ {IDC_LINEWITHGROUPS, CLS_EX_LINEWITHGROUPS, 0},
+ {IDC_QUICKSEARCHVISONLY, CLS_EX_QUICKSEARCHVISONLY, 0},
+ {IDC_SORTGROUPSALPHA, CLS_EX_SORTGROUPSALPHA, 0},
+ {IDC_NOTNOSMOOTHSCROLLING, CLS_EX_NOSMOOTHSCROLLING, 1}
+};
+
+struct CheckBoxValues_t
+{
+ DWORD style;
+ TCHAR* szDescr;
+};
+
+static const struct CheckBoxValues_t greyoutValues[] = {
+ { GREYF_UNFOCUS, _T("Not focused") },
+ { MODEF_OFFLINE, _T("Offline") },
+ { PF2_ONLINE, _T("Online") },
+ { PF2_SHORTAWAY, _T("Away") },
+ { PF2_LONGAWAY, _T("NA") },
+ { PF2_LIGHTDND, _T("Occupied") },
+ { PF2_HEAVYDND, _T("DND") },
+ { PF2_FREECHAT, _T("Free for chat") },
+ { PF2_INVISIBLE, _T("Invisible") },
+ { PF2_OUTTOLUNCH, _T("Out to lunch") },
+ { PF2_ONTHEPHONE, _T("On the phone") }
+};
+
+static const struct CheckBoxValues_t offlineValues[] = {
+ { MODEF_OFFLINE, _T("Offline") },
+ { PF2_ONLINE, _T("Online") },
+ { PF2_SHORTAWAY, _T("Away") },
+ { PF2_LONGAWAY, _T("NA") },
+ { PF2_LIGHTDND, _T("Occupied") },
+ { PF2_HEAVYDND, _T("DND") },
+ { PF2_FREECHAT, _T("Free for chat") },
+ { PF2_INVISIBLE, _T("Invisible") },
+ { PF2_OUTTOLUNCH, _T("Out to lunch") },
+ { PF2_ONTHEPHONE, _T("On the phone") }
+};
+
+static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *values, int nValues, DWORD style)
+{
+ TVINSERTSTRUCT tvis;
+ int i;
+
+ tvis.hParent = NULL;
+ tvis.hInsertAfter = TVI_LAST;
+ tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
+ for (i = 0; i < nValues; i++) {
+ tvis.item.lParam = values[i].style;
+ tvis.item.pszText = TranslateTS( values[i].szDescr );
+ tvis.item.stateMask = TVIS_STATEIMAGEMASK;
+ tvis.item.state = INDEXTOSTATEIMAGEMASK((style & tvis.item.lParam) != 0 ? 2 : 1);
+ TreeView_InsertItem( hwndTree, &tvis);
+} }
+
+static DWORD MakeCheckBoxTreeFlags(HWND hwndTree)
+{
+ DWORD flags = 0;
+ TVITEM tvi;
+
+ tvi.mask = TVIF_HANDLE | TVIF_PARAM | TVIF_STATE;
+ tvi.hItem = TreeView_GetRoot(hwndTree);
+ while (tvi.hItem) {
+ TreeView_GetItem(hwndTree, &tvi);
+ if (((tvi.state & TVIS_STATEIMAGEMASK) >> 12 == 2))
+ flags |= tvi.lParam;
+ tvi.hItem = TreeView_GetNextSibling(hwndTree, tvi.hItem);
+ }
+ return flags;
+}
+
+static BOOL CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLong(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE,
+ GetWindowLong(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
+ SetWindowLong(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE,
+ GetWindowLong(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), GWL_STYLE) | TVS_NOHSCROLL | TVS_CHECKBOXES);
+ {
+ int i;
+ DWORD exStyle = DBGetContactSettingDword(NULL, "CLC", "ExStyle", pcli->pfnGetDefaultExStyle());
+ for (i = 0; i < SIZEOF(checkBoxToStyleEx); i++)
+ CheckDlgButton(hwndDlg, checkBoxToStyleEx[i].id,
+ (exStyle & checkBoxToStyleEx[i].flag) ^ (checkBoxToStyleEx[i].flag *
+ checkBoxToStyleEx[i].not) ? BST_CHECKED : BST_UNCHECKED);
+ }
+ {
+ UDACCEL accel[2] = { {0, 10} , {2, 50} };
+ SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETRANGE, 0, MAKELONG(999, 0));
+ SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETACCEL, SIZEOF(accel), (LPARAM) & accel);
+ SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_SETPOS, 0,
+ MAKELONG(DBGetContactSettingWord(NULL, "CLC", "ScrollTime", CLCDEFAULT_SCROLLTIME), 0));
+ }
+ CheckDlgButton(hwndDlg, IDC_IDLE, DBGetContactSettingByte(NULL, "CLC", "ShowIdle", CLCDEFAULT_SHOWIDLE) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETRANGE, 0, MAKELONG(64, 0));
+ SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_SETPOS, 0,
+ MAKELONG(DBGetContactSettingByte(NULL, "CLC", "LeftMargin", CLCDEFAULT_LEFTMARGIN), 0));
+ SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETRANGE, 0, MAKELONG(50, 0));
+ SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_SETPOS, 0,
+ MAKELONG(DBGetContactSettingByte(NULL, "CLC", "GroupIndent", CLCDEFAULT_GROUPINDENT), 0));
+ CheckDlgButton(hwndDlg, IDC_GREYOUT,
+ DBGetContactSettingDword(NULL, "CLC", "GreyoutFlags", CLCDEFAULT_GREYOUTFLAGS) ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), greyoutValues, SIZEOF(greyoutValues),
+ DBGetContactSettingDword(NULL, "CLC", "FullGreyoutFlags", CLCDEFAULT_FULLGREYOUTFLAGS));
+ FillCheckBoxTree(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS), offlineValues, SIZEOF(offlineValues),
+ DBGetContactSettingDword(NULL, "CLC", "OfflineModes", CLCDEFAULT_OFFLINEMODES));
+ CheckDlgButton(hwndDlg, IDC_NOSCROLLBAR, DBGetContactSettingByte(NULL, "CLC", "NoVScrollBar", 0) ? BST_CHECKED : BST_UNCHECKED);
+ return TRUE;
+ case WM_VSCROLL:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_NOTNOSMOOTHSCROLLING)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SMOOTHTIME), IsDlgButtonChecked(hwndDlg, IDC_NOTNOSMOOTHSCROLLING));
+ if (LOWORD(wParam) == IDC_GREYOUT)
+ EnableWindow(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), IsDlgButtonChecked(hwndDlg, IDC_GREYOUT));
+ if ((LOWORD(wParam) == IDC_LEFTMARGIN || LOWORD(wParam) == IDC_SMOOTHTIME || LOWORD(wParam) == IDC_GROUPINDENT)
+ && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()))
+ return 0;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case IDC_GREYOUTOPTS:
+ case IDC_HIDEOFFLINEOPTS:
+ if (((LPNMHDR) lParam)->code == NM_CLICK) {
+ TVHITTESTINFO hti;
+ hti.pt.x = (short) LOWORD(GetMessagePos());
+ hti.pt.y = (short) HIWORD(GetMessagePos());
+ ScreenToClient(((LPNMHDR) lParam)->hwndFrom, &hti.pt);
+ if (TreeView_HitTest(((LPNMHDR) lParam)->hwndFrom, &hti))
+ if (hti.flags & TVHT_ONITEMSTATEICON) {
+ TVITEM tvi;
+ tvi.mask = TVIF_HANDLE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
+ tvi.hItem = hti.hItem;
+ TreeView_GetItem(((LPNMHDR) lParam)->hwndFrom, &tvi);
+ tvi.iImage = tvi.iSelectedImage = tvi.iImage == 1 ? 2 : 1;
+ TreeView_SetItem(((LPNMHDR) lParam)->hwndFrom, &tvi);
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ }
+ }
+ break;
+ case 0:
+ if (((LPNMHDR) lParam)->code == PSN_APPLY ) {
+ int i;
+ DWORD exStyle = 0;
+ for (i = 0; i < SIZEOF(checkBoxToStyleEx); i++)
+ if ((IsDlgButtonChecked(hwndDlg, checkBoxToStyleEx[i].id) == 0) == checkBoxToStyleEx[i].not)
+ exStyle |= checkBoxToStyleEx[i].flag;
+
+ DBWriteContactSettingDword(NULL, "CLC", "ExStyle", exStyle);
+ {
+ DWORD fullGreyoutFlags = MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS));
+ DBWriteContactSettingDword(NULL, "CLC", "FullGreyoutFlags", fullGreyoutFlags);
+ if (IsDlgButtonChecked(hwndDlg, IDC_GREYOUT))
+ DBWriteContactSettingDword(NULL, "CLC", "GreyoutFlags", fullGreyoutFlags);
+ else
+ DBWriteContactSettingDword(NULL, "CLC", "GreyoutFlags", 0);
+ }
+ DBWriteContactSettingByte(NULL, "CLC", "ShowIdle", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_IDLE) ? 1 : 0));
+ DBWriteContactSettingDword(NULL, "CLC", "OfflineModes", MakeCheckBoxTreeFlags(GetDlgItem(hwndDlg, IDC_HIDEOFFLINEOPTS)));
+ DBWriteContactSettingByte(NULL, "CLC", "LeftMargin",
+ (BYTE) SendDlgItemMessage(hwndDlg, IDC_LEFTMARGINSPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingWord(NULL, "CLC", "ScrollTime",
+ (WORD) SendDlgItemMessage(hwndDlg, IDC_SMOOTHTIMESPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingByte(NULL, "CLC", "GroupIndent",
+ (BYTE) SendDlgItemMessage(hwndDlg, IDC_GROUPINDENTSPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingByte(NULL, "CLC", "NoVScrollBar", (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_NOSCROLLBAR) ? 1 : 0));
+ pcli->pfnClcOptionsChanged();
+ return TRUE;
+ }
+ break;
+ }
+ break;
+ case WM_DESTROY:
+ ImageList_Destroy(TreeView_GetImageList(GetDlgItem(hwndDlg, IDC_GREYOUTOPTS), TVSIL_NORMAL));
+ break;
+ }
+ return FALSE;
+}
+
+static BOOL CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_BITMAP,
+ DBGetContactSettingByte(NULL, "CLC", "UseBitmap", CLCDEFAULT_USEBITMAP) ? BST_CHECKED : BST_UNCHECKED);
+ SendMessage(hwndDlg, WM_USER + 10, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_BKCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELBKCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0,
+ DBGetContactSettingDword(NULL, "CLC", "SelBkColour", CLCDEFAULT_SELBKCOLOUR));
+ CheckDlgButton(hwndDlg, IDC_WINCOLOUR, DBGetContactSettingByte(NULL, "CLC", "UseWinColours", 0));
+ SendMessage(hwndDlg, WM_USER + 11, 0, 0);
+ {
+ DBVARIANT dbv;
+ if (!DBGetContactSetting(NULL, "CLC", "BkBitmap", &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_FILENAME, dbv.pszVal);
+ if (ServiceExists(MS_UTILS_PATHTOABSOLUTE)) {
+ char szPath[MAX_PATH];
+
+ if (CallService(MS_UTILS_PATHTOABSOLUTE, (WPARAM) dbv.pszVal, (LPARAM) szPath))
+ SetDlgItemTextA(hwndDlg, IDC_FILENAME, szPath);
+ }
+ else
+ mir_free(dbv.pszVal);
+ }
+ }
+ {
+ WORD bmpUse = DBGetContactSettingWord(NULL, "CLC", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
+ CheckDlgButton(hwndDlg, IDC_STRETCHH, bmpUse & CLB_STRETCHH ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_STRETCHV, bmpUse & CLB_STRETCHV ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TILEH, bmpUse & CLBF_TILEH ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TILEV, bmpUse & CLBF_TILEV ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SCROLL, bmpUse & CLBF_SCROLL ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_PROPORTIONAL, bmpUse & CLBF_PROPORTIONAL ? BST_CHECKED : BST_UNCHECKED);
+ }
+ {
+ HRESULT(STDAPICALLTYPE * MySHAutoComplete) (HWND, DWORD);
+ MySHAutoComplete = (HRESULT(STDAPICALLTYPE *) (HWND, DWORD)) GetProcAddress(GetModuleHandleA("shlwapi"), "SHAutoComplete");
+ if (MySHAutoComplete)
+ MySHAutoComplete(GetDlgItem(hwndDlg, IDC_FILENAME), 1);
+ }
+ return TRUE;
+ case WM_USER + 10:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FILENAME), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BROWSE), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STRETCHH), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STRETCHV), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TILEH), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TILEV), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCROLL), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PROPORTIONAL), IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ break;
+ case WM_USER + 11:
+ {
+ BOOL b = IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BKGCOLOUR), !b);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SELCOLOUR), !b);
+ break;
+ }
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_BROWSE) {
+ char str[MAX_PATH];
+ OPENFILENAMEA ofn = { 0 };
+ char filter[512];
+
+ GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
+ ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
+ ofn.hwndOwner = hwndDlg;
+ ofn.hInstance = NULL;
+ CallService(MS_UTILS_GETBITMAPFILTERSTRINGS, SIZEOF(filter), (LPARAM) filter);
+ ofn.lpstrFilter = filter;
+ ofn.lpstrFile = str;
+ ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
+ ofn.nMaxFile = SIZEOF(str);
+ ofn.nMaxFileTitle = MAX_PATH;
+ ofn.lpstrDefExt = "bmp";
+ if (!GetOpenFileNameA(&ofn))
+ break;
+ SetDlgItemTextA(hwndDlg, IDC_FILENAME, str);
+ }
+ else if (LOWORD(wParam) == IDC_FILENAME && HIWORD(wParam) != EN_CHANGE)
+ break;
+ if (LOWORD(wParam) == IDC_BITMAP)
+ SendMessage(hwndDlg, WM_USER + 10, 0, 0);
+ if (LOWORD(wParam) == IDC_WINCOLOUR)
+ SendMessage(hwndDlg, WM_USER + 11, 0, 0);
+ if (LOWORD(wParam) == IDC_FILENAME && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()))
+ return 0;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY:
+ DBWriteContactSettingByte(NULL, "CLC", "UseBitmap", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BITMAP));
+ {
+ COLORREF col;
+ col = SendDlgItemMessage(hwndDlg, IDC_BKGCOLOUR, CPM_GETCOLOUR, 0, 0);
+ if (col == CLCDEFAULT_BKCOLOUR)
+ DBDeleteContactSetting(NULL, "CLC", "BkColour");
+ else
+ DBWriteContactSettingDword(NULL, "CLC", "BkColour", col);
+ col = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0);
+ if (col == CLCDEFAULT_SELBKCOLOUR)
+ DBDeleteContactSetting(NULL, "CLC", "SelBkColour");
+ else
+ DBWriteContactSettingDword(NULL, "CLC", "SelBkColour", col);
+ DBWriteContactSettingByte(NULL, "CLC", "UseWinColours", (BYTE)(IsDlgButtonChecked(hwndDlg, IDC_WINCOLOUR)));
+ }
+ {
+ char str[MAX_PATH], strrel[MAX_PATH];
+ GetDlgItemTextA(hwndDlg, IDC_FILENAME, str, SIZEOF(str));
+ if (ServiceExists(MS_UTILS_PATHTORELATIVE)) {
+ if (CallService(MS_UTILS_PATHTORELATIVE, (WPARAM) str, (LPARAM) strrel))
+ DBWriteContactSettingString(NULL, "CLC", "BkBitmap", strrel);
+ else
+ DBWriteContactSettingString(NULL, "CLC", "BkBitmap", str);
+ }
+ else
+ DBWriteContactSettingString(NULL, "CLC", "BkBitmap", str);
+ }
+ {
+ WORD flags = 0;
+ if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHH))
+ flags |= CLB_STRETCHH;
+ if (IsDlgButtonChecked(hwndDlg, IDC_STRETCHV))
+ flags |= CLB_STRETCHV;
+ if (IsDlgButtonChecked(hwndDlg, IDC_TILEH))
+ flags |= CLBF_TILEH;
+ if (IsDlgButtonChecked(hwndDlg, IDC_TILEV))
+ flags |= CLBF_TILEV;
+ if (IsDlgButtonChecked(hwndDlg, IDC_SCROLL))
+ flags |= CLBF_SCROLL;
+ if (IsDlgButtonChecked(hwndDlg, IDC_PROPORTIONAL))
+ flags |= CLBF_PROPORTIONAL;
+ DBWriteContactSettingWord(NULL, "CLC", "BkBmpUse", flags);
+ }
+ pcli->pfnClcOptionsChanged();
+ return TRUE;
+ }
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static const TCHAR* szFontIdDescr[FONTID_LAST + 1] =
+{
+ _T("Standard contacts"),
+ _T("Online contacts to whom you have a different visibility"),
+ _T("Offline contacts"),
+ _T("Contacts which are 'not on list'"),
+ _T("Groups"),
+ _T("Group member counts"),
+ _T("Dividers"),
+ _T("Offline contacts to whom you have a different visibility")
+};
+
+#define SAMEASF_FACE 1
+#define SAMEASF_SIZE 2
+#define SAMEASF_STYLE 4
+#define SAMEASF_COLOUR 8
+#include <pshpack1.h>
+struct
+{
+ BYTE sameAsFlags, sameAs;
+ COLORREF colour;
+ char size;
+ BYTE style;
+ BYTE charset;
+ TCHAR szFace[LF_FACESIZE];
+}
+static fontSettings[FONTID_LAST + 1];
+#include <poppack.h>
+static WORD fontSameAsDefault[FONTID_LAST + 1] = { 0x00FF, 0x0B00, 0x0F00, 0x0700, 0x0B00, 0x0104, 0x0D00, 0x0B02 };
+static char *fontSizes[] = { "7", "8", "10", "14", "16", "18", "20", "24", "28" };
+static int fontListOrder[FONTID_LAST + 1] =
+{ FONTID_CONTACTS, FONTID_INVIS, FONTID_OFFLINE, FONTID_OFFINVIS, FONTID_NOTONLIST, FONTID_GROUPS, FONTID_GROUPCOUNTS, FONTID_DIVIDERS };
+
+#define M_REBUILDFONTGROUP (WM_USER+10)
+#define M_REMAKESAMPLE (WM_USER+11)
+#define M_RECALCONEFONT (WM_USER+12)
+#define M_RECALCOTHERFONTS (WM_USER+13)
+#define M_SAVEFONT (WM_USER+14)
+#define M_REFRESHSAMEASBOXES (WM_USER+15)
+#define M_FILLSCRIPTCOMBO (WM_USER+16)
+#define M_REDOROWHEIGHT (WM_USER+17)
+#define M_LOADFONT (WM_USER+18)
+#define M_GUESSSAMEASBOXES (WM_USER+19)
+#define M_SETSAMEASBOXES (WM_USER+20)
+
+static int CALLBACK EnumFontsProc(ENUMLOGFONTEX * lpelfe, NEWTEXTMETRICEX * lpntme, int FontType, LPARAM lParam)
+{
+ if (!IsWindow((HWND) lParam))
+ return FALSE;
+ if (SendMessage((HWND) lParam, CB_FINDSTRINGEXACT, -1, (LPARAM) lpelfe->elfLogFont.lfFaceName) == CB_ERR)
+ SendMessage((HWND) lParam, CB_ADDSTRING, 0, (LPARAM) lpelfe->elfLogFont.lfFaceName);
+ return TRUE;
+}
+
+void FillFontListThread(HWND hwndDlg)
+{
+ LOGFONT lf = { 0 };
+ HDC hdc = GetDC(hwndDlg);
+ lf.lfCharSet = DEFAULT_CHARSET;
+ lf.lfFaceName[0] = 0;
+ lf.lfPitchAndFamily = 0;
+ EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC) EnumFontsProc, (LPARAM) GetDlgItem(hwndDlg, IDC_TYPEFACE), 0);
+ ReleaseDC(hwndDlg, hdc);
+ return;
+}
+
+static int CALLBACK EnumFontScriptsProc(ENUMLOGFONTEX * lpelfe, NEWTEXTMETRICEX * lpntme, int FontType, LPARAM lParam)
+{
+ if (SendMessage((HWND) lParam, CB_FINDSTRINGEXACT, -1, (LPARAM) lpelfe->elfScript) == CB_ERR) {
+ int i = SendMessage((HWND) lParam, CB_ADDSTRING, 0, (LPARAM) lpelfe->elfScript);
+ SendMessage((HWND) lParam, CB_SETITEMDATA, i, lpelfe->elfLogFont.lfCharSet);
+ }
+ return TRUE;
+}
+
+static int TextOptsDlgResizer(HWND hwndDlg, LPARAM lParam, UTILRESIZECONTROL * urc)
+{
+ return RD_ANCHORX_LEFT | RD_ANCHORY_TOP;
+}
+
+static void SwitchTextDlgToMode(HWND hwndDlg, int expert)
+{
+ ShowWindow(GetDlgItem(hwndDlg, IDC_GAMMACORRECT), expert ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_STSAMETEXT), expert ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_SAMETYPE), expert ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_SAMESIZE), expert ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_SAMESTYLE), expert ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_SAMECOLOUR), expert ? SW_SHOW : SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_STSIZETEXT), expert ? SW_HIDE : SW_SHOW);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_STCOLOURTEXT), expert ? SW_HIDE : SW_SHOW);
+ SetDlgItemText(hwndDlg, IDC_STASTEXT, TranslateTS(expert ? _T("as:") : _T("based on:")));
+ {
+ UTILRESIZEDIALOG urd = { 0 };
+ urd.cbSize = sizeof(urd);
+ urd.hwndDlg = hwndDlg;
+ urd.hInstance = g_hInst;
+ urd.lpTemplate = MAKEINTRESOURCEA(expert ? IDD_OPT_CLCTEXT : IDD_OPT_CLCTEXTSIMPLE);
+ urd.pfnResizer = TextOptsDlgResizer;
+ CallService(MS_UTILS_RESIZEDIALOG, 0, (LPARAM) & urd);
+ }
+ //resizer breaks the sizing of the edit box
+ SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETBUDDY, (WPARAM) GetDlgItem(hwndDlg, IDC_ROWHEIGHT), 0);
+ SendMessage(hwndDlg, M_REFRESHSAMEASBOXES,
+ SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_GETCURSEL, 0, 0), 0), 0);
+}
+
+static BOOL CALLBACK DlgProcClcTextOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ static HFONT hFontSample;
+
+ switch (msg) {
+ case WM_INITDIALOG:
+ hFontSample = NULL;
+ SetDlgItemTextA(hwndDlg, IDC_SAMPLE, "Sample");
+ TranslateDialogDefault(hwndDlg);
+ if (!SendMessage(GetParent(hwndDlg), PSM_ISEXPERT, 0, 0))
+ SwitchTextDlgToMode(hwndDlg, 0);
+ forkthread(FillFontListThread, 0, hwndDlg);
+ {
+ int i, itemId, fontId;
+ LOGFONT lf;
+ COLORREF colour;
+ WORD sameAs;
+ char str[32];
+
+ for (i = 0; i <= FONTID_LAST; i++) {
+ fontId = fontListOrder[i];
+ pcli->pfnGetFontSetting(fontId, &lf, &colour);
+ wsprintfA(str, "Font%dAs", fontId);
+ sameAs = DBGetContactSettingWord(NULL, "CLC", str, fontSameAsDefault[fontId]);
+ fontSettings[fontId].sameAsFlags = HIBYTE(sameAs);
+ fontSettings[fontId].sameAs = LOBYTE(sameAs);
+ fontSettings[fontId].style =
+ (lf.lfWeight == FW_NORMAL ? 0 : DBFONTF_BOLD) | (lf.lfItalic ? DBFONTF_ITALIC : 0) | (lf.lfUnderline ? DBFONTF_UNDERLINE : 0);
+ if (lf.lfHeight < 0) {
+ HDC hdc;
+ SIZE size;
+ HFONT hFont = CreateFontIndirect(&lf);
+ hdc = GetDC(hwndDlg);
+ SelectObject(hdc, hFont);
+ GetTextExtentPoint32A(hdc, "_W", 2, &size);
+ ReleaseDC(hwndDlg, hdc);
+ DeleteObject(hFont);
+ fontSettings[fontId].size = (char) size.cy;
+ }
+ else fontSettings[fontId].size = (char) lf.lfHeight;
+ fontSettings[fontId].charset = lf.lfCharSet;
+ fontSettings[fontId].colour = colour;
+ lstrcpy(fontSettings[fontId].szFace, lf.lfFaceName);
+ itemId = SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_ADDSTRING, 0, (LPARAM) TranslateTS( szFontIdDescr[fontId] ));
+ SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_SETITEMDATA, itemId, fontId);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_SETCURSEL, 0, 0);
+ for (i = 0; i < SIZEOF(fontSizes); i++)
+ SendDlgItemMessageA(hwndDlg, IDC_FONTSIZE, CB_ADDSTRING, 0, (LPARAM) fontSizes[i]);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETRANGE, 0, MAKELONG(255, 0));
+ SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETPOS, 0, MAKELONG(DBGetContactSettingByte(NULL, "CLC", "RowHeight", CLCDEFAULT_ROWHEIGHT), 0));
+ SendMessage(hwndDlg, M_REBUILDFONTGROUP, 0, 0);
+ SendMessage(hwndDlg, M_SAVEFONT, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_HOTCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_HOTTEXTCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_HOTCOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, "CLC", "HotTextColour", CLCDEFAULT_HOTTEXTCOLOUR));
+ CheckDlgButton(hwndDlg, IDC_GAMMACORRECT, DBGetContactSettingByte(NULL, "CLC", "GammaCorrect", CLCDEFAULT_GAMMACORRECT) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_SELTEXTCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, "CLC", "SelTextColour", CLCDEFAULT_SELTEXTCOLOUR));
+ SendDlgItemMessage(hwndDlg, IDC_QUICKCOLOUR, CPM_SETDEFAULTCOLOUR, 0, CLCDEFAULT_QUICKSEARCHCOLOUR);
+ SendDlgItemMessage(hwndDlg, IDC_QUICKCOLOUR, CPM_SETCOLOUR, 0, DBGetContactSettingDword(NULL, "CLC", "QuickSearchColour", CLCDEFAULT_QUICKSEARCHCOLOUR));
+ return TRUE;
+ case M_REBUILDFONTGROUP: //remake all the needed controls when the user changes the font selector at the top
+ {
+ int i = SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_GETCURSEL, 0, 0), 0);
+ SendMessage(hwndDlg, M_SETSAMEASBOXES, i, 0);
+ {
+ int j, id, itemId;
+ char szText[256];
+ SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_RESETCONTENT, 0, 0);
+ itemId = SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_ADDSTRING, 0, (LPARAM) TranslateT("<none>"));
+ SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_SETITEMDATA, itemId, 0xFF);
+ if (0xFF == fontSettings[i].sameAs)
+ SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_SETCURSEL, itemId, 0);
+ for (j = 0; j <= FONTID_LAST; j++) {
+ SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_GETLBTEXT, j, (LPARAM) szText);
+ id = SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_GETITEMDATA, j, 0);
+ if (id == i)
+ continue;
+ itemId = SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_ADDSTRING, 0, (LPARAM) szText);
+ SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_SETITEMDATA, itemId, id);
+ if (id == fontSettings[i].sameAs)
+ SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_SETCURSEL, itemId, 0);
+ }
+ }
+ SendMessage(hwndDlg, M_LOADFONT, i, 0);
+ SendMessage(hwndDlg, M_REFRESHSAMEASBOXES, i, 0);
+ SendMessage(hwndDlg, M_REMAKESAMPLE, 0, 0);
+ break;
+ }
+ case M_SETSAMEASBOXES: //set the check mark in the 'same as' boxes to the right value for fontid wParam
+ CheckDlgButton(hwndDlg, IDC_SAMETYPE, fontSettings[wParam].sameAsFlags & SAMEASF_FACE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SAMESIZE, fontSettings[wParam].sameAsFlags & SAMEASF_SIZE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SAMESTYLE, fontSettings[wParam].sameAsFlags & SAMEASF_STYLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SAMECOLOUR, fontSettings[wParam].sameAsFlags & SAMEASF_COLOUR ? BST_CHECKED : BST_UNCHECKED);
+ break;
+ case M_FILLSCRIPTCOMBO: //fill the script combo box and set the selection to the value for fontid wParam
+ {
+ LOGFONT lf = { 0 };
+ int i;
+ HDC hdc = GetDC(hwndDlg);
+ lf.lfCharSet = DEFAULT_CHARSET;
+ GetDlgItemText(hwndDlg, IDC_TYPEFACE, lf.lfFaceName, LF_FACESIZE );
+ lf.lfPitchAndFamily = 0;
+ SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_RESETCONTENT, 0, 0);
+ EnumFontFamiliesEx(hdc, &lf, (FONTENUMPROC) EnumFontScriptsProc, (LPARAM) GetDlgItem(hwndDlg, IDC_SCRIPT), 0);
+ ReleaseDC(hwndDlg, hdc);
+ for (i = SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETCOUNT, 0, 0) - 1; i >= 0; i--) {
+ if (SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETITEMDATA, i, 0) == fontSettings[wParam].charset) {
+ SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_SETCURSEL, i, 0);
+ break;
+ }
+ }
+ if (i < 0)
+ SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_SETCURSEL, 0, 0);
+ break;
+ }
+ case WM_CTLCOLORSTATIC:
+ if ((HWND) lParam == GetDlgItem(hwndDlg, IDC_SAMPLE)) {
+ SetTextColor((HDC) wParam, SendDlgItemMessage(hwndDlg, IDC_COLOUR, CPM_GETCOLOUR, 0, 0));
+ SetBkColor((HDC) wParam, GetSysColor(COLOR_3DFACE));
+ return (BOOL) GetSysColorBrush(COLOR_3DFACE);
+ }
+ break;
+ case M_REFRESHSAMEASBOXES: //set the disabled flag on the 'same as' checkboxes to the values for fontid wParam
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SAMETYPE), fontSettings[wParam].sameAs != 0xFF);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SAMESIZE), fontSettings[wParam].sameAs != 0xFF);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SAMESTYLE), fontSettings[wParam].sameAs != 0xFF);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SAMECOLOUR), fontSettings[wParam].sameAs != 0xFF);
+ if (SendMessage(GetParent(hwndDlg), PSM_ISEXPERT, 0, 0)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TYPEFACE), fontSettings[wParam].sameAs == 0xFF
+ || !(fontSettings[wParam].sameAsFlags & SAMEASF_FACE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCRIPT), fontSettings[wParam].sameAs == 0xFF
+ || !(fontSettings[wParam].sameAsFlags & SAMEASF_FACE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FONTSIZE), fontSettings[wParam].sameAs == 0xFF
+ || !(fontSettings[wParam].sameAsFlags & SAMEASF_SIZE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BOLD), fontSettings[wParam].sameAs == 0xFF
+ || !(fontSettings[wParam].sameAsFlags & SAMEASF_STYLE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ITALIC), fontSettings[wParam].sameAs == 0xFF
+ || !(fontSettings[wParam].sameAsFlags & SAMEASF_STYLE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UNDERLINE), fontSettings[wParam].sameAs == 0xFF
+ || !(fontSettings[wParam].sameAsFlags & SAMEASF_STYLE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOUR), fontSettings[wParam].sameAs == 0xFF
+ || !(fontSettings[wParam].sameAsFlags & SAMEASF_COLOUR));
+ }
+ else {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TYPEFACE), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SCRIPT), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FONTSIZE), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BOLD), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ITALIC), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_UNDERLINE), TRUE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_COLOUR), TRUE);
+ }
+ break;
+ case M_REMAKESAMPLE: //remake the sample edit box font based on the settings in the controls
+ {
+ LOGFONTA lf;
+ if (hFontSample) {
+ SendDlgItemMessage(hwndDlg, IDC_SAMPLE, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDC_FONTID, WM_GETFONT, 0, 0), 0);
+ DeleteObject(hFontSample);
+ }
+ lf.lfHeight = GetDlgItemInt(hwndDlg, IDC_FONTSIZE, NULL, FALSE);
+ {
+ HDC hdc = GetDC(NULL);
+ lf.lfHeight = -MulDiv(lf.lfHeight, GetDeviceCaps(hdc, LOGPIXELSY), 72);
+ ReleaseDC(NULL, hdc);
+ }
+ lf.lfWidth = lf.lfEscapement = lf.lfOrientation = 0;
+ lf.lfWeight = IsDlgButtonChecked(hwndDlg, IDC_BOLD) ? FW_BOLD : FW_NORMAL;
+ lf.lfItalic = IsDlgButtonChecked(hwndDlg, IDC_ITALIC);
+ lf.lfUnderline = IsDlgButtonChecked(hwndDlg, IDC_UNDERLINE);
+ lf.lfStrikeOut = 0;
+ lf.lfCharSet = (BYTE) SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETCURSEL, 0, 0), 0);
+ lf.lfOutPrecision = OUT_DEFAULT_PRECIS;
+ lf.lfClipPrecision = CLIP_DEFAULT_PRECIS;
+ lf.lfQuality = DEFAULT_QUALITY;
+ lf.lfPitchAndFamily = DEFAULT_PITCH | FF_DONTCARE;
+ GetDlgItemTextA(hwndDlg, IDC_TYPEFACE, lf.lfFaceName, SIZEOF(lf.lfFaceName));
+ hFontSample = CreateFontIndirectA(&lf);
+ SendDlgItemMessage(hwndDlg, IDC_SAMPLE, WM_SETFONT, (WPARAM) hFontSample, TRUE);
+ break;
+ }
+ case M_RECALCONEFONT: //copy the 'same as' settings for fontid wParam from their sources
+ if (fontSettings[wParam].sameAs == 0xFF)
+ break;
+ if (fontSettings[wParam].sameAsFlags & SAMEASF_FACE) {
+ lstrcpy(fontSettings[wParam].szFace, fontSettings[fontSettings[wParam].sameAs].szFace);
+ fontSettings[wParam].charset = fontSettings[fontSettings[wParam].sameAs].charset;
+ }
+ if (fontSettings[wParam].sameAsFlags & SAMEASF_SIZE)
+ fontSettings[wParam].size = fontSettings[fontSettings[wParam].sameAs].size;
+ if (fontSettings[wParam].sameAsFlags & SAMEASF_STYLE)
+ fontSettings[wParam].style = fontSettings[fontSettings[wParam].sameAs].style;
+ if (fontSettings[wParam].sameAsFlags & SAMEASF_COLOUR)
+ fontSettings[wParam].colour = fontSettings[fontSettings[wParam].sameAs].colour;
+ break;
+ case M_RECALCOTHERFONTS: //recalculate the 'same as' settings for all fonts but wParam
+ {
+ int i;
+ for (i = 0; i <= FONTID_LAST; i++) {
+ if (i == (int) wParam)
+ continue;
+ SendMessage(hwndDlg, M_RECALCONEFONT, i, 0);
+ }
+ break;
+ }
+ case M_SAVEFONT: //save the font settings from the controls to font wParam
+ fontSettings[wParam].sameAsFlags =
+ (IsDlgButtonChecked(hwndDlg, IDC_SAMETYPE) ? SAMEASF_FACE : 0) | (IsDlgButtonChecked(hwndDlg, IDC_SAMESIZE) ? SAMEASF_SIZE : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_SAMESTYLE) ? SAMEASF_STYLE : 0) | (IsDlgButtonChecked(hwndDlg, IDC_SAMECOLOUR) ? SAMEASF_COLOUR : 0);
+ fontSettings[wParam].sameAs =
+ (BYTE) SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_GETCURSEL, 0, 0), 0);
+ GetDlgItemText(hwndDlg, IDC_TYPEFACE, fontSettings[wParam].szFace, SIZEOF( fontSettings[wParam].szFace ));
+ fontSettings[wParam].charset =
+ (BYTE) SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SCRIPT, CB_GETCURSEL, 0, 0), 0);
+ fontSettings[wParam].size = (char) GetDlgItemInt(hwndDlg, IDC_FONTSIZE, NULL, FALSE);
+ fontSettings[wParam].style =
+ (IsDlgButtonChecked(hwndDlg, IDC_BOLD) ? DBFONTF_BOLD : 0) | (IsDlgButtonChecked(hwndDlg, IDC_ITALIC) ? DBFONTF_ITALIC : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_UNDERLINE) ? DBFONTF_UNDERLINE : 0);
+ fontSettings[wParam].colour = SendDlgItemMessage(hwndDlg, IDC_COLOUR, CPM_GETCOLOUR, 0, 0);
+ SendMessage(hwndDlg, M_REDOROWHEIGHT, 0, 0);
+ break;
+ case M_REDOROWHEIGHT: //recalculate the minimum feasible row height
+ {
+ int i;
+ int minHeight = GetSystemMetrics(SM_CYSMICON);
+ for (i = 0; i <= FONTID_LAST; i++)
+ if (fontSettings[i].size > minHeight)
+ minHeight = fontSettings[i].size;
+ i = SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0);
+ if (i < minHeight)
+ SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_SETPOS, 0, MAKELONG(minHeight, 0));
+ break;
+ }
+ case M_LOADFONT: //load font wParam into the controls
+ SetDlgItemText(hwndDlg, IDC_TYPEFACE, fontSettings[wParam].szFace);
+ SendMessage(hwndDlg, M_FILLSCRIPTCOMBO, wParam, 0);
+ SetDlgItemInt(hwndDlg, IDC_FONTSIZE, fontSettings[wParam].size, FALSE);
+ CheckDlgButton(hwndDlg, IDC_BOLD, fontSettings[wParam].style & DBFONTF_BOLD ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ITALIC, fontSettings[wParam].style & DBFONTF_ITALIC ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_UNDERLINE, fontSettings[wParam].style & DBFONTF_UNDERLINE ? BST_CHECKED : BST_UNCHECKED);
+ {
+ LOGFONT lf;
+ COLORREF colour;
+ pcli->pfnGetDefaultFontSetting(wParam, &lf, &colour);
+ SendDlgItemMessage(hwndDlg, IDC_COLOUR, CPM_SETDEFAULTCOLOUR, 0, colour);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_COLOUR, CPM_SETCOLOUR, 0, fontSettings[wParam].colour);
+ break;
+ case M_GUESSSAMEASBOXES: //guess suitable values for the 'same as' checkboxes for fontId wParam
+ fontSettings[wParam].sameAsFlags = 0;
+ if (fontSettings[wParam].sameAs == 0xFF)
+ break;
+ if (!lstrcmp(fontSettings[wParam].szFace, fontSettings[fontSettings[wParam].sameAs].szFace) &&
+ fontSettings[wParam].charset == fontSettings[fontSettings[wParam].sameAs].charset)
+ fontSettings[wParam].sameAsFlags |= SAMEASF_FACE;
+ if (fontSettings[wParam].size == fontSettings[fontSettings[wParam].sameAs].size)
+ fontSettings[wParam].sameAsFlags |= SAMEASF_SIZE;
+ if (fontSettings[wParam].style == fontSettings[fontSettings[wParam].sameAs].style)
+ fontSettings[wParam].sameAsFlags |= SAMEASF_STYLE;
+ if (fontSettings[wParam].colour == fontSettings[fontSettings[wParam].sameAs].colour)
+ fontSettings[wParam].sameAsFlags |= SAMEASF_COLOUR;
+ SendMessage(hwndDlg, M_SETSAMEASBOXES, wParam, 0);
+ break;
+ case WM_VSCROLL:
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_COMMAND:
+ {
+ int fontId = SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_FONTID, CB_GETCURSEL, 0, 0), 0);
+ switch (LOWORD(wParam)) {
+ case IDC_FONTID:
+ if (HIWORD(wParam) != CBN_SELCHANGE)
+ return FALSE;
+ SendMessage(hwndDlg, M_REBUILDFONTGROUP, 0, 0);
+ return 0;
+ case IDC_SAMETYPE:
+ case IDC_SAMESIZE:
+ case IDC_SAMESTYLE:
+ case IDC_SAMECOLOUR:
+ SendMessage(hwndDlg, M_SAVEFONT, fontId, 0);
+ SendMessage(hwndDlg, M_RECALCONEFONT, fontId, 0);
+ SendMessage(hwndDlg, M_REMAKESAMPLE, 0, 0);
+ SendMessage(hwndDlg, M_REFRESHSAMEASBOXES, fontId, 0);
+ break;
+ case IDC_SAMEAS:
+ if (HIWORD(wParam) != CBN_SELCHANGE)
+ return FALSE;
+ if (SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_GETCURSEL, 0, 0), 0) ==
+ fontId)
+ SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_SETCURSEL, 0, 0);
+ if (!SendMessage(GetParent(hwndDlg), PSM_ISEXPERT, 0, 0)) {
+ int sameAs =
+ SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_SAMEAS, CB_GETCURSEL, 0, 0), 0);
+ if (sameAs != 0xFF)
+ SendMessage(hwndDlg, M_LOADFONT, sameAs, 0);
+ SendMessage(hwndDlg, M_SAVEFONT, fontId, 0);
+ SendMessage(hwndDlg, M_GUESSSAMEASBOXES, fontId, 0);
+ }
+ else
+ SendMessage(hwndDlg, M_SAVEFONT, fontId, 0);
+ SendMessage(hwndDlg, M_RECALCONEFONT, fontId, 0);
+ SendMessage(hwndDlg, M_FILLSCRIPTCOMBO, fontId, 0);
+ SendMessage(hwndDlg, M_REMAKESAMPLE, 0, 0);
+ SendMessage(hwndDlg, M_REFRESHSAMEASBOXES, fontId, 0);
+ break;
+ case IDC_TYPEFACE:
+ case IDC_SCRIPT:
+ case IDC_FONTSIZE:
+ if (HIWORD(wParam) != CBN_EDITCHANGE && HIWORD(wParam) != CBN_SELCHANGE)
+ return FALSE;
+ if (HIWORD(wParam) == CBN_SELCHANGE) {
+ SendDlgItemMessage(hwndDlg, LOWORD(wParam), CB_SETCURSEL, SendDlgItemMessage(hwndDlg, LOWORD(wParam), CB_GETCURSEL, 0, 0), 0);
+ }
+ if (LOWORD(wParam) == IDC_TYPEFACE)
+ SendMessage(hwndDlg, M_FILLSCRIPTCOMBO, fontId, 0);
+ //fall through
+ case IDC_BOLD:
+ case IDC_ITALIC:
+ case IDC_UNDERLINE:
+ case IDC_COLOUR:
+ SendMessage(hwndDlg, M_SAVEFONT, fontId, 0);
+ if (!SendMessage(GetParent(hwndDlg), PSM_ISEXPERT, 0, 0)) {
+ SendMessage(hwndDlg, M_GUESSSAMEASBOXES, fontId, 0);
+ SendMessage(hwndDlg, M_REFRESHSAMEASBOXES, fontId, 0);
+ }
+ SendMessage(hwndDlg, M_RECALCOTHERFONTS, fontId, 0);
+ SendMessage(hwndDlg, M_REMAKESAMPLE, 0, 0);
+ SendMessage(hwndDlg, M_REDOROWHEIGHT, 0, 0);
+ break;
+ case IDC_SAMPLE:
+ return 0;
+ case IDC_ROWHEIGHT:
+ if (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
+ return 0;
+ break;
+ }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ }
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY:
+ {
+ int i;
+ char str[20];
+
+ // Force min height calculation
+ // This prevents users from setting the row height to be too low
+ SendMessage(hwndDlg, M_REDOROWHEIGHT, 0, 0);
+ for (i = 0; i <= FONTID_LAST; i++) {
+ wsprintfA(str, "Font%dName", i);
+ DBWriteContactSettingTString(NULL, "CLC", str, fontSettings[i].szFace);
+ wsprintfA(str, "Font%dSet", i);
+ DBWriteContactSettingByte(NULL, "CLC", str, fontSettings[i].charset);
+ wsprintfA(str, "Font%dSize", i);
+ DBWriteContactSettingByte(NULL, "CLC", str, fontSettings[i].size);
+ wsprintfA(str, "Font%dSty", i);
+ DBWriteContactSettingByte(NULL, "CLC", str, fontSettings[i].style);
+ wsprintfA(str, "Font%dCol", i);
+ DBWriteContactSettingDword(NULL, "CLC", str, fontSettings[i].colour);
+ wsprintfA(str, "Font%dAs", i);
+ DBWriteContactSettingWord(NULL, "CLC", str, (WORD) ((fontSettings[i].sameAsFlags << 8) | fontSettings[i].sameAs));
+ }
+ }
+ {
+ COLORREF col;
+ col = SendDlgItemMessage(hwndDlg, IDC_SELCOLOUR, CPM_GETCOLOUR, 0, 0);
+ if (col == CLCDEFAULT_SELTEXTCOLOUR)
+ DBDeleteContactSetting(NULL, "CLC", "SelTextColour");
+ else
+ DBWriteContactSettingDword(NULL, "CLC", "SelTextColour", col);
+ col = SendDlgItemMessage(hwndDlg, IDC_HOTCOLOUR, CPM_GETCOLOUR, 0, 0);
+ if (col == CLCDEFAULT_HOTTEXTCOLOUR)
+ DBDeleteContactSetting(NULL, "CLC", "HotTextColour");
+ else
+ DBWriteContactSettingDword(NULL, "CLC", "HotTextColour", col);
+ col = SendDlgItemMessage(hwndDlg, IDC_QUICKCOLOUR, CPM_GETCOLOUR, 0, 0);
+ if (col == CLCDEFAULT_QUICKSEARCHCOLOUR)
+ DBDeleteContactSetting(NULL, "CLC", "QuickSearchColour");
+ else
+ DBWriteContactSettingDword(NULL, "CLC", "QuickSearchColour", col);
+ }
+ DBWriteContactSettingByte(NULL, "CLC", "RowHeight", (BYTE) SendDlgItemMessage(hwndDlg, IDC_ROWHEIGHTSPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingByte(NULL, "CLC", "GammaCorrect", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_GAMMACORRECT));
+ pcli->pfnClcOptionsChanged();
+ return TRUE;
+ case PSN_EXPERTCHANGED:
+ SwitchTextDlgToMode(hwndDlg, ((PSHNOTIFY *) lParam)->lParam);
+ break;
+ }
+ break;
+ }
+ break;
+ case WM_DESTROY:
+ if (hFontSample) {
+ SendDlgItemMessage(hwndDlg, IDC_SAMPLE, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDC_FONTID, WM_GETFONT, 0, 0), 0);
+ DeleteObject(hFontSample);
+ }
+ break;
+ }
+ return FALSE;
+}
+
+/****************************************************************************************/
+
+int ClcOptInit(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+
+ ZeroMemory(&odp, sizeof(odp));
+ odp.cbSize = sizeof(odp);
+ odp.position = 0;
+ odp.hInstance = g_hInst;
+ odp.pszGroup = "Contact List";
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLC);
+ odp.pszTitle = "List";
+ odp.pfnDlgProc = DlgProcClcMainOpts;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) & odp);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLCBKG);
+ odp.pszTitle = "List Background";
+ odp.pfnDlgProc = DlgProcClcBkgOpts;
+ odp.flags = ODPF_BOLDGROUPS;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) & odp);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLCTEXT);
+ odp.pszTitle = "List Text";
+ odp.pfnDlgProc = DlgProcClcTextOpts;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) & odp);
+ return 0;
+}
diff --git a/miranda-wine/plugins/clist/clcpaint.c b/miranda-wine/plugins/clist/clcpaint.c
new file mode 100644
index 0000000..d244c88
--- /dev/null
+++ b/miranda-wine/plugins/clist/clcpaint.c
@@ -0,0 +1,590 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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 "commonheaders.h"
+
+extern HIMAGELIST himlCListClc;
+static BYTE divide3[765] = { 255 };
+
+static void ChangeToFont(HDC hdc, struct ClcData *dat, int id, int *fontHeight)
+{
+ SelectObject(hdc, dat->fontInfo[id].hFont);
+ SetTextColor(hdc, dat->fontInfo[id].colour);
+ if (fontHeight)
+ *fontHeight = dat->fontInfo[id].fontHeight;
+}
+
+static void __inline SetHotTrackColour(HDC hdc, struct ClcData *dat)
+{
+ if (dat->gammaCorrection) {
+ COLORREF oldCol, newCol;
+ int oldLum, newLum;
+
+ oldCol = GetTextColor(hdc);
+ oldLum = (GetRValue(oldCol) * 30 + GetGValue(oldCol) * 59 + GetBValue(oldCol) * 11) / 100;
+ newLum = (GetRValue(dat->hotTextColour) * 30 + GetGValue(dat->hotTextColour) * 59 + GetBValue(dat->hotTextColour) * 11) / 100;
+ if (newLum == 0) {
+ SetTextColor(hdc, dat->hotTextColour);
+ return;
+ }
+ if (newLum >= oldLum + 20) {
+ oldLum += 20;
+ newCol =
+ RGB(GetRValue(dat->hotTextColour) * oldLum / newLum, GetGValue(dat->hotTextColour) * oldLum / newLum,
+ GetBValue(dat->hotTextColour) * oldLum / newLum);
+ }
+ else if (newLum <= oldLum) {
+ int r, g, b;
+ r = GetRValue(dat->hotTextColour) * oldLum / newLum;
+ g = GetGValue(dat->hotTextColour) * oldLum / newLum;
+ b = GetBValue(dat->hotTextColour) * oldLum / newLum;
+ if (r > 255) {
+ g += (r - 255) * 3 / 7;
+ b += (r - 255) * 3 / 7;
+ r = 255;
+ }
+ if (g > 255) {
+ r += (g - 255) * 59 / 41;
+ if (r > 255)
+ r = 255;
+ b += (g - 255) * 59 / 41;
+ g = 255;
+ }
+ if (b > 255) {
+ r += (b - 255) * 11 / 89;
+ if (r > 255)
+ r = 255;
+ g += (b - 255) * 11 / 89;
+ if (g > 255)
+ g = 255;
+ b = 255;
+ }
+ newCol = RGB(r, g, b);
+ }
+ else
+ newCol = dat->hotTextColour;
+ SetTextColor(hdc, newCol);
+ }
+ else
+ SetTextColor(hdc, dat->hotTextColour);
+}
+
+static int GetStatusOnlineness(int status)
+{
+ switch (status) {
+ case ID_STATUS_FREECHAT: return 110;
+ case ID_STATUS_ONLINE: return 100;
+ case ID_STATUS_OCCUPIED: return 60;
+ case ID_STATUS_ONTHEPHONE: return 50;
+ case ID_STATUS_DND: return 40;
+ case ID_STATUS_AWAY: return 30;
+ case ID_STATUS_OUTTOLUNCH: return 20;
+ case ID_STATUS_NA: return 10;
+ case ID_STATUS_INVISIBLE: return 5;
+ }
+ return 0;
+}
+
+static int GetGeneralisedStatus(void)
+{
+ int i, status, thisStatus, statusOnlineness, thisOnlineness;
+
+ status = ID_STATUS_OFFLINE;
+ statusOnlineness = 0;
+
+ for (i = 0; i < pcli->hClcProtoCount; i++) {
+ thisStatus = pcli->clcProto[i].dwStatus;
+ if (thisStatus == ID_STATUS_INVISIBLE)
+ return ID_STATUS_INVISIBLE;
+ thisOnlineness = GetStatusOnlineness(thisStatus);
+ if (thisOnlineness > statusOnlineness) {
+ status = thisStatus;
+ statusOnlineness = thisOnlineness;
+ }
+ }
+ return status;
+}
+
+static int GetRealStatus(struct ClcContact *contact, int status)
+{
+ int i;
+ char *szProto = contact->proto;
+ if (!szProto)
+ return status;
+ for (i = 0; i < pcli->hClcProtoCount; i++) {
+ if (!lstrcmpA(pcli->clcProto[i].szProto, szProto)) {
+ return pcli->clcProto[i].dwStatus;
+ }
+ }
+ return status;
+}
+
+static HMODULE themeAPIHandle = NULL; // handle to uxtheme.dll
+static HANDLE(WINAPI * MyOpenThemeData) (HWND, LPCWSTR);
+static HRESULT(WINAPI * MyCloseThemeData) (HANDLE);
+static HRESULT(WINAPI * MyDrawThemeBackground) (HANDLE, HDC, int, int, const RECT *, const RECT *);
+
+#define MGPROC(x) GetProcAddress(themeAPIHandle,x)
+void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
+{
+ HDC hdcMem;
+ RECT clRect;
+ int y, indent, index, fontHeight;
+ struct ClcGroup *group;
+ HBITMAP hBmpOsb, hOldBitmap;
+ HFONT hOldFont;
+ DWORD style = GetWindowLong(hwnd, GWL_STYLE);
+ int status = GetGeneralisedStatus();
+ int grey = 0, groupCountsFontTopShift;
+ HBRUSH hBrushAlternateGrey = NULL;
+ // yes I know about GetSysColorBrush()
+ COLORREF tmpbkcolour = style & CLS_CONTACTLIST ? (dat->useWindowsColours ? GetSysColor(COLOR_3DFACE) : dat->bkColour) : dat->bkColour;
+
+ if (dat->greyoutFlags & pcli->pfnClcStatusToPf2(status) || style & WS_DISABLED)
+ grey = 1;
+ else if (GetFocus() != hwnd && dat->greyoutFlags & GREYF_UNFOCUS)
+ grey = 1;
+ GetClientRect(hwnd, &clRect);
+ if (rcPaint == NULL)
+ rcPaint = &clRect;
+ if (IsRectEmpty(rcPaint))
+ return;
+ y = -dat->yScroll;
+ hdcMem = CreateCompatibleDC(hdc);
+ hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), NULL);
+ hOldBitmap = SelectObject(hdcMem, hBmpOsb);
+ {
+ TEXTMETRIC tm;
+ hOldFont = SelectObject(hdcMem, dat->fontInfo[FONTID_GROUPS].hFont);
+ GetTextMetrics(hdcMem, &tm);
+ groupCountsFontTopShift = tm.tmAscent;
+ SelectObject(hdcMem, dat->fontInfo[FONTID_GROUPCOUNTS].hFont);
+ GetTextMetrics(hdcMem, &tm);
+ groupCountsFontTopShift -= tm.tmAscent;
+ }
+ if (style & CLS_GREYALTERNATE)
+ hBrushAlternateGrey =
+ CreateSolidBrush(GetNearestColor(hdcMem, RGB(GetRValue(tmpbkcolour) - 10, GetGValue(tmpbkcolour) - 10, GetBValue(tmpbkcolour) - 10)));
+
+ ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
+ SetBkMode(hdcMem, TRANSPARENT);
+ {
+ HBRUSH hBrush, hoBrush;
+
+ hBrush = CreateSolidBrush(tmpbkcolour);
+ hoBrush = (HBRUSH) SelectObject(hdcMem, hBrush);
+ FillRect(hdcMem, rcPaint, hBrush);
+ SelectObject(hdcMem, hoBrush);
+ DeleteObject(hBrush);
+ if (dat->hBmpBackground) {
+ BITMAP bmp;
+ HDC hdcBmp;
+ int x, y;
+ int maxx, maxy;
+ int destw, desth;
+
+ // XXX: Halftone isnt supported on 9x, however the scretch problems dont happen on 98.
+ SetStretchBltMode(hdcMem, HALFTONE);
+
+ GetObject(dat->hBmpBackground, sizeof(bmp), &bmp);
+ hdcBmp = CreateCompatibleDC(hdcMem);
+ SelectObject(hdcBmp, dat->hBmpBackground);
+ y = dat->backgroundBmpUse & CLBF_SCROLL ? -dat->yScroll : 0;
+ maxx = dat->backgroundBmpUse & CLBF_TILEH ? clRect.right : 1;
+ maxy = dat->backgroundBmpUse & CLBF_TILEV ? maxy = rcPaint->bottom : y + 1;
+ switch (dat->backgroundBmpUse & CLBM_TYPE) {
+ case CLB_STRETCH:
+ if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
+ if (clRect.right * bmp.bmHeight < clRect.bottom * bmp.bmWidth) {
+ desth = clRect.bottom;
+ destw = desth * bmp.bmWidth / bmp.bmHeight;
+ }
+ else {
+ destw = clRect.right;
+ desth = destw * bmp.bmHeight / bmp.bmWidth;
+ }
+ }
+ else {
+ destw = clRect.right;
+ desth = clRect.bottom;
+ }
+ break;
+ case CLB_STRETCHH:
+ if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
+ destw = clRect.right;
+ desth = destw * bmp.bmHeight / bmp.bmWidth;
+ }
+ else {
+ destw = clRect.right;
+ desth = bmp.bmHeight;
+ }
+ break;
+ case CLB_STRETCHV:
+ if (dat->backgroundBmpUse & CLBF_PROPORTIONAL) {
+ desth = clRect.bottom;
+ destw = desth * bmp.bmWidth / bmp.bmHeight;
+ }
+ else {
+ destw = bmp.bmWidth;
+ desth = clRect.bottom;
+ }
+ break;
+ default: //clb_topleft
+ destw = bmp.bmWidth;
+ desth = bmp.bmHeight;
+ break;
+ }
+ for (; y < maxy; y += desth) {
+ if (y < rcPaint->top - desth)
+ continue;
+ for (x = 0; x < maxx; x += destw)
+ StretchBlt(hdcMem, x, y, destw, desth, hdcBmp, 0, 0, bmp.bmWidth, bmp.bmHeight, SRCCOPY);
+ }
+ DeleteDC(hdcBmp);
+ }
+ }
+ group = &dat->list;
+ group->scanIndex = 0;
+ indent = 0;
+ for (index = 0; y < rcPaint->bottom;) {
+ if (group->scanIndex == group->cl.count) {
+ group = group->parent;
+ indent--;
+ if (group == NULL)
+ break;
+ group->scanIndex++;
+ continue;
+ }
+ if (y > rcPaint->top - dat->rowHeight) {
+ int iImage = -1;
+ int selected = index == dat->selection && (dat->showSelAlways || dat->exStyle & CLS_EX_SHOWSELALWAYS || GetFocus() == hwnd)
+ && group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER;
+ int hottrack = dat->exStyle & CLS_EX_TRACKSELECT && group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER && dat->iHotTrack == index;
+ SIZE textSize, countsSize, spaceSize;
+ int width, checkboxWidth;
+ char *szCounts;
+
+ //alternating grey
+ if (style & CLS_GREYALTERNATE && index & 1) {
+ RECT rc;
+ rc.top = y;
+ rc.bottom = rc.top + dat->rowHeight;
+ rc.left = 0;
+ rc.right = clRect.right;
+ FillRect(hdcMem, &rc, hBrushAlternateGrey);
+ }
+
+ //setup
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP)
+ ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_INFO) {
+ if (group->cl.items[group->scanIndex]->flags & CLCIIF_GROUPFONT)
+ ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
+ else
+ ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
+ }
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_DIVIDER)
+ ChangeToFont(hdcMem, dat, FONTID_DIVIDERS, &fontHeight);
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST)
+ ChangeToFont(hdcMem, dat, FONTID_NOTONLIST, &fontHeight);
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT &&
+ ((group->cl.items[group->scanIndex]->flags & CONTACTF_INVISTO
+ && GetRealStatus(group->cl.items[group->scanIndex], status) != ID_STATUS_INVISIBLE)
+ || (group->cl.items[group->scanIndex]->flags & CONTACTF_VISTO
+ && GetRealStatus(group->cl.items[group->scanIndex], status) == ID_STATUS_INVISIBLE)
+ )
+ ) {
+ // the contact is in the always visible list and the proto is invisible
+ // the contact is in the always invisible and the proto is in any other mode
+ ChangeToFont(hdcMem, dat, group->cl.items[group->scanIndex]->flags & CONTACTF_ONLINE ? FONTID_INVIS : FONTID_OFFINVIS, &fontHeight);
+ }
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && !(group->cl.items[group->scanIndex]->flags & CONTACTF_ONLINE))
+ ChangeToFont(hdcMem, dat, FONTID_OFFLINE, &fontHeight);
+ else
+ ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
+ GetTextExtentPoint32(hdcMem, group->cl.items[group->scanIndex]->szText, lstrlen(group->cl.items[group->scanIndex]->szText), &textSize);
+ width = textSize.cx;
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
+ szCounts = pcli->pfnGetGroupCountsText(dat, group->cl.items[group->scanIndex]);
+ if (szCounts[0]) {
+ GetTextExtentPoint32A(hdcMem, " ", 1, &spaceSize);
+ ChangeToFont(hdcMem, dat, FONTID_GROUPCOUNTS, &fontHeight);
+ GetTextExtentPoint32A(hdcMem, szCounts, lstrlenA(szCounts), &countsSize);
+ width += spaceSize.cx + countsSize.cx;
+ }
+ }
+
+ if ((style & CLS_CHECKBOXES && group->cl.items[group->scanIndex]->type == CLCIT_CONTACT) ||
+ (style & CLS_GROUPCHECKBOXES && group->cl.items[group->scanIndex]->type == CLCIT_GROUP) ||
+ (group->cl.items[group->scanIndex]->type == CLCIT_INFO && group->cl.items[group->scanIndex]->flags & CLCIIF_CHECKBOX))
+ checkboxWidth = dat->checkboxSize + 2;
+ else
+ checkboxWidth = 0;
+
+ //background
+ if (selected) {
+ int x = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace - 2;
+ ImageList_DrawEx(dat->himlHighlight, 0, hdcMem, x, y, min(width + 5, clRect.right - x), dat->rowHeight, CLR_NONE, CLR_NONE,
+ dat->exStyle & CLS_EX_NOTRANSLUCENTSEL ? ILD_NORMAL : ILD_BLEND25);
+ SetTextColor(hdcMem, dat->selTextColour);
+ }
+ else if (hottrack)
+ SetHotTrackColour(hdcMem, dat);
+
+ //checkboxes
+ if (checkboxWidth) {
+ RECT rc;
+ HANDLE hTheme = NULL;
+
+ // THEME
+ if (IsWinVerXPPlus()) {
+ if (!themeAPIHandle) {
+ themeAPIHandle = GetModuleHandleA("uxtheme");
+ if (themeAPIHandle) {
+ MyOpenThemeData = (HANDLE(WINAPI *) (HWND, LPCWSTR)) MGPROC("OpenThemeData");
+ MyCloseThemeData = (HRESULT(WINAPI *) (HANDLE)) MGPROC("CloseThemeData");
+ MyDrawThemeBackground =
+ (HRESULT(WINAPI *) (HANDLE, HDC, int, int, const RECT *, const RECT *)) MGPROC("DrawThemeBackground");
+ }
+ }
+ // Make sure all of these methods are valid (i would hope either all or none work)
+ if (MyOpenThemeData && MyCloseThemeData && MyDrawThemeBackground) {
+ hTheme = MyOpenThemeData(hwnd, L"BUTTON");
+ }
+ }
+ rc.left = dat->leftMargin + indent * dat->groupIndent;
+ rc.right = rc.left + dat->checkboxSize;
+ rc.top = y + ((dat->rowHeight - dat->checkboxSize) >> 1);
+ rc.bottom = rc.top + dat->checkboxSize;
+ if (hTheme) {
+ MyDrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? (hottrack ? CBS_CHECKEDHOT : CBS_CHECKEDNORMAL) : (hottrack ? CBS_UNCHECKEDHOT : CBS_UNCHECKEDNORMAL), &rc, &rc);
+ }
+ else
+ DrawFrameControl(hdcMem, &rc, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_FLAT | (group->cl.items[group->scanIndex]->flags & CONTACTF_CHECKED ? DFCS_CHECKED : 0) | (hottrack ? DFCS_HOT : 0));
+ if (hTheme && MyCloseThemeData) {
+ MyCloseThemeData(hTheme);
+ hTheme = NULL;
+ }
+ }
+
+ //icon
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP)
+ iImage = group->cl.items[group->scanIndex]->group->expanded ? IMAGE_GROUPOPEN : IMAGE_GROUPSHUT;
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT)
+ iImage = group->cl.items[group->scanIndex]->iImage;
+ if (iImage != -1) {
+ /*COLORREF colourFg=dat->selBkColour;
+ int mode=ILD_NORMAL;
+ if(selected) mode=ILD_SELECTED;
+ else if(hottrack) {mode=ILD_FOCUS; colourFg=dat->hotTextColour;}
+ else if(group->cl.items[group->scanIndex]->type==CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags&CONTACTF_NOTONLIST) {colourFg=dat->fontInfo[FONTID_NOTONLIST].colour; mode=ILD_BLEND50;}
+ ImageList_DrawEx(himlCListClc,iImage,hdcMem,dat->leftMargin+indent*dat->groupIndent+checkboxWidth,y+((dat->rowHeight-16)>>1),0,0,CLR_NONE,colourFg,mode);
+ */
+ // this doesnt use CLS_CONTACTLIST since the colour prolly wont match anyway
+ COLORREF colourFg = dat->selBkColour;
+ int mode = ILD_NORMAL;
+ if (hottrack) {
+ colourFg = dat->hotTextColour;
+ }
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST) {
+ colourFg = dat->fontInfo[FONTID_NOTONLIST].colour;
+ mode = ILD_BLEND50;
+ }
+ if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && dat->showIdle
+ && (group->cl.items[group->scanIndex]->flags & CONTACTF_IDLE)
+ && GetRealStatus(group->cl.items[group->scanIndex], ID_STATUS_OFFLINE) != ID_STATUS_OFFLINE)
+ mode = ILD_SELECTED;
+ ImageList_DrawEx(himlCListClc, iImage, hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth,
+ y + ((dat->rowHeight - 16) >> 1), 0, 0, CLR_NONE, colourFg, mode);
+ }
+
+ //text
+ if (group->cl.items[group->scanIndex]->type == CLCIT_DIVIDER) {
+ RECT rc;
+ rc.top = y + (dat->rowHeight >> 1);
+ rc.bottom = rc.top + 2;
+ rc.left = dat->leftMargin + indent * dat->groupIndent;
+ rc.right = rc.left + ((clRect.right - rc.left - textSize.cx) >> 1) - 3;
+ DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
+ TextOut(hdcMem, rc.right + 3, y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText,
+ lstrlen(group->cl.items[group->scanIndex]->szText));
+ rc.left = rc.right + 6 + textSize.cx;
+ rc.right = clRect.right;
+ DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
+ }
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP) {
+ RECT rc;
+ if (szCounts[0]) {
+ fontHeight = dat->fontInfo[FONTID_GROUPS].fontHeight;
+ rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
+ rc.right = min(clRect.right - countsSize.cx, rc.left + textSize.cx + spaceSize.cx);
+ rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
+ rc.bottom = rc.top + textSize.cy;
+ if (rc.right < rc.left + 4)
+ rc.right = clRect.right + 1;
+ else
+ TextOutA(hdcMem, rc.right, rc.top + groupCountsFontTopShift, szCounts, lstrlenA(szCounts));
+ ChangeToFont(hdcMem, dat, FONTID_GROUPS, &fontHeight);
+ if (selected)
+ SetTextColor(hdcMem, dat->selTextColour);
+ else if (hottrack)
+ SetHotTrackColour(hdcMem, dat);
+ rc.right--;
+ ExtTextOut(hdcMem, rc.left, rc.top, ETO_CLIPPED, &rc, group->cl.items[group->scanIndex]->szText,
+ lstrlen(group->cl.items[group->scanIndex]->szText), NULL);
+ }
+ else
+ TextOut(hdcMem, dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace,
+ y + ((dat->rowHeight - fontHeight) >> 1), group->cl.items[group->scanIndex]->szText,
+ lstrlen(group->cl.items[group->scanIndex]->szText));
+ if (dat->exStyle & CLS_EX_LINEWITHGROUPS) {
+ rc.top = y + (dat->rowHeight >> 1);
+ rc.bottom = rc.top + 2;
+ rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace + width + 3;
+ rc.right = clRect.right - 1 - dat->extraColumnSpacing * dat->extraColumnsCount;
+ if (rc.right - rc.left > 1)
+ DrawEdge(hdcMem, &rc, BDR_SUNKENOUTER, BF_RECT);
+ }
+ }
+ else {
+ TCHAR *szText = group->cl.items[group->scanIndex]->szText;
+ RECT rc;
+ rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
+ rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
+ rc.right = (clRect.right - clRect.left);
+ rc.bottom = rc.top;
+ DrawText(hdcMem, szText, lstrlen(szText), &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
+ }
+ if (selected) {
+ if (group->cl.items[group->scanIndex]->type != CLCIT_DIVIDER) {
+ TCHAR *szText = group->cl.items[group->scanIndex]->szText;
+ RECT rc;
+ int qlen = lstrlen(dat->szQuickSearch);
+ SetTextColor(hdcMem, dat->quickSearchColour);
+ rc.left = dat->leftMargin + indent * dat->groupIndent + checkboxWidth + dat->iconXSpace;
+ rc.top = y + ((dat->rowHeight - fontHeight) >> 1);
+ rc.right = (clRect.right - clRect.left);
+ rc.bottom = rc.top;
+ if (qlen)
+ DrawText(hdcMem, szText, qlen, &rc, DT_EDITCONTROL | DT_NOPREFIX | DT_NOCLIP | DT_WORD_ELLIPSIS | DT_SINGLELINE);
+ }
+ }
+
+ //extra icons
+ for (iImage = 0; iImage < dat->extraColumnsCount; iImage++) {
+ COLORREF colourFg = dat->selBkColour;
+ int mode = ILD_NORMAL;
+ if (group->cl.items[group->scanIndex]->iExtraImage[iImage] == 0xFF)
+ continue;
+ if (selected)
+ mode = ILD_SELECTED;
+ else if (hottrack) {
+ mode = ILD_FOCUS;
+ colourFg = dat->hotTextColour;
+ }
+ else if (group->cl.items[group->scanIndex]->type == CLCIT_CONTACT && group->cl.items[group->scanIndex]->flags & CONTACTF_NOTONLIST) {
+ colourFg = dat->fontInfo[FONTID_NOTONLIST].colour;
+ mode = ILD_BLEND50;
+ }
+ ImageList_DrawEx(dat->himlExtraColumns, group->cl.items[group->scanIndex]->iExtraImage[iImage], hdcMem,
+ clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - iImage), y + ((dat->rowHeight - 16) >> 1), 0, 0,
+ CLR_NONE, colourFg, mode);
+ }
+ }
+ index++;
+ y += dat->rowHeight;
+ if (group->cl.items[group->scanIndex]->type == CLCIT_GROUP && group->cl.items[group->scanIndex]->group->expanded) {
+ group = group->cl.items[group->scanIndex]->group;
+ indent++;
+ group->scanIndex = 0;
+ continue;
+ }
+ group->scanIndex++;
+ }
+ if (dat->iInsertionMark != -1) { //insertion mark
+ HBRUSH hBrush, hoBrush;
+ POINT pts[8];
+ HRGN hRgn;
+
+ pts[0].x = dat->leftMargin;
+ pts[0].y = dat->iInsertionMark * dat->rowHeight - dat->yScroll - 4;
+ pts[1].x = pts[0].x + 2;
+ pts[1].y = pts[0].y + 3;
+ pts[2].x = clRect.right - 4;
+ pts[2].y = pts[1].y;
+ pts[3].x = clRect.right - 1;
+ pts[3].y = pts[0].y - 1;
+ pts[4].x = pts[3].x;
+ pts[4].y = pts[0].y + 7;
+ pts[5].x = pts[2].x + 1;
+ pts[5].y = pts[1].y + 2;
+ pts[6].x = pts[1].x;
+ pts[6].y = pts[5].y;
+ pts[7].x = pts[0].x;
+ pts[7].y = pts[4].y;
+ hRgn = CreatePolygonRgn(pts, SIZEOF(pts), ALTERNATE);
+ hBrush = CreateSolidBrush(dat->fontInfo[FONTID_CONTACTS].colour);
+ hoBrush = (HBRUSH) SelectObject(hdcMem, hBrush);
+ FillRgn(hdcMem, hRgn, hBrush);
+ SelectObject(hdcMem, hoBrush);
+ DeleteObject(hBrush);
+ }
+ if (!grey)
+ BitBlt(hdc, rcPaint->left, rcPaint->top, rcPaint->right - rcPaint->left, rcPaint->bottom - rcPaint->top, hdcMem, rcPaint->left, rcPaint->top,
+ SRCCOPY);
+ SelectObject(hdcMem,hOldBitmap);
+ SelectObject(hdcMem,hOldFont);
+ DeleteDC(hdcMem);
+ if (hBrushAlternateGrey)
+ DeleteObject(hBrushAlternateGrey);
+ if (grey) {
+ PBYTE bits;
+ BITMAPINFOHEADER bmih = { 0 };
+ int i;
+ int greyRed, greyGreen, greyBlue;
+ COLORREF greyColour;
+ bmih.biBitCount = 32;
+ bmih.biSize = sizeof(bmih);
+ bmih.biCompression = BI_RGB;
+ bmih.biHeight = -clRect.bottom;
+ bmih.biPlanes = 1;
+ bmih.biWidth = clRect.right;
+ bits = (PBYTE) malloc(4 * bmih.biWidth * -bmih.biHeight);
+ GetDIBits(hdc, hBmpOsb, 0, clRect.bottom, bits, (BITMAPINFO *) & bmih, DIB_RGB_COLORS);
+ greyColour = GetSysColor(COLOR_3DFACE);
+ greyRed = GetRValue(greyColour) * 2;
+ greyGreen = GetGValue(greyColour) * 2;
+ greyBlue = GetBValue(greyColour) * 2;
+ if (divide3[0] == 255) {
+ for (i = 0; i < SIZEOF(divide3); i++)
+ divide3[i] = (i + 1) / 3;
+ }
+ for (i = 4 * clRect.right * clRect.bottom - 4; i >= 0; i -= 4) {
+ bits[i] = divide3[bits[i] + greyBlue];
+ bits[i + 1] = divide3[bits[i + 1] + greyGreen];
+ bits[i + 2] = divide3[bits[i + 2] + greyRed];
+ }
+ SetDIBitsToDevice(hdc, 0, 0, clRect.right, clRect.bottom, 0, 0, 0, clRect.bottom, bits, (BITMAPINFO *) & bmih, DIB_RGB_COLORS);
+ free(bits);
+ }
+ DeleteObject(hBmpOsb);
+}
diff --git a/miranda-wine/plugins/clist/clist.h b/miranda-wine/plugins/clist/clist.h
new file mode 100644
index 0000000..4184dbe
--- /dev/null
+++ b/miranda-wine/plugins/clist/clist.h
@@ -0,0 +1,30 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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.
+*/
+void LoadContactTree(void);
+int IconFromStatusMode(const char *szProto,int status);
+HTREEITEM GetTreeItemByHContact(HANDLE hContact);
+void TrayIconUpdateWithImageList(int iImage,const char *szNewTip,char *szPreferredProto);
+void SortContacts(void);
+void ChangeContactIcon(HANDLE hContact,int iIcon,int add);
+
+#define NEWSTR_ALLOCA(A) (A==NULL)?NULL:strcpy((char*)alloca(strlen(A)+1),A)
diff --git a/miranda-wine/plugins/clist/clistmenus.c b/miranda-wine/plugins/clist/clistmenus.c
new file mode 100644
index 0000000..0480afa
--- /dev/null
+++ b/miranda-wine/plugins/clist/clistmenus.c
@@ -0,0 +1,947 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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 "commonheaders.h"
+
+#define FIRSTCUSTOMMENUITEMID 30000
+#define MENU_CUSTOMITEMMAIN 0x80000000
+#define MENU_CUSTOMITEMCONTEXT 0x40000000
+#define SEPARATORPOSITIONINTERVAL 100000
+
+struct CListMenuItem
+{
+ WORD id;
+ int iconId;
+ CLISTMENUITEM mi;
+};
+
+static int nextMenuId;
+static struct CListMenuItem *mainMenuItem, *contextMenuItem;
+static int mainItemCount, contextItemCount;
+static HIMAGELIST hImlMenuIcons;
+static HANDLE hPreBuildContactMenuEvent, hAckHook;
+static HMENU hMainMenu, hStatusMenu, hRootMenu;
+int currentStatusMenuItem, currentDesiredStatusMode;
+static int statusModeList[] =
+{
+ ID_STATUS_OFFLINE, ID_STATUS_ONLINE, ID_STATUS_AWAY, ID_STATUS_NA, ID_STATUS_OCCUPIED, ID_STATUS_DND, ID_STATUS_FREECHAT, ID_STATUS_INVISIBLE,
+ ID_STATUS_ONTHEPHONE, ID_STATUS_OUTTOLUNCH
+};
+
+static int skinIconStatusList[] =
+{
+ SKINICON_STATUS_OFFLINE, SKINICON_STATUS_ONLINE, SKINICON_STATUS_AWAY, SKINICON_STATUS_NA, SKINICON_STATUS_OCCUPIED, SKINICON_STATUS_DND,
+ SKINICON_STATUS_FREE4CHAT, SKINICON_STATUS_INVISIBLE, SKINICON_STATUS_ONTHEPHONE, SKINICON_STATUS_OUTTOLUNCH
+};
+
+static int statusModePf2List[] =
+{ 0xFFFFFFFF, PF2_ONLINE, PF2_SHORTAWAY, PF2_LONGAWAY, PF2_LIGHTDND, PF2_HEAVYDND, PF2_FREECHAT, PF2_INVISIBLE, PF2_ONTHEPHONE, PF2_OUTTOLUNCH };
+
+extern HANDLE hStatusModeChangeEvent;
+
+static TCHAR* LangPackPcharToTchar( const char* pszStr )
+{
+ if ( pszStr == NULL )
+ return NULL;
+
+ #if defined( _UNICODE )
+ { int len = strlen( pszStr );
+ TCHAR* result = ( TCHAR* )alloca(( len+1 )*sizeof( TCHAR ));
+ MultiByteToWideChar( CallService( MS_LANGPACK_GETCODEPAGE, 0, 0 ), 0, pszStr, -1, result, len );
+ result[len] = 0;
+ return wcsdup( TranslateW( result ));
+ }
+ #else
+ return _strdup( Translate( pszStr ));
+ #endif
+}
+
+static void InsertMenuItemWithSeparators(HMENU hMenu, int uItem, BOOL fByPosition, MENUITEMINFO* lpmii)
+{
+ int thisItemPosition, needSeparator;
+ MENUITEMINFO mii;
+
+ if (lpmii->fMask & MIIM_SUBMENU)
+ thisItemPosition = (int) lpmii->dwItemData;
+ else
+ thisItemPosition = mainMenuItem[lpmii->dwItemData & ~MENU_CUSTOMITEMMAIN].mi.position;
+ ZeroMemory(&mii, sizeof(mii));
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ //check for separator before
+ if (uItem) {
+ mii.fMask = MIIM_SUBMENU | MIIM_DATA | MIIM_TYPE;
+ GetMenuItemInfo(hMenu, uItem - 1, TRUE, &mii);
+ if (mii.fType == MFT_SEPARATOR)
+ needSeparator = 0;
+ else if (mii.hSubMenu == NULL && (mii.dwItemData & MENU_CUSTOMITEMMAIN) == 0)
+ needSeparator = 0;
+ else if (mii.hSubMenu == NULL)
+ needSeparator =
+ ((mainMenuItem[mii.dwItemData & ~MENU_CUSTOMITEMMAIN].mi.position) / SEPARATORPOSITIONINTERVAL) !=
+ thisItemPosition / SEPARATORPOSITIONINTERVAL;
+ else
+ needSeparator = ((int) mii.dwItemData) / SEPARATORPOSITIONINTERVAL != thisItemPosition / SEPARATORPOSITIONINTERVAL;
+ if (needSeparator) {
+ //but might be supposed to be after the next one instead
+ mii.fType = 0;
+ if (uItem < GetMenuItemCount(hMenu)) {
+ mii.fMask = MIIM_SUBMENU | MIIM_DATA | MIIM_TYPE;
+ GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
+ }
+ if (mii.fType != MFT_SEPARATOR) {
+ mii.fMask = MIIM_TYPE;
+ mii.fType = MFT_SEPARATOR;
+ InsertMenuItem(hMenu, uItem, TRUE, &mii);
+ }
+ uItem++;
+ }
+ }
+ //check for separator after
+ if (uItem < GetMenuItemCount(hMenu)) {
+ mii.fMask = MIIM_SUBMENU | MIIM_DATA | MIIM_TYPE;
+ mii.cch = 0;
+ GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
+ if (mii.fType == MFT_SEPARATOR)
+ needSeparator = 0;
+ else if (mii.hSubMenu == NULL && (mii.dwItemData & MENU_CUSTOMITEMMAIN) == 0)
+ needSeparator = 0;
+ else if (mii.hSubMenu == NULL)
+ needSeparator =
+ ((mainMenuItem[mii.dwItemData & ~MENU_CUSTOMITEMMAIN].mi.position) / SEPARATORPOSITIONINTERVAL) !=
+ thisItemPosition / SEPARATORPOSITIONINTERVAL;
+ else
+ needSeparator = ((int) mii.dwItemData) / SEPARATORPOSITIONINTERVAL != thisItemPosition / SEPARATORPOSITIONINTERVAL;
+ if (needSeparator) {
+ mii.fMask = MIIM_TYPE;
+ mii.fType = MFT_SEPARATOR;
+ InsertMenuItem(hMenu, uItem, TRUE, &mii);
+ }
+ }
+ if (uItem == GetMenuItemCount(hMenu) - 1) {
+ TCHAR str[32];
+ mii.fMask = MIIM_SUBMENU | MIIM_DATA | MIIM_TYPE;
+ mii.dwTypeData = str;
+ mii.cch = SIZEOF(str);
+ GetMenuItemInfo(hMenu, uItem, TRUE, &mii);
+ if (mii.fType == MFT_STRING && !_tcscmp(mii.dwTypeData, TranslateT("E&xit"))) {
+ //make sure we keep the separator before the exit menu item
+ mii.fMask = MIIM_TYPE;
+ mii.fType = MFT_SEPARATOR;
+ InsertMenuItem(hMenu, uItem, TRUE, &mii);
+ }
+ }
+ InsertMenuItem(hMenu, uItem, TRUE, lpmii);
+}
+
+//#define PUTPOSITIONSONMENU
+static int AddMainMenuItem(WPARAM wParam, LPARAM lParam)
+{
+ CLISTMENUITEM *mi = (CLISTMENUITEM *) lParam;
+ MENUITEMINFO mii;
+ TCHAR* ptszName;
+ int i;
+ HMENU hMenu;
+
+ if (mi==NULL || mi->cbSize != sizeof(CLISTMENUITEM))
+ return 0;
+ mainMenuItem = (struct CListMenuItem *) realloc(mainMenuItem, sizeof(struct CListMenuItem) * (mainItemCount + 1));
+ mainMenuItem[mainItemCount].id = nextMenuId++;
+ mainMenuItem[mainItemCount].mi = *mi;
+ mainMenuItem[mainItemCount].mi.pszService = strdup(mi->pszService);
+ mainMenuItem[mainItemCount].mi.pszContactOwner = NULL;
+ mainMenuItem[mainItemCount].mi.pszName = NULL;
+ if (mi->hIcon == NULL)
+ mainMenuItem[mainItemCount].iconId = -1;
+ else
+ mainMenuItem[mainItemCount].iconId = ImageList_AddIcon(hImlMenuIcons, mi->hIcon);
+ hMenu = hMainMenu;
+ ZeroMemory(&mii, sizeof(mii));
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_SUBMENU | MIIM_TYPE | MIIM_DATA;
+ if (mi->pszPopupName != NULL) {
+ TCHAR str[80];
+ TCHAR* ptszPopupName = LangPackPcharToTchar( mi->pszPopupName );
+ for (i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
+ mii.cch = SIZEOF(str);
+ mii.dwTypeData = str;
+ GetMenuItemInfo(hMenu, i, TRUE, &mii);
+#ifdef PUTPOSITIONSONMENU
+ if (mii.hSubMenu != NULL && !_tcsnicmp(str, ptszPopupName, _tcslen(ptszPopupName)))
+ break;
+#else
+ if (mii.hSubMenu != NULL && !_tcsicmp(str, ptszPopupName))
+ break;
+#endif
+ }
+ if (i < 0) {
+ mii.fMask = MIIM_SUBMENU | MIIM_DATA | MIIM_TYPE;
+ for (i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
+ mii.cch = SIZEOF(str);
+ mii.dwTypeData = str;
+ GetMenuItemInfo(hMenu, i, TRUE, &mii);
+ if (mii.fType == MFT_SEPARATOR)
+ continue;
+ if (mii.hSubMenu == NULL && (mii.dwItemData & MENU_CUSTOMITEMMAIN) == 0)
+ continue;
+ if (mii.hSubMenu == NULL) {
+ if (mainMenuItem[mii.dwItemData & ~MENU_CUSTOMITEMMAIN].mi.position <= mainMenuItem[mainItemCount].mi.popupPosition)
+ break;
+ }
+ else {
+ if ((int) mii.dwItemData <= mainMenuItem[mainItemCount].mi.popupPosition)
+ break;
+ } }
+
+ i++;
+ mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_SUBMENU;
+ mii.fType = MFT_STRING;
+ mii.dwItemData = (DWORD) mi->popupPosition;
+ mii.hSubMenu = CreatePopupMenu();
+#ifdef PUTPOSITIONSONMENU
+ {
+ TCHAR str[256];
+ mir_sntprintf(str, SIZEOF(str), "%s (%d)", ptszPopupName, mi->popupPosition);
+ mii.dwTypeData = str;
+ InsertMenuItemWithSeparators(hMenu, i, TRUE, &mii);
+ }
+#else
+ mii.dwTypeData = ptszPopupName;
+ InsertMenuItemWithSeparators(hMenu, i, TRUE, &mii);
+#endif
+ }
+ free(ptszPopupName);
+ hMenu = mii.hSubMenu;
+ }
+ mii.fMask = MIIM_SUBMENU | MIIM_DATA;
+ for (i = GetMenuItemCount(hMenu) - 1; i >= 0; i--) {
+ GetMenuItemInfo(hMenu, i, TRUE, &mii);
+ if (mii.fType == MFT_SEPARATOR)
+ continue;
+ if (mii.hSubMenu == NULL && (mii.dwItemData & MENU_CUSTOMITEMMAIN) == 0)
+ continue;
+ if (mii.hSubMenu == NULL) {
+ if (mainMenuItem[mii.dwItemData & ~MENU_CUSTOMITEMMAIN].mi.position <= mainMenuItem[mainItemCount].mi.position)
+ break;
+ }
+ else {
+ if ((int) mii.dwItemData <= mainMenuItem[mainItemCount].mi.position)
+ break;
+ }
+ }
+ i++;
+ if (!IsWinVer98Plus()) {
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_DATA | MIIM_TYPE | MIIM_ID;
+ }
+ else {
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STRING;
+ if (mainMenuItem[mainItemCount].iconId != -1)
+ mii.fMask |= MIIM_BITMAP;
+ }
+ ptszName = LangPackPcharToTchar( mi->pszName );
+
+ mii.fType = MFT_STRING;
+ mii.wID = mainMenuItem[mainItemCount].id;
+ mii.dwItemData = mainItemCount | MENU_CUSTOMITEMMAIN;
+ mii.hbmpItem = HBMMENU_CALLBACK;
+#ifdef PUTPOSITIONSONMENU
+ {
+ TCHAR str[256];
+ mir_sntprintf(str, SIZEOF(str), "%s (%d)", ptszName, mi->position);
+ mii.dwTypeData = str;
+ InsertMenuItemWithSeparators(hMenu, i, TRUE, &mii);
+ }
+#else
+ mii.dwTypeData = ptszName;
+ InsertMenuItemWithSeparators(hMenu, i, TRUE, &mii);
+#endif
+ free( ptszName );
+ mainItemCount++;
+ return MENU_CUSTOMITEMMAIN | (mainItemCount - 1);
+}
+
+static int AddContactMenuItem(WPARAM wParam, LPARAM lParam)
+{
+ CLISTMENUITEM *mi = (CLISTMENUITEM *) lParam;
+
+ if (mi==NULL || mi->cbSize != sizeof(CLISTMENUITEM))
+ return 0;
+ contextMenuItem = (struct CListMenuItem *) realloc(contextMenuItem, sizeof(struct CListMenuItem) * (contextItemCount + 1));
+ contextMenuItem[contextItemCount].id = nextMenuId++;
+ contextMenuItem[contextItemCount].mi = *mi;
+ contextMenuItem[contextItemCount].mi.pszService = strdup(mi->pszService);
+ contextMenuItem[contextItemCount].mi.ptszName = LangPackPcharToTchar(mi->pszName);
+ if (mi->pszContactOwner != NULL)
+ contextMenuItem[contextItemCount].mi.pszContactOwner = strdup(mi->pszContactOwner);
+ if (mi->hIcon == NULL)
+ contextMenuItem[contextItemCount].iconId = -1;
+ else
+ contextMenuItem[contextItemCount].iconId = ImageList_AddIcon(hImlMenuIcons, mi->hIcon);
+ contextItemCount++;
+ return MENU_CUSTOMITEMCONTEXT | (contextItemCount - 1);
+}
+
+static int ModifyCustomMenuItem(WPARAM wParam, LPARAM lParam)
+{
+ struct CListMenuItem *clmi;
+ CLISTMENUITEM *mi = (CLISTMENUITEM *) lParam;
+ MENUITEMINFO mii;
+
+ if (mi==NULL || mi->cbSize != sizeof(CLISTMENUITEM))
+ return 1;
+ if (wParam & MENU_CUSTOMITEMMAIN) {
+ if ((int) (wParam & ~MENU_CUSTOMITEMMAIN) >= mainItemCount)
+ return 1;
+ clmi = mainMenuItem + (wParam & ~MENU_CUSTOMITEMMAIN);
+ }
+ else if (wParam & MENU_CUSTOMITEMCONTEXT) {
+ if ((int) (wParam & ~MENU_CUSTOMITEMCONTEXT) >= contextItemCount)
+ return 1;
+ clmi = contextMenuItem + (wParam & ~MENU_CUSTOMITEMCONTEXT);
+ }
+ else
+ return 1;
+ ZeroMemory(&mii, sizeof(mii));
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ if (mi->flags & CMIM_NAME) {
+ if (clmi->mi.pszName != NULL)
+ free(clmi->mi.pszName);
+ clmi->mi.ptszName = LangPackPcharToTchar(mi->pszName);
+ if (wParam & MENU_CUSTOMITEMMAIN) {
+ mii.fMask = IsWinVer98Plus()? MIIM_STRING : MIIM_TYPE;
+ mii.fType = MFT_STRING;
+ mii.dwTypeData = clmi->mi.ptszName;
+ SetMenuItemInfo(hMainMenu, clmi->id, FALSE, &mii);
+ }
+ }
+ if (mi->flags & CMIM_FLAGS) {
+ clmi->mi.flags = mi->flags & ~CMIM_ALL;
+ if (wParam & MENU_CUSTOMITEMMAIN) {
+ mii.fMask = MIIM_STATE;
+ mii.fState = ((clmi->mi.flags & CMIF_GRAYED) ? MFS_GRAYED : 0) | ((clmi->mi.flags & CMIF_CHECKED) ? MFS_CHECKED : 0);
+ SetMenuItemInfo(hMainMenu, clmi->id, FALSE, &mii);
+ }
+ }
+ if (mi->flags & CMIM_ICON) {
+ clmi->mi.hIcon = mi->hIcon;
+ if (mi->hIcon != NULL)
+ clmi->iconId = ImageList_ReplaceIcon(hImlMenuIcons, clmi->iconId, mi->hIcon);
+ else
+ clmi->iconId = -1; //fixme, should remove old icon & shuffle all iconIds
+ }
+ if (mi->flags & CMIM_HOTKEY) {
+ clmi->mi.hotKey = mi->hotKey;
+ }
+ return 0;
+}
+
+int MenuProcessCommand(WPARAM wParam, LPARAM lParam)
+{
+ int i;
+ PROTOCOLDESCRIPTOR **proto;
+ int protoCount;
+
+ if (HIWORD(wParam) & MPCF_MAINMENU) {
+ int newStatus, protoIndex;
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) & protoCount, (LPARAM) & proto);
+ if (LOWORD(wParam) >= ID_STATUS_OFFLINE + SIZEOF(statusModeList)
+ && LOWORD(wParam) < ID_STATUS_OFFLINE + (protoCount + 1) * SIZEOF(statusModeList)) {
+ // one of the protocol-specific status menus
+ protoIndex = (LOWORD(wParam) - ID_STATUS_OFFLINE) / SIZEOF(statusModeList) - 1;
+ newStatus = (LOWORD(wParam) - ID_STATUS_OFFLINE) % SIZEOF(statusModeList) + ID_STATUS_OFFLINE;
+ // let the world know, this need's the translated ID_STATUS_* NOT LOWORD(wParam)
+ // which is offseted by some degree depending on protocol used
+ CallProtoService(proto[protoIndex]->szName, PS_SETSTATUS, newStatus, 0);
+ NotifyEventHooks(hStatusModeChangeEvent, newStatus, (LPARAM) proto[protoIndex]->szName);
+ }
+ switch (LOWORD(wParam)) {
+ case ID_STATUS_OFFLINE:
+ case ID_STATUS_ONLINE:
+ case ID_STATUS_AWAY:
+ case ID_STATUS_DND:
+ case ID_STATUS_NA:
+ case ID_STATUS_OCCUPIED:
+ case ID_STATUS_FREECHAT:
+ case ID_STATUS_INVISIBLE:
+ case ID_STATUS_OUTTOLUNCH:
+ case ID_STATUS_ONTHEPHONE:
+ currentDesiredStatusMode = LOWORD(wParam);
+ for (i = 0; i < protoCount; i++)
+ CallProtoService(proto[i]->szName, PS_SETSTATUS, LOWORD(wParam), 0);
+ DBWriteContactSettingWord(NULL, "CList", "Status", (WORD) currentDesiredStatusMode);
+ NotifyEventHooks(hStatusModeChangeEvent, LOWORD(wParam), 0);
+ return 1;
+ }
+ for (i = 0; i < mainItemCount; i++) {
+ if (LOWORD(wParam) == mainMenuItem[i].id) {
+ CallService(mainMenuItem[i].mi.pszService, 0, (LPARAM) NULL);
+ return 1;
+ }
+ }
+ }
+ if (HIWORD(wParam) & MPCF_CONTACTMENU) {
+ for (i = 0; i < contextItemCount; i++) {
+ if (LOWORD(wParam) == contextMenuItem[i].id) {
+ if ((HANDLE) lParam != NULL)
+ CallService(contextMenuItem[i].mi.pszService, lParam, (LPARAM) (HWND) NULL);
+ return 1;
+ }
+ }
+ }
+ return 0;
+}
+
+static int MenuProcessHotkey(WPARAM vKey, LPARAM lParam)
+{
+ int i;
+
+ if (lParam & MPCF_MAINMENU) {
+ if (vKey >= '0' && vKey <= '9' && GetKeyState(VK_CONTROL) & 0x8000 && !(GetKeyState(VK_MENU) & 0x8000) && !(GetKeyState(VK_SHIFT) & 0x8000)) {
+ MenuProcessCommand(MAKEWPARAM(statusModeList[vKey - '0'], MPCF_MAINMENU), 0);
+ return 1;
+ }
+ for (i = 0; i < mainItemCount; i++) {
+ if (mainMenuItem[i].mi.hotKey == 0)
+ continue;
+ if (HIWORD(mainMenuItem[i].mi.hotKey) != vKey)
+ continue;
+ if (!(LOWORD(mainMenuItem[i].mi.hotKey) & MOD_ALT) != !(GetKeyState(VK_MENU) & 0x8000))
+ continue;
+ if (!(LOWORD(mainMenuItem[i].mi.hotKey) & MOD_CONTROL) != !(GetKeyState(VK_CONTROL) & 0x8000))
+ continue;
+ if (!(LOWORD(mainMenuItem[i].mi.hotKey) & MOD_SHIFT) != !(GetKeyState(VK_SHIFT) & 0x8000))
+ continue;
+ CallService(mainMenuItem[i].mi.pszService, 0, (LPARAM) NULL);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+//straight subtraction is not possible because I was getting overflows
+static int MenuSortProc(int *item1, int *item2)
+{
+ if (contextMenuItem[*item2].mi.position > contextMenuItem[*item1].mi.position)
+ return 1;
+ if (contextMenuItem[*item2].mi.position < contextMenuItem[*item1].mi.position)
+ return -1;
+ return 0;
+}
+
+static int BuildContactMenu(WPARAM wParam, LPARAM lParam)
+{
+ HMENU hMenu;
+ MENUITEMINFO mii;
+ int i;
+ int *itemOrder, itemCount;
+ int isOnline, isOnList;
+ HANDLE hContact = (HANDLE) wParam;
+ int prevPosition;
+ int chatRoom;
+ DWORD miim_bitmap_verSpecific;
+ char *szProto;
+
+ NotifyEventHooks(hPreBuildContactMenuEvent, (WPARAM) hContact, 0);
+
+ szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM) hContact, 0);
+ isOnList = 0 == DBGetContactSettingByte(hContact, "CList", "NotOnList", 0);
+ isOnline = szProto != NULL && ID_STATUS_OFFLINE != DBGetContactSettingWord(hContact, szProto, "Status", ID_STATUS_OFFLINE);
+ chatRoom = szProto?DBGetContactSettingByte(hContact, szProto, "ChatRoom", 0):0;
+ if ( contextItemCount ) {
+ itemOrder = (int *) malloc(sizeof(int) * contextItemCount);
+ ZeroMemory(itemOrder, sizeof(int) * contextItemCount);
+ } else {
+ itemOrder = (int *) malloc(sizeof(int) * 1);
+ ZeroMemory(itemOrder, sizeof(int) * 1);
+ }
+ itemCount = 0;
+ for (i = 0; i < contextItemCount; i++) {
+ if (contextMenuItem[i].id == 0)
+ continue;
+ if (szProto == NULL)
+ continue;
+ // Begin Ugly hack to hide chat room menus
+ if (chatRoom) {
+ if (!strcmp(contextMenuItem[i].mi.pszName,Translate("&Message")))
+ continue;
+ if (!strcmp(contextMenuItem[i].mi.pszName,Translate("&File")))
+ continue;
+ if (!strcmp(contextMenuItem[i].mi.pszName,Translate("User &Details")))
+ continue;
+ if (!strcmp(contextMenuItem[i].mi.pszName,Translate("View &History")))
+ continue;
+ }
+ // End ugly hack
+ if (contextMenuItem[i].mi.pszContactOwner != NULL) {
+ if (strcmp(contextMenuItem[i].mi.pszContactOwner, szProto))
+ continue;
+ }
+ if (contextMenuItem[i].mi.flags & CMIF_HIDDEN)
+ continue;
+ if (contextMenuItem[i].mi.flags & CMIF_NOTONLIST && isOnList)
+ continue;
+ if (contextMenuItem[i].mi.flags & CMIF_NOTOFFLIST && !isOnList)
+ continue;
+ if (contextMenuItem[i].mi.flags & CMIF_NOTONLINE && isOnline)
+ continue;
+ if (contextMenuItem[i].mi.flags & CMIF_NOTOFFLINE && !isOnline)
+ continue;
+ itemOrder[itemCount] = i;
+ itemCount++;
+ }
+ //sorts in reverse order since it's easiest to add items bottom to top
+ qsort(itemOrder, itemCount, sizeof(int), (int (*)(const void *, const void *)) MenuSortProc);
+ hMenu = CreatePopupMenu();
+ ZeroMemory(&mii, sizeof(mii));
+ if (!IsWinVer98Plus()) {
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STATE | MIIM_TYPE;
+ miim_bitmap_verSpecific = 0;
+ }
+ else {
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_DATA | MIIM_ID | MIIM_STATE | MIIM_STRING;
+ miim_bitmap_verSpecific = MIIM_BITMAP;
+ }
+ mii.fType = MFT_STRING;
+ mii.hbmpItem = HBMMENU_CALLBACK;
+ prevPosition = contextMenuItem[itemOrder[0]].mi.position;
+ for (i = 0; i < itemCount; i++) {
+ if (prevPosition / SEPARATORPOSITIONINTERVAL != contextMenuItem[itemOrder[i]].mi.position / SEPARATORPOSITIONINTERVAL) {
+ UINT oldMask = mii.fMask;
+ mii.fMask = MIIM_TYPE;
+ mii.fType = MFT_SEPARATOR;
+ InsertMenuItem(hMenu, 0, TRUE, &mii);
+ mii.fMask = oldMask;
+ mii.fType = MFT_STRING;
+ }
+ prevPosition = contextMenuItem[itemOrder[i]].mi.position;
+ if (contextMenuItem[itemOrder[i]].iconId == -1)
+ mii.fMask &= ~miim_bitmap_verSpecific;
+ else
+ mii.fMask |= miim_bitmap_verSpecific;
+ mii.dwItemData = itemOrder[i] | MENU_CUSTOMITEMCONTEXT;
+ mii.fState =
+ ((contextMenuItem[itemOrder[i]].mi.flags & CMIF_GRAYED) ? MFS_GRAYED : MFS_ENABLED) | ((contextMenuItem[itemOrder[i]].mi.
+ flags & CMIF_CHECKED) ? MFS_CHECKED :
+ MFS_UNCHECKED);
+ mii.wID = contextMenuItem[itemOrder[i]].id;
+ mii.dwTypeData = contextMenuItem[itemOrder[i]].mi.ptszName;
+#ifdef _DEBUG
+ if (GetKeyState(VK_CONTROL) & 0x8000) {
+ TCHAR str[256];
+ wsprintf(str, _T("%s (%d)"), contextMenuItem[itemOrder[i]].mi.pszName, contextMenuItem[itemOrder[i]].mi.position);
+ mii.dwTypeData = str;
+ InsertMenuItem(hMenu, 0, TRUE, &mii);
+ }
+ else InsertMenuItem(hMenu, 0, TRUE, &mii);
+#else
+ InsertMenuItem(hMenu, 0, TRUE, &mii);
+#endif
+ }
+ free(itemOrder);
+ return (int) hMenu;
+}
+
+static int MenuIconsChanged(WPARAM wParam, LPARAM lParam)
+{
+ int i, protoCount, networkProtoCount, j;
+ PROTOCOLDESCRIPTOR **proto;
+ DWORD flags;
+ MENUITEMINFO mii;
+
+ ZeroMemory(&mii, sizeof(mii));
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_DATA;
+
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) & protoCount, (LPARAM) & proto);
+ networkProtoCount = 0;
+ for (i = 0; i < protoCount; i++)
+ if (proto[i]->type == PROTOTYPE_PROTOCOL)
+ networkProtoCount++;
+ if (networkProtoCount > 1) {
+ for (i = 0; i < protoCount; i++) {
+ if (proto[i]->type != PROTOTYPE_PROTOCOL)
+ continue;
+ flags = CallProtoService(proto[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0);
+ for (j = 0; j < SIZEOF(statusModeList); j++) {
+ if (!(flags & statusModePf2List[j]))
+ continue;
+ if (!GetMenuItemInfo(hStatusMenu, (i + 1) * SIZEOF(statusModeList) + statusModeList[j], FALSE, &mii))
+ continue;
+ if ((mii.dwItemData & MENU_CUSTOMITEMMAIN) != MENU_CUSTOMITEMMAIN)
+ continue;
+ ImageList_ReplaceIcon(hImlMenuIcons, mainMenuItem[mii.dwItemData & ~MENU_CUSTOMITEMMAIN].iconId,
+ LoadSkinnedProtoIcon(proto[i]->szName, statusModeList[j]));
+ } } }
+
+ for (i = 0; i < SIZEOF(statusModeList); i++) {
+ if (!GetMenuItemInfo(hStatusMenu, statusModeList[i], FALSE, &mii))
+ continue;
+ if ((mii.dwItemData & MENU_CUSTOMITEMMAIN) != MENU_CUSTOMITEMMAIN)
+ continue;
+ ImageList_ReplaceIcon(hImlMenuIcons, mainMenuItem[mii.dwItemData & ~MENU_CUSTOMITEMMAIN].iconId,
+ LoadSkinnedProtoIcon(NULL, statusModeList[i]));
+ }
+ return 0;
+}
+
+static void GiveExistingItemAnIcon(UINT id, HICON hIcon)
+{
+ MENUITEMINFO mii;
+
+ mainMenuItem = (struct CListMenuItem *) realloc(mainMenuItem, sizeof(struct CListMenuItem) * (mainItemCount + 1));
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_BITMAP | MIIM_DATA;
+ mii.dwItemData = MENU_CUSTOMITEMMAIN | mainItemCount;
+ mii.hbmpItem = HBMMENU_CALLBACK;
+ mainMenuItem[mainItemCount].iconId = ImageList_AddIcon(hImlMenuIcons, hIcon);
+ mainMenuItem[mainItemCount].id = 0xFFFF;
+ mainMenuItem[mainItemCount].mi.hotKey = 0;
+ mainMenuItem[mainItemCount].mi.pszName = NULL;
+ mainMenuItem[mainItemCount].mi.pszService = NULL;
+ SetMenuItemInfo(hStatusMenu, id, FALSE, &mii);
+ mainItemCount++;
+}
+
+static int MeasureMenuItem(WPARAM wParam, LPARAM lParam)
+{
+ struct CListMenuItem *clmi = NULL;
+ LPMEASUREITEMSTRUCT mis = (LPMEASUREITEMSTRUCT) lParam;
+ if (mis->itemData & MENU_CUSTOMITEMCONTEXT)
+ clmi = &contextMenuItem[mis->itemData & ~MENU_CUSTOMITEMCONTEXT];
+ else if (mis->itemData & MENU_CUSTOMITEMMAIN)
+ clmi = &mainMenuItem[mis->itemData & ~MENU_CUSTOMITEMMAIN];
+ if (clmi == NULL)
+ return FALSE;
+ if (clmi->iconId == -1)
+ return FALSE;
+
+ mis->itemWidth = max(0, GetSystemMetrics(SM_CXSMICON) - GetSystemMetrics(SM_CXMENUCHECK) + 4);
+ mis->itemHeight = GetSystemMetrics(SM_CYSMICON) + 2;
+ return TRUE;
+}
+
+static int DrawMenuItem(WPARAM wParam, LPARAM lParam)
+{
+ struct CListMenuItem *clmi = NULL;
+ int y;
+ LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT) lParam;
+
+ if (dis->itemData & MENU_CUSTOMITEMCONTEXT)
+ clmi = &contextMenuItem[dis->itemData & ~MENU_CUSTOMITEMCONTEXT];
+ else if (dis->itemData & MENU_CUSTOMITEMMAIN)
+ clmi = &mainMenuItem[dis->itemData & ~MENU_CUSTOMITEMMAIN];
+ if (clmi == NULL)
+ return FALSE;
+ if (clmi->iconId == -1)
+ return FALSE;
+
+ y = (dis->rcItem.bottom - dis->rcItem.top - GetSystemMetrics(SM_CYSMICON)) / 2 + 1;
+ if (dis->itemState & ODS_SELECTED) {
+ if (dis->itemState & ODS_CHECKED) {
+ RECT rc;
+ rc.left = 2;
+ rc.right = GetSystemMetrics(SM_CXSMICON) + 2;
+ rc.top = y;
+ rc.bottom = rc.top + GetSystemMetrics(SM_CYSMICON) + 2;
+ FillRect(dis->hDC, &rc, GetSysColorBrush(COLOR_HIGHLIGHT));
+ ImageList_DrawEx(hImlMenuIcons, clmi->iconId, dis->hDC, 2, y, 0, 0, CLR_NONE, CLR_DEFAULT, ILD_SELECTED);
+ }
+ else
+ ImageList_DrawEx(hImlMenuIcons, clmi->iconId, dis->hDC, 2, y, 0, 0, CLR_NONE, CLR_DEFAULT, ILD_FOCUS);
+ }
+ else {
+ if (dis->itemState & ODS_CHECKED) {
+ HBRUSH hBrush;
+ RECT rc;
+ COLORREF menuCol, hiliteCol;
+ rc.left = 0;
+ rc.right = GetSystemMetrics(SM_CXSMICON) + 4;
+ rc.top = y - 2;
+ rc.bottom = rc.top + GetSystemMetrics(SM_CYSMICON) + 4;
+ DrawEdge(dis->hDC, &rc, BDR_SUNKENOUTER, BF_RECT);
+ InflateRect(&rc, -1, -1);
+ menuCol = GetSysColor(COLOR_MENU);
+ hiliteCol = GetSysColor(COLOR_3DHIGHLIGHT);
+ hBrush =
+ CreateSolidBrush(RGB
+ ((GetRValue(menuCol) + GetRValue(hiliteCol)) / 2, (GetGValue(menuCol) + GetGValue(hiliteCol)) / 2,
+ (GetBValue(menuCol) + GetBValue(hiliteCol)) / 2));
+ FillRect(dis->hDC, &rc, hBrush);
+ DeleteObject(hBrush);
+ ImageList_DrawEx(hImlMenuIcons, clmi->iconId, dis->hDC, 2, y, 0, 0, CLR_NONE, GetSysColor(COLOR_MENU), ILD_BLEND25);
+ }
+ else ImageList_DrawEx(hImlMenuIcons, clmi->iconId, dis->hDC, 2, y, 0, 0, CLR_NONE, CLR_NONE, ILD_NORMAL);
+ }
+ return TRUE;
+}
+
+static int MenuGetMain(WPARAM wParam, LPARAM lParam)
+{
+ return (int) hMainMenu;
+}
+
+static int MenuGetStatus(WPARAM wParam, LPARAM lParam)
+{
+ return (int) hStatusMenu;
+}
+
+static int MenuModulesLoaded(WPARAM wParam, LPARAM lParam)
+{
+ int i, protoCount, networkProtoCount;
+ char *szProto = NULL;
+ char *szLastProto = NULL;
+ PROTOCOLDESCRIPTOR **proto;
+ DWORD statusFlags = 0, flags, moreflags = 0;
+
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) & protoCount, (LPARAM) & proto);
+ networkProtoCount = 0;
+ for (i = 0; i < protoCount; i++) /* look for valid protocols */
+ if (proto[i]->type == PROTOTYPE_PROTOCOL && CallProtoService(proto[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0) != 0) {
+ networkProtoCount++;
+ szLastProto = proto[i]->szName; /* remember the protocol name, since it maybe the last */
+ } //if
+
+ if (IsWinVer98Plus()) {
+ /* if a single network protocol is used, load the iconset for the global menu by name */
+ if (networkProtoCount == 1)
+ szProto = szLastProto;
+ for (i = 0; i < SIZEOF(statusModeList); i++) {
+ GiveExistingItemAnIcon(statusModeList[i], LoadSkinnedProtoIcon(szProto, statusModeList[i]));
+ }
+ HookEvent(ME_SKIN_ICONSCHANGED, MenuIconsChanged);
+ }
+
+ if (networkProtoCount > 1) {
+ MENUITEMINFO mii;
+ ZeroMemory(&mii, sizeof(mii));
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_TYPE;
+ mii.fType = MFT_SEPARATOR;
+ mii.dwTypeData = _T("");
+ InsertMenuItem(hStatusMenu, 0, TRUE, &mii);
+ }
+ for (i = 0; i < protoCount; i++) {
+ if (proto[i]->type != PROTOTYPE_PROTOCOL || CallProtoService(proto[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ continue;
+ flags = CallProtoService(proto[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0);
+ moreflags = CallProtoService(proto[i]->szName, PS_GETCAPS, PFLAGNUM_5, 0);
+ if (networkProtoCount > 1) {
+ MENUITEMINFO mii;
+ char protoName[128];
+ int j;
+ HMENU hMenu = GetSubMenu(LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CLISTMENU)), 1);
+ ZeroMemory(&mii, sizeof(mii));
+ for (j = 0; j < SIZEOF(statusModeList); j++) {
+ if (!(flags & statusModePf2List[j]))
+ DeleteMenu(hMenu, statusModeList[j], MF_BYCOMMAND);
+ else if (moreflags & statusModePf2List[j] && j > 0)
+ DeleteMenu(hMenu, statusModeList[j], MF_BYCOMMAND);
+ else {
+ TCHAR text[128], *ptab;
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_TYPE;
+ mii.cch = SIZEOF(text);
+ mii.dwTypeData = text;
+ GetMenuItemInfo(hMenu, statusModeList[j], FALSE, &mii);
+ _tcscpy(text, TranslateTS(text));
+ ptab = _tcschr(text, '\t');
+ if (ptab != NULL)
+ *ptab = '\0';
+ if (IsWinVer98Plus()) {
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_ID | MIIM_BITMAP | MIIM_DATA | MIIM_STRING;
+ mainMenuItem = (struct CListMenuItem *)realloc(mainMenuItem, sizeof(struct CListMenuItem) * (mainItemCount + 1));
+ mainMenuItem[mainItemCount].iconId =
+ ImageList_AddIcon(hImlMenuIcons, LoadSkinnedProtoIcon(proto[i]->szName, statusModeList[j]));
+ mainMenuItem[mainItemCount].id = 0xFFFF;
+ mainMenuItem[mainItemCount].mi.hotKey = 0;
+ mainMenuItem[mainItemCount].mi.pszName = NULL;
+ mainMenuItem[mainItemCount].mi.pszService = NULL;
+ mii.dwItemData = MENU_CUSTOMITEMMAIN | mainItemCount;
+ mii.hbmpItem = HBMMENU_CALLBACK;
+ mainItemCount++;
+ }
+ else
+ mii.fMask = MIIM_ID | MIIM_TYPE;
+ mii.wID = statusModeList[j] + (i + 1) * SIZEOF(statusModeList);
+ SetMenuItemInfo(hMenu, statusModeList[j], FALSE, &mii);
+ }
+ }
+ if (IsWinVer98Plus()) {
+ HICON hIcon;
+ mii.cbSize = sizeof(mii);
+ mii.fMask = MIIM_SUBMENU | MIIM_BITMAP | MIIM_DATA | MIIM_STRING;
+ mainMenuItem = (struct CListMenuItem *) realloc(mainMenuItem, sizeof(struct CListMenuItem) * (mainItemCount + 1));
+ hIcon = (HICON) CallProtoService(proto[i]->szName, PS_LOADICON, PLI_PROTOCOL | PLIF_SMALL, 0);
+ mainMenuItem[mainItemCount].iconId = ImageList_AddIcon(hImlMenuIcons, hIcon);
+ DestroyIcon(hIcon);
+ mainMenuItem[mainItemCount].id = 0xFFFF;
+ mainMenuItem[mainItemCount].mi.hotKey = 0;
+ mainMenuItem[mainItemCount].mi.pszName = NULL;
+ mainMenuItem[mainItemCount].mi.pszService = NULL;
+ mii.dwItemData = MENU_CUSTOMITEMMAIN | mainItemCount;
+ mii.hbmpItem = HBMMENU_CALLBACK;
+ mainItemCount++;
+ }
+ else {
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_SUBMENU | MIIM_TYPE;
+ }
+ mii.fType = MFT_STRING;
+ mii.hSubMenu = hMenu;
+ CallProtoService(proto[i]->szName, PS_GETNAME, SIZEOF(protoName), (LPARAM) protoName);
+ { TCHAR* ptszProtoName = LangPackPcharToTchar(protoName);
+ mii.dwTypeData = ptszProtoName;
+ InsertMenuItem(hStatusMenu, 0, TRUE, &mii);
+ free(ptszProtoName);
+ } }
+ statusFlags |= ( flags & ~moreflags );
+ }
+ for (i = 0; i < SIZEOF(statusModeList); i++)
+ if (!(statusFlags & statusModePf2List[i]))
+ DeleteMenu(hStatusMenu, statusModeList[i], MF_BYCOMMAND);
+ return 0;
+}
+
+static int MenuProtoAck(WPARAM wParam, LPARAM lParam)
+{
+ int protoCount, i, networkProtoCount;
+ PROTOCOLDESCRIPTOR **proto;
+ ACKDATA *ack = (ACKDATA *) lParam;
+ int overallStatus = 0, thisStatus;
+
+ if (ack->type != ACKTYPE_STATUS)
+ return 0;
+ if (ack->result != ACKRESULT_SUCCESS)
+ return 0;
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) & protoCount, (LPARAM) & proto);
+ networkProtoCount = 0;
+ for (i = 0; i < protoCount; i++)
+ if (proto[i]->type == PROTOTYPE_PROTOCOL) {
+ thisStatus = CallProtoService(proto[i]->szName, PS_GETSTATUS, 0, 0);
+ if (overallStatus == 0)
+ overallStatus = thisStatus;
+ else if (overallStatus != thisStatus)
+ overallStatus = -1;
+ networkProtoCount++;
+ }
+ if (overallStatus > ID_STATUS_CONNECTING) {
+ CheckMenuItem(hStatusMenu, currentStatusMenuItem, MF_BYCOMMAND | MF_UNCHECKED);
+ currentStatusMenuItem = overallStatus;
+ CheckMenuItem(hStatusMenu, currentStatusMenuItem, MF_BYCOMMAND | MF_CHECKED);
+ SetMenuDefaultItem(hStatusMenu, currentStatusMenuItem, FALSE);
+ currentDesiredStatusMode = currentStatusMenuItem;
+ }
+ else {
+ CheckMenuItem(hStatusMenu, currentStatusMenuItem, MF_BYCOMMAND | MF_UNCHECKED);
+ SetMenuDefaultItem(hStatusMenu, -1, FALSE);
+ currentStatusMenuItem = 0;
+ }
+ if (networkProtoCount <= 1)
+ return 0;
+ for (i = 0; i < protoCount; i++)
+ if (!strcmp(proto[i]->szName, ack->szModule))
+ break;
+ //hProcess is previous mode, lParam is new mode
+ if ((int) ack->hProcess >= ID_STATUS_OFFLINE && (int) ack->hProcess < ID_STATUS_OFFLINE + SIZEOF(statusModeList))
+ CheckMenuItem(hStatusMenu, (i + 1) * SIZEOF(statusModeList) + (int) ack->hProcess, MF_BYCOMMAND | MF_UNCHECKED);
+ if (ack->lParam >= ID_STATUS_OFFLINE && ack->lParam < ID_STATUS_OFFLINE + SIZEOF(statusModeList))
+ CheckMenuItem(hStatusMenu, (i + 1) * SIZEOF(statusModeList) + ack->lParam, MF_BYCOMMAND | MF_CHECKED);
+ return 0;
+}
+
+static int MenuModulesShutdown(WPARAM wParam, LPARAM lParam)
+{
+ UnhookEvent(hAckHook);
+ return 0;
+}
+
+int InitCustomMenus(void)
+{
+ CreateServiceFunction(MS_CLIST_ADDMAINMENUITEM, AddMainMenuItem);
+ CreateServiceFunction(MS_CLIST_ADDCONTACTMENUITEM, AddContactMenuItem);
+ CreateServiceFunction(MS_CLIST_MODIFYMENUITEM, ModifyCustomMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUMEASUREITEM, MeasureMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUDRAWITEM, DrawMenuItem);
+ CreateServiceFunction(MS_CLIST_MENUBUILDCONTACT, BuildContactMenu);
+ CreateServiceFunction(MS_CLIST_MENUGETMAIN, MenuGetMain);
+ CreateServiceFunction(MS_CLIST_MENUGETSTATUS, MenuGetStatus);
+ CreateServiceFunction(MS_CLIST_MENUPROCESSCOMMAND, MenuProcessCommand);
+ CreateServiceFunction(MS_CLIST_MENUPROCESSHOTKEY, MenuProcessHotkey);
+ hPreBuildContactMenuEvent = CreateHookableEvent(ME_CLIST_PREBUILDCONTACTMENU);
+ hAckHook = (HANDLE) HookEvent(ME_PROTO_ACK, MenuProtoAck);
+ hRootMenu = LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_CLISTMENU));
+ hMainMenu = GetSubMenu(hRootMenu, 0);
+ hStatusMenu = GetSubMenu(hRootMenu, 1);
+ CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hMainMenu, 0);
+ CallService(MS_LANGPACK_TRANSLATEMENU, (WPARAM) hStatusMenu, 0);
+ nextMenuId = FIRSTCUSTOMMENUITEMID;
+ mainMenuItem = contextMenuItem = NULL;
+ mainItemCount = contextItemCount = 0;
+ if (IsWinVerXPPlus()) //need 32-bit icons on XP for alpha channels
+ hImlMenuIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR32 | ILC_MASK, 15, 100);
+ else //Win2k won't blend icons with imagelist_drawex when color-depth>16-bit. Don't know about WinME, but it certainly doesn't support alpha channels
+ hImlMenuIcons = ImageList_Create(GetSystemMetrics(SM_CXSMICON), GetSystemMetrics(SM_CYSMICON), ILC_COLOR16 | ILC_MASK, 15, 100);
+
+ currentStatusMenuItem = ID_STATUS_OFFLINE;
+ currentDesiredStatusMode = ID_STATUS_OFFLINE;
+ {
+ MENUITEMINFO mii;
+ mii.cbSize = MENUITEMINFO_V4_SIZE;
+ mii.fMask = MIIM_STATE;
+ mii.fState = MFS_CHECKED | MFS_DEFAULT;
+ SetMenuItemInfo(hStatusMenu, currentStatusMenuItem, FALSE, &mii);
+ }
+
+ HookEvent(ME_SYSTEM_MODULESLOADED, MenuModulesLoaded);
+ HookEvent(ME_SYSTEM_SHUTDOWN, MenuModulesShutdown);
+ return 0;
+}
+
+void UninitCustomMenus(void)
+{
+ int i;
+
+ ImageList_Destroy(hImlMenuIcons);
+ for (i = 0; i < mainItemCount; i++) {
+ if (mainMenuItem[i].mi.pszName != NULL)
+ free(mainMenuItem[i].mi.pszName);
+ if (mainMenuItem[i].mi.pszService != NULL)
+ free(mainMenuItem[i].mi.pszService);
+ }
+ for (i = 0; i < contextItemCount; i++) {
+ if (contextMenuItem[i].mi.pszName != NULL)
+ free(contextMenuItem[i].mi.pszName);
+ if (contextMenuItem[i].mi.pszService != NULL)
+ free(contextMenuItem[i].mi.pszService);
+ if (contextMenuItem[i].mi.pszContactOwner != NULL)
+ free(contextMenuItem[i].mi.pszContactOwner);
+ }
+ free(mainMenuItem);
+ free(contextMenuItem);
+ DestroyMenu(hStatusMenu);
+ DestroyMenu(hMainMenu);
+ DestroyMenu(hRootMenu);
+}
diff --git a/miranda-wine/plugins/clist/clistopts.c b/miranda-wine/plugins/clist/clistopts.c
new file mode 100644
index 0000000..7db1efa
--- /dev/null
+++ b/miranda-wine/plugins/clist/clistopts.c
@@ -0,0 +1,353 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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 "commonheaders.h"
+
+static BOOL CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+ case WM_USER + 1:
+ {
+ HANDLE hContact = (HANDLE) wParam;
+ DBCONTACTWRITESETTING *ws = (DBCONTACTWRITESETTING *) lParam;
+ if (hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL
+ && lstrcmpiA(ws->szModule, "CList") == 0 && lstrcmpiA(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg)) {
+ CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, ws->value.bVal == 0);
+ }
+ break;
+ }
+ case WM_DESTROY:
+ {
+ UnhookEvent((HANDLE) GetWindowLong(hwndDlg, GWL_USERDATA));
+ break;
+ }
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ SetWindowLong(hwndDlg, GWL_USERDATA, (LONG) HookEventMessage(ME_DB_CONTACT_SETTINGCHANGED, hwndDlg, WM_USER + 1));
+ CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEOFFLINE,
+ DBGetContactSettingByte(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_HIDEEMPTYGROUPS,
+ DBGetContactSettingByte(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS,
+ DBGetContactSettingByte(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_SORTBYNAME, !DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT)
+ && !DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SORTBYSTATUS,
+ DBGetContactSettingByte(NULL, "CList", "SortByStatus", SETTING_SORTBYSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SORTBYPROTO,
+ DBGetContactSettingByte(NULL, "CList", "SortByProto", SETTING_SORTBYPROTO_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CONFIRMDELETE,
+ DBGetContactSettingByte(NULL, "CList", "ConfirmDelete", SETTING_CONFIRMDELETE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOHIDE,
+ DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ {
+ DWORD caps = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS1, 0);
+ if (!(caps & CLUIF_HIDEEMPTYGROUPS))
+ ShowWindow(GetDlgItem(hwndDlg, IDC_HIDEEMPTYGROUPS), SW_HIDE);
+ if (!(caps & CLUIF_DISABLEGROUPS))
+ ShowWindow(GetDlgItem(hwndDlg, IDC_DISABLEGROUPS), SW_HIDE);
+ if (caps & CLUIF_HASONTOPOPTION)
+ ShowWindow(GetDlgItem(hwndDlg, IDC_ONTOP), SW_HIDE);
+ if (caps & CLUIF_HASAUTOHIDEOPTION) {
+ ShowWindow(GetDlgItem(hwndDlg, IDC_AUTOHIDE), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), SW_HIDE);
+ ShowWindow(GetDlgItem(hwndDlg, IDC_STAUTOHIDESECS), SW_HIDE);
+ }
+ }
+ SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1));
+ SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0,
+ MAKELONG(DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0));
+ CheckDlgButton(hwndDlg, IDC_ONECLK,
+ DBGetContactSettingByte(NULL, "CList", "Tray1Click", SETTING_TRAY1CLICK_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSSTATUS,
+ DBGetContactSettingByte(NULL, "CList", "AlwaysStatus", SETTING_ALWAYSSTATUS_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ALWAYSMULTI,
+ !DBGetContactSettingByte(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DONTCYCLE,
+ DBGetContactSettingByte(NULL, "CList", "TrayIcon",
+ SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_SINGLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CYCLE,
+ DBGetContactSettingByte(NULL, "CList", "TrayIcon",
+ SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_CYCLE ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MULTITRAY,
+ DBGetContactSettingByte(NULL, "CList", "TrayIcon",
+ SETTING_TRAYICON_DEFAULT) == SETTING_TRAYICON_MULTI ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DISABLEBLINK,
+ DBGetContactSettingByte(NULL, "CList", "DisableTrayFlash", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKTIME), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKSPIN), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STMSDELAY), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ CheckDlgButton(hwndDlg, IDC_ICONBLINK, DBGetContactSettingByte(NULL, "CList", "NoIconBlink", 0) == 1 ? BST_CHECKED : BST_UNCHECKED);
+ if (IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), FALSE);
+ }
+ if (IsDlgButtonChecked(hwndDlg, IDC_CYCLE)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), FALSE);
+ }
+ if (IsDlgButtonChecked(hwndDlg, IDC_MULTITRAY)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), FALSE);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETRANGE, 0, MAKELONG(120, 1));
+ SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_SETPOS, 0,
+ MAKELONG(DBGetContactSettingWord(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT), 0));
+ {
+ int i, count, item;
+ PROTOCOLDESCRIPTOR **protos;
+ char szName[64];
+ DBVARIANT dbv = { DBVT_DELETED };
+ DBGetContactSetting(NULL, "CList", "PrimaryStatus", &dbv);
+ CallService(MS_PROTO_ENUMPROTOCOLS, (WPARAM) & count, (LPARAM) & protos);
+ item = SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) TranslateT("Global"));
+ SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) 0);
+ for (i = 0; i < count; i++) {
+ if (protos[i]->type != PROTOTYPE_PROTOCOL || CallProtoService(protos[i]->szName, PS_GETCAPS, PFLAGNUM_2, 0) == 0)
+ continue;
+ CallProtoService(protos[i]->szName, PS_GETNAME, SIZEOF(szName), (LPARAM) szName);
+ item = SendDlgItemMessageA(hwndDlg, IDC_PRIMARYSTATUS, CB_ADDSTRING, 0, (LPARAM) szName);
+ SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETITEMDATA, item, (LPARAM) protos[i]);
+ if (dbv.type == DBVT_ASCIIZ && !lstrcmpA(dbv.pszVal, protos[i]->szName))
+ SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, item, 0);
+ }
+ DBFreeVariant(&dbv);
+ }
+ if (-1 == (int) SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0))
+ SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_SETCURSEL, 0, 0);
+ SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETBUDDY, (WPARAM) GetDlgItem(hwndDlg, IDC_BLINKTIME), 0); // set buddy
+ SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETRANGE, 0, MAKELONG(0x3FFF, 250));
+ SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_SETPOS, 0, MAKELONG(DBGetContactSettingWord(NULL, "CList", "IconFlashTime", 550), 0));
+ return TRUE;
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_AUTOHIDE) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ }
+ if (LOWORD(wParam) == IDC_DONTCYCLE || LOWORD(wParam) == IDC_CYCLE || LOWORD(wParam) == IDC_MULTITRAY) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_PRIMARYSTATUS), IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIME), IsDlgButtonChecked(hwndDlg, IDC_CYCLE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_CYCLETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_CYCLE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ALWAYSMULTI), IsDlgButtonChecked(hwndDlg, IDC_MULTITRAY));
+ }
+ if (LOWORD(wParam) == IDC_DISABLEBLINK) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKTIME), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_BLINKSPIN), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STMSDELAY), !IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ }
+ if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_CYCLETIME) && HIWORD(wParam) != EN_CHANGE)
+ break;
+ if (LOWORD(wParam) == IDC_PRIMARYSTATUS && HIWORD(wParam) != CBN_SELCHANGE)
+ break;
+ if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_CYCLETIME) && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()))
+ return 0;
+ if (LOWORD(wParam) == IDC_BLINKTIME && HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus())
+ return 0; // dont make apply enabled during buddy set crap
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->idFrom) {
+ case 0:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY:
+ DBWriteContactSettingByte(NULL, "CList", "HideOffline", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_HIDEOFFLINE));
+ {
+ DWORD caps = CallService(MS_CLUI_GETCAPS, CLUICAPS_FLAGS1, 0);
+ if (caps & CLUIF_HIDEEMPTYGROUPS)
+ DBWriteContactSettingByte(NULL, "CList", "HideEmptyGroups",
+ (BYTE) IsDlgButtonChecked(hwndDlg, IDC_HIDEEMPTYGROUPS));
+ if (caps & CLUIF_DISABLEGROUPS)
+ DBWriteContactSettingByte(NULL, "CList", "UseGroups", (BYTE) ! IsDlgButtonChecked(hwndDlg, IDC_DISABLEGROUPS));
+ if (!(caps & CLUIF_HASONTOPOPTION)) {
+ DBWriteContactSettingByte(NULL, "CList", "OnTop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ SetWindowPos((HWND) CallService(MS_CLUI_GETHWND, 0, 0),
+ IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE);
+ }
+ if (!(caps & CLUIF_HASAUTOHIDEOPTION)) {
+ DBWriteContactSettingByte(NULL, "CList", "AutoHide", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ DBWriteContactSettingWord(NULL, "CList", "HideTime",
+ (WORD) SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
+ }
+ }
+ DBWriteContactSettingByte(NULL, "CList", "SortByStatus", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SORTBYSTATUS));
+ DBWriteContactSettingByte(NULL, "CList", "SortByProto", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SORTBYPROTO));
+ DBWriteContactSettingByte(NULL, "CList", "ConfirmDelete", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CONFIRMDELETE));
+ DBWriteContactSettingByte(NULL, "CList", "Tray1Click", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONECLK));
+ DBWriteContactSettingByte(NULL, "CList", "AlwaysStatus", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ALWAYSSTATUS));
+ DBWriteContactSettingByte(NULL, "CList", "AlwaysMulti", (BYTE) ! IsDlgButtonChecked(hwndDlg, IDC_ALWAYSMULTI));
+ DBWriteContactSettingByte(NULL, "CList", "TrayIcon",
+ (BYTE) (IsDlgButtonChecked(hwndDlg, IDC_DONTCYCLE) ? SETTING_TRAYICON_SINGLE
+ : (IsDlgButtonChecked(hwndDlg, IDC_CYCLE) ? SETTING_TRAYICON_CYCLE :
+ SETTING_TRAYICON_MULTI)));
+ DBWriteContactSettingWord(NULL, "CList", "CycleTime",
+ (WORD) SendDlgItemMessage(hwndDlg, IDC_CYCLETIMESPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingWord(NULL, "CList", "IconFlashTime",
+ (WORD) SendDlgItemMessage(hwndDlg, IDC_BLINKSPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingByte(NULL, "CList", "DisableTrayFlash", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DISABLEBLINK));
+ DBWriteContactSettingByte(NULL, "CList", "NoIconBlink", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ICONBLINK));
+ if (!SendDlgItemMessage
+ (hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA, SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0), 0))
+ DBDeleteContactSetting(NULL, "CList", "PrimaryStatus");
+ else
+ DBWriteContactSettingString(NULL, "CList", "PrimaryStatus",
+ ((PROTOCOLDESCRIPTOR *)
+ SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETITEMDATA,
+ SendDlgItemMessage(hwndDlg, IDC_PRIMARYSTATUS, CB_GETCURSEL, 0, 0),
+ 0))->szName);
+ pcli->pfnTrayIconIconsChanged();
+ pcli->pfnLoadContactTree(); /* this won't do job properly since it only really works when changes happen */
+ pcli->pfnInvalidateDisplayNameCacheEntry( INVALID_HANDLE_VALUE ); /* force reshuffle */
+ return TRUE;
+ }
+ break;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static BOOL CALLBACK DlgProcHotkeyOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+ case WM_INITDIALOG:
+ {
+ DBVARIANT dbv;
+
+ TranslateDialogDefault(hwndDlg);
+
+ CheckDlgButton(hwndDlg, IDC_SHOWHIDE, DBGetContactSettingByte(NULL, "CList", "HKEnShowHide", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_READMSG, DBGetContactSettingByte(NULL, "CList", "HKEnReadMsg", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_NETSEARCH, DBGetContactSettingByte(NULL, "CList", "HKEnNetSearch", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWOPTIONS, DBGetContactSettingByte(NULL, "CList", "HKEnShowOptions", 0) ? BST_CHECKED : BST_UNCHECKED);
+
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HKSHOWHIDE), IsDlgButtonChecked(hwndDlg, IDC_SHOWHIDE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HKREADMSG), IsDlgButtonChecked(hwndDlg, IDC_READMSG));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HKSEARCH), IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SEARCHURL), IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SEARCHNEWWND), IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HOTKEYURLSTR), IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HKSHOWOPTIONS), IsDlgButtonChecked(hwndDlg, IDC_SHOWOPTIONS));
+
+ SendDlgItemMessage(hwndDlg, IDC_HKSHOWHIDE, HKM_SETHOTKEY,
+ DBGetContactSettingWord(NULL, "CList", "HKShowHide", MAKEWORD('A', HOTKEYF_CONTROL | HOTKEYF_SHIFT)), 0);
+ SendDlgItemMessage(hwndDlg, IDC_HKREADMSG, HKM_SETHOTKEY,
+ DBGetContactSettingWord(NULL, "CList", "HKReadMsg", MAKEWORD('I', HOTKEYF_CONTROL | HOTKEYF_SHIFT)), 0);
+ SendDlgItemMessage(hwndDlg, IDC_HKSEARCH, HKM_SETHOTKEY,
+ DBGetContactSettingWord(NULL, "CList", "HKNetSearch", MAKEWORD('S', HOTKEYF_CONTROL | HOTKEYF_SHIFT)), 0);
+ SendDlgItemMessage(hwndDlg, IDC_HKSHOWOPTIONS, HKM_SETHOTKEY,
+ DBGetContactSettingWord(NULL, "CList", "HKShowOptions", MAKEWORD('O', HOTKEYF_CONTROL | HOTKEYF_SHIFT)), 0);
+ if (!DBGetContactSetting(NULL, "CList", "SearchUrl", &dbv)) {
+ SetDlgItemTextA(hwndDlg, IDC_SEARCHURL, dbv.pszVal);
+ mir_free(dbv.pszVal);
+ }
+ else
+ SetDlgItemTextA(hwndDlg, IDC_SEARCHURL, "http://www.google.com/");
+ CheckDlgButton(hwndDlg, IDC_SEARCHNEWWND, DBGetContactSettingByte(NULL, "CList", "HKSearchNewWnd", 0) ? BST_CHECKED : BST_UNCHECKED);
+ return TRUE;
+ }
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_SEARCHURL && (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()))
+ return 0;
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ switch (LOWORD(wParam)) {
+ case IDC_SHOWHIDE:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HKSHOWHIDE), IsDlgButtonChecked(hwndDlg, IDC_SHOWHIDE));
+ break;
+ case IDC_READMSG:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HKREADMSG), IsDlgButtonChecked(hwndDlg, IDC_READMSG));
+ break;
+ case IDC_NETSEARCH:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HKSEARCH), IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SEARCHURL), IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SEARCHNEWWND), IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HOTKEYURLSTR), IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ break;
+ case IDC_SHOWOPTIONS:
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HKSHOWOPTIONS), IsDlgButtonChecked(hwndDlg, IDC_SHOWOPTIONS));
+ break;
+ }
+ break;
+ case WM_NOTIFY:
+ switch (((LPNMHDR) lParam)->code) {
+ case PSN_APPLY:
+ {
+ char str[256];
+ pcli->pfnHotKeysUnregister((HWND) CallService(MS_CLUI_GETHWND, 0, 0));
+ DBWriteContactSettingByte(NULL, "CList", "HKEnShowHide", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWHIDE));
+ DBWriteContactSettingWord(NULL, "CList", "HKShowHide", (WORD) SendDlgItemMessage(hwndDlg, IDC_HKSHOWHIDE, HKM_GETHOTKEY, 0, 0));
+ DBWriteContactSettingByte(NULL, "CList", "HKEnReadMsg", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_READMSG));
+ DBWriteContactSettingWord(NULL, "CList", "HKReadMsg", (WORD) SendDlgItemMessage(hwndDlg, IDC_HKREADMSG, HKM_GETHOTKEY, 0, 0));
+ DBWriteContactSettingByte(NULL, "CList", "HKEnNetSearch", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_NETSEARCH));
+ DBWriteContactSettingWord(NULL, "CList", "HKNetSearch", (WORD) SendDlgItemMessage(hwndDlg, IDC_HKSEARCH, HKM_GETHOTKEY, 0, 0));
+ GetDlgItemTextA(hwndDlg, IDC_SEARCHURL, str, SIZEOF(str));
+ DBWriteContactSettingString(NULL, "CList", "SearchUrl", str);
+ DBWriteContactSettingByte(NULL, "CList", "HKSearchNewWnd", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SEARCHNEWWND));
+ DBWriteContactSettingByte(NULL, "CList", "HKEnShowOptions", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWOPTIONS));
+ DBWriteContactSettingWord(NULL, "CList", "HKShowOptions", (WORD) SendDlgItemMessage(hwndDlg, IDC_HKSHOWOPTIONS, HKM_GETHOTKEY, 0, 0));
+ pcli->pfnHotKeysRegister((HWND) CallService(MS_CLUI_GETHWND, 0, 0));
+ return TRUE;
+ }
+ }
+ break;
+ }
+ return FALSE;
+}
+
+/****************************************************************************************/
+
+static UINT expertOnlyControls[] = { IDC_ALWAYSSTATUS };
+
+int CListOptInit(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+
+ ZeroMemory(&odp, sizeof(odp));
+ odp.cbSize = sizeof(odp);
+ odp.position = -1000000000;
+ odp.hInstance = g_hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLIST);
+ odp.pszTitle = "Contact List";
+ odp.pfnDlgProc = DlgProcGenOpts;
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.nIDBottomSimpleControl = IDC_STCLISTGROUP;
+ odp.expertOnlyControls = expertOnlyControls;
+ odp.nExpertOnlyControls = SIZEOF(expertOnlyControls);
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) & odp);
+
+ odp.position = -900000000;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_HOTKEY);
+ odp.pszTitle = "Hotkeys";
+ odp.pszGroup = "Events";
+ odp.pfnDlgProc = DlgProcHotkeyOpts;
+ odp.nIDBottomSimpleControl = 0;
+ odp.nExpertOnlyControls = 0;
+ odp.expertOnlyControls = NULL;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) & odp);
+ return 0;
+}
diff --git a/miranda-wine/plugins/clist/cluiopts.c b/miranda-wine/plugins/clist/cluiopts.c
new file mode 100644
index 0000000..588d3b1
--- /dev/null
+++ b/miranda-wine/plugins/clist/cluiopts.c
@@ -0,0 +1,346 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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 "commonheaders.h"
+
+extern BOOL(WINAPI * MySetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD);
+
+static BOOL CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_BRINGTOFRONT,
+ DBGetContactSettingByte(NULL, "CList", "BringToFront", SETTING_BRINGTOFRONT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONTOP, DBGetContactSettingByte(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_TOOLWND,
+ DBGetContactSettingByte(NULL, "CList", "ToolWindow", SETTING_TOOLWINDOW_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_MIN2TRAY,
+ DBGetContactSettingByte(NULL, "CList", "Min2Tray", SETTING_MIN2TRAY_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
+ CheckDlgButton(hwndDlg, IDC_SHOWCAPTION,
+ DBGetContactSettingByte(NULL, "CLUI", "ShowCaption", SETTING_SHOWCAPTION_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWMAINMENU,
+ DBGetContactSettingByte(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_CLIENTDRAG,
+ DBGetContactSettingByte(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), FALSE);
+ }
+ CheckDlgButton(hwndDlg, IDC_FADEINOUT, DBGetContactSettingByte(NULL, "CLUI", "FadeInOut", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZE, DBGetContactSettingByte(NULL, "CLUI", "AutoSize", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_DROPSHADOW, DBGetContactSettingByte(NULL, "CList", "WindowShadow", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_ONDESKTOP, DBGetContactSettingByte(NULL, "CList", "OnDesktop", 0) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETRANGE, 0, MAKELONG(100, 0));
+ SendDlgItemMessage(hwndDlg, IDC_MAXSIZESPIN, UDM_SETPOS, 0, DBGetContactSettingByte(NULL, "CLUI", "MaxSizeHeight", 75));
+ CheckDlgButton(hwndDlg, IDC_AUTOSIZEUPWARD, DBGetContactSettingByte(NULL, "CLUI", "AutoSizeUpward", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_AUTOHIDE,
+ DBGetContactSettingByte(NULL, "CList", "AutoHide", SETTING_AUTOHIDE_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+ SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETRANGE, 0, MAKELONG(900, 1));
+ SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_SETPOS, 0,
+ MAKELONG(DBGetContactSettingWord(NULL, "CList", "HideTime", SETTING_HIDETIME_DEFAULT), 0));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ if (!IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC21), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC22), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZEHEIGHT), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZESPIN), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOSIZEUPWARD), FALSE);
+ }
+
+ { DBVARIANT dbv;
+ if ( !DBGetContactSettingTString(NULL, "CList", "TitleText", &dbv)) {
+ SetDlgItemText(hwndDlg, IDC_TITLETEXT, dbv.ptszVal);
+ DBFreeVariant( &dbv );
+ }
+ else SetDlgItemTextA(hwndDlg, IDC_TITLETEXT, MIRANDANAME);
+ }
+ if (!IsWinVer2000Plus()) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_FADEINOUT), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSPARENT), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_DROPSHADOW), FALSE);
+ }
+ else
+ CheckDlgButton(hwndDlg, IDC_TRANSPARENT,
+ DBGetContactSettingByte(NULL, "CList", "Transparent", SETTING_TRANSPARENT_DEFAULT) ? BST_CHECKED : BST_UNCHECKED);
+
+ if (!IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), FALSE);
+ }
+ SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
+ SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETRANGE, FALSE, MAKELONG(1, 255));
+ SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_SETPOS, TRUE, DBGetContactSettingByte(NULL, "CList", "Alpha", SETTING_ALPHA_DEFAULT));
+ SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_SETPOS, TRUE,
+ DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT));
+ SendMessage(hwndDlg, WM_HSCROLL, 0x12345678, 0);
+ return TRUE;
+
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_AUTOHIDE) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIME), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_HIDETIMESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC01), IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ }
+ else if (LOWORD(wParam) == IDC_TRANSPARENT) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC11), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC12), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TRANSINACTIVE), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_ACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_INACTIVEPERC), IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ }
+ else if (LOWORD(wParam) == IDC_AUTOSIZE) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC21), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_STATIC22), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZEHEIGHT), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MAXSIZESPIN), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_AUTOSIZEUPWARD), IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ }
+ else if (LOWORD(wParam) == IDC_TOOLWND) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
+ }
+ else if (LOWORD(wParam) == IDC_SHOWCAPTION) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TOOLWND), IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_MIN2TRAY), !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)
+ && IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_TITLETEXT), IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
+ }
+
+ if ((LOWORD(wParam) == IDC_HIDETIME || LOWORD(wParam) == IDC_TITLETEXT || LOWORD(wParam) == IDC_MAXSIZEHEIGHT) &&
+ (HIWORD(wParam) != EN_CHANGE || (HWND) lParam != GetFocus()))
+ return 0;
+
+ // Enable apply button
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+
+ case WM_HSCROLL:
+ {
+ char str[10];
+ wsprintfA(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0) / 255);
+ SetDlgItemTextA(hwndDlg, IDC_INACTIVEPERC, str);
+ wsprintfA(str, "%d%%", 100 * SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0) / 255);
+ SetDlgItemTextA(hwndDlg, IDC_ACTIVEPERC, str);
+ }
+ if (wParam != 0x12345678)
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_NOTIFY:
+ if (((LPNMHDR) lParam)->code == PSN_APPLY) {
+ DBWriteContactSettingByte(NULL, "CList", "OnTop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
+ DBWriteContactSettingByte(NULL, "CList", "ToolWindow", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TOOLWND));
+ DBWriteContactSettingByte(NULL, "CList", "BringToFront", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
+ DBWriteContactSettingByte(NULL, "CLUI", "FadeInOut", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_FADEINOUT));
+ DBWriteContactSettingByte(NULL, "CLUI", "AutoSize", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
+ DBWriteContactSettingByte(NULL, "CLUI", "MaxSizeHeight", (BYTE) GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, NULL, FALSE));
+ DBWriteContactSettingByte(NULL, "CLUI", "AutoSizeUpward", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
+ DBWriteContactSettingByte(NULL, "CList", "AutoHide", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
+ DBWriteContactSettingWord(NULL, "CList", "HideTime", (WORD) SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
+ DBWriteContactSettingByte(NULL, "CList", "Transparent", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT));
+ DBWriteContactSettingByte(NULL, "CList", "Alpha", (BYTE) SendDlgItemMessage(hwndDlg, IDC_TRANSACTIVE, TBM_GETPOS, 0, 0));
+ DBWriteContactSettingByte(NULL, "CList", "AutoAlpha", (BYTE) SendDlgItemMessage(hwndDlg, IDC_TRANSINACTIVE, TBM_GETPOS, 0, 0));
+ DBWriteContactSettingByte(NULL, "CList", "WindowShadow", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_DROPSHADOW));
+ DBWriteContactSettingByte(NULL, "CList", "OnDesktop", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP));
+ DBWriteContactSettingByte(NULL, "CLUI", "ShowCaption", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION));
+ DBWriteContactSettingByte(NULL, "CLUI", "ShowMainMenu", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU));
+ DBWriteContactSettingByte(NULL, "CLUI", "ClientAreaDrag", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_CLIENTDRAG));
+ DBWriteContactSettingByte(NULL, "CList", "Min2Tray", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY));
+ {
+ TCHAR title[256];
+ GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, SIZEOF(title));
+ DBWriteContactSettingTString(NULL, "CList", "TitleText", title);
+ SetWindowText(pcli->hwndContactList, title);
+ }
+ pcli->pfnLoadCluiGlobalOpts();
+ SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0,
+ SWP_NOMOVE | SWP_NOSIZE);
+ if (IsDlgButtonChecked(hwndDlg, IDC_TOOLWND)) {
+ // Window must be hidden to dynamically remove the taskbar button.
+ // See http://msdn.microsoft.com/library/en-us/shellcc/platform/shell/programmersguide/shell_int/shell_int_programming/taskbar.asp
+ WINDOWPLACEMENT p;
+ p.length = sizeof(p);
+ GetWindowPlacement(pcli->hwndContactList, &p);
+ ShowWindow(pcli->hwndContactList, SW_HIDE);
+ SetWindowLong(pcli->hwndContactList, GWL_EXSTYLE,
+ GetWindowLong(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
+ SetWindowPlacement(pcli->hwndContactList, &p);
+ }
+ else SetWindowLong(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLong(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_TOOLWINDOW);
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_ONDESKTOP)) {
+ HWND hProgMan = FindWindowA("Progman", NULL);
+ if (IsWindow(hProgMan))
+ SetParent(pcli->hwndContactList, hProgMan);
+ }
+ else SetParent(pcli->hwndContactList, NULL);
+
+ if (IsDlgButtonChecked(hwndDlg, IDC_SHOWCAPTION))
+ SetWindowLong(pcli->hwndContactList, GWL_STYLE,
+ GetWindowLong(pcli->hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX);
+ else
+ SetWindowLong(pcli->hwndContactList, GWL_STYLE,
+ GetWindowLong(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX));
+ if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
+ SetMenu(pcli->hwndContactList, NULL);
+ else
+ SetMenu(pcli->hwndContactList, pcli->hMenuMain);
+ SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_FRAME | RDW_INVALIDATE);
+ if (IsIconic(pcli->hwndContactList) && !IsDlgButtonChecked(hwndDlg, IDC_TOOLWND))
+ ShowWindow(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_MIN2TRAY) ? SW_HIDE : SW_SHOW);
+ if (IsDlgButtonChecked(hwndDlg, IDC_TRANSPARENT)) {
+ SetWindowLong(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLong(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ if (MySetLayeredWindowAttributes)
+ MySetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0),
+ (BYTE) DBGetContactSettingByte(NULL, "CList", "AutoAlpha", SETTING_AUTOALPHA_DEFAULT),
+ LWA_ALPHA);
+ }
+ else SetWindowLong(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLong(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+
+ SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+static BOOL CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
+{
+ switch (msg) {
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ CheckDlgButton(hwndDlg, IDC_SHOWSBAR, DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1) ? BST_CHECKED : BST_UNCHECKED);
+ {
+ BYTE showOpts = DBGetContactSettingByte(NULL, "CLUI", "SBarShow", 1);
+ CheckDlgButton(hwndDlg, IDC_SHOWICON, showOpts & 1 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWPROTO, showOpts & 2 ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWSTATUS, showOpts & 4 ? BST_CHECKED : BST_UNCHECKED);
+ }
+ CheckDlgButton(hwndDlg, IDC_RIGHTSTATUS, DBGetContactSettingByte(NULL, "CLUI", "SBarRightClk", 0) ? BST_UNCHECKED : BST_CHECKED);
+ CheckDlgButton(hwndDlg, IDC_RIGHTMIRANDA, !IsDlgButtonChecked(hwndDlg, IDC_RIGHTSTATUS) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_EQUALSECTIONS, DBGetContactSettingByte(NULL, "CLUI", "EqualSections", 0) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SBPANELBEVEL, DBGetContactSettingByte(NULL, "CLUI", "SBarBevel", 1) ? BST_CHECKED : BST_UNCHECKED);
+ CheckDlgButton(hwndDlg, IDC_SHOWGRIP, DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? BST_CHECKED : BST_UNCHECKED);
+ if (!IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SBPANELBEVEL), FALSE);
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWGRIP), FALSE);
+ }
+ return TRUE;
+ case WM_COMMAND:
+ if (LOWORD(wParam) == IDC_SHOWSBAR) {
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWICON), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWPROTO), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWSTATUS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTSTATUS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_RIGHTMIRANDA), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_EQUALSECTIONS), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SBPANELBEVEL), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ EnableWindow(GetDlgItem(hwndDlg, IDC_SHOWGRIP), IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ }
+ SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0);
+ break;
+ case WM_NOTIFY:
+ if (((LPNMHDR) lParam)->code == PSN_APPLY ) {
+ DBWriteContactSettingByte(NULL, "CLUI", "ShowSBar", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
+ DBWriteContactSettingByte(NULL, "CLUI", "SBarShow",
+ (BYTE) ((IsDlgButtonChecked(hwndDlg, IDC_SHOWICON) ? 1 : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_SHOWPROTO) ? 2 : 0) |
+ (IsDlgButtonChecked(hwndDlg, IDC_SHOWSTATUS) ? 4 : 0)));
+ DBWriteContactSettingByte(NULL, "CLUI", "SBarRightClk", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_RIGHTMIRANDA));
+ DBWriteContactSettingByte(NULL, "CLUI", "EqualSections", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_EQUALSECTIONS));
+ DBWriteContactSettingByte(NULL, "CLUI", "SBarBevel", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
+ pcli->pfnLoadCluiGlobalOpts();
+ if (DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) != (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
+ HWND parent = GetParent(pcli->hwndStatus);
+ int flags = WS_CHILD | CCS_BOTTOM;
+ DBWriteContactSettingByte(NULL, "CLUI", "ShowGrip", (BYTE) IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
+ ShowWindow(pcli->hwndStatus, SW_HIDE);
+ DestroyWindow(pcli->hwndStatus);
+ flags |= DBGetContactSettingByte(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
+ flags |= DBGetContactSettingByte(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
+ pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, parent, NULL, g_hInst, NULL);
+ }
+ if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR))
+ ShowWindow(pcli->hwndStatus, SW_SHOW);
+ else
+ ShowWindow(pcli->hwndStatus, SW_HIDE);
+ SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ return TRUE;
+ }
+ break;
+ }
+ return FALSE;
+}
+
+/****************************************************************************************/
+
+static UINT expertOnlyControls[] =
+{
+ IDC_BRINGTOFRONT, IDC_AUTOSIZE, IDC_STATIC21, IDC_MAXSIZEHEIGHT, IDC_MAXSIZESPIN,
+ IDC_STATIC22, IDC_AUTOSIZEUPWARD, IDC_SHOWMAINMENU, IDC_SHOWCAPTION, IDC_CLIENTDRAG
+};
+
+int CluiOptInit(WPARAM wParam, LPARAM lParam)
+{
+ OPTIONSDIALOGPAGE odp;
+
+ ZeroMemory(&odp, sizeof(odp));
+ odp.cbSize = sizeof(odp);
+ odp.position = 0;
+ odp.hInstance = g_hInst;
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_CLUI);
+ odp.pszTitle = "Window";
+ odp.pszGroup = "Contact List";
+ odp.pfnDlgProc = DlgProcCluiOpts;
+ odp.flags = ODPF_BOLDGROUPS;
+ odp.nIDBottomSimpleControl = IDC_STWINDOWGROUP;
+ odp.expertOnlyControls = expertOnlyControls;
+ odp.nExpertOnlyControls = SIZEOF(expertOnlyControls);
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) & odp);
+
+ odp.pszTemplate = MAKEINTRESOURCEA(IDD_OPT_SBAR);
+ odp.pszTitle = "Status Bar";
+ odp.pfnDlgProc = DlgProcSBarOpts;
+ odp.flags = ODPF_BOLDGROUPS | ODPF_EXPERTONLY;
+ odp.nIDBottomSimpleControl = 0;
+ odp.nExpertOnlyControls = 0;
+ odp.expertOnlyControls = NULL;
+ CallService(MS_OPT_ADDPAGE, wParam, (LPARAM) & odp);
+ return 0;
+}
diff --git a/miranda-wine/plugins/clist/commonheaders.c b/miranda-wine/plugins/clist/commonheaders.c
new file mode 100644
index 0000000..14f99f7
--- /dev/null
+++ b/miranda-wine/plugins/clist/commonheaders.c
@@ -0,0 +1 @@
+#include "commonheaders.h"
diff --git a/miranda-wine/plugins/clist/commonheaders.h b/miranda-wine/plugins/clist/commonheaders.h
new file mode 100644
index 0000000..6a061ff
--- /dev/null
+++ b/miranda-wine/plugins/clist/commonheaders.h
@@ -0,0 +1,96 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2005 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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.
+*/
+
+#if defined(UNICODE)
+#define _UNICODE 1
+#endif
+
+#include <tchar.h>
+#include <malloc.h>
+
+#ifdef _DEBUG
+# define _CRTDBG_MAP_ALLOC
+# include <stdlib.h>
+# include <crtdbg.h>
+#endif
+
+#define _WIN32_WINNT 0x0501
+#include <windows.h>
+#include <commctrl.h>
+#include <stdio.h>
+#include <time.h>
+#include <stddef.h>
+#include <process.h>
+#include <io.h>
+#include <string.h>
+#include <direct.h>
+#include "resource.h"
+#include "forkthread.h"
+#include <win2k.h>
+#include <newpluginapi.h>
+#include <m_clist.h>
+#include <m_clc.h>
+#include <m_clistint.h>
+#include <m_clui.h>
+#include <m_plugins.h>
+#include <m_system.h>
+#include <m_database.h>
+#include <m_langpack.h>
+#include <m_button.h>
+#include <m_options.h>
+#include <m_protosvc.h>
+#include <m_utils.h>
+#include <m_skin.h>
+#include <m_contacts.h>
+#include <m_file.h>
+#include <m_addcontact.h>
+#include "clc.h"
+#include "clist.h"
+
+// shared vars
+extern HINSTANCE g_hInst;
+
+/* most free()'s are invalid when the code is executed from a dll, so this changes
+ all the bad free()'s to good ones, however it's still incorrect code. The reasons for not
+ changing them include:
+
+ * DBFreeVariant has a CallService() lookup
+ * free() is executed in some large loops to do with clist creation of group data
+ * easy search and replace
+
+*/
+
+extern struct MM_INTERFACE memoryManagerInterface;
+
+#define mir_alloc(n) memoryManagerInterface.mmi_malloc(n)
+#define mir_free(ptr) memoryManagerInterface.mmi_free(ptr)
+#define mir_realloc(ptr,size) memoryManagerInterface.mmi_realloc(ptr,size)
+
+static __inline char * mir_strdup(const char * src)
+{
+ char * p = 0;
+ if ( src == NULL ) return NULL;
+ p=mir_alloc( strlen(src)+1 );
+ strcpy(p, src);
+ return p;
+}
diff --git a/miranda-wine/plugins/clist/forkthread.c b/miranda-wine/plugins/clist/forkthread.c
new file mode 100644
index 0000000..920fc1f
--- /dev/null
+++ b/miranda-wine/plugins/clist/forkthread.c
@@ -0,0 +1,94 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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 "commonheaders.h"
+
+struct FORK_ARG
+{
+ HANDLE hEvent;
+ void (__cdecl * threadcode) (void *);
+ unsigned (__stdcall * threadcodeex) (void *);
+ void *arg;
+};
+
+void __cdecl forkthread_r(struct FORK_ARG *fa)
+{
+ void (*callercode) (void *) = fa->threadcode;
+ void *arg = fa->arg;
+ CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+ SetEvent(fa->hEvent);
+ __try {
+ callercode(arg);
+ }
+ __finally {
+ CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+ }
+ return;
+}
+
+unsigned long forkthread(void (__cdecl * threadcode) (void *), unsigned long stacksize, void *arg)
+{
+ unsigned long rc;
+ struct FORK_ARG fa;
+ fa.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ fa.threadcode = threadcode;
+ fa.arg = arg;
+ rc = _beginthread(forkthread_r, stacksize, &fa);
+ if ((unsigned long) -1L != rc) {
+ WaitForSingleObject(fa.hEvent, INFINITE);
+ } //if
+ CloseHandle(fa.hEvent);
+ return rc;
+}
+
+unsigned long __stdcall forkthreadex_r(struct FORK_ARG *fa)
+{
+ unsigned (__stdcall * threadcode) (void *) = fa->threadcodeex;
+ void *arg = fa->arg;
+ unsigned long rc;
+
+ CallService(MS_SYSTEM_THREAD_PUSH, 0, 0);
+ SetEvent(fa->hEvent);
+ __try {
+ rc = threadcode(arg);
+ }
+ __finally {
+ CallService(MS_SYSTEM_THREAD_POP, 0, 0);
+ }
+ return rc;
+}
+
+unsigned long forkthreadex(void *sec, unsigned stacksize, unsigned (__stdcall * threadcode) (void *), void *arg, unsigned cf, unsigned *thraddr)
+{
+ unsigned long rc;
+ struct FORK_ARG fa;
+ fa.threadcodeex = threadcode;
+ fa.arg = arg;
+ fa.hEvent = CreateEvent(NULL, FALSE, FALSE, NULL);
+ rc = _beginthreadex(sec, stacksize, forkthreadex_r, &fa, 0, thraddr);
+ if (rc) {
+ WaitForSingleObject(fa.hEvent, INFINITE);
+ }
+ CloseHandle(fa.hEvent);
+ return rc;
+}
diff --git a/miranda-wine/plugins/clist/forkthread.h b/miranda-wine/plugins/clist/forkthread.h
new file mode 100644
index 0000000..9abcf5e
--- /dev/null
+++ b/miranda-wine/plugins/clist/forkthread.h
@@ -0,0 +1,63 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2003 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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.
+*/
+
+/*
+
+Purpose:
+
+ A safe version of _beginthread()
+
+Description:
+
+ A new thread is created and the source thread is paused until
+ internal code to call MS_SYSTEM_THREAD_PUSH is made in the context
+ if the new thread.
+
+ The source thread is then released and then the user supplied
+ code is called, when that function returns -- MS_SYSTEM_THREAD_POP
+ is called and then the thread returns.
+
+ This insures that Miranda will not exit whilst new threads
+ are trying to be born; and the unwind wait stack will unsure
+ that Miranda will wait for all created threads to return as well.
+
+Cavets:
+
+ The function must be reimplemented across MT plugins, since thread
+ creation depends on CRT which can not be shared.
+
+*/
+unsigned long forkthread (
+ void (__cdecl *threadcode)(void*),
+ unsigned long stacksize,
+ void *arg
+);
+
+unsigned long forkthreadex(
+ void *sec,
+ unsigned stacksize,
+ unsigned (__stdcall *threadcode)(void*),
+ void *arg,
+ unsigned cf,
+ unsigned *thraddr
+);
diff --git a/miranda-wine/plugins/clist/init.c b/miranda-wine/plugins/clist/init.c
new file mode 100644
index 0000000..843a5bb
--- /dev/null
+++ b/miranda-wine/plugins/clist/init.c
@@ -0,0 +1,175 @@
+/*
+
+Miranda IM: the free IM client for Microsoft* Windows*
+
+Copyright 2000-2005 Miranda ICQ/IM project,
+all portions of this codebase are copyrighted to the people
+listed in contributors.txt.
+
+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 "commonheaders.h"
+
+HINSTANCE g_hInst = 0;
+PLUGINLINK *pluginLink;
+CLIST_INTERFACE* pcli = NULL;
+HIMAGELIST himlCListClc = NULL;
+HANDLE hStatusModeChangeEvent;
+
+extern int currentDesiredStatusMode;
+
+struct MM_INTERFACE memoryManagerInterface;
+BOOL(WINAPI * MySetLayeredWindowAttributes) (HWND, COLORREF, BYTE, DWORD) = NULL;
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// external functions
+
+int MenuProcessCommand(WPARAM wParam, LPARAM lParam);
+int InitCustomMenus(void);
+void UninitCustomMenus(void);
+
+void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint);
+
+int ClcOptInit(WPARAM wParam, LPARAM lParam);
+int CluiOptInit(WPARAM wParam, LPARAM lParam);
+int CListOptInit(WPARAM wParam, LPARAM lParam);
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// dll stub
+
+BOOL WINAPI DllMain(HINSTANCE hInstDLL, DWORD dwReason, LPVOID reserved)
+{
+ g_hInst = hInstDLL;
+ DisableThreadLibraryCalls(g_hInst);
+ return TRUE;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// returns the plugin information
+
+PLUGININFO pluginInfo = {
+ sizeof(PLUGININFO),
+ #if defined( _UNICODE )
+ "Classic contact list (Unicode)",
+ #else
+ "Classic contact list",
+ #endif
+ PLUGIN_MAKE_VERSION(0, 5, 1, 1),
+
+ "Display contacts, event notifications, protocol status",
+ "Miranda IM project",
+ "ghazan@miranda-im.org",
+ "Copyright 2000-2006 Miranda IM project",
+ "http://www.miranda-im.org",
+ UNICODE_AWARE,
+ DEFMOD_CLISTALL
+};
+
+__declspec(dllexport) PLUGININFO *MirandaPluginInfo(DWORD mirandaVersion)
+{
+ if (mirandaVersion < PLUGIN_MAKE_VERSION(0, 4, 3, 0))
+ return NULL;
+ return &pluginInfo;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// called when all modules got loaded
+
+static int OnModulesLoaded( WPARAM wParam, LPARAM lParam )
+{
+ himlCListClc = (HIMAGELIST) CallService(MS_CLIST_GETICONSIMAGELIST, 0, 0);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// options iniatialization
+
+static int OnOptsInit(WPARAM wParam, LPARAM lParam)
+{
+ ClcOptInit(wParam, lParam);
+ CluiOptInit(wParam, lParam);
+ CListOptInit(wParam, lParam);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// menu status services
+
+static int SetStatusMode(WPARAM wParam, LPARAM lParam)
+{
+ //todo: check wParam is valid so people can't use this to run random menu items
+ MenuProcessCommand(MAKEWPARAM(LOWORD(wParam), MPCF_MAINMENU), 0);
+ return 0;
+}
+
+static int GetStatusMode(WPARAM wParam, LPARAM lParam)
+{
+ return currentDesiredStatusMode;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// main clist initialization routine
+
+int __declspec(dllexport) CListInitialise(PLUGINLINK * link)
+{
+ int rc = 0;
+ pluginLink = link;
+ #ifdef _DEBUG
+ _CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF);
+ #endif
+
+ // get the internal malloc/free()
+ memset(&memoryManagerInterface, 0, sizeof(memoryManagerInterface));
+ memoryManagerInterface.cbSize = sizeof(memoryManagerInterface);
+ CallService(MS_SYSTEM_GET_MMI, 0, (LPARAM) & memoryManagerInterface);
+
+ pcli = ( CLIST_INTERFACE* )CallService(MS_CLIST_RETRIEVE_INTERFACE, 0, (LPARAM)g_hInst);
+ if ( (int)pcli == CALLSERVICE_NOTFOUND ) {
+ MessageBoxA( NULL, "This version of plugin requires Miranda IM 0.5 or later", "Fatal error", MB_OK );
+ return 1;
+ }
+ pcli->pfnPaintClc = PaintClc;
+
+ MySetLayeredWindowAttributes = (BOOL(WINAPI *) (HWND, COLORREF, BYTE, DWORD)) GetProcAddress(
+ LoadLibraryA("user32.dll"), "SetLayeredWindowAttributes");
+
+ HookEvent(ME_SYSTEM_MODULESLOADED, OnModulesLoaded);
+ HookEvent(ME_OPT_INITIALISE, OnOptsInit);
+
+ hStatusModeChangeEvent = CreateHookableEvent(ME_CLIST_STATUSMODECHANGE);
+
+ InitCustomMenus();
+ CreateServiceFunction(MS_CLIST_SETSTATUSMODE, SetStatusMode);
+ CreateServiceFunction(MS_CLIST_GETSTATUSMODE, GetStatusMode);
+ return 0;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// a plugin loader aware of CList exports will never call this.
+
+int __declspec(dllexport) Load(PLUGINLINK * link)
+{
+ return 1;
+}
+
+/////////////////////////////////////////////////////////////////////////////////////////
+// a plugin unloader
+
+int __declspec(dllexport) Unload(void)
+{
+ UninitCustomMenus();
+ return 0;
+}
diff --git a/miranda-wine/plugins/clist/res/blank.ico b/miranda-wine/plugins/clist/res/blank.ico
new file mode 100644
index 0000000..7845f62
--- /dev/null
+++ b/miranda-wine/plugins/clist/res/blank.ico
Binary files differ
diff --git a/miranda-wine/plugins/clist/res/delete.ico b/miranda-wine/plugins/clist/res/delete.ico
new file mode 100644
index 0000000..9b0f0ff
--- /dev/null
+++ b/miranda-wine/plugins/clist/res/delete.ico
Binary files differ
diff --git a/miranda-wine/plugins/clist/res/dragcopy.cur b/miranda-wine/plugins/clist/res/dragcopy.cur
new file mode 100644
index 0000000..89c7c96
--- /dev/null
+++ b/miranda-wine/plugins/clist/res/dragcopy.cur
Binary files differ
diff --git a/miranda-wine/plugins/clist/res/dropuser.cur b/miranda-wine/plugins/clist/res/dropuser.cur
new file mode 100644
index 0000000..a84b19e
--- /dev/null
+++ b/miranda-wine/plugins/clist/res/dropuser.cur
Binary files differ
diff --git a/miranda-wine/plugins/clist/res/hyperlin.cur b/miranda-wine/plugins/clist/res/hyperlin.cur
new file mode 100644
index 0000000..f0f548c
--- /dev/null
+++ b/miranda-wine/plugins/clist/res/hyperlin.cur
Binary files differ
diff --git a/miranda-wine/plugins/clist/res/rename.ico b/miranda-wine/plugins/clist/res/rename.ico
new file mode 100644
index 0000000..2c6bc2a
--- /dev/null
+++ b/miranda-wine/plugins/clist/res/rename.ico
Binary files differ
diff --git a/miranda-wine/plugins/clist/resource.h b/miranda-wine/plugins/clist/resource.h
new file mode 100644
index 0000000..d6aeddf
--- /dev/null
+++ b/miranda-wine/plugins/clist/resource.h
@@ -0,0 +1,554 @@
+//{{NO_DEPENDENCIES}}
+// Microsoft Developer Studio generated include file.
+// Used by resource.rc
+//
+#define IDC_AUTHICON 1
+#define IDC_NOTOALL 3
+#define IDC_APPLY 3
+#define IDI_MIRANDA 102
+#define IDD_ABOUT 103
+#define IDI_SMS 103
+#define IDI_ONLINE 104
+#define IDI_OFFLINE 105
+#define IDD_GNUPL 110
+#define IDD_ADDED 115
+#define IDD_URLSEND 119
+#define IDD_URLRECV 120
+#define IDD_AUTHREQ 121
+#define IDD_DETAILS 125
+#define IDD_OPT_CLIST 126
+#define IDD_HISTORY 127
+#define IDI_AWAY 128
+#define IDI_FREE4CHAT 129
+#define IDI_INVISIBLE 130
+#define IDI_NA 131
+#define IDD_OPT_SOUND 134
+#define IDI_SENDURL 135
+#define IDI_RECVMSG 136
+#define IDI_SENDMSG 137
+#define IDI_URL 138
+#define IDI_DND 158
+#define IDI_OCCUPIED 159
+#define IDI_USERDETAILS 160
+#define IDI_FINDUSER 161
+#define IDI_HELP 162
+#define IDI_OPTIONS 163
+#define IDI_MIRANDAWEBSITE 172
+#define IDI_RENAME 173
+#define IDI_HISTORY 174
+#define IDI_DELETE 175
+#define IDR_CONTEXT 180
+#define IDC_DROP 183
+#define IDD_OPT_HOTKEY 184
+#define IDD_HISTORY_FIND 192
+#define IDI_SENDEMAIL 193
+#define IDD_FILERECV 194
+#define IDD_PROFILEMANAGER 197
+#define IDD_NEWPROFILE 198
+#define IDR_CLISTMENU 199
+#define IDI_BLANK 200
+#define IDD_FINDADD 201
+#define IDI_USERONLINE 201
+#define IDD_OPT_AUTOAWAY 202
+#define IDI_GROUPSHUT 202
+#define IDD_OPTIONS 203
+#define IDI_GROUPOPEN 203
+#define IDD_PLUGINCONFLICT 204
+#define IDD_FILESEND 205
+#define IDI_NOTICK 205
+#define IDD_OPT_PLUGINS 206
+#define IDI_TICK 206
+#define IDD_OPT_ICONS 207
+#define IDI_FILE 207
+#define IDI_TIMESTAMP 208
+#define IDI_CHANGEFONT 209
+#define IDI_ADDCONTACT 210
+#define IDI_SMALLDOT 211
+#define IDI_FILLEDBLOB 212
+#define IDD_READAWAYMSG 213
+#define IDI_EMPTYBLOB 213
+#define IDD_OPT_IGNORE 214
+#define IDC_HYPERLINKHAND 214
+#define IDD_OPT_VISIBILITY 215
+#define IDC_DROPUSER 215
+#define IDD_SETAWAYMSG 216
+#define IDI_DETAILSLOGO 216
+#define IDD_OPT_AWAYMSG 217
+#define IDD_OPT_CLUI 218
+#define IDD_INFO_SUMMARY 220
+#define IDD_INFO_CONTACT 221
+#define IDD_INFO_BACKGROUND 222
+#define IDD_INFO_NOTES 223
+#define IDD_ADDEMAIL 226
+#define IDD_ICONINDEX 227
+#define IDD_OPT_CLC 228
+#define IDD_OPT_CLCTEXT 229
+#define IDD_OPT_CLCBKG 230
+#define IDD_INFO_LOCATION 231
+#define IDD_INFO_WORK 232
+#define IDD_ADDPHONE 233
+#define IDD_OPT_SBAR 234
+#define IDD_INSTALLINI 235
+#define IDD_WARNINICHANGE 236
+#define IDD_INIIMPORTDONE 237
+#define IDD_OPT_CLCTEXTSIMPLE 239
+#define IDB_SORTCOLUP 239
+#define IDB_SORTCOLDOWN 240
+#define IDD_OPT_NETLIB 246
+#define IDD_NETLIBLOGOPTS 247
+#define IDD_FILETRANSFERINFO 249
+#define IDD_OPT_FILETRANSFER 250
+#define IDD_FILEEXISTS 251
+#define IDD_DELETECONTACT 254
+#define IDD_DENYREASON 256
+#define IDD_ADDCONTACT 257
+#define IDD_OPT_CONTACT 261
+#define IDI_MULTISEND 263
+#define IDI_DOWNARROW 264
+#define IDD_CREDITS 265
+#define IDD_OPT_IDLE 268
+#define IDC_SAVE 1001
+#define IDI_ONTHEPHONE 1002
+#define IDC_MESSAGE 1002
+#define IDI_OUTTOLUNCH 1003
+#define IDC_AUTOCLOSE 1004
+#define IDC_FROM 1005
+#define IDC_AUTOMIN 1005
+#define IDC_DATE 1006
+#define IDC_DUMPRECV 1006
+#define IDC_MSG 1008
+#define IDC_PROXYDNS 1008
+#define IDC_NAME 1009
+#define IDC_PROXYTYPE 1009
+#define IDC_STATIC23 1010
+#define IDC_SPECIFYPORTS 1013
+#define IDC_ST_ENTERMSG 1013
+#define IDC_ST_ENTERURL 1014
+#define IDC_SPECIFYPORTSO 1014
+#define IDC_TEXT 1019
+#define IDC_SHOWNAMES 1024
+#define IDC_ABOUT 1032
+#define IDC_MYNOTES 1033
+#define IDC_URLS 1037
+#define IDC_REPLY 1039
+#define IDC_URL 1041
+#define IDC_REASON 1046
+#define IDC_EMAIL 1048
+#define IDC_NAMENICK 1049
+#define IDC_NAMEFIRST 1050
+#define IDC_NAMELAST 1051
+#define IDC_NICK 1053
+#define IDC_GENDER 1060
+#define IDC_CITY 1061
+#define IDC_STATE 1062
+#define IDC_COUNTRY 1063
+#define IDC_AGE 1064
+#define IDC_ZIP 1064
+#define IDC_PHONE 1065
+#define IDC_STREET 1065
+#define IDC_COMPANY 1066
+#define IDC_LANGUAGE1 1066
+#define IDC_TIMEZONE 1067
+#define IDC_DEPARTMENT 1067
+#define IDC_LOCALTIME 1068
+#define IDC_DETAILS 1069
+#define IDC_POSITION 1069
+#define IDC_LANGUAGE2 1069
+#define IDC_ADD 1070
+#define IDC_LANGUAGE3 1070
+#define IDC_MOREOPTIONS 1071
+#define IDC_USERMENU 1071
+#define IDC_MIN2TRAY 1073
+#define IDC_ONTOP 1074
+#define IDC_SHOWMAINMENU 1075
+#define IDC_CLIENTDRAG 1076
+#define IDC_EDIT 1078
+#define IDC_LIST 1079
+#define IDC_HISTORY 1080
+#define IDC_USESOUND 1085
+#define IDC_TOOLWND 1097
+#define IDC_ONECLK 1098
+#define IDC_SHOWCAPTION 1098
+#define IDC_HIDEOFFLINE 1099
+#define IDC_SHOWHIDE 1100
+#define IDC_HIDEEMPTYGROUPS 1100
+#define IDC_SORTBYSTATUS 1101
+#define IDC_FADEINOUT 1101
+#define IDC_READMSG 1102
+#define IDC_AUTOSIZE 1102
+#define IDC_DISABLEGROUPS 1102
+#define IDC_AUTOSIZEUPWARD 1103
+#define IDC_ALWAYSSTATUS 1103
+#define IDC_NETSEARCH 1104
+#define IDC_CONFIRMDELETE 1104
+#define IDC_SORTBYPROTO 1105
+#define IDC_SHOWOPTIONS 1105
+#define IDC_SEARCHURL 1106
+#define IDC_BUILDTIME 1108
+#define IDC_NUMBER 1113
+#define IDC_UIN 1123
+#define IDC_TRANSPARENT 1124
+#define IDC_TRANSINACTIVE 1126
+#define IDC_TRANSACTIVE 1128
+#define IDC_FINDWHAT 1131
+#define IDC_FIND 1132
+#define IDC_FILE 1133
+#define IDC_PROFILELIST 1134
+#define IDC_NEWPROFILE 1135
+#define IDC_NEWPROFILENAME 1136
+#define IDC_TABS 1141
+#define IDC_RESULTS 1142
+#define IDC_STATUS 1144
+#define IDC_SCREENSAVE 1145
+#define IDC_TIMED 1146
+#define IDC_AWAYTIME 1147
+#define IDC_USEPROXY 1148
+#define IDC_SETNA 1148
+#define IDC_PROXYAUTH 1149
+#define IDC_NATIME 1149
+#define IDC_PROXYHOST 1150
+#define IDC_PROXYPORT 1151
+#define IDC_PROXYUSER 1152
+#define IDC_PROXYPASS 1153
+#define IDC_STATIC11 1154
+#define IDC_STATIC12 1155
+#define IDC_STATIC21 1156
+#define IDC_STATIC22 1157
+#define IDC_STATIC31 1158
+#define IDC_STATIC32 1159
+#define IDC_PROXYAUTHNTLM 1160
+#define IDC_HKSHOWHIDE 1162
+#define IDC_HKREADMSG 1163
+#define IDC_SOUNDLIST 1163
+#define IDC_HKSEARCH 1164
+#define IDC_CHANGE 1164
+#define IDC_PREVIEW 1165
+#define IDC_HKSHOWOPTIONS 1165
+#define IDC_PLUGINLIST 1167
+#define IDC_FEATURENAME 1168
+#define IDC_CHOOSE 1169
+#define IDC_TO 1170
+#define IDC_ABOUTGROUP 1175
+#define IDC_DESCRIPTION 1176
+#define IDC_AUTHOR 1177
+#define IDC_COPYRIGHT 1178
+#define IDC_VERSION 1179
+#define IDC_HOMEPAGE 1181
+#define IDC_RESTARTREQD 1182
+#define IDC_ICONSET 1183
+#define IDC_BROWSE 1184
+#define IDC_RUNATSTARTBROWSE 1185
+#define IDC_PAGETREE 1186
+#define IDC_RUNNOW 1186
+#define IDC_INACTIVEPERC 1187
+#define IDC_ACTIVEPERC 1188
+#define IDC_SEARCHNEWWND 1188
+#define IDC_RETRIEVING 1193
+#define IDC_TITLETEXT 1196
+#define IDC_GETMORE 1200
+#define IDC_VISIBLEICON 1204
+#define IDC_INVISIBLEICON 1205
+#define IDC_FILEICON 1206
+#define IDC_ONLINEICON 1207
+#define IDC_FILENAMES 1208
+#define IDC_ALLICON 1208
+#define IDC_DONTREPLY 1209
+#define IDC_NONEICON 1209
+#define IDC_USEPREVIOUS 1210
+#define IDC_NODIALOG 1211
+#define IDC_USESPECIFIC 1212
+#define IDC_FILEDIR 1213
+#define IDC_ALLFILESPROGRESS 1217
+#define IDC_CURRENTSPEED 1219
+#define IDC_STAWAYTYPE 1220
+#define IDC_WHITERECT 1221
+#define IDC_ALLSPEED 1221
+#define IDC_CURRENTFILEPROGRESS 1222
+#define IDC_CURRENTFILEGROUP 1223
+#define IDC_FIRSTNAME 1224
+#define IDC_LASTNAME 1225
+#define IDC_CURRENTTRANSFERRED 1225
+#define IDC_DOBDAY 1226
+#define IDC_DOBMONTH 1227
+#define IDC_WEBPAGE 1228
+#define IDC_DOBYEAR 1228
+#define IDC_UPDATING 1231
+#define IDC_NAMEORDER 1234
+#define IDC_AUTOHIDE 1235
+#define IDC_HIDETIME 1236
+#define IDC_RECONNECTREQD 1239
+#define IDC_IMPORT 1241
+#define IDC_TOMAIN 1243
+#define IDC_TOPROTO 1244
+#define IDC_PROTOLIST 1245
+#define IDC_TODEFICON 1246
+#define IDC_IMPORTMULTI 1247
+#define IDC_MAXSIZEHEIGHT 1254
+#define IDC_MAXSIZESPIN 1255
+#define IDC_FONTID 1256
+#define IDC_SAMETYPE 1257
+#define IDC_SAMESTYLE 1258
+#define IDC_SAMECOLOUR 1259
+#define IDC_SAMEAS 1260
+#define IDC_TYPEFACE 1261
+#define IDC_BOLD 1262
+#define IDC_ITALIC 1263
+#define IDC_COLOUR 1264
+#define IDC_UNDERLINE 1265
+#define IDC_HOTCOLOUR 1267
+#define IDC_SAMESIZE 1268
+#define IDC_BKGCOLOUR 1269
+#define IDC_FILENAME 1271
+#define IDC_SCROLL 1277
+#define IDC_PROPORTIONAL 1278
+#define IDC_SELCOLOUR 1281
+#define IDC_QUICKCOLOUR 1282
+#define IDC_SMOOTHTIME 1283
+#define IDC_SMOOTHTIMESPIN 1284
+#define IDC_GREYOUT 1285
+#define IDC_ROWHEIGHT 1285
+#define IDC_ROWHEIGHTSPIN 1286
+#define IDC_GREYOUTOPTS 1288
+#define IDC_GROUPINDENT 1289
+#define IDC_GROUPINDENTSPIN 1290
+#define IDC_LEFTMARGIN 1291
+#define IDC_SAMPLE 1292
+#define IDC_LEFTMARGINSPIN 1292
+#define IDC_FONTSIZE 1293
+#define IDC_STRETCHH 1298
+#define IDC_STRETCHV 1299
+#define IDC_TILEH 1300
+#define IDC_SCRIPT 1300
+#define IDC_TILEV 1301
+#define IDC_GAMMACORRECT 1302
+#define IDC_INTERESTS 1305
+#define IDC_EMAILS 1306
+#define IDC_PAST 1307
+#define IDC_HIDEOFFLINEOPTS 1308
+#define IDC_PHONES 1308
+#define IDC_SMS 1310
+#define IDC_AREA 1312
+#define IDC_UPDATE 1313
+#define IDC_DONTCYCLE 1315
+#define IDC_PRIMARYSTATUS 1316
+#define IDC_CYCLE 1317
+#define IDC_CYCLETIME 1318
+#define IDC_CYCLETIMESPIN 1319
+#define IDC_HIDETIMESPIN 1320
+#define IDC_MULTITRAY 1321
+#define IDC_ALWAYSMULTI 1322
+#define IDC_SHOWICON 1323
+#define IDC_SHOWPROTO 1324
+#define IDC_SHOWSTATUS 1325
+#define IDC_EQUALSECTIONS 1326
+#define IDC_SHOWSBAR 1329
+#define IDC_RIGHTMIRANDA 1330
+#define IDC_RIGHTSTATUS 1331
+#define IDC_ININAME 1333
+#define IDC_VIEWINI 1334
+#define IDC_SECURITYINFO 1335
+#define IDC_SETTINGNAME 1336
+#define IDC_NEWVALUE 1337
+#define IDC_WARNNOMORE 1338
+#define IDC_DELETE 1339
+#define IDC_RECYCLE 1340
+#define IDC_NEWNAME 1341
+#define IDC_MOVE 1342
+#define IDC_LEAVE 1343
+#define IDC_EXPERT 1346
+#define IDC_SORTBYNAME 1347
+#define IDC_STAUTOHIDESECS 1349
+#define IDC_STCLISTGROUP 1350
+#define IDC_DISABLEDRAGDROP 1351
+#define IDC_NOTEDITLABELS 1352
+#define IDC_SHOWSELALWAYS 1353
+#define IDC_TRACKSELECT 1354
+#define IDC_SHOWGROUPCOUNTS 1355
+#define IDC_HIDECOUNTSWHENEMPTY 1356
+#define IDC_DIVIDERONOFF 1357
+#define IDC_NOTNOTRANSLUCENTSEL 1358
+#define IDC_LINEWITHGROUPS 1359
+#define IDC_QUICKSEARCHVISONLY 1360
+#define IDC_SORTGROUPSALPHA 1361
+#define IDC_NOTNOSMOOTHSCROLLING 1362
+#define IDC_BITMAP 1363
+#define IDC_STWINDOWGROUP 1364
+#define IDC_STATIC01 1365
+#define IDC_CATEGORYLIST 1366
+#define IDC_LOADICONS 1369
+#define IDC_STICONSGROUP 1371
+#define IDC_MSGICON 1375
+#define IDC_URLICON 1376
+#define IDC_STNOPAGE 1377
+#define IDC_STCHECKMARKS 1380
+#define IDC_STSAMETEXT 1382
+#define IDC_STASTEXT 1383
+#define IDC_STSIZETEXT 1384
+#define IDC_STCOLOURTEXT 1385
+#define IDC_STHORZBAR 1386
+#define IDC_MIRANDA 1388
+#define IDC_STATUSBAR 1389
+#define IDC_PROTOIDGROUP 1392
+#define IDC_BYPROTOID 1393
+#define IDC_PROTOID 1394
+#define IDC_EMAILGROUP 1395
+#define IDC_BYEMAIL 1396
+#define IDC_STNAMENICK 1397
+#define IDC_NAMEGROUP 1398
+#define IDC_BYNAME 1399
+#define IDC_STNAMEFIRST 1400
+#define IDC_STNAMELAST 1401
+#define IDC_ADVANCEDGROUP 1402
+#define IDC_BYADVANCED 1403
+#define IDC_ADVANCED 1404
+#define IDC_STSIMPLERIGHT 1440
+#define IDC_NETLIBUSERS 1443
+#define IDC_STOFTENPORT 1445
+#define IDC_STATIC51 1446
+#define IDC_STATIC52 1447
+#define IDC_STATIC43 1448
+#define IDC_LOGOPTIONS 1449
+#define IDC_PORTSRANGE 1450
+#define IDC_TOCONSOLE 1451
+#define IDC_STATIC53 1451
+#define IDC_SHOWCONSOLEATSTART 1452
+#define IDC_PORTSRANGEO 1452
+#define IDC_STATIC54 1453
+#define IDC_SHOWCONSOLE 1454
+#define IDC_TOOUTPUTDEBUGSTRING 1455
+#define IDC_TOFILE 1456
+#define IDC_CLEARCONSOLE 1457
+#define IDC_RUNATSTART 1458
+#define IDC_DUMPSENT 1464
+#define IDC_DUMPPROXY 1466
+#define IDC_TEXTDUMPS 1467
+#define IDC_AUTODETECTTEXT 1468
+#define IDC_TIMEFORMAT 1469
+#define IDC_FILENAMEBROWSE 1470
+#define IDC_SHOWTHISDLGATSTART 1471
+#define IDC_FILEDIRBROWSE 1475
+#define IDC_ALLFILESGROUP 1476
+#define IDC_SCANCMDLINEBROWSE 1476
+#define IDC_ALLTRANSFERRED 1477
+#define IDC_OPENFOLDER 1478
+#define IDC_OPENFILE 1479
+#define IDC_TOTALSIZE 1480
+#define IDC_APPENDNICKTODIR 1483
+#define IDC_AUTOACCEPT 1484
+#define IDC_SCANCMDLINE 1485
+#define IDC_WARNBEFOREOPENING 1488
+#define IDC_SCANDURINGDL 1489
+#define IDC_SCANAFTERDL 1490
+#define IDC_NOSCANNER 1491
+#define IDC_ST_CMDLINE 1492
+#define IDC_ST_CMDLINEHELP 1493
+#define IDC_PROPERTIES 1496
+#define IDC_RESUME 1497
+#define IDC_EXISTINGICON 1499
+#define IDC_RESUMEALL 1500
+#define IDC_OVERWRITE 1501
+#define IDC_OVERWRITEALL 1502
+#define IDC_SKIP 1503
+#define IDC_EXISTINGSIZE 1506
+#define IDC_EXISTINGDATE 1507
+#define IDC_EXISTINGTYPE 1508
+#define IDC_NEWICON 1509
+#define IDC_NEWSIZE 1510
+#define IDC_NEWDATE 1511
+#define IDC_NEWTYPE 1512
+#define IDC_SAVEAS 1513
+#define IDC_ASK 1516
+#define IDC_RENAME 1519
+#define IDC_VIRUSSCANNERGROUP 1520
+#define IDC_HIDE 1534
+#define IDC_TOPLINE 1535
+#define IDC_GPLBTN 1536
+#define IDC_MAIL 1536
+#define IDC_MYHANDLE 1540
+#define IDC_GROUP 1541
+#define IDC_ADDED 1542
+#define IDC_AUTH 1543
+#define IDC_PLUGINSTATIC1 1559
+#define IDC_DELETEHISTORY 1560
+#define IDC_HOTKEYURLSTR 1567
+#define IDC_SETNASTR 1568
+#define IDC_AAUTHOR 1569
+#define IDC_AHOMEPAGE 1570
+#define IDC_AVERSION 1571
+#define IDC_ACOPYRIGHT 1572
+#define IDC_ADESCRIPTION 1573
+#define IDC_PLUGINENABLE 1574
+#define IDC_AUTHREQ 1577
+#define IDC_AUTHGB 1578
+#define IDC_BRINGTOFRONT 1579
+#define IDC_PROTOCOL 1580
+#define IDC_CONTRIBLINK 1586
+#define IDC_HOMELINK 1587
+#define IDC_SUPPORTLINK 1588
+#define IDC_DEVS 1589
+#define IDC_GPL 1590
+#define IDC_LOGO 1591
+#define IDC_CREDITSTEXT 1595
+#define IDC_WSLOCK 1599
+#define IDC_BLINKTIME 1607
+#define IDC_BLINKSPIN 1608
+#define IDC_DISABLEBLINK 1609
+#define IDC_IDLE 1610
+#define IDC_SBPANELBEVEL 1611
+#define IDC_DROPSHADOW 1612
+#define IDC_SHOWGRIP 1612
+#define IDC_NOSCROLLBAR 1613
+#define IDC_BUTTON1 1633
+#define IDC_IDLECHECK 1636
+#define IDC_IDLEONWINDOWS 1637
+#define IDC_IDLEONMIRANDA 1638
+#define IDC_IDLEUSEGLI 1639
+#define IDC_SCREENSAVER 1642
+#define IDC_LOCKED 1643
+#define IDC_IDLESHORT 1644
+#define IDC_IDLELONG 1645
+#define IDC_IDLE1STTIME 1646
+#define IDC_IDLE2NDTIME 1647
+#define IDC_IDLEPRIVATE 1649
+#define IDC_AASTATUS 1650
+#define IDC_AASHORTIDLE 1651
+#define IDC_AALONGSTATUS 1652
+#define IDC_AALONGIDLE 1656
+#define IDC_ONDESKTOP 1657
+#define IDC_WINCOLOUR 1659
+#define IDC_ICONBLINK 1660
+#define IDC_STMSDELAY 1661
+#define IDI_SEARCHALL 32548
+#define ID_ICQ_EXIT 40001
+#define IDM_COPY 40001
+#define ID_RESET 40002
+#define POPUP_HIDEEMPTYGROUPS 40003
+#define POPUP_NEWSUBGROUP 40004
+#define POPUP_HIDEOFFLINE 40005
+#define POPUP_GROUPHIDEOFFLINE 40006
+#define POPUP_HIDEOFFLINEROOT 40007
+#define POPUP_DISABLEGROUPS 40008
+#define IDC_SENDMESSAGE 40009
+#define IDM_COPYALL 40011
+#define IDM_SELECTALL 40012
+#define IDM_CLEAR 40013
+#define IDM_OPENNEW 40014
+#define IDM_OPENEXISTING 40015
+#define IDM_COPYLINK 40016
+#define POPUP_HIDEMIRANDA 40017
+#define ID_TRAY_HIDE 40038
+#define ID_TRAY_EXIT 40040
+#define POPUP_NEWGROUP 40050
+#define POPUP_RENAMEGROUP 40052
+#define POPUP_DELETEGROUP 40053
+
+// Next default values for new objects
+//
+#ifdef APSTUDIO_INVOKED
+#ifndef APSTUDIO_READONLY_SYMBOLS
+#define _APS_NEXT_RESOURCE_VALUE 269
+#define _APS_NEXT_COMMAND_VALUE 40018
+#define _APS_NEXT_CONTROL_VALUE 1662
+#define _APS_NEXT_SYMED_VALUE 101
+#endif
+#endif
diff --git a/miranda-wine/plugins/clist/resource.rc b/miranda-wine/plugins/clist/resource.rc
new file mode 100644
index 0000000..698307c
--- /dev/null
+++ b/miranda-wine/plugins/clist/resource.rc
@@ -0,0 +1,706 @@
+// Microsoft Visual C++ generated resource script.
+//
+#include "resource.h"
+
+#define APSTUDIO_READONLY_SYMBOLS
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 2 resource.
+//
+#include <windows.h>
+#include <winres.h>
+#include <statusmodes.h>
+
+/////////////////////////////////////////////////////////////////////////////
+#undef APSTUDIO_READONLY_SYMBOLS
+
+/////////////////////////////////////////////////////////////////////////////
+// English (U.S.) resources
+
+#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
+#ifdef _WIN32
+LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
+#pragma code_page(1252)
+#endif //_WIN32
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Dialog
+//
+
+IDD_DELETECONTACT DIALOGEX 0, 0, 284, 90
+STYLE DS_SETFONT | DS_MODALFRAME | DS_SETFOREGROUND | DS_FIXEDSYS |
+ DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
+EXSTYLE WS_EX_CONTROLPARENT
+CAPTION "Delete Contact"
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ DEFPUSHBUTTON "No",IDNO,162,38,65,14
+ PUSHBUTTON "Yes",IDYES,54,38,65,14
+ CONTROL "Hide from list only, in order to keep their history and ignore/visibility settings",
+ IDC_HIDE,"Button",BS_AUTOCHECKBOX | BS_MULTILINE |
+ WS_TABSTOP,7,65,270,9
+ LTEXT "Use Options->Ignore (expert mode) to unhide contacts.",
+ IDC_STATIC,20,78,257,8
+ CONTROL "Are you sure you want to delete %s?",IDC_TOPLINE,"Static",
+ SS_SIMPLE | SS_NOPREFIX | WS_GROUP,7,7,270,8
+ LTEXT "This will erase all history and settings for this contact!",
+ IDC_STATIC,7,18,239,14
+END
+
+IDD_OPT_HOTKEY DIALOGEX 0, 0, 238, 136
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Hotkeys",IDC_STATIC,4,4,230,126
+ CONTROL "Show/Hide:",IDC_SHOWHIDE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,14,19,78,9
+ CONTROL "HotKey1",IDC_HKSHOWHIDE,"msctls_hotkey32",WS_BORDER |
+ WS_TABSTOP,92,17,93,12
+ CONTROL "Read Msg:",IDC_READMSG,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,14,36,78,9
+ CONTROL "HotKey1",IDC_HKREADMSG,"msctls_hotkey32",WS_BORDER |
+ WS_TABSTOP,92,34,93,12
+ CONTROL "Net Search:",IDC_NETSEARCH,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,14,53,78,9
+ CONTROL "HotKey1",IDC_HKSEARCH,"msctls_hotkey32",WS_BORDER |
+ WS_TABSTOP,92,51,93,12
+ LTEXT "URL:",IDC_HOTKEYURLSTR,26,71,22,8
+ EDITTEXT IDC_SEARCHURL,92,69,136,12,ES_AUTOHSCROLL
+ CONTROL "Open in new browser window",IDC_SEARCHNEWWND,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,92,86,136,10
+ CONTROL "Show Options",IDC_SHOWOPTIONS,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,14,107,71,9
+ CONTROL "HotKey1",IDC_HKSHOWOPTIONS,"msctls_hotkey32",WS_BORDER |
+ WS_TABSTOP,92,105,93,12
+END
+
+IDD_OPT_CLIST DIALOGEX 0, 0, 314, 204
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ CONTROL "Hide offline users",IDC_HIDEOFFLINE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,17,124,10
+ CONTROL "Hide empty groups",IDC_HIDEEMPTYGROUPS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,33,124,10
+ CONTROL "Disable groups",IDC_DISABLEGROUPS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,50,124,10
+ CONTROL "Ask before deleting contacts",IDC_CONFIRMDELETE,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,67,124,10
+ CONTROL "Sort contacts by name",IDC_SORTBYNAME,"Button",
+ BS_AUTORADIOBUTTON | WS_GROUP,153,14,144,10
+ CONTROL "Sort contacts by status",IDC_SORTBYSTATUS,"Button",
+ BS_AUTORADIOBUTTON,153,26,149,10
+ CONTROL "Sort contacts by protocol",IDC_SORTBYPROTO,"Button",
+ BS_AUTORADIOBUTTON,153,38,151,10
+ CONTROL "Single click interface",IDC_ONECLK,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,152,68,150,10
+ CONTROL "Always show status in tooltip",IDC_ALWAYSSTATUS,"Button",
+ BS_AUTOCHECKBOX | BS_TOP | BS_MULTILINE | WS_TABSTOP,152,
+ 81,151,11
+ CONTROL "Disable icon blinking",IDC_DISABLEBLINK,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,152,95,86,9
+ EDITTEXT IDC_BLINKTIME,153,109,35,12,ES_NUMBER
+ LTEXT "ms delay",IDC_STMSDELAY,192,110,113,8
+ CONTROL "Show",IDC_DONTCYCLE,"Button",BS_AUTORADIOBUTTON |
+ WS_GROUP,10,143,97,10
+ COMBOBOX IDC_PRIMARYSTATUS,107,142,78,70,CBS_DROPDOWNLIST |
+ WS_VSCROLL | WS_TABSTOP
+ LTEXT "icon when statuses differ",IDC_STATIC,189,144,116,8,NOT
+ WS_GROUP
+ CONTROL "Cycle icons every",IDC_CYCLE,"Button",
+ BS_AUTORADIOBUTTON,10,160,97,10
+ EDITTEXT IDC_CYCLETIME,107,159,30,12,ES_RIGHT | ES_NUMBER
+ CONTROL "Spin1",IDC_CYCLETIMESPIN,"msctls_updown32",
+ UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
+ UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,127,158,
+ 10,14
+ LTEXT "seconds, when statuses differ",IDC_STATIC,140,161,165,8,
+ NOT WS_GROUP
+ CONTROL "Show multiple icons",IDC_MULTITRAY,"Button",
+ BS_AUTORADIOBUTTON,10,177,98,10
+ CONTROL "Only when statuses differ",IDC_ALWAYSMULTI,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,108,177,198,10
+ GROUPBOX "Contact List",IDC_STCLISTGROUP,2,2,135,126
+ GROUPBOX "System tray icon",IDC_STATIC,143,57,169,70
+ GROUPBOX "System tray icon when using multiple protocols",
+ IDC_STATIC,2,131,310,66
+ GROUPBOX "Contact List Sorting",IDC_STATIC,143,2,169,54,WS_GROUP
+ CONTROL "Spin5",IDC_BLINKSPIN,"msctls_updown32",UDS_SETBUDDYINT |
+ UDS_ALIGNRIGHT | UDS_ARROWKEYS | UDS_NOTHOUSANDS |
+ UDS_HOTTRACK,173,97,11,21
+ CONTROL "Disable icon blinking",IDC_ICONBLINK,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,10,84,97,10
+END
+
+IDD_OPT_CLUI DIALOGEX 0, 0, 313, 245
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Window",IDC_STWINDOWGROUP,4,4,305,154
+ CONTROL "Always on top",IDC_ONTOP,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,13,18,128,10
+ CONTROL "Tool style main window",IDC_TOOLWND,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,32,128,10
+ CONTROL "Minimize to tray",IDC_MIN2TRAY,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,13,46,128,10
+ CONTROL "Hide contact list after it has been idle for",
+ IDC_AUTOHIDE,"Button",BS_AUTOCHECKBOX | BS_TOP |
+ BS_MULTILINE | WS_TABSTOP,141,18,162,10
+ EDITTEXT IDC_HIDETIME,151,33,30,12,ES_RIGHT | ES_NUMBER
+ CONTROL "Spin1",IDC_HIDETIMESPIN,"msctls_updown32",
+ UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
+ UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,172,32,10,
+ 14
+ LTEXT "seconds",IDC_STATIC01,186,35,56,8
+ CONTROL "Automatically resize window to height of list",
+ IDC_AUTOSIZE,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,141,
+ 55,162,10
+ LTEXT "maximum",IDC_STATIC21,151,71,45,8
+ EDITTEXT IDC_MAXSIZEHEIGHT,197,69,31,12,ES_RIGHT | ES_AUTOHSCROLL |
+ ES_NUMBER
+ CONTROL "Spin1",IDC_MAXSIZESPIN,"msctls_updown32",
+ UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
+ UDS_ARROWKEYS | UDS_HOTTRACK,218,68,10,14
+ LTEXT "% of screen",IDC_STATIC22,230,71,69,8
+ CONTROL "Size upwards",IDC_AUTOSIZEUPWARD,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,151,86,147,10
+ LTEXT "Title bar text:",IDC_STATIC,12,106,51,8
+ GROUPBOX "Translucency options (Windows 2000/XP only)",IDC_STATIC,
+ 4,161,305,80
+ CONTROL "Fade contact list in/out",IDC_FADEINOUT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,174,163,10
+ CONTROL "Transparent contact list",IDC_TRANSPARENT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,191,151,9
+ LTEXT "Inactive opacity:",IDC_STATIC11,23,206,89,8
+ CONTROL "Slider2",IDC_TRANSINACTIVE,"msctls_trackbar32",TBS_TOP |
+ TBS_NOTICKS | WS_TABSTOP,112,205,130,11
+ LTEXT "Active opacity:",IDC_STATIC12,23,221,89,8
+ CONTROL "Slider2",IDC_TRANSACTIVE,"msctls_trackbar32",TBS_TOP |
+ TBS_NOTICKS | WS_TABSTOP,112,221,130,11
+ LTEXT "000%",IDC_INACTIVEPERC,246,206,29,8,SS_NOPREFIX
+ LTEXT "000%",IDC_ACTIVEPERC,246,222,29,8,SS_NOPREFIX
+ CONTROL "Show menu bar",IDC_SHOWMAINMENU,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,60,128,10
+ CONTROL "Easy move",IDC_CLIENTDRAG,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,13,74,128,10
+ CONTROL "Show title bar",IDC_SHOWCAPTION,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,13,88,128,10
+ CONTROL "If window is partially covered, bring to front instead of hiding",
+ IDC_BRINGTOFRONT,"Button",BS_AUTOCHECKBOX | BS_MULTILINE |
+ WS_TABSTOP,141,102,162,16
+ EDITTEXT IDC_TITLETEXT,63,104,72,12,ES_AUTOHSCROLL
+ CONTROL "Show drop shadow (restart required)",IDC_DROPSHADOW,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,13,122,138,10
+ CONTROL "Pin to desktop",IDC_ONDESKTOP,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,13,137,128,10
+END
+
+IDD_OPT_CLC DIALOGEX 0, 0, 314, 251
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Items",IDC_STATIC,2,2,310,114
+ CONTROL "Show divider between online and offline contacts",
+ IDC_DIVIDERONOFF,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 11,13,179,10
+ CONTROL "Hot track items as mouse passes over",IDC_TRACKSELECT,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,28,179,10
+ CONTROL "Disable drag and drop of items",IDC_DISABLEDRAGDROP,
+ "Button",BS_AUTOCHECKBOX | WS_TABSTOP,11,43,179,10
+ CONTROL "Disable rename of items by clicking twice",
+ IDC_NOTEDITLABELS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 11,58,179,10
+ CONTROL "Show selection even when list is not focused",
+ IDC_SHOWSELALWAYS,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
+ 11,73,179,10
+ CONTROL "Make selection highlight translucent",
+ IDC_NOTNOTRANSLUCENTSEL,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,11,88,179,10
+ LTEXT "'Hide Offline' means to hide:",IDC_STATIC,191,10,112,8
+ CONTROL "Tree1",IDC_HIDEOFFLINEOPTS,"SysTreeView32",
+ TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER |
+ WS_TABSTOP | 0x4000,191,20,112,86
+ GROUPBOX "Groups",IDC_STATIC,2,120,148,121
+ CONTROL "Draw a line alongside group names",IDC_LINEWITHGROUPS,
+ "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,
+ 129,131,16
+ CONTROL "Show counts of number of contacts in a group",
+ IDC_SHOWGROUPCOUNTS,"Button",BS_AUTOCHECKBOX |
+ BS_MULTILINE | WS_TABSTOP,11,147,131,16
+ CONTROL "Hide group counts when there are none online",
+ IDC_HIDECOUNTSWHENEMPTY,"Button",BS_AUTOCHECKBOX |
+ BS_MULTILINE | WS_TABSTOP,11,165,131,16
+ CONTROL "Sort groups alphabetically",IDC_SORTGROUPSALPHA,"Button",
+ BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,183,131,
+ 16
+ CONTROL "Quicksearch in open groups only",IDC_QUICKSEARCHVISONLY,
+ "Button",BS_AUTOCHECKBOX | BS_MULTILINE | WS_TABSTOP,11,
+ 201,131,16
+ LTEXT "Indent groups by:",IDC_STATIC,11,221,67,8
+ EDITTEXT IDC_GROUPINDENT,78,219,31,12,ES_RIGHT | ES_NUMBER
+ CONTROL "Spin1",IDC_GROUPINDENTSPIN,"msctls_updown32",
+ UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
+ UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,95,215,10,
+ 14
+ LTEXT "pixels",IDC_STATIC,112,221,36,8
+ GROUPBOX "Visual",IDC_STATIC,156,120,156,121
+ CONTROL "Scroll list smoothly",IDC_NOTNOSMOOTHSCROLLING,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,164,130,139,10
+ LTEXT "Time:",IDC_STATIC11,174,144,42,8
+ EDITTEXT IDC_SMOOTHTIME,216,142,31,12,ES_RIGHT | ES_NUMBER
+ CONTROL "Spin1",IDC_SMOOTHTIMESPIN,"msctls_updown32",
+ UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
+ UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,237,137,
+ 10,14
+ LTEXT "milliseconds",IDC_STATIC12,250,140,56,8,SS_CENTERIMAGE
+ LTEXT "Left margin:",IDC_STATIC,165,180,52,8
+ EDITTEXT IDC_LEFTMARGIN,215,180,31,12,ES_RIGHT | ES_NUMBER
+ CONTROL "Spin1",IDC_LEFTMARGINSPIN,"msctls_updown32",
+ UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
+ UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,240,180,
+ 10,14
+ LTEXT "pixels",IDC_STATIC,250,180,54,8
+ CONTROL "Grey out entire list when:",IDC_GREYOUT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,165,195,139,10
+ CONTROL "Tree1",IDC_GREYOUTOPTS,"SysTreeView32",
+ TVS_DISABLEDRAGDROP | TVS_NOTOOLTIPS | WS_BORDER |
+ WS_TABSTOP | 0x4000,165,205,139,30
+ CONTROL "Dim idle contacts",IDC_IDLE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,11,102,153,10
+ CONTROL "Hide vertical scroll bar",IDC_NOSCROLLBAR,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,165,160,140,10
+END
+
+IDD_OPT_CLCTEXT DIALOGEX 0, 0, 277, 240
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Fonts",IDC_STATIC,4,4,269,125
+ COMBOBOX IDC_FONTID,12,17,253,87,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "same",IDC_STSAMETEXT,19,32,45,10,SS_CENTERIMAGE
+ CONTROL "Typeface",IDC_SAMETYPE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,64,32,52,10
+ CONTROL "Size",IDC_SAMESIZE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,117,32,45,10
+ CONTROL "Style",IDC_SAMESTYLE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,163,32,48,10
+ CONTROL "Colour",IDC_SAMECOLOUR,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,212,32,53,10
+ LTEXT "as:",IDC_STASTEXT,19,46,45,10,SS_CENTERIMAGE
+ COMBOBOX IDC_SAMEAS,64,45,196,88,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ CONTROL "",IDC_STHORZBAR,"Static",SS_ETCHEDHORZ,9,64,259,1
+ COMBOBOX IDC_TYPEFACE,12,72,136,182,CBS_DROPDOWN | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_SCRIPT,156,72,60,68,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ COMBOBOX IDC_FONTSIZE,225,72,40,69,CBS_DROPDOWN | WS_VSCROLL |
+ WS_TABSTOP
+ CONTROL "Bold",IDC_BOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,12,
+ 88,45,10
+ CONTROL "Italic",IDC_ITALIC,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,65,88,52,10
+ CONTROL "Underline",IDC_UNDERLINE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,117,88,66,10
+ CONTROL "",IDC_COLOUR,"ColourPicker",WS_TABSTOP,206,87,59,12
+ EDITTEXT IDC_SAMPLE,63,104,151,16,ES_CENTER | ES_READONLY | NOT
+ WS_TABSTOP
+ GROUPBOX "Rows",IDC_STATIC,4,134,269,31
+ LTEXT "Row height:",IDC_STATIC,12,148,65,8
+ EDITTEXT IDC_ROWHEIGHT,77,146,31,12,ES_RIGHT | ES_NUMBER
+ CONTROL "Spin1",IDC_ROWHEIGHTSPIN,"msctls_updown32",
+ UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
+ UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,97,145,10,
+ 14
+ LTEXT "pixels",IDC_STATIC,112,148,62,8
+ GROUPBOX "Additional Colours",IDC_STATIC,4,171,269,65
+ LTEXT "Selected text:",IDC_STATIC,12,186,65,8
+ CONTROL "",IDC_SELCOLOUR,"ColourPicker",WS_TABSTOP,77,184,29,12
+ LTEXT "Hottrack text:",IDC_STATIC,12,202,65,8
+ CONTROL "",IDC_HOTCOLOUR,"ColourPicker",WS_TABSTOP,77,200,29,12
+ CONTROL "Gamma correction",IDC_GAMMACORRECT,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,119,201,117,10
+ LTEXT "Quicksearch text:",IDC_STATIC,12,218,65,8
+ CONTROL "",IDC_QUICKCOLOUR,"ColourPicker",WS_TABSTOP,77,216,29,
+ 12
+ LTEXT "Size:",IDC_STSIZETEXT,231,114,34,8,NOT WS_VISIBLE
+ LTEXT "Colour:",IDC_STCOLOURTEXT,228,102,37,8,NOT WS_VISIBLE
+END
+
+IDD_OPT_CLCBKG DIALOGEX 0, 0, 235, 154
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Contact List Background",IDC_STATIC,4,4,227,146
+ LTEXT "Background colour",IDC_STATIC,59,35,72,8,NOT WS_GROUP
+ CONTROL "",IDC_BKGCOLOUR,"ColourPicker",WS_TABSTOP,22,35,32,10
+ LTEXT "Selection colour",IDC_STATIC,59,51,72,8
+ CONTROL "",IDC_SELCOLOUR,"ColourPicker",WS_TABSTOP,22,51,32,10
+ CONTROL "Use background image",IDC_BITMAP,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,12,70,161,10
+ EDITTEXT IDC_FILENAME,22,88,184,12,ES_AUTOHSCROLL
+ PUSHBUTTON "...",IDC_BROWSE,208,88,15,11
+ CONTROL "Stretch to width",IDC_STRETCHH,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,22,105,100,10
+ CONTROL "Stretch to height",IDC_STRETCHV,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,122,105,101,10
+ CONTROL "Tile horizontally",IDC_TILEH,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,22,118,100,10
+ CONTROL "Tile vertically",IDC_TILEV,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,122,118,101,10
+ CONTROL "Scroll with text",IDC_SCROLL,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,22,131,100,10
+ CONTROL "Stretch proportionally",IDC_PROPORTIONAL,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,122,131,101,10
+ CONTROL "Use Windows colours",IDC_WINCOLOUR,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,12,20,156,10
+END
+
+IDD_OPT_SBAR DIALOGEX 0, 0, 178, 212
+STYLE DS_SETFONT | DS_FIXEDSYS | DS_CENTER | WS_CHILD
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Status Bar",IDC_STATIC,4,4,170,204
+ CONTROL "Show status bar",IDC_SHOWSBAR,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,12,17,152,10
+ CONTROL "Show icons",IDC_SHOWICON,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,22,33,142,10
+ CONTROL "Show protocol names",IDC_SHOWPROTO,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,22,48,142,10
+ CONTROL "Show status text",IDC_SHOWSTATUS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,22,63,142,10
+ CONTROL "Right click opens status menu",IDC_RIGHTSTATUS,"Button",
+ BS_AUTORADIOBUTTON,22,160,142,10
+ CONTROL "Right click opens Miranda IM menu",IDC_RIGHTMIRANDA,
+ "Button",BS_AUTORADIOBUTTON,22,147,142,10
+ CONTROL "Make sections equal width",IDC_EQUALSECTIONS,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,22,78,142,10
+ CONTROL "Show bevels on panels",IDC_SBPANELBEVEL,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,22,94,107,10
+ CONTROL "Show resize grip indicator",IDC_SHOWGRIP,"Button",
+ BS_AUTOCHECKBOX | WS_TABSTOP,22,110,96,10
+END
+
+IDD_OPT_CLCTEXTSIMPLE DIALOGEX 0, 0, 277, 240
+STYLE DS_SETFONT | DS_FIXEDSYS | WS_CHILD | WS_VISIBLE
+EXSTYLE WS_EX_CONTROLPARENT
+FONT 8, "MS Shell Dlg", 0, 0, 0x1
+BEGIN
+ GROUPBOX "Fonts",IDC_STATIC,4,4,269,125
+ COMBOBOX IDC_FONTID,12,17,253,87,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "as:",IDC_STASTEXT,25,34,52,10,SS_CENTERIMAGE
+ COMBOBOX IDC_SAMEAS,77,33,163,88,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ CONTROL "",IDC_STHORZBAR,"Static",SS_ETCHEDHORZ,9,51,259,1
+ COMBOBOX IDC_TYPEFACE,12,58,172,182,CBS_DROPDOWN | CBS_SORT |
+ WS_VSCROLL | WS_TABSTOP
+ COMBOBOX IDC_SCRIPT,192,58,73,68,CBS_DROPDOWNLIST | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "Size:",IDC_STSIZETEXT,33,76,34,8
+ COMBOBOX IDC_FONTSIZE,67,74,54,69,CBS_DROPDOWN | WS_VSCROLL |
+ WS_TABSTOP
+ LTEXT "Colour:",IDC_STCOLOURTEXT,147,76,37,8
+ CONTROL "",IDC_COLOUR,"ColourPicker",WS_TABSTOP,184,74,59,12
+ CONTROL "Bold",IDC_BOLD,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,58,
+ 90,45,10
+ CONTROL "Italic",IDC_ITALIC,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,117,90,52,10
+ CONTROL "Underline",IDC_UNDERLINE,"Button",BS_AUTOCHECKBOX |
+ WS_TABSTOP,179,90,66,10
+ EDITTEXT IDC_SAMPLE,63,104,151,16,ES_CENTER | ES_READONLY | NOT
+ WS_TABSTOP
+ GROUPBOX "Rows",IDC_STATIC,4,134,269,31
+ LTEXT "Row height:",IDC_STATIC,12,148,65,8
+ EDITTEXT IDC_ROWHEIGHT,77,146,31,12,ES_RIGHT | ES_NUMBER
+ CONTROL "Spin1",IDC_ROWHEIGHTSPIN,"msctls_updown32",
+ UDS_SETBUDDYINT | UDS_ALIGNRIGHT | UDS_AUTOBUDDY |
+ UDS_ARROWKEYS | UDS_NOTHOUSANDS | UDS_HOTTRACK,97,145,10,
+ 14
+ LTEXT "pixels",IDC_STATIC,112,148,62,8
+ GROUPBOX "Additional Colours",IDC_STATIC,4,171,269,65
+ LTEXT "Selected text:",IDC_STATIC,12,186,65,8
+ CONTROL "",IDC_SELCOLOUR,"ColourPicker",WS_TABSTOP,77,184,29,12
+ LTEXT "Hottrack text:",IDC_STATIC,12,202,65,8
+ CONTROL "",IDC_HOTCOLOUR,"ColourPicker",WS_TABSTOP,77,200,29,12
+ LTEXT "Quicksearch text:",IDC_STATIC,12,218,65,8
+ CONTROL "",IDC_QUICKCOLOUR,"ColourPicker",WS_TABSTOP,77,216,29,
+ 12
+END
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// DESIGNINFO
+//
+
+#ifdef APSTUDIO_INVOKED
+GUIDELINES DESIGNINFO
+BEGIN
+ IDD_DELETECONTACT, DIALOG
+ BEGIN
+ LEFTMARGIN, 7
+ RIGHTMARGIN, 277
+ TOPMARGIN, 7
+ BOTTOMMARGIN, 85
+ END
+
+ IDD_OPT_HOTKEY, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 234
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 132
+ HORZGUIDE, 23
+ HORZGUIDE, 40
+ HORZGUIDE, 57
+ END
+
+ IDD_OPT_CLIST, DIALOG
+ BEGIN
+ LEFTMARGIN, 2
+ RIGHTMARGIN, 312
+ VERTGUIDE, 10
+ VERTGUIDE, 107
+ TOPMARGIN, 2
+ BOTTOMMARGIN, 202
+ HORZGUIDE, 179
+ HORZGUIDE, 196
+ END
+
+ IDD_OPT_CLUI, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 309
+ VERTGUIDE, 13
+ VERTGUIDE, 23
+ VERTGUIDE, 112
+ VERTGUIDE, 141
+ VERTGUIDE, 151
+ VERTGUIDE, 175
+ VERTGUIDE, 242
+ VERTGUIDE, 246
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 241
+ HORZGUIDE, 18
+ HORZGUIDE, 39
+ HORZGUIDE, 75
+ HORZGUIDE, 180
+ HORZGUIDE, 196
+ END
+
+ IDD_OPT_CLC, DIALOG
+ BEGIN
+ LEFTMARGIN, 2
+ RIGHTMARGIN, 312
+ VERTGUIDE, 11
+ VERTGUIDE, 164
+ VERTGUIDE, 216
+ TOPMARGIN, 2
+ BOTTOMMARGIN, 249
+ HORZGUIDE, 145
+ HORZGUIDE, 163
+ HORZGUIDE, 222
+ END
+
+ IDD_OPT_CLCTEXT, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 273
+ VERTGUIDE, 12
+ VERTGUIDE, 19
+ VERTGUIDE, 77
+ VERTGUIDE, 258
+ VERTGUIDE, 265
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 236
+ HORZGUIDE, 37
+ HORZGUIDE, 51
+ HORZGUIDE, 79
+ HORZGUIDE, 94
+ HORZGUIDE, 152
+ HORZGUIDE, 190
+ HORZGUIDE, 206
+ HORZGUIDE, 222
+ END
+
+ IDD_OPT_CLCBKG, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 231
+ VERTGUIDE, 12
+ VERTGUIDE, 22
+ VERTGUIDE, 122
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 150
+ HORZGUIDE, 24
+ HORZGUIDE, 35
+ HORZGUIDE, 73
+ HORZGUIDE, 89
+ HORZGUIDE, 102
+ HORZGUIDE, 115
+ END
+
+ IDD_OPT_SBAR, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 174
+ VERTGUIDE, 12
+ VERTGUIDE, 22
+ VERTGUIDE, 164
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 208
+ END
+
+ IDD_OPT_CLCTEXTSIMPLE, DIALOG
+ BEGIN
+ LEFTMARGIN, 4
+ RIGHTMARGIN, 273
+ VERTGUIDE, 12
+ VERTGUIDE, 19
+ VERTGUIDE, 77
+ VERTGUIDE, 258
+ VERTGUIDE, 265
+ TOPMARGIN, 4
+ BOTTOMMARGIN, 236
+ HORZGUIDE, 37
+ HORZGUIDE, 64
+ HORZGUIDE, 80
+ HORZGUIDE, 95
+ HORZGUIDE, 152
+ HORZGUIDE, 190
+ HORZGUIDE, 206
+ HORZGUIDE, 222
+ END
+END
+#endif // APSTUDIO_INVOKED
+
+
+#ifdef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// TEXTINCLUDE
+//
+
+1 TEXTINCLUDE
+BEGIN
+ "resource.h\0"
+END
+
+2 TEXTINCLUDE
+BEGIN
+ "#include <windows.h>\r\n"
+ "#include <winres.h>\r\n"
+ "#include <statusmodes.h>\r\n"
+ "\0"
+END
+
+3 TEXTINCLUDE
+BEGIN
+ "\r\n"
+ "\0"
+END
+
+#endif // APSTUDIO_INVOKED
+
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Icon
+//
+
+// Icon with lowest ID value placed first to ensure application icon
+// remains consistent on all systems.
+IDI_RENAME ICON "res\\rename.ico"
+IDI_BLANK ICON "res\\blank.ico"
+IDI_DELETE ICON "res\\delete.ico"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Cursor
+//
+
+IDC_HYPERLINKHAND CURSOR "res\\hyperlin.cur"
+IDC_DROP CURSOR "res\\dragcopy.cur"
+IDC_DROPUSER CURSOR "res\\dropuser.cur"
+
+/////////////////////////////////////////////////////////////////////////////
+//
+// Menu
+//
+
+IDR_CLISTMENU MENU
+BEGIN
+ POPUP "&¤"
+ BEGIN
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_ICQ_EXIT
+ END
+ POPUP "&Status"
+ BEGIN
+ MENUITEM "&Offline\tCtrl+0", ID_STATUS_OFFLINE, CHECKED
+ MENUITEM "On&line\tCtrl+1", ID_STATUS_ONLINE
+ MENUITEM "&Away\tCtrl+2", ID_STATUS_AWAY
+ MENUITEM "&NA\tCtrl+3", ID_STATUS_NA
+ MENUITEM "Occ&upied\tCtrl+4", ID_STATUS_OCCUPIED
+ MENUITEM "&DND\tCtrl+5", ID_STATUS_DND
+ MENUITEM "&Free for chat\tCtrl+6", ID_STATUS_FREECHAT
+ MENUITEM "&Invisible\tCtrl+7", ID_STATUS_INVISIBLE
+ MENUITEM "On the &Phone\tCtrl+8", ID_STATUS_ONTHEPHONE
+ MENUITEM "Out to &Lunch\tCtrl+9", ID_STATUS_OUTTOLUNCH
+ END
+END
+
+IDR_CONTEXT MENU
+BEGIN
+ POPUP "Tray"
+ BEGIN
+ MENUITEM "&Hide/Show", ID_TRAY_HIDE
+ MENUITEM SEPARATOR
+ MENUITEM "E&xit", ID_TRAY_EXIT
+ END
+ POPUP "Nowhere"
+ BEGIN
+ MENUITEM "&New Group", POPUP_NEWGROUP
+ MENUITEM SEPARATOR
+ MENUITEM "&Hide Offline Users", POPUP_HIDEOFFLINE
+ MENUITEM "Hide &Offline Users out here", POPUP_HIDEOFFLINEROOT
+ MENUITEM "Hide &Empty Groups", POPUP_HIDEEMPTYGROUPS
+ MENUITEM "Disable &Groups", POPUP_DISABLEGROUPS
+ MENUITEM SEPARATOR
+ MENUITEM "Hide Miranda", POPUP_HIDEMIRANDA
+ END
+ POPUP "Group"
+ BEGIN
+ MENUITEM "&New Subgroup", POPUP_NEWSUBGROUP
+ MENUITEM "&Hide Offline Users in here", POPUP_GROUPHIDEOFFLINE
+ MENUITEM SEPARATOR
+ MENUITEM "&Rename Group", POPUP_RENAMEGROUP
+ MENUITEM "&Delete Group", POPUP_DELETEGROUP
+ END
+END
+
+#endif // English (U.S.) resources
+/////////////////////////////////////////////////////////////////////////////
+
+
+
+#ifndef APSTUDIO_INVOKED
+/////////////////////////////////////////////////////////////////////////////
+//
+// Generated from the TEXTINCLUDE 3 resource.
+//
+
+
+/////////////////////////////////////////////////////////////////////////////
+#endif // not APSTUDIO_INVOKED
+