summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2012-11-05 20:08:43 +0000
committerGeorge Hazan <george.hazan@gmail.com>2012-11-05 20:08:43 +0000
commit35a9af527f9b7ec35e81455784cd0a795be910c5 (patch)
tree7a562aa27d45a54e143d732452bfc62ad2d242c7
parent81dc8462ddae0555821a6093bda8a67fe6bb504e (diff)
- removed duplicate constants;
- code cleaning git-svn-id: http://svn.miranda-ng.org/main/trunk@2211 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--include/m_clc.h4
-rw-r--r--plugins/Clist_modern/src/modern_clui.cpp6
-rw-r--r--plugins/Clist_mw/src/clui.cpp19
-rw-r--r--plugins/Clist_nicer/src/Include/clc.h1
-rw-r--r--plugins/Clist_nicer/src/clui.cpp1423
-rw-r--r--src/core/stdclist/src/clcpaint.cpp8
-rw-r--r--src/modules/clist/clc.cpp8
-rw-r--r--src/modules/clist/clcitems.cpp5
-rw-r--r--src/modules/clist/clcmsgs.cpp1
-rw-r--r--src/modules/clist/clcutils.cpp4
-rw-r--r--src/modules/clist/clui.cpp8
-rw-r--r--src/modules/extraicons/extraicons.cpp3
12 files changed, 765 insertions, 725 deletions
diff --git a/include/m_clc.h b/include/m_clc.h
index bb6befc7dc..67ffdd9f3f 100644
--- a/include/m_clc.h
+++ b/include/m_clc.h
@@ -218,6 +218,10 @@ typedef struct {
//NM_CLICK //hItem, iColumn, pt, flags valid
//NM_KEYDOWN //NMKEY structure, only sent when key is not already processed, return nonzero to prevent further processing
+// clist window tree messages
+#define M_CREATECLC (WM_USER+1)
+#define M_SETALLEXTRAICONS (WM_USER+2)
+
//an infotip for an item should be shown now
//wParam = 0
//lParam = (LPARAM)(CLCINFOTIP*)&it
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp
index 872cb6e165..9a8c0324d3 100644
--- a/plugins/Clist_modern/src/modern_clui.cpp
+++ b/plugins/Clist_modern/src/modern_clui.cpp
@@ -2233,7 +2233,7 @@ LRESULT CLUI::OnCreate( UINT msg, WPARAM wParam, LPARAM lParam )
DrawMenuBar(m_hWnd);
CLUIServices_ProtocolStatusChanged(0,0);
- { MENUITEMINFO mii;
+ MENUITEMINFO mii;
ZeroMemory(&mii,sizeof(mii));
mii.cbSize = MENUITEMINFO_V4_SIZE;
mii.fMask = MIIM_TYPE|MIIM_DATA;
@@ -2251,9 +2251,7 @@ LRESULT CLUI::OnCreate( UINT msg, WPARAM wParam, LPARAM lParam )
mii.fType = MFT_OWNERDRAW;
mii.dwItemData = MENU_MINIMIZE;
SetMenuItemInfo(GetMenu(m_hWnd),2,TRUE,&mii);
- }
- //PostMessage(m_hWnd, M_CREATECLC, 0, 0);
- //pcli->hwndContactList = m_hWnd;
+
uMsgGetProfile = RegisterWindowMessage(_T("Miranda::GetProfile")); // don't localise
bTransparentFocus = 1;
return FALSE;
diff --git a/plugins/Clist_mw/src/clui.cpp b/plugins/Clist_mw/src/clui.cpp
index c4ce950db4..3e23ecd5dc 100644
--- a/plugins/Clist_mw/src/clui.cpp
+++ b/plugins/Clist_mw/src/clui.cpp
@@ -42,13 +42,15 @@ static int lastreqh = 0,requr = 0,disableautoupd = 1;
HANDLE hFrameContactTree;
BYTE showOpts;//for statusbar
-typedef struct{
-int IconsCount;
-int CycleStartTick;
-char *szProto;
-int n;
-int TimerCreated;
-} ProtoTicks,*pProtoTicks;
+typedef struct
+{
+ int IconsCount;
+ int CycleStartTick;
+ char *szProto;
+ int n;
+ int TimerCreated;
+}
+ ProtoTicks,*pProtoTicks;
ProtoTicks CycleStartTick[64];//max 64 protocols
@@ -77,9 +79,6 @@ HICON GetConnectingIconForProto_DLL(char *szProto,int b);
void RegisterProtoIconsForAllProtoIconLib();
-#define M_CREATECLC (WM_USER+1)
-#define M_SETALLEXTRAICONS (WM_USER+2)
-
static int CluiModulesLoaded(WPARAM wParam,LPARAM lParam)
{
MENUITEMINFO mii;
diff --git a/plugins/Clist_nicer/src/Include/clc.h b/plugins/Clist_nicer/src/Include/clc.h
index 4195b6c8b7..7e2cacdf3f 100644
--- a/plugins/Clist_nicer/src/Include/clc.h
+++ b/plugins/Clist_nicer/src/Include/clc.h
@@ -33,7 +33,6 @@
#define INTM_XSTATUSCHANGED (WM_USER+26)
#define INTM_METACHANGEDEVENT (WM_USER+27)
#define INTM_CODEPAGECHANGED (WM_USER+28)
-//#define INTM_CLIENTCHANGED (WM_USER+29)
#define INTM_AVATARCHANGED (WM_USER+30)
#define INTM_STATUSMSGCHANGED (WM_USER+31)
#define INTM_SORTCLC (WM_USER+32)
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp
index 3db0ad2f9f..8dea08ad8b 100644
--- a/plugins/Clist_nicer/src/clui.cpp
+++ b/plugins/Clist_nicer/src/clui.cpp
@@ -844,491 +844,496 @@ static void GetButtonRect(HWND hwnd, RECT *rc)
}
}
-#define M_CREATECLC (WM_USER+1)
LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
switch (msg) {
- case WM_CREATE: {
- int i;
- {
- int flags = WS_CHILD | CCS_BOTTOM;
- flags |= cfg::getByte("CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
- flags |= cfg::getByte("CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, hwnd, NULL, g_hInst, NULL);
- if (flags & WS_VISIBLE) {
- ShowWindow(pcli->hwndStatus, SW_SHOW);
- SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0);
- }
- OldStatusBarProc = (WNDPROC)SetWindowLongPtr(pcli->hwndStatus, GWLP_WNDPROC, (LONG_PTR)NewStatusBarWndProc);
- SetClassLong(pcli->hwndStatus, GCL_STYLE, GetClassLong(pcli->hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW));
- }
- g_oldSize.cx = g_oldSize.cy = 0;
- old_cliststate = cfg::getByte("CList", "State", SETTING_STATE_NORMAL);
- cfg::writeByte("CList", "State", SETTING_STATE_HIDDEN);
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~WS_VISIBLE);
- SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | WS_CLIPCHILDREN);
- if (!cfg::dat.bFirstRun)
- ConfigureEventArea(hwnd);
- CluiProtocolStatusChanged(0, 0);
- ConfigureCLUIGeometry(0);
-
- for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- statusNames[i - ID_STATUS_OFFLINE] = reinterpret_cast<TCHAR *>(CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, GSMDF_TCHAR));
-
- //delay creation of CLC so that it can get the status icons right the first time (needs protocol modules loaded)
- if (cfg::dat.bLayeredHack) {
- SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | (WS_EX_LAYERED));
- API::SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 255, LWA_ALPHA);
- }
-
- if (cfg::dat.isTransparent) {
- SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
- API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
+ case WM_CREATE: {
+ int i;
+ {
+ int flags = WS_CHILD | CCS_BOTTOM;
+ flags |= cfg::getByte("CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
+ flags |= cfg::getByte("CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
+ pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, NULL, flags, 0, 0, 0, 0, hwnd, NULL, g_hInst, NULL);
+ if (flags & WS_VISIBLE) {
+ ShowWindow(pcli->hwndStatus, SW_SHOW);
+ SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0);
}
- transparentFocus = 1;
+ OldStatusBarProc = (WNDPROC)SetWindowLongPtr(pcli->hwndStatus, GWLP_WNDPROC, (LONG_PTR)NewStatusBarWndProc);
+ SetClassLong(pcli->hwndStatus, GCL_STYLE, GetClassLong(pcli->hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW));
+ }
+ g_oldSize.cx = g_oldSize.cy = 0;
+ old_cliststate = cfg::getByte("CList", "State", SETTING_STATE_NORMAL);
+ cfg::writeByte("CList", "State", SETTING_STATE_HIDDEN);
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~WS_VISIBLE);
+ SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) | WS_CLIPCHILDREN);
+ if (!cfg::dat.bFirstRun)
+ ConfigureEventArea(hwnd);
+ CluiProtocolStatusChanged(0, 0);
+ ConfigureCLUIGeometry(0);
+
+ for (i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
+ statusNames[i - ID_STATUS_OFFLINE] = reinterpret_cast<TCHAR *>(CallService(MS_CLIST_GETSTATUSMODEDESCRIPTION, (WPARAM)i, GSMDF_TCHAR));
+
+ //delay creation of CLC so that it can get the status icons right the first time (needs protocol modules loaded)
+ if (cfg::dat.bLayeredHack) {
+ SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | (WS_EX_LAYERED));
+ API::SetLayeredWindowAttributes(hwnd, RGB(0, 0, 0), 255, LWA_ALPHA);
+ }
- TranslateMenu(GetMenu(hwnd));
- PostMessage(hwnd, M_CREATECLC, 0, 0);
- return FALSE;
+ if (cfg::dat.isTransparent) {
+ SetWindowLongPtr(hwnd, GWL_EXSTYLE, GetWindowLongPtr(hwnd, GWL_EXSTYLE) | WS_EX_LAYERED);
+ API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
}
- case WM_NCCREATE: {
+ transparentFocus = 1;
+
+ TranslateMenu(GetMenu(hwnd));
+ PostMessage(hwnd, M_CREATECLC, 0, 0);
+ return FALSE;
+ }
+ case WM_NCCREATE:
+ {
LPCREATESTRUCT p = (LPCREATESTRUCT)lParam;
p->style &= ~(CS_HREDRAW | CS_VREDRAW);
}
break;
- case M_CREATECLC: {
- if (cfg::getByte("CLUI", "useskin", 0))
- IMG_LoadItems();
- CreateButtonBar(hwnd);
- //FYR: to be checked: otherwise it raises double xStatus items
- //NotifyEventHooks(pcli->hPreBuildStatusMenuEvent, 0, 0);
- SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE);
+
+ case M_CREATECLC: {
+ if (cfg::getByte("CLUI", "useskin", 0))
+ IMG_LoadItems();
+ CreateButtonBar(hwnd);
+ //FYR: to be checked: otherwise it raises double xStatus items
+ //NotifyEventHooks(pcli->hPreBuildStatusMenuEvent, 0, 0);
+ SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE);
+ {
+ LONG style;
+ BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
+ ShowWindow(pcli->hwndContactList, SW_HIDE);
+ style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
+ if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT)
{
- LONG style;
- BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW);
- ShowWindow(pcli->hwndContactList, SW_HIDE);
- style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
- if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT)
- {
- style |= WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE;
+ style |= WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE;
+ style &= ~WS_EX_APPWINDOW;
+ }
+ else
+ {
+ style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
+ if (cfg::getByte("CList", "AlwaysHideOnTB", 1))
style &= ~WS_EX_APPWINDOW;
- }
else
- {
- style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
- if (cfg::getByte("CList", "AlwaysHideOnTB", 1))
- style &= ~WS_EX_APPWINDOW;
- else
- style |= WS_EX_APPWINDOW;
- }
+ style |= WS_EX_APPWINDOW;
+ }
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style);
- ApplyCLUIBorderStyle(pcli->hwndContactList);
+ SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style);
+ ApplyCLUIBorderStyle(pcli->hwndContactList);
- SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE);
- }
+ SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE);
+ }
- ConfigureFrame();
+ ConfigureFrame();
- CreateCLC(hwnd);
- cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0);
+ CreateCLC(hwnd);
+ cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0);
- if (API::sysConfig.isWin2KPlus && cfg::dat.bFullTransparent) {
- if (g_CLUISkinnedBkColorRGB)
- Tweak_It(g_CLUISkinnedBkColorRGB);
- else if (cfg::dat.bClipBorder || (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME))
- Tweak_It(RGB(255, 0, 255));
- else
- Tweak_It(cfg::clcdat->bkColour);
- }
+ if (API::sysConfig.isWin2KPlus && cfg::dat.bFullTransparent) {
+ if (g_CLUISkinnedBkColorRGB)
+ Tweak_It(g_CLUISkinnedBkColorRGB);
+ else if (cfg::dat.bClipBorder || (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME))
+ Tweak_It(RGB(255, 0, 255));
+ else
+ Tweak_It(cfg::clcdat->bkColour);
+ }
- cfg::writeByte("CList", "State", old_cliststate);
+ cfg::writeByte("CList", "State", old_cliststate);
- if (cfg::getByte("CList", "AutoApplyLastViewMode", 0)) {
- DBVARIANT dbv = {0};
- if (!DBGetContactSetting(NULL, "CList", "LastViewMode", &dbv)) {
- if (lstrlenA(dbv.pszVal) > 2) {
- if (cfg::getDword(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff)
- ApplyViewMode((char *)dbv.pszVal);
- }
- DBFreeVariant(&dbv);
+ if (cfg::getByte("CList", "AutoApplyLastViewMode", 0)) {
+ DBVARIANT dbv = {0};
+ if (!DBGetContactSetting(NULL, "CList", "LastViewMode", &dbv)) {
+ if (lstrlenA(dbv.pszVal) > 2) {
+ if (cfg::getDword(NULL, CLVM_MODULE, dbv.pszVal, -1) != 0xffffffff)
+ ApplyViewMode((char *)dbv.pszVal);
}
+ DBFreeVariant(&dbv);
}
- if (!cfg::dat.autosize)
- ShowCLUI(hwnd);
- else {
- show_on_first_autosize = TRUE;
- RecalcScrollBar(pcli->hwndContactTree, cfg::clcdat);
- }
- return 0;
}
- case WM_ERASEBKGND:
+ if (!cfg::dat.autosize)
+ ShowCLUI(hwnd);
+ else {
+ show_on_first_autosize = TRUE;
+ RecalcScrollBar(pcli->hwndContactTree, cfg::clcdat);
+ }
+ return 0;
+ }
+ case WM_ERASEBKGND:
+ return TRUE;
+ if (cfg::dat.bSkinnedButtonMode)
return TRUE;
- if (cfg::dat.bSkinnedButtonMode)
- return TRUE;
- return DefWindowProc(hwnd, msg, wParam, lParam);
- case WM_PAINT: {
- PAINTSTRUCT ps;
- RECT rc, rcFrame, rcClient;
- HDC hdc;
- HRGN rgn = 0;
- HDC hdcReal = BeginPaint(hwnd, &ps);
-
- if (during_sizing)
- rcClient = rcWPC;
- else
- GetClientRect(hwnd, &rcClient);
- CopyRect(&rc, &rcClient);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+ case WM_PAINT: {
+ PAINTSTRUCT ps;
+ RECT rc, rcFrame, rcClient;
+ HDC hdc;
+ HRGN rgn = 0;
+ HDC hdcReal = BeginPaint(hwnd, &ps);
+
+ if (during_sizing)
+ rcClient = rcWPC;
+ else
+ GetClientRect(hwnd, &rcClient);
+ CopyRect(&rc, &rcClient);
- if (!cfg::dat.hdcBg || rc.right > cfg::dat.dcSize.cx || rc.bottom + cfg::dat.statusBarHeight > cfg::dat.dcSize.cy) {
- RECT rcWorkArea;
+ if (!cfg::dat.hdcBg || rc.right > cfg::dat.dcSize.cx || rc.bottom + cfg::dat.statusBarHeight > cfg::dat.dcSize.cy) {
+ RECT rcWorkArea;
- SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
- if (API::pfnMonitorFromWindow)
- {
- HMONITOR hMon = API::pfnMonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
- MONITORINFO mi;
- mi.cbSize = sizeof(mi);
- if (API::pfnGetMonitorInfo(hMon, &mi))
- rcWorkArea = mi.rcWork;
- }
+ SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE);
+ if (API::pfnMonitorFromWindow)
+ {
+ HMONITOR hMon = API::pfnMonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST);
+ MONITORINFO mi;
+ mi.cbSize = sizeof(mi);
+ if (API::pfnGetMonitorInfo(hMon, &mi))
+ rcWorkArea = mi.rcWork;
+ }
- cfg::dat.dcSize.cy = max(rc.bottom + cfg::dat.statusBarHeight, rcWorkArea.bottom - rcWorkArea.top);
- cfg::dat.dcSize.cx = max(rc.right, (rcWorkArea.right - rcWorkArea.left) / 2);
+ cfg::dat.dcSize.cy = max(rc.bottom + cfg::dat.statusBarHeight, rcWorkArea.bottom - rcWorkArea.top);
+ cfg::dat.dcSize.cx = max(rc.right, (rcWorkArea.right - rcWorkArea.left) / 2);
- if (cfg::dat.hdcBg) {
- SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBgOld);
- DeleteObject(cfg::dat.hbmBg);
- DeleteDC(cfg::dat.hdcBg);
- }
- cfg::dat.hdcBg = CreateCompatibleDC(hdcReal);
- cfg::dat.hbmBg = CreateCompatibleBitmap(hdcReal, cfg::dat.dcSize.cx, cfg::dat.dcSize.cy);
- cfg::dat.hbmBgOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBg));
+ if (cfg::dat.hdcBg) {
+ SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBgOld);
+ DeleteObject(cfg::dat.hbmBg);
+ DeleteDC(cfg::dat.hdcBg);
}
+ cfg::dat.hdcBg = CreateCompatibleDC(hdcReal);
+ cfg::dat.hbmBg = CreateCompatibleBitmap(hdcReal, cfg::dat.dcSize.cx, cfg::dat.dcSize.cy);
+ cfg::dat.hbmBgOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBg));
+ }
- if (cfg::shutDown) {
- EndPaint(hwnd, &ps);
- return 0;
- }
+ if (cfg::shutDown) {
+ EndPaint(hwnd, &ps);
+ return 0;
+ }
- hdc = cfg::dat.hdcBg;
+ hdc = cfg::dat.hdcBg;
- CopyRect(&rcFrame, &rcClient);
- if (g_CLUISkinnedBkColor) {
- if (cfg::dat.fOnDesktop) {
- HDC dc = GetDC(0);
- RECT rcWin;
+ CopyRect(&rcFrame, &rcClient);
+ if (g_CLUISkinnedBkColor) {
+ if (cfg::dat.fOnDesktop) {
+ HDC dc = GetDC(0);
+ RECT rcWin;
- GetWindowRect(hwnd, &rcWin);
- BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, dc, rcWin.left, rcWin.top, SRCCOPY);
- } else
- FillRect(hdc, &rcClient, g_CLUISkinnedBkColor);
- }
+ GetWindowRect(hwnd, &rcWin);
+ BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, dc, rcWin.left, rcWin.top, SRCCOPY);
+ } else
+ FillRect(hdc, &rcClient, g_CLUISkinnedBkColor);
+ }
- if (cfg::dat.bClipBorder != 0 || cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME) {
- int docked = CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0);
- int clip = cfg::dat.bClipBorder;
+ if (cfg::dat.bClipBorder != 0 || cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME) {
+ int docked = CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0);
+ int clip = cfg::dat.bClipBorder;
- if (!g_CLUISkinnedBkColor)
- FillRect(hdc, &rcClient, cfg::dat.hBrushColorKey);
- if (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME)
- rgn = CreateRoundRectRgn(clip, docked ? 0 : clip, rcClient.right - clip + 1, rcClient.bottom - (docked ? 0 : clip - 1), 8 + clip, 8 + clip);
- else
- rgn = CreateRectRgn(clip, docked ? 0 : clip, rcClient.right - clip, rcClient.bottom - (docked ? 0 : clip));
- SelectClipRgn(hdc, rgn);
- }
+ if (!g_CLUISkinnedBkColor)
+ FillRect(hdc, &rcClient, cfg::dat.hBrushColorKey);
+ if (cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME)
+ rgn = CreateRoundRectRgn(clip, docked ? 0 : clip, rcClient.right - clip + 1, rcClient.bottom - (docked ? 0 : clip - 1), 8 + clip, 8 + clip);
+ else
+ rgn = CreateRectRgn(clip, docked ? 0 : clip, rcClient.right - clip, rcClient.bottom - (docked ? 0 : clip));
+ SelectClipRgn(hdc, rgn);
+ }
- if (g_CLUIImageItem) {
- IMG_RenderImageItem(hdc, g_CLUIImageItem, &rcFrame);
- cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
- ClientToScreen(hwnd, &cfg::dat.ptW);
- goto skipbg;
- }
+ if (g_CLUIImageItem) {
+ IMG_RenderImageItem(hdc, g_CLUIImageItem, &rcFrame);
+ cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
+ ClientToScreen(hwnd, &cfg::dat.ptW);
+ goto skipbg;
+ }
- if (cfg::dat.bWallpaperMode)
- FillRect(hdc, &rcClient, cfg::dat.hBrushCLCBk);
- else
- FillRect(hdc, &rcClient, GetSysColorBrush(COLOR_3DFACE));
-
- rcFrame.left += (cfg::dat.bCLeft - 1);
- rcFrame.right -= (cfg::dat.bCRight - 1);
- rcFrame.bottom++;
- rcFrame.bottom -= cfg::dat.statusBarHeight;
- rcFrame.top += (cfg::dat.topOffset - 1);
-
- if (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN) {
- if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
- InflateRect(&rcFrame, -1, -1);
- if (cfg::dat.bmpBackground)
- BlitWallpaper(hdc, &rcFrame, &ps.rcPaint, cfg::clcdat);
- cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
- ClientToScreen(hwnd, &cfg::dat.ptW);
- }
- InflateRect(&rcFrame, 1, 1);
- if (cfg::dat.bSkinnedButtonMode)
- rcFrame.bottom -= (cfg::dat.bottomOffset);
- DrawEdge(hdc, &rcFrame, BDR_SUNKENOUTER, BF_RECT);
- } else if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
+ if (cfg::dat.bWallpaperMode)
+ FillRect(hdc, &rcClient, cfg::dat.hBrushCLCBk);
+ else
+ FillRect(hdc, &rcClient, GetSysColorBrush(COLOR_3DFACE));
+
+ rcFrame.left += (cfg::dat.bCLeft - 1);
+ rcFrame.right -= (cfg::dat.bCRight - 1);
+ rcFrame.bottom++;
+ rcFrame.bottom -= cfg::dat.statusBarHeight;
+ rcFrame.top += (cfg::dat.topOffset - 1);
+
+ if (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN) {
+ if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
+ InflateRect(&rcFrame, -1, -1);
if (cfg::dat.bmpBackground)
BlitWallpaper(hdc, &rcFrame, &ps.rcPaint, cfg::clcdat);
cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
ClientToScreen(hwnd, &cfg::dat.ptW);
}
+ InflateRect(&rcFrame, 1, 1);
+ if (cfg::dat.bSkinnedButtonMode)
+ rcFrame.bottom -= (cfg::dat.bottomOffset);
+ DrawEdge(hdc, &rcFrame, BDR_SUNKENOUTER, BF_RECT);
+ } else if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) {
+ if (cfg::dat.bmpBackground)
+ BlitWallpaper(hdc, &rcFrame, &ps.rcPaint, cfg::clcdat);
+ cfg::dat.ptW.x = cfg::dat.ptW.y = 0;
+ ClientToScreen(hwnd, &cfg::dat.ptW);
+ }
skipbg:
- BitBlt(hdcReal, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hdc, 0, 0, SRCCOPY);
- if (rgn) {
- SelectClipRgn(hdc, NULL);
- DeleteObject(rgn);
- }
- EndPaint(hwnd, &ps);
- return 0;
+ BitBlt(hdcReal, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hdc, 0, 0, SRCCOPY);
+ if (rgn) {
+ SelectClipRgn(hdc, NULL);
+ DeleteObject(rgn);
}
- case WM_ENTERSIZEMOVE: {
- RECT rc;
- POINT pt = {0};
-
- GetWindowRect(hwnd, &g_PreSizeRect);
- GetClientRect(hwnd, &rc);
- ClientToScreen(hwnd, &pt);
- g_CLUI_x_off = pt.x - g_PreSizeRect.left;
- g_CLUI_y_off = pt.y - g_PreSizeRect.top;
- pt.x = rc.right;
- ClientToScreen(hwnd, &pt);
- g_CLUI_x1_off = g_PreSizeRect.right - pt.x;
- pt.x = 0;
- pt.y = rc.bottom;
- ClientToScreen(hwnd, &pt);
- g_CLUI_y1_off = g_PreSizeRect.bottom - pt.y;
- //g_CluiData.neeedSnap = TRUE;
+ EndPaint(hwnd, &ps);
+ return 0;
+ }
+ case WM_ENTERSIZEMOVE: {
+ RECT rc;
+ POINT pt = {0};
+
+ GetWindowRect(hwnd, &g_PreSizeRect);
+ GetClientRect(hwnd, &rc);
+ ClientToScreen(hwnd, &pt);
+ g_CLUI_x_off = pt.x - g_PreSizeRect.left;
+ g_CLUI_y_off = pt.y - g_PreSizeRect.top;
+ pt.x = rc.right;
+ ClientToScreen(hwnd, &pt);
+ g_CLUI_x1_off = g_PreSizeRect.right - pt.x;
+ pt.x = 0;
+ pt.y = rc.bottom;
+ ClientToScreen(hwnd, &pt);
+ g_CLUI_y1_off = g_PreSizeRect.bottom - pt.y;
+ //g_CluiData.neeedSnap = TRUE;
+ break;
+ }
+ case WM_EXITSIZEMOVE:
+ //g_CluiData.neeedSnap = FALSE;
+ PostMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
+ //RedrawWindow(hwnd,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ break;
+ case WM_SIZING: {
+ RECT *szrect = (RECT *)lParam;
+
+ break;
+ if (Docking_IsDocked(0, 0))
break;
- }
- case WM_EXITSIZEMOVE:
- //g_CluiData.neeedSnap = FALSE;
- PostMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
- //RedrawWindow(hwnd,NULL,NULL,RDW_INVALIDATE|RDW_ERASE|RDW_FRAME|RDW_UPDATENOW|RDW_ALLCHILDREN);
+ g_SizingRect = *((RECT *)lParam);
+ if (wParam != WMSZ_BOTTOM && wParam != WMSZ_BOTTOMRIGHT && wParam != WMSZ_BOTTOMLEFT)
+ szrect->bottom = g_PreSizeRect.bottom;
+ if (wParam != WMSZ_RIGHT && wParam != WMSZ_BOTTOMRIGHT && wParam != WMSZ_TOPRIGHT)
+ szrect->right = g_PreSizeRect.right;
+ return TRUE;
+ }
+
+ case WM_WINDOWPOSCHANGED:
+ if (!Docking_IsDocked(0, 0))
+ return(0);
+ else
break;
- case WM_SIZING: {
- RECT *szrect = (RECT *)lParam;
- break;
- if (Docking_IsDocked(0, 0))
- break;
- g_SizingRect = *((RECT *)lParam);
- if (wParam != WMSZ_BOTTOM && wParam != WMSZ_BOTTOMRIGHT && wParam != WMSZ_BOTTOMLEFT)
- szrect->bottom = g_PreSizeRect.bottom;
- if (wParam != WMSZ_RIGHT && wParam != WMSZ_BOTTOMRIGHT && wParam != WMSZ_TOPRIGHT)
- szrect->right = g_PreSizeRect.right;
- return TRUE;
- }
+ case WM_WINDOWPOSCHANGING: {
+ WINDOWPOS *wp = (WINDOWPOS *)lParam;
- case WM_WINDOWPOSCHANGED:
- if (!Docking_IsDocked(0, 0))
- return(0);
- else
- break;
+ if (wp && wp->flags & SWP_NOSIZE)
+ return FALSE;
- case WM_WINDOWPOSCHANGING: {
- WINDOWPOS *wp = (WINDOWPOS *)lParam;
+ //if (Docking_IsDocked(0, 0))
+ // break;
- if (wp && wp->flags & SWP_NOSIZE)
- return FALSE;
+ if (pcli->hwndContactList != NULL) {
+ RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
+ during_sizing = true;
+
+ new_window_rect.left = 0;
+ new_window_rect.right = wp->cx - (g_CLUI_x_off + g_CLUI_x1_off);
+ new_window_rect.top = 0;
+ new_window_rect.bottom = wp->cy - g_CLUI_y_off - g_CLUI_y1_off;
+
+ if (cfg::dat.dwFlags & CLUI_FRAME_SBARSHOW) {
+ RECT rcStatus;
+ SetWindowPos(pcli->hwndStatus, 0, 0, new_window_rect.bottom - 20, new_window_rect.right, 20, SWP_NOZORDER);
+ GetWindowRect(pcli->hwndStatus, &rcStatus);
+ cfg::dat.statusBarHeight = (rcStatus.bottom - rcStatus.top);
+ if (wp->cx != g_oldSize.cx)
+ SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0);
+ RedrawWindow(pcli->hwndStatus, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
+ } else
+ cfg::dat.statusBarHeight = 0;
+
+ SizeFramesByWindowRect(&new_window_rect);
+ dock_prevent_moving = 0;
+ LayoutButtons(hwnd, &new_window_rect);
+ dock_prevent_moving = 1;
+ g_oldPos.x = wp->x;
+ g_oldPos.y = wp->y;
+ g_oldSize.cx = wp->cx;
+ g_oldSize.cy = wp->cy;
+ rcWPC = new_window_rect;
- //if (Docking_IsDocked(0, 0))
- // break;
-
- if (pcli->hwndContactList != NULL) {
- RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
- during_sizing = true;
-
- new_window_rect.left = 0;
- new_window_rect.right = wp->cx - (g_CLUI_x_off + g_CLUI_x1_off);
- new_window_rect.top = 0;
- new_window_rect.bottom = wp->cy - g_CLUI_y_off - g_CLUI_y1_off;
-
- if (cfg::dat.dwFlags & CLUI_FRAME_SBARSHOW) {
- RECT rcStatus;
- SetWindowPos(pcli->hwndStatus, 0, 0, new_window_rect.bottom - 20, new_window_rect.right, 20, SWP_NOZORDER);
- GetWindowRect(pcli->hwndStatus, &rcStatus);
- cfg::dat.statusBarHeight = (rcStatus.bottom - rcStatus.top);
- if (wp->cx != g_oldSize.cx)
- SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0);
- RedrawWindow(pcli->hwndStatus, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
- } else
- cfg::dat.statusBarHeight = 0;
-
- SizeFramesByWindowRect(&new_window_rect);
- dock_prevent_moving = 0;
- LayoutButtons(hwnd, &new_window_rect);
- dock_prevent_moving = 1;
- g_oldPos.x = wp->x;
- g_oldPos.y = wp->y;
- g_oldSize.cx = wp->cx;
- g_oldSize.cy = wp->cy;
- rcWPC = new_window_rect;
-
- during_sizing = false;
- }
during_sizing = false;
- return(0);
}
+ during_sizing = false;
+ return(0);
+ }
- case WM_SIZE: {
- RECT rc;
+ case WM_SIZE: {
+ RECT rc;
- if ((wParam == 0 && lParam == 0) || Docking_IsDocked(0, 0)) {
-
- if (IsZoomed(hwnd))
- ShowWindow(hwnd, SW_SHOWNORMAL);
-
- if (pcli->hwndContactList != 0) {
- SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0);
- GetWindowRect(hwnd, &rc);
- WINDOWPOS wp = {0};
- wp.cx = rc.right - rc.left;
- wp.cy = rc.bottom - rc.top;
- wp.x = rc.left;
- wp.y = rc.top;
- wp.flags = 0;
- SendMessage(hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)&wp);
- SendMessage(hwnd, WM_EXITSIZEMOVE, 0, 0);
- }
+ if ((wParam == 0 && lParam == 0) || Docking_IsDocked(0, 0)) {
+
+ if (IsZoomed(hwnd))
+ ShowWindow(hwnd, SW_SHOWNORMAL);
+
+ if (pcli->hwndContactList != 0) {
+ SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0);
+ GetWindowRect(hwnd, &rc);
+ WINDOWPOS wp = {0};
+ wp.cx = rc.right - rc.left;
+ wp.cy = rc.bottom - rc.top;
+ wp.x = rc.left;
+ wp.y = rc.top;
+ wp.flags = 0;
+ SendMessage(hwnd, WM_WINDOWPOSCHANGING, 0, (LPARAM)&wp);
+ SendMessage(hwnd, WM_EXITSIZEMOVE, 0, 0);
}
}
- case WM_MOVE:
- if (!IsIconic(hwnd)) {
+ }
+ case WM_MOVE:
+ if (!IsIconic(hwnd)) {
+ RECT rc;
+ GetWindowRect(hwnd, &rc);
+
+ if (!Docking_IsDocked(0, 0)) {
+ cluiPos.bottom = (DWORD)(rc.bottom - rc.top);
+ cluiPos.left = rc.left;
+ cluiPos.top = rc.top;
+ }
+ cluiPos.right = rc.right - rc.left;
+ if (cfg::dat.realTimeSaving) {
RECT rc;
GetWindowRect(hwnd, &rc);
- if (!Docking_IsDocked(0, 0)) {
- cluiPos.bottom = (DWORD)(rc.bottom - rc.top);
- cluiPos.left = rc.left;
- cluiPos.top = rc.top;
- }
- cluiPos.right = rc.right - rc.left;
- if (cfg::dat.realTimeSaving) {
- RECT rc;
- GetWindowRect(hwnd, &rc);
-
- // if docked, dont remember pos (except for width)
- if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
- cfg::writeDword("CList", "Height", (DWORD)(rc.bottom - rc.top));
- cfg::writeDword("CList", "x", (DWORD) rc.left);
- cfg::writeDword("CList", "y", (DWORD) rc.top);
- }
- cfg::writeDword("CList", "Width", (DWORD)(rc.right - rc.left));
+ // if docked, dont remember pos (except for width)
+ if (!CallService(MS_CLIST_DOCKINGISDOCKED, 0, 0)) {
+ cfg::writeDword("CList", "Height", (DWORD)(rc.bottom - rc.top));
+ cfg::writeDword("CList", "x", (DWORD) rc.left);
+ cfg::writeDword("CList", "y", (DWORD) rc.top);
}
+ cfg::writeDword("CList", "Width", (DWORD)(rc.right - rc.left));
}
- return TRUE;
-
- case WM_SETFOCUS:
- SetFocus(pcli->hwndContactTree);
- return 0;
- case CLUIINTM_REMOVEFROMTASKBAR: {
- BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
- if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT && cfg::getByte("CList", "AlwaysHideOnTB", 0))
- RemoveFromTaskBar(hwnd);
- return 0;
}
- case WM_ACTIVATE:
- if (g_fading_active) {
- if (wParam != WA_INACTIVE && cfg::dat.isTransparent)
- transparentFocus = 1;
- return DefWindowProc(hwnd, msg, wParam, lParam);
- }
- if (wParam == WA_INACTIVE) {
- if ((HWND) wParam != hwnd)
- if (cfg::dat.isTransparent)
- if (transparentFocus)
- SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
- } else {
- if (cfg::dat.isTransparent) {
- KillTimer(hwnd, TM_AUTOALPHA);
- API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
- transparentFocus = 1;
- }
- SetWindowPos(pcli->hwndContactList, cfg::getByte("CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING);
- }
- PostMessage(hwnd, CLUIINTM_REMOVEFROMTASKBAR, 0, 0);
- return DefWindowProc(hwnd, msg, wParam, lParam);
+ return TRUE;
+
+ case WM_SETFOCUS:
+ SetFocus(pcli->hwndContactTree);
+ return 0;
- case WM_SETCURSOR:
+ case CLUIINTM_REMOVEFROMTASKBAR: {
+ BYTE windowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
+ if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT && cfg::getByte("CList", "AlwaysHideOnTB", 0))
+ RemoveFromTaskBar(hwnd);
+ return 0;
+ }
+ case WM_ACTIVATE:
+ if (g_fading_active) {
+ if (wParam != WA_INACTIVE && cfg::dat.isTransparent)
+ transparentFocus = 1;
+ return DefWindowProc(hwnd, msg, wParam, lParam);
+ }
+ if (wParam == WA_INACTIVE) {
+ if ((HWND) wParam != hwnd)
+ if (cfg::dat.isTransparent)
+ if (transparentFocus)
+ SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
+ } else {
if (cfg::dat.isTransparent) {
- if (!transparentFocus && GetForegroundWindow() != hwnd) {
- API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
- transparentFocus = 1;
- SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
- }
+ KillTimer(hwnd, TM_AUTOALPHA);
+ API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
+ transparentFocus = 1;
}
- return DefWindowProc(hwnd, msg, wParam, lParam);
- case WM_NCHITTEST: {
- LRESULT result;
- RECT r;
- POINT pt;
- int k = 0;
- int clip = cfg::dat.bClipBorder;
+ SetWindowPos(pcli->hwndContactList, cfg::getByte("CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING);
+ }
+ PostMessage(hwnd, CLUIINTM_REMOVEFROMTASKBAR, 0, 0);
+ return DefWindowProc(hwnd, msg, wParam, lParam);
- GetWindowRect(hwnd, &r);
- GetCursorPos(&pt);
- if (pt.y <= r.bottom && pt.y >= r.bottom - clip - 6 && !cfg::getByte("CLUI", "AutoSize", 0)) {
- if (pt.x > r.left + clip + 10 && pt.x < r.right - clip - 10)
- return HTBOTTOM;
- if (pt.x < r.left + clip + 10)
- return HTBOTTOMLEFT;
- if (pt.x > r.right - clip - 10)
- return HTBOTTOMRIGHT;
-
- } else if (pt.y >= r.top && pt.y <= r.top + 3 && !cfg::getByte("CLUI", "AutoSize", 0)) {
- if (pt.x > r.left + clip + 10 && pt.x < r.right - clip - 10)
- return HTTOP;
- if (pt.x < r.left + clip + 10)
- return HTTOPLEFT;
- if (pt.x > r.right - clip - 10)
- return HTTOPRIGHT;
- } else if (pt.x >= r.left && pt.x <= r.left + clip + 6)
- return HTLEFT;
- else if (pt.x >= r.right - clip - 6 && pt.x <= r.right)
- return HTRIGHT;
-
- result = DefWindowProc(hwnd, WM_NCHITTEST, wParam, lParam);
- if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT || result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT)
- if (cfg::dat.autosize)
- return HTCLIENT;
- return result;
+ case WM_SETCURSOR:
+ if (cfg::dat.isTransparent) {
+ if (!transparentFocus && GetForegroundWindow() != hwnd) {
+ API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
+ transparentFocus = 1;
+ SetTimer(hwnd, TM_AUTOALPHA, 250, NULL);
+ }
}
+ return DefWindowProc(hwnd, msg, wParam, lParam);
- case WM_TIMER:
- if ((int) wParam == TM_AUTOALPHA) {
- int inwnd;
+ case WM_NCHITTEST: {
+ LRESULT result;
+ RECT r;
+ POINT pt;
+ int k = 0;
+ int clip = cfg::dat.bClipBorder;
- if (GetForegroundWindow() == hwnd) {
- KillTimer(hwnd, TM_AUTOALPHA);
- inwnd = 1;
- } else {
- POINT pt;
- HWND hwndPt;
- pt.x = (short) LOWORD(GetMessagePos());
- pt.y = (short) HIWORD(GetMessagePos());
- hwndPt = WindowFromPoint(pt);
- inwnd = (hwndPt == hwnd || GetParent(hwndPt) == hwnd);
- }
- if (inwnd != transparentFocus) {
- //change
- transparentFocus = inwnd;
- if (transparentFocus)
- API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
- else
- API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.autoalpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
- }
- if (!transparentFocus)
- KillTimer(hwnd, TM_AUTOALPHA);
- } else if (wParam == TIMERID_AUTOSIZE) {
- KillTimer(hwnd, wParam);
- SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
- PostMessage(hwnd, WM_SIZE, 0, 0);
- PostMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
+ GetWindowRect(hwnd, &r);
+ GetCursorPos(&pt);
+ if (pt.y <= r.bottom && pt.y >= r.bottom - clip - 6 && !cfg::getByte("CLUI", "AutoSize", 0)) {
+ if (pt.x > r.left + clip + 10 && pt.x < r.right - clip - 10)
+ return HTBOTTOM;
+ if (pt.x < r.left + clip + 10)
+ return HTBOTTOMLEFT;
+ if (pt.x > r.right - clip - 10)
+ return HTBOTTOMRIGHT;
+
+ } else if (pt.y >= r.top && pt.y <= r.top + 3 && !cfg::getByte("CLUI", "AutoSize", 0)) {
+ if (pt.x > r.left + clip + 10 && pt.x < r.right - clip - 10)
+ return HTTOP;
+ if (pt.x < r.left + clip + 10)
+ return HTTOPLEFT;
+ if (pt.x > r.right - clip - 10)
+ return HTTOPRIGHT;
+ } else if (pt.x >= r.left && pt.x <= r.left + clip + 6)
+ return HTLEFT;
+ else if (pt.x >= r.right - clip - 6 && pt.x <= r.right)
+ return HTRIGHT;
+
+ result = DefWindowProc(hwnd, WM_NCHITTEST, wParam, lParam);
+ if (result == HTSIZE || result == HTTOP || result == HTTOPLEFT || result == HTTOPRIGHT || result == HTBOTTOM || result == HTBOTTOMRIGHT || result == HTBOTTOMLEFT)
+ if (cfg::dat.autosize)
+ return HTCLIENT;
+ return result;
+ }
+
+ case WM_TIMER:
+ if ((int) wParam == TM_AUTOALPHA) {
+ int inwnd;
+
+ if (GetForegroundWindow() == hwnd) {
+ KillTimer(hwnd, TM_AUTOALPHA);
+ inwnd = 1;
}
- return TRUE;
- case WM_SHOWWINDOW: {
+ else {
+ POINT pt;
+ HWND hwndPt;
+ pt.x = (short) LOWORD(GetMessagePos());
+ pt.y = (short) HIWORD(GetMessagePos());
+ hwndPt = WindowFromPoint(pt);
+ inwnd = (hwndPt == hwnd || GetParent(hwndPt) == hwnd);
+ }
+ if (inwnd != transparentFocus) {
+ //change
+ transparentFocus = inwnd;
+ if (transparentFocus)
+ API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.alpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
+ else
+ API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), cfg::dat.autoalpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
+ }
+ if (!transparentFocus)
+ KillTimer(hwnd, TM_AUTOALPHA);
+ } else if (wParam == TIMERID_AUTOSIZE) {
+ KillTimer(hwnd, wParam);
+ SetWindowPos(hwnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSENDCHANGING);
+ PostMessage(hwnd, WM_SIZE, 0, 0);
+ PostMessage(hwnd, CLUIINTM_REDRAW, 0, 0);
+ }
+ return TRUE;
+ case WM_SHOWWINDOW:
+ {
static int noRecurse = 0;
DWORD thisTick, startTick;
int sourceAlpha, destAlpha;
@@ -1389,10 +1394,11 @@ skipbg:
API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)(sourceAlpha + (destAlpha - sourceAlpha) * (int)(thisTick - startTick) / 200), LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
}
API::SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)(destAlpha), LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0));
- return DefWindowProc(hwnd, msg, wParam, lParam);
}
+ return DefWindowProc(hwnd, msg, wParam, lParam);
- case WM_SYSCOMMAND: {
+ case WM_SYSCOMMAND:
+ {
BYTE bWindowStyle = cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT);
if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle) {
if (wParam == SC_RESTORE) {
@@ -1407,7 +1413,8 @@ skipbg:
if (wParam == SC_MAXIMIZE)
return 0;
- else if (wParam == SC_MINIMIZE) {
+
+ if (wParam == SC_MINIMIZE) {
if (SETTING_WINDOWSTYLE_DEFAULT == bWindowStyle && !cfg::getByte("CList", "AlwaysHideOnTB", 0)) {
cfg::writeByte("CList", "State", SETTING_STATE_MINIMIZED);
break;
@@ -1415,18 +1422,20 @@ skipbg:
pcli->pfnShowHide(0, 0);
return 0;
}
- else if (wParam == SC_RESTORE) {
+ if (wParam == SC_RESTORE) {
pcli->pfnShowHide(0, 0);
- return(0);
+ return 0;
}
- return DefWindowProc(hwnd, msg, wParam, lParam);
}
+ return DefWindowProc(hwnd, msg, wParam, lParam);
- case WM_COMMAND: {
+ case WM_COMMAND:
+ {
DWORD dwOldFlags = cfg::dat.dwFlags;
if (HIWORD(wParam) == BN_CLICKED && lParam != 0) {
if (LOWORD(wParam) == IDC_TBFIRSTUID - 1)
break;
+
else if (LOWORD(wParam) >= IDC_TBFIRSTUID) { // skinnable buttons handling
ButtonItem *item = g_ButtonItems;
WPARAM wwParam = 0;
@@ -1451,7 +1460,8 @@ skipbg:
CallService(item->szService, wwParam, llParam);
else if (contactOK)
serviceFailure = TRUE;
- } else if (item->dwFlags & BUTTON_ISPROTOSERVICE && cfg::clcdat) {
+ }
+ else if (item->dwFlags & BUTTON_ISPROTOSERVICE && cfg::clcdat) {
if (contactOK) {
char szFinalService[512];
@@ -1461,7 +1471,8 @@ skipbg:
else
serviceFailure = TRUE;
}
- } else if (item->dwFlags & BUTTON_ISDBACTION) {
+ }
+ else if (item->dwFlags & BUTTON_ISDBACTION) {
BYTE *pValue;
char *szModule = item->szModule;
char *szSetting = item->szSetting;
@@ -1472,8 +1483,8 @@ skipbg:
if (contactOK && item->dwFlags & BUTTON_ISCONTACTDBACTION)
szModule = (char *)CallService(MS_PROTO_GETCONTACTBASEPROTO, (WPARAM)hContact, 0);
finalhContact = hContact;
- } else
- contactOK = 1;
+ }
+ else contactOK = 1;
if (contactOK) {
BOOL fDelete = FALSE;
@@ -1492,19 +1503,19 @@ skipbg:
DBDeleteContactSetting(finalhContact, szModule, szSetting);
} else {
switch (item->type) {
- case DBVT_BYTE:
- cfg::writeByte(finalhContact, szModule, szSetting, pValue[0]);
- break;
- case DBVT_WORD:
- cfg::writeWord(finalhContact, szModule, szSetting, *((WORD *)&pValue[0]));
- //_DebugTraceA("set WORD value: %s, %s, %d ON %d", szModule, item->szSetting, *((WORD *)&pValue[0]), finalhContact);
- break;
- case DBVT_DWORD:
- cfg::writeDword(finalhContact, szModule, szSetting, *((DWORD *)&pValue[0]));
- break;
- case DBVT_ASCIIZ:
- cfg::writeString(finalhContact, szModule, szSetting, (char *)pValue);
- break;
+ case DBVT_BYTE:
+ cfg::writeByte(finalhContact, szModule, szSetting, pValue[0]);
+ break;
+ case DBVT_WORD:
+ cfg::writeWord(finalhContact, szModule, szSetting, *((WORD *)&pValue[0]));
+ //_DebugTraceA("set WORD value: %s, %s, %d ON %d", szModule, item->szSetting, *((WORD *)&pValue[0]), finalhContact);
+ break;
+ case DBVT_DWORD:
+ cfg::writeDword(finalhContact, szModule, szSetting, *((DWORD *)&pValue[0]));
+ break;
+ case DBVT_ASCIIZ:
+ cfg::writeString(finalhContact, szModule, szSetting, (char *)pValue);
+ break;
}
}
} else if (item->dwFlags & BUTTON_ISTOGGLE)
@@ -1524,54 +1535,58 @@ skipbg:
}
goto buttons_done;
}
+
switch (LOWORD(wParam)) {
- case IDC_TBMENU:
- case IDC_TBTOPMENU: {
+ case IDC_TBMENU:
+ case IDC_TBTOPMENU:
+ {
RECT rc;
HMENU hMenu = (HMENU) CallService(MS_CLIST_MENUGETMAIN, 0, 0);
GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc);
TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBMENU ? rc.top : rc.bottom, 0, hwnd, NULL);
- return 0;
}
- case IDC_TBTOPSTATUS:
- case IDC_TBGLOBALSTATUS: {
+ return 0;
+
+ case IDC_TBTOPSTATUS:
+ case IDC_TBGLOBALSTATUS:
+ {
RECT rc;
HMENU hmenu = (HMENU)CallService(MS_CLIST_MENUGETSTATUS, 0, 0);
GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc);
TrackPopupMenu(hmenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, rc.top, 0, hwnd, NULL);
- return 0;
}
+ return 0;
- case IDC_TABSRMMSLIST:
- case IDC_TABSRMMMENU:
- if (ServiceExists("SRMsg_MOD/GetWindowFlags"))
- CallService("SRMsg_MOD/Show_TrayMenu", 0, LOWORD(wParam) == IDC_TABSRMMSLIST ? 0 : 1);
- return 0;
+ case IDC_TABSRMMSLIST:
+ case IDC_TABSRMMMENU:
+ if (ServiceExists("SRMsg_MOD/GetWindowFlags"))
+ CallService("SRMsg_MOD/Show_TrayMenu", 0, LOWORD(wParam) == IDC_TABSRMMSLIST ? 0 : 1);
+ return 0;
- case IDC_TBSOUND:
- cfg::dat.soundsOff = !cfg::dat.soundsOff;
- cfg::writeByte("CLUI", "NoSounds", (BYTE)cfg::dat.soundsOff);
- cfg::writeByte("Skin", "UseSound", (BYTE)(cfg::dat.soundsOff ? 0 : 1));
- return 0;
+ case IDC_TBSOUND:
+ cfg::dat.soundsOff = !cfg::dat.soundsOff;
+ cfg::writeByte("CLUI", "NoSounds", (BYTE)cfg::dat.soundsOff);
+ cfg::writeByte("Skin", "UseSound", (BYTE)(cfg::dat.soundsOff ? 0 : 1));
+ return 0;
- case IDC_TBSELECTVIEWMODE:
- SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_SELECTMODE, lParam);
- break;
- case IDC_TBCLEARVIEWMODE:
- SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_RESETMODES, lParam);
- break;
- case IDC_TBCONFIGUREVIEWMODE:
- SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_CONFIGUREMODES, lParam);
- break;
- case IDC_TBFINDANDADD:
- CallService(MS_FINDADD_FINDADD, 0, 0);
- return 0;
- case IDC_TBACCOUNTS:
- CallService(MS_PROTO_SHOWACCMGR, 0, 0);
- break;
- case IDC_TBOPTIONS:
- CallService("Options/OptionsCommand", 0, 0);
- return 0;
+ case IDC_TBSELECTVIEWMODE:
+ SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_SELECTMODE, lParam);
+ break;
+ case IDC_TBCLEARVIEWMODE:
+ SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_RESETMODES, lParam);
+ break;
+ case IDC_TBCONFIGUREVIEWMODE:
+ SendMessage(g_hwndViewModeFrame, WM_COMMAND, IDC_CONFIGUREMODES, lParam);
+ break;
+ case IDC_TBFINDANDADD:
+ CallService(MS_FINDADD_FINDADD, 0, 0);
+ return 0;
+ case IDC_TBACCOUNTS:
+ CallService(MS_PROTO_SHOWACCMGR, 0, 0);
+ break;
+ case IDC_TBOPTIONS:
+ CallService("Options/OptionsCommand", 0, 0);
+ return 0;
}
}
else if (CallService(MS_CLIST_MENUPROCESSCOMMAND, MAKEWPARAM(LOWORD(wParam), MPCF_MAINMENU), (LPARAM)(HANDLE) NULL))
@@ -1579,81 +1594,81 @@ skipbg:
buttons_done:
switch (LOWORD(wParam)) {
- case ID_TRAY_EXIT:
- case ID_ICQ_EXIT:
- cfg::shutDown = 1;
- if (CallService(MS_SYSTEM_OKTOEXIT, 0, 0))
- DestroyWindow(hwnd);
- break;
- case ID_TRAY_HIDE:
- case IDC_TBMINIMIZE:
- pcli->pfnShowHide(0, 0);
- break;
- case POPUP_NEWGROUP:
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
- SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
- CallService(MS_CLIST_GROUPCREATE, 0, 0);
- break;
- case POPUP_HIDEOFFLINE:
- case IDC_TBHIDEOFFLINE:
- CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)(-1), 0);
- break;
- case POPUP_HIDEOFFLINEROOT:
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT, !SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0), 0);
- break;
- case POPUP_HIDEEMPTYGROUPS: {
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
- cfg::writeByte("CList", "HideEmptyGroups", (BYTE) newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
- break;
- }
- case IDC_TBHIDEGROUPS:
- case POPUP_DISABLEGROUPS: {
- int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
- cfg::writeByte("CList", "UseGroups", (BYTE) newVal);
- SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
- CheckDlgButton(hwnd, IDC_TBHIDEGROUPS, newVal ? BST_CHECKED : BST_UNCHECKED);
- break;
- }
- case POPUP_HIDEMIRANDA:
- pcli->pfnShowHide(0, 0);
- break;
- case POPUP_VISIBILITY:
- cfg::dat.dwFlags ^= CLUI_SHOWVISI;
- break;
- case POPUP_SHOWMETAICONS:
- cfg::dat.dwFlags ^= CLUI_USEMETAICONS;
- SendMessage(pcli->hwndContactTree, CLM_AUTOREBUILD, 0, 0);
- break;
- case POPUP_FRAME:
- cfg::dat.dwFlags ^= CLUI_FRAME_CLISTSUNKEN;
- break;
- case POPUP_BUTTONS:
- cfg::dat.dwFlags ^= CLUI_FRAME_SHOWBOTTOMBUTTONS;
- break;
- case POPUP_SHOWSTATUSICONS:
- cfg::dat.dwFlags ^= CLUI_FRAME_STATUSICONS;
- break;
- case POPUP_FLOATER:
- cfg::dat.bUseFloater ^= CLUI_USE_FLOATER;
- if (cfg::dat.bUseFloater & CLUI_USE_FLOATER) {
- SFL_Create();
- SFL_SetState(-1);
- } else
- SFL_Destroy();
- cfg::writeByte("CLUI", "FloaterMode", cfg::dat.bUseFloater);
- break;
- case POPUP_FLOATER_AUTOHIDE:
- cfg::dat.bUseFloater ^= CLUI_FLOATER_AUTOHIDE;
- SFL_SetState(cfg::dat.bUseFloater & CLUI_FLOATER_AUTOHIDE ? (cfg::getByte("CList", "State", SETTING_STATE_NORMAL) == SETTING_STATE_NORMAL ? 0 : 1) : 1);
- cfg::writeByte("CLUI", "FloaterMode", cfg::dat.bUseFloater);
- break;
- case POPUP_FLOATER_EVENTS:
- cfg::dat.bUseFloater ^= CLUI_FLOATER_EVENTS;
- SFL_SetSize();
- SFL_Update(0, 0, 0, NULL, FALSE);
- cfg::writeByte("CLUI", "FloaterMode", cfg::dat.bUseFloater);
- break;
+ case ID_TRAY_EXIT:
+ case ID_ICQ_EXIT:
+ cfg::shutDown = 1;
+ if (CallService(MS_SYSTEM_OKTOEXIT, 0, 0))
+ DestroyWindow(hwnd);
+ break;
+ case ID_TRAY_HIDE:
+ case IDC_TBMINIMIZE:
+ pcli->pfnShowHide(0, 0);
+ break;
+ case POPUP_NEWGROUP:
+ SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0);
+ SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, 1, 0);
+ CallService(MS_CLIST_GROUPCREATE, 0, 0);
+ break;
+ case POPUP_HIDEOFFLINE:
+ case IDC_TBHIDEOFFLINE:
+ CallService(MS_CLIST_SETHIDEOFFLINE, (WPARAM)(-1), 0);
+ break;
+ case POPUP_HIDEOFFLINEROOT:
+ SendMessage(pcli->hwndContactTree, CLM_SETHIDEOFFLINEROOT, !SendMessage(pcli->hwndContactTree, CLM_GETHIDEOFFLINEROOT, 0, 0), 0);
+ break;
+ case POPUP_HIDEEMPTYGROUPS: {
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_HIDEEMPTYGROUPS);
+ cfg::writeByte("CList", "HideEmptyGroups", (BYTE) newVal);
+ SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, newVal, 0);
+ break;
+ }
+ case IDC_TBHIDEGROUPS:
+ case POPUP_DISABLEGROUPS: {
+ int newVal = !(GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE) & CLS_USEGROUPS);
+ cfg::writeByte("CList", "UseGroups", (BYTE) newVal);
+ SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, newVal, 0);
+ CheckDlgButton(hwnd, IDC_TBHIDEGROUPS, newVal ? BST_CHECKED : BST_UNCHECKED);
+ break;
+ }
+ case POPUP_HIDEMIRANDA:
+ pcli->pfnShowHide(0, 0);
+ break;
+ case POPUP_VISIBILITY:
+ cfg::dat.dwFlags ^= CLUI_SHOWVISI;
+ break;
+ case POPUP_SHOWMETAICONS:
+ cfg::dat.dwFlags ^= CLUI_USEMETAICONS;
+ SendMessage(pcli->hwndContactTree, CLM_AUTOREBUILD, 0, 0);
+ break;
+ case POPUP_FRAME:
+ cfg::dat.dwFlags ^= CLUI_FRAME_CLISTSUNKEN;
+ break;
+ case POPUP_BUTTONS:
+ cfg::dat.dwFlags ^= CLUI_FRAME_SHOWBOTTOMBUTTONS;
+ break;
+ case POPUP_SHOWSTATUSICONS:
+ cfg::dat.dwFlags ^= CLUI_FRAME_STATUSICONS;
+ break;
+ case POPUP_FLOATER:
+ cfg::dat.bUseFloater ^= CLUI_USE_FLOATER;
+ if (cfg::dat.bUseFloater & CLUI_USE_FLOATER) {
+ SFL_Create();
+ SFL_SetState(-1);
+ } else
+ SFL_Destroy();
+ cfg::writeByte("CLUI", "FloaterMode", cfg::dat.bUseFloater);
+ break;
+ case POPUP_FLOATER_AUTOHIDE:
+ cfg::dat.bUseFloater ^= CLUI_FLOATER_AUTOHIDE;
+ SFL_SetState(cfg::dat.bUseFloater & CLUI_FLOATER_AUTOHIDE ? (cfg::getByte("CList", "State", SETTING_STATE_NORMAL) == SETTING_STATE_NORMAL ? 0 : 1) : 1);
+ cfg::writeByte("CLUI", "FloaterMode", cfg::dat.bUseFloater);
+ break;
+ case POPUP_FLOATER_EVENTS:
+ cfg::dat.bUseFloater ^= CLUI_FLOATER_EVENTS;
+ SFL_SetSize();
+ SFL_Update(0, 0, 0, NULL, FALSE);
+ cfg::writeByte("CLUI", "FloaterMode", cfg::dat.bUseFloater);
+ break;
}
if (dwOldFlags != cfg::dat.dwFlags) {
InvalidateRect(pcli->hwndContactTree, NULL, FALSE);
@@ -1666,49 +1681,54 @@ buttons_done:
PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
}
- return FALSE;
}
- case WM_LBUTTONDOWN: {
- if (g_ButtonItems) {
- POINT ptMouse, pt;
+ return FALSE;
- GetCursorPos(&ptMouse);
- pt = ptMouse;
- return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
- }
- break;
+ case WM_LBUTTONDOWN:
+ if (g_ButtonItems) {
+ POINT ptMouse, pt;
+
+ GetCursorPos(&ptMouse);
+ pt = ptMouse;
+ return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
}
- case WM_DISPLAYCHANGE:
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
- break;
- case WM_NOTIFY:
- if (((LPNMHDR) lParam)->hwndFrom == pcli->hwndContactTree) {
- switch (((LPNMHDR) lParam)->code) {
- case CLN_LISTSIZECHANGE:
- sttProcessResize(hwnd, (NMCLISTCONTROL*)lParam);
- return FALSE;
+ break;
+
+ case WM_DISPLAYCHANGE:
+ SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged
+ break;
- case NM_CLICK: {
- NMCLISTCONTROL *nm = (NMCLISTCONTROL *) lParam;
- DWORD hitFlags;
- HANDLE hItem;
+ case WM_NOTIFY:
+ if (((LPNMHDR) lParam)->hwndFrom == pcli->hwndContactTree) {
+ switch (((LPNMHDR) lParam)->code) {
+ case CLN_LISTSIZECHANGE:
+ sttProcessResize(hwnd, (NMCLISTCONTROL*)lParam);
+ return FALSE;
- hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_HITTEST, (WPARAM) & hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
+ case NM_CLICK:
+ {
+ NMCLISTCONTROL *nm = (NMCLISTCONTROL *) lParam;
+ DWORD hitFlags;
+ HANDLE hItem;
- if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0)
- break;
- if (cfg::getByte("CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
- POINT pt;
- pt = nm->pt;
- ClientToScreen(pcli->hwndContactTree, &pt);
- return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
- }
+ hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_HITTEST, (WPARAM) & hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
+
+ if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0)
+ break;
+ if (cfg::getByte("CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) {
+ POINT pt;
+ pt = nm->pt;
+ ClientToScreen(pcli->hwndContactTree, &pt);
+ return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y));
}
- return FALSE;
}
+ return FALSE;
}
- break;
- case WM_CONTEXTMENU: {
+ }
+ break;
+
+ case WM_CONTEXTMENU:
+ {
RECT rc;
POINT pt;
@@ -1745,14 +1765,16 @@ buttons_done:
}
break;
- case WM_MEASUREITEM:
- if (((LPMEASUREITEMSTRUCT) lParam)->itemData == MENU_MIRANDAMENU) {
- ((LPMEASUREITEMSTRUCT) lParam)->itemWidth = g_cxsmIcon * 4 / 3;
- ((LPMEASUREITEMSTRUCT) lParam)->itemHeight = 0;
- return TRUE;
- }
- return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
- case WM_DRAWITEM: {
+ case WM_MEASUREITEM:
+ if (((LPMEASUREITEMSTRUCT) lParam)->itemData == MENU_MIRANDAMENU) {
+ ((LPMEASUREITEMSTRUCT) lParam)->itemWidth = g_cxsmIcon * 4 / 3;
+ ((LPMEASUREITEMSTRUCT) lParam)->itemHeight = 0;
+ return TRUE;
+ }
+ return CallService(MS_CLIST_MENUMEASUREITEM, wParam, lParam);
+
+ case WM_DRAWITEM:
+ {
LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT) lParam;
if (hbmLockedPoint == 0) {
@@ -1820,13 +1842,15 @@ buttons_done:
}
}
x += 18;
- } else {
+ }
+ else {
x += 2;
if (pd->statusbarpos == 0)
x += (cfg::dat.bEqualSections ? (cfg::dat.bCLeft / 2) : cfg::dat.bCLeft);
else if (pd->statusbarpos == nParts - 1)
x -= (cfg::dat.bCRight / 2);
}
+
if (showOpts & 2) {
TCHAR szName[64];
PROTOACCOUNT* pa = ProtoGetAccount( szProto );
@@ -1847,66 +1871,69 @@ buttons_done:
GetTextExtentPoint32(dis->hDC, szStatus, lstrlen(szStatus), &textSize);
TextOut(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - textSize.cy) >> 1, szStatus, lstrlen(szStatus));
}
- } else if (dis->CtlType == ODT_MENU) {
+ }
+ else if (dis->CtlType == ODT_MENU) {
if (dis->itemData == MENU_MIRANDAMENU)
break;
return CallService(MS_CLIST_MENUDRAWITEM, wParam, lParam);
}
- return 0;
}
+ return 0;
- case WM_CLOSE:
- if (SETTING_WINDOWSTYLE_DEFAULT == cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT) && !cfg::getByte("CList", "AlwaysHideOnTB", 0)) {
- PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
- return(0);
- }
- pcli->pfnShowHide(0, 0);
+ case WM_CLOSE:
+ if (SETTING_WINDOWSTYLE_DEFAULT == cfg::getByte("CLUI", "WindowStyle", SETTING_WINDOWSTYLE_DEFAULT) && !cfg::getByte("CList", "AlwaysHideOnTB", 0)) {
+ PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0);
return(0);
+ }
+ pcli->pfnShowHide(0, 0);
+ return(0);
- case CLUIINTM_REDRAW:
- if (show_on_first_autosize) {
- show_on_first_autosize = FALSE;
- ShowCLUI(hwnd);
- }
- RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
- return 0;
- case CLUIINTM_STATUSBARUPDATE:
- CluiProtocolStatusChanged(0, 0);
- return 0;
+ case CLUIINTM_REDRAW:
+ if (show_on_first_autosize) {
+ show_on_first_autosize = FALSE;
+ ShowCLUI(hwnd);
+ }
+ RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ return 0;
- case WM_THEMECHANGED:
- API::updateState();
- break;
+ case CLUIINTM_STATUSBARUPDATE:
+ CluiProtocolStatusChanged(0, 0);
+ return 0;
- case WM_DESTROY:
- if (cfg::dat.hdcBg) {
- SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBgOld);
- DeleteObject(cfg::dat.hbmBg);
- DeleteDC(cfg::dat.hdcBg);
- cfg::dat.hdcBg = NULL;
- }
- if (cfg::dat.bmpBackground) {
- SelectObject(cfg::dat.hdcPic, cfg::dat.hbmPicOld);
- DeleteDC(cfg::dat.hdcPic);
- DeleteObject(cfg::dat.bmpBackground);
- cfg::dat.bmpBackground = NULL;
- }
- FreeProtocolData();
- if (hdcLockedPoint) {
- SelectObject(hdcLockedPoint, hbmOldLockedPoint);
- DeleteObject(hbmLockedPoint);
- DeleteDC(hdcLockedPoint);
- }
- /*
- * if this has not yet been set, do it now.
- * indicates that clist is shutting down and prevents various things
- * from happening at shutdown.
- */
- if (!cfg::shutDown)
- cfg::shutDown = 1;
- CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)hFrameContactTree, 0);
- break;
+ case WM_THEMECHANGED:
+ API::updateState();
+ break;
+
+ case WM_DESTROY:
+ if (cfg::dat.hdcBg) {
+ SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBgOld);
+ DeleteObject(cfg::dat.hbmBg);
+ DeleteDC(cfg::dat.hdcBg);
+ cfg::dat.hdcBg = NULL;
+ }
+ if (cfg::dat.bmpBackground) {
+ SelectObject(cfg::dat.hdcPic, cfg::dat.hbmPicOld);
+ DeleteDC(cfg::dat.hdcPic);
+ DeleteObject(cfg::dat.bmpBackground);
+ cfg::dat.bmpBackground = NULL;
+ }
+ FreeProtocolData();
+ if (hdcLockedPoint) {
+ SelectObject(hdcLockedPoint, hbmOldLockedPoint);
+ DeleteObject(hbmLockedPoint);
+ DeleteDC(hdcLockedPoint);
+ }
+ /*
+ * if this has not yet been set, do it now.
+ * indicates that clist is shutting down and prevents various things
+ * from happening at shutdown.
+ */
+ if (!cfg::shutDown)
+ cfg::shutDown = 1;
+ CallService(MS_CLIST_FRAMES_REMOVEFRAME, (WPARAM)hFrameContactTree, 0);
+ break;
}
+
return saveContactListWndProc(hwnd, msg, wParam, lParam);
}
@@ -1924,71 +1951,77 @@ static BOOL g_AboutDlgActive = 0;
INT_PTR CALLBACK DlgProcAbout(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HICON hIcon;
COLORREF url_visited = RGB(128, 0, 128);
COLORREF url_unvisited = RGB(0, 0, 255);
switch (msg) {
- case WM_INITDIALOG:
- TranslateDialogDefault(hwndDlg);
- {
- int h;
- HFONT hFont;
- LOGFONT lf;
-
- g_AboutDlgActive = TRUE;
- hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_CLNICER, WM_GETFONT, 0, 0);
- GetObject(hFont, sizeof(lf), &lf);
- h = lf.lfHeight;
- lf.lfHeight = (int)(lf.lfHeight * 1.5);
- lf.lfWeight = FW_BOLD;
- hFont = CreateFontIndirect(&lf);
- SendDlgItemMessage(hwndDlg, IDC_CLNICER, WM_SETFONT, (WPARAM)hFont, 0);
- lf.lfHeight = h;
- hFont = CreateFontIndirect(&lf);
- SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_SETFONT, (WPARAM)hFont, 0);
- }
- {
- char str[64];
- DWORD v = pluginInfo.version;
- mir_snprintf(str, sizeof(str), "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
- SetDlgItemTextA(hwndDlg, IDC_VERSION, str);
- }
- hIcon = LoadIcon(GetModuleHandleA("miranda32.exe"), MAKEINTRESOURCE(102));
+ case WM_INITDIALOG:
+ TranslateDialogDefault(hwndDlg);
+ {
+ int h;
+ HFONT hFont;
+ LOGFONT lf;
+
+ g_AboutDlgActive = TRUE;
+ hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_CLNICER, WM_GETFONT, 0, 0);
+ GetObject(hFont, sizeof(lf), &lf);
+ h = lf.lfHeight;
+ lf.lfHeight = (int)(lf.lfHeight * 1.5);
+ lf.lfWeight = FW_BOLD;
+ hFont = CreateFontIndirect(&lf);
+ SendDlgItemMessage(hwndDlg, IDC_CLNICER, WM_SETFONT, (WPARAM)hFont, 0);
+ lf.lfHeight = h;
+ hFont = CreateFontIndirect(&lf);
+ SendDlgItemMessage(hwndDlg, IDC_VERSION, WM_SETFONT, (WPARAM)hFont, 0);
+ }
+ {
+ char str[64];
+ DWORD v = pluginInfo.version;
+ mir_snprintf(str, sizeof(str), "%s %d.%d.%d.%d", Translate("Version"), HIBYTE(HIWORD(v)), LOBYTE(HIWORD(v)), HIBYTE(LOWORD(v)), LOBYTE(LOWORD(v)));
+ SetDlgItemTextA(hwndDlg, IDC_VERSION, str);
+ }
+ {
+ HICON hIcon = LoadIcon(GetModuleHandleA("miranda32.exe"), MAKEINTRESOURCE(102));
SendDlgItemMessage(hwndDlg, IDC_LOGO, STM_SETICON, (WPARAM)hIcon, 0);
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, (LPARAM)hIcon);
DestroyIcon(hIcon);
+ }
+ return TRUE;
+
+ case WM_COMMAND:
+ switch (LOWORD(wParam)) {
+ case IDOK:
+ case IDCANCEL:
+ DestroyWindow(hwndDlg);
return TRUE;
- case WM_COMMAND:
- switch (LOWORD(wParam)) {
- case IDOK:
- case IDCANCEL:
- DestroyWindow(hwndDlg);
- return TRUE;
- case IDC_SUPPORT:
- CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://miranda-ng.org/");
- break;
- }
- break;
- case WM_CTLCOLOREDIT:
- case WM_CTLCOLORSTATIC:
- if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_WHITERECT)
- || (HWND)lParam == GetDlgItem(hwndDlg, IDC_CLNICER)
- || (HWND)lParam == GetDlgItem(hwndDlg, IDC_VERSION)
- || (HWND)lParam == GetDlgItem(hwndDlg, IDC_COPYRIGHT)
- || (HWND)lParam == GetDlgItem(hwndDlg, IDC_SUPPORT)
- || (HWND)lParam == GetDlgItem(hwndDlg, IDC_LOGO)) {
- if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_CLNICER))
- SetTextColor((HDC)wParam, RGB(180, 10, 10));
- else if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_VERSION))
- SetTextColor((HDC)wParam, RGB(70, 70, 70));
- else
- SetTextColor((HDC)wParam, RGB(0, 0, 0));
- SetBkColor((HDC)wParam, RGB(255, 255, 255));
- return (INT_PTR)GetStockObject(WHITE_BRUSH);
- }
+ case IDC_SUPPORT:
+ CallService(MS_UTILS_OPENURL, 1, (LPARAM)"http://miranda-ng.org/");
break;
- case WM_DESTROY: {
+ }
+ break;
+
+ case WM_CTLCOLOREDIT:
+ case WM_CTLCOLORSTATIC:
+ if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_WHITERECT)
+ || (HWND)lParam == GetDlgItem(hwndDlg, IDC_CLNICER)
+ || (HWND)lParam == GetDlgItem(hwndDlg, IDC_VERSION)
+ || (HWND)lParam == GetDlgItem(hwndDlg, IDC_COPYRIGHT)
+ || (HWND)lParam == GetDlgItem(hwndDlg, IDC_SUPPORT)
+ || (HWND)lParam == GetDlgItem(hwndDlg, IDC_LOGO))
+ {
+ if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_CLNICER))
+ SetTextColor((HDC)wParam, RGB(180, 10, 10));
+ else if ((HWND)lParam == GetDlgItem(hwndDlg, IDC_VERSION))
+ SetTextColor((HDC)wParam, RGB(70, 70, 70));
+ else
+ SetTextColor((HDC)wParam, RGB(0, 0, 0));
+ SetBkColor((HDC)wParam, RGB(255, 255, 255));
+ return (INT_PTR)GetStockObject(WHITE_BRUSH);
+ }
+ break;
+
+ case WM_DESTROY:
+ {
HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_CLNICER, WM_GETFONT, 0, 0);
SendDlgItemMessage(hwndDlg, IDC_CLNICER, WM_SETFONT, SendDlgItemMessage(hwndDlg, IDOK, WM_GETFONT, 0, 0), 0);
DeleteObject(hFont);
diff --git a/src/core/stdclist/src/clcpaint.cpp b/src/core/stdclist/src/clcpaint.cpp
index 278e2e493b..690f0af8b6 100644
--- a/src/core/stdclist/src/clcpaint.cpp
+++ b/src/core/stdclist/src/clcpaint.cpp
@@ -497,10 +497,10 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
}
//extra icons
- for (iImage = 0; iImage < dat->extraColumnsCount; iImage++) {
+ for (int i = dat->extraColumnsCount-1; i >= 0; i--) {
COLORREF colourFg = dat->selBkColour;
int mode = ILD_NORMAL;
- if (group->cl.items[group->scanIndex]->iExtraImage[iImage] == 0xFFFF)
+ if (group->cl.items[group->scanIndex]->iExtraImage[i] == 0xFFFF)
continue;
if (selected)
mode = ILD_SELECTED;
@@ -512,8 +512,8 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT * rcPaint)
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,
+ ImageList_DrawEx(dat->himlExtraColumns, group->cl.items[group->scanIndex]->iExtraImage[i], hdcMem,
+ clRect.right - dat->extraColumnSpacing * (dat->extraColumnsCount - i), y + ((dat->rowHeight - 16) >> 1), 0, 0,
CLR_NONE, colourFg, mode);
}
}
diff --git a/src/modules/clist/clc.cpp b/src/modules/clist/clc.cpp
index 3f513f337a..20f966515b 100644
--- a/src/modules/clist/clc.cpp
+++ b/src/modules/clist/clc.cpp
@@ -699,7 +699,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
case SB_PAGEDOWN: desty += clRect.bottom - dat->rowHeight; break;
case SB_BOTTOM: desty = 0x7FFFFFFF; break;
case SB_TOP: desty = 0; break;
- case SB_THUMBTRACK: desty = HIWORD(wParam); noSmooth = 1; break; //noone has more than 4000 contacts, right?
+ case SB_THUMBTRACK: desty = HIWORD(wParam); noSmooth = 1; break; //noone has more than 4000 contacts, right?
default: return 0;
}
cli.pfnScrollTo(hwnd, dat, desty, noSmooth);
@@ -802,7 +802,7 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
cli.pfnHideInfoTip(hwnd, dat);
KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
- if (wParam == 27) //escape
+ if (wParam == 27) //escape
dat->szQuickSearch[0] = 0;
else if (wParam == '\b' && dat->szQuickSearch[0])
dat->szQuickSearch[lstrlen(dat->szQuickSearch) - 1] = '\0';
@@ -1203,10 +1203,10 @@ LRESULT CALLBACK fnContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam,
ClcGroup *group;
ClcContact *contact;
cli.pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
- if (group->parent) { //move to root
+ if (group->parent) { //move to root
if (contact->type == CLCIT_CONTACT) //dropee is a contact
CallService(MS_CLIST_CONTACTCHANGEGROUP, (WPARAM)contact->hContact, 0);
- else if (contact->type == CLCIT_GROUP) { //dropee is a group
+ else if (contact->type == CLCIT_GROUP) { //dropee is a group
TCHAR szNewName[120];
lstrcpyn(szNewName, contact->szText, SIZEOF(szNewName));
cli.pfnRenameGroup(contact->groupId, szNewName);
diff --git a/src/modules/clist/clcitems.cpp b/src/modules/clist/clcitems.cpp
index 94280f0bcf..c39f5cf5a6 100644
--- a/src/modules/clist/clcitems.cpp
+++ b/src/modules/clist/clcitems.cpp
@@ -244,7 +244,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int upd
if (szGroupName == NULL) {
mir_free(dbv.ptszVal);
return;
- } //never happens
+ }
if ( !lstrcmp(szGroupName, dbv.ptszVal))
break;
}
@@ -258,7 +258,7 @@ void fnAddContactToTree(HWND hwnd, struct ClcData *dat, HANDLE hContact, int upd
if (szGroupName == NULL) {
mir_free(dbv.ptszVal);
return;
- } //never happens
+ }
if ( !lstrcmp(szGroupName, dbv.ptszVal))
break;
len = lstrlen(szGroupName);
@@ -429,6 +429,7 @@ void fnRebuildEntireList(HWND hwnd, struct ClcData *dat)
}
cli.pfnSortCLC(hwnd, dat, 0);
+ cli.pfnSetAllExtraIcons(cli.hwndContactTree, 0);
}
int fnGetGroupContentsCount(ClcGroup *group, int visibleOnly)
diff --git a/src/modules/clist/clcmsgs.cpp b/src/modules/clist/clcmsgs.cpp
index 7d5664ec20..b35c7b0d64 100644
--- a/src/modules/clist/clcmsgs.cpp
+++ b/src/modules/clist/clcmsgs.cpp
@@ -396,6 +396,7 @@ LRESULT fnProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPAR
case CLM_SETFONT:
if (HIWORD(lParam) < 0 || HIWORD(lParam) > FONTID_MAX)
return 0;
+
dat->fontInfo[HIWORD(lParam)].hFont = (HFONT) wParam;
dat->fontInfo[HIWORD(lParam)].changed = 1;
{
diff --git a/src/modules/clist/clcutils.cpp b/src/modules/clist/clcutils.cpp
index fe2685ccbc..97b0db6abb 100644
--- a/src/modules/clist/clcutils.cpp
+++ b/src/modules/clist/clcutils.cpp
@@ -562,7 +562,7 @@ int fnGetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt)
}
if (ok) {
ok = 0;
- if (bottomItem == -1 || bottomcontact->type != CLCIT_GROUP) { //need to special-case moving to end
+ if (bottomItem == -1 || bottomcontact->type != CLCIT_GROUP) { //need to special-case moving to end
if (topItem != dat->iDragItem) {
for (; topgroup; topgroup = topgroup->parent) {
if (topgroup == movecontact->group)
@@ -589,7 +589,7 @@ int fnGetDropTargetInformation(HWND hwnd, struct ClcData *dat, POINT pt)
}
if (contact->type == CLCIT_GROUP) {
if (dat->iInsertionMark == -1) {
- if (movecontact->type == CLCIT_GROUP) { //check not moving onto its own subgroup
+ if (movecontact->type == CLCIT_GROUP) { //check not moving onto its own subgroup
for (; group; group = group->parent)
if (group == movecontact->group)
return DROPTARGET_ONSELF;
diff --git a/src/modules/clist/clui.cpp b/src/modules/clist/clui.cpp
index 0e569f7ccb..b39dd5882c 100644
--- a/src/modules/clist/clui.cpp
+++ b/src/modules/clist/clui.cpp
@@ -449,7 +449,11 @@ void fnDrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, HICON eventIcon)
return;
}
-#define M_CREATECLC (WM_USER+1)
+static void CreateCLC()
+{
+ cli.pfnReloadExtraIcons();
+}
+
LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
if (msg == uMsgProcessProfile)
@@ -532,6 +536,8 @@ LRESULT CALLBACK fnContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
| (db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ?
CLS_HIDEEMPTYGROUPS : 0), 0, 0, 0, 0, hwnd, NULL, cli.hInst, NULL);
SendMessage(hwnd, WM_SIZE, 0, 0);
+
+ CreateCLC();
break;
case M_RESTORESTATUS:
diff --git a/src/modules/extraicons/extraicons.cpp b/src/modules/extraicons/extraicons.cpp
index 7a4f1a40e6..eef801f408 100644
--- a/src/modules/extraicons/extraicons.cpp
+++ b/src/modules/extraicons/extraicons.cpp
@@ -365,7 +365,6 @@ INT_PTR ExtraIcon_Register(WPARAM wParam, LPARAM lParam)
return 0;
// Found one, now merge it
-
if ( _tcsicmp(extra->getDescription(), desc)) {
tstring newDesc = extra->getDescription();
newDesc += _T(" / ");
@@ -489,7 +488,7 @@ void LoadExtraIconsModule()
CreateServiceFunction(MS_CLIST_EXTRA_ADD_ICON, &svcExtraIcon_Add);
- hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
+ hEventExtraClick = CreateHookableEvent(ME_CLIST_EXTRA_CLICK);
hEventExtraImageApplying = CreateHookableEvent(ME_CLIST_EXTRA_IMAGE_APPLY);
hEventExtraImageListRebuilding = CreateHookableEvent(ME_CLIST_EXTRA_LIST_REBUILD);