diff options
author | George Hazan <ghazan@miranda.im> | 2018-05-23 23:29:25 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-05-23 23:29:25 +0300 |
commit | 176e52e14fd0358a7f26ca8d7b0205244dfde2e7 (patch) | |
tree | 10da2f8951d20103af0215c38d07ea96ba61c191 /plugins/Clist_nicer/src | |
parent | 91b13500b47a51f3a284d9f409b7b8dac167a06d (diff) |
no need to initialize pcli variable in each plugin (only in Clist_*)
Diffstat (limited to 'plugins/Clist_nicer/src')
-rw-r--r-- | plugins/Clist_nicer/src/CLCButton.cpp | 10 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clc.cpp | 32 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcitems.cpp | 4 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcopts.cpp | 8 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clcutils.cpp | 20 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistevents.cpp | 18 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistmenus.cpp | 12 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistmod.cpp | 24 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistopts.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clistsettings.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/clui.cpp | 134 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/cluiframes.cpp | 122 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/cluiopts.cpp | 96 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/cluiservices.cpp | 28 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/extBackg.cpp | 46 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/groupmenu.cpp | 2 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/init.cpp | 80 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/statusbar.cpp | 6 | ||||
-rw-r--r-- | plugins/Clist_nicer/src/viewmodes.cpp | 8 |
19 files changed, 328 insertions, 330 deletions
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index e49c935939..ea251eda52 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -190,7 +190,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) pt.x = rcParent.left;
pt.y = rcParent.top;
- ScreenToClient(pcli->hwndContactList, &pt);
+ ScreenToClient(g_CLI.hwndContactList, &pt);
BitBlt(hdcMem, 0, 0, rc.right, rc.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
if (imgItem)
@@ -212,7 +212,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) pt.x = rcParent.left;
pt.y = rcParent.top;
- ScreenToClient(pcli->hwndContactList, &pt);
+ ScreenToClient(g_CLI.hwndContactList, &pt);
if (ctl->bIsTTButton)
item_id = ctl->stateId == PBS_HOT ? ID_EXTBKTBBUTTONMOUSEOVER : (ctl->stateId == PBS_PRESSED ? ID_EXTBKTBBUTTONSPRESSED : ID_EXTBKTBBUTTONSNPRESSED);
@@ -281,7 +281,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) GetWindowRect(ctl->hwnd, &rcParent);
pt.x = rcParent.left;
pt.y = rcParent.top;
- ScreenToClient(pcli->hwndContactList, &pt);
+ ScreenToClient(g_CLI.hwndContactList, &pt);
BitBlt(hdcMem, 0, 0, rcClient.right, rcClient.bottom, cfg::dat.hdcBg, pt.x, pt.y, SRCCOPY);
if (ctl->bIsTTButton) {
@@ -466,7 +466,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR break;
case WM_NCHITTEST:
- switch (SendMessage(pcli->hwndContactList, WM_NCHITTEST, wParam, lParam)) {
+ switch (SendMessage(g_CLI.hwndContactList, WM_NCHITTEST, wParam, lParam)) {
case HTLEFT:
case HTRIGHT:
case HTBOTTOM:
@@ -536,7 +536,7 @@ static LRESULT CALLBACK ToolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA int iCtrlId = ClcGetButtonId((HWND)lParam);
// standard buttons are processed in the main window
if (iCtrlId) {
- SendMessage(pcli->hwndContactList, msg, MAKELONG(iCtrlId, BN_CLICKED), lParam);
+ SendMessage(g_CLI.hwndContactList, msg, MAKELONG(iCtrlId, BN_CLICKED), lParam);
return 0;
}
}
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index 8cab4be93d..74a71b83a0 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -109,7 +109,7 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) if (hContact) {
if (!__strcmp(cws->szModule, "CList")) {
if (!__strcmp(cws->szSetting, "StatusMsg"))
- SendMessage(pcli->hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
+ SendMessage(g_CLI.hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
}
else if (!__strcmp(cws->szModule, "UserInfo")) {
if (!__strcmp(cws->szSetting, "ANSIcodepage"))
@@ -136,14 +136,14 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) if (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT))
return 0;
- SendMessage(pcli->hwndContactTree, INTM_STATUSCHANGED, hContact, lParam);
+ SendMessage(g_CLI.hwndContactTree, INTM_STATUSCHANGED, hContact, lParam);
return 0;
}
if (strstr("YMsg|StatusDescr|XStatusMsg", cws->szSetting))
- SendMessage(pcli->hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
+ SendMessage(g_CLI.hwndContactTree, INTM_STATUSMSGCHANGED, hContact, lParam);
else if (strstr(cws->szSetting, "XStatus"))
- SendMessage(pcli->hwndContactTree, INTM_XSTATUSCHANGED, hContact, lParam);
+ SendMessage(g_CLI.hwndContactTree, INTM_XSTATUSCHANGED, hContact, lParam);
else if (!__strcmp(cws->szSetting, "Timezone") || !__strcmp(cws->szSetting, "TzName"))
ReloadExtraInfo(hContact);
@@ -259,7 +259,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L Clist_EndRename(dat, 1);
KillTimer(hwnd, TIMERID_INFOTIP);
KillTimer(hwnd, TIMERID_RENAME);
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
return DefWindowProc(hwnd, msg, wParam, lParam);
case WM_NCCALCSIZE:
@@ -283,7 +283,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
Clist_DeleteItemFromTree(hwnd, wParam);
if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(wParam, nullptr, dat)) {
- pcli->pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
+ g_CLI.pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
@@ -324,9 +324,9 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!Clist_FindItem(hwnd, dat, hContact, &contact, &group, nullptr)) {
if (shouldShow && db_is_contact(wParam)) {
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
- pcli->pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
+ g_CLI.pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
recalcScrollBar = 1;
Clist_FindItem(hwnd, dat, hContact, &contact, nullptr, nullptr);
if (contact) {
@@ -341,7 +341,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (contact->iImage == (WORD)lParam)
break;
if (!shouldShow && !(style & CLS_NOHIDEOFFLINE) && (style & CLS_HIDEOFFLINE || group->hideOffline || cfg::dat.bFilterEffective)) { // CLVM changed
- if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
+ if (dat->selection >= 0 && g_CLI.pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
Clist_RemoveItemFromGroup(hwnd, group, contact, 0);
contactRemoved = TRUE;
@@ -358,7 +358,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (hSelItem) {
ClcGroup *selgroup;
if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
- dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
+ dat->selection = g_CLI.pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
}
@@ -366,7 +366,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L PostMessage(hwnd, INTM_SORTCLC, 0, recalcScrollBar);
PostMessage(hwnd, INTM_INVALIDATE, 0, contactRemoved ? 0 : wParam);
if (recalcScrollBar)
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
}
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -489,7 +489,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L break;
contact->proto = GetContactProto(wParam);
- pcli->pfnInvalidateDisplayNameCacheEntry(wParam);
+ g_CLI.pfnInvalidateDisplayNameCacheEntry(wParam);
mir_wstrncpy(contact->szText, Clist_GetContactDisplayName(wParam), _countof(contact->szText));
RTL_DetectAndSet(contact, 0);
@@ -512,11 +512,11 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_SORTCLC:
if (dat->bNeedsResort) {
- pcli->pfnSortCLC(hwnd, dat, TRUE);
+ g_CLI.pfnSortCLC(hwnd, dat, TRUE);
dat->bNeedsResort = false;
}
if (lParam)
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_IDLECHANGED:
@@ -643,7 +643,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L {
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
if (pt.x == -1 && pt.y == -1) {
- dat->selection = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
+ dat->selection = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
if (dat->selection != -1)
Clist_EnsureVisible(hwnd, dat, dat->selection, 0);
pt.x = dat->iconXSpace + 15;
@@ -664,7 +664,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (contact->type == CLCIT_GROUP) {
hMenu = Menu_BuildSubGroupMenu(contact->group);
ClientToScreen(hwnd, &pt);
- TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr);
CheckMenuItem(hMenu, POPUP_GROUPHIDEOFFLINE, contact->group->hideOffline ? MF_CHECKED : MF_UNCHECKED);
DestroyMenu(hMenu);
return 0;
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 906568a206..24c4429dee 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -246,11 +246,11 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) void ReloadExtraInfo(MCONTACT hContact)
{
- if (hContact && pcli->hwndContactTree) {
+ if (hContact && g_CLI.hwndContactTree) {
TExtraCache *p = cfg::getCache(hContact, nullptr);
if (p) {
TZ_LoadTimeZone(hContact, p);
- InvalidateRect(pcli->hwndContactTree, nullptr, FALSE);
+ InvalidateRect(g_CLI.hwndContactTree, nullptr, FALSE);
}
}
}
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 01a94b2df5..ed44db113f 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -455,9 +455,9 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam cfg::dat.bShowLocalTimeSelective = IsDlgButtonChecked(hwndDlg, IDC_SHOWLOCALTIMEONLYWHENDIFFERENT) ? 1 : 0;
db_set_b(NULL, "CLC", "SelectiveLocalTime", (BYTE)cfg::dat.bShowLocalTimeSelective);
- KillTimer(pcli->hwndContactTree, TIMERID_REFRESH);
+ KillTimer(g_CLI.hwndContactTree, TIMERID_REFRESH);
if (cfg::dat.bShowLocalTime)
- SetTimer(pcli->hwndContactTree, TIMERID_REFRESH, 65000, nullptr);
+ SetTimer(g_CLI.hwndContactTree, TIMERID_REFRESH, 65000, nullptr);
cfg::dat.dualRowMode = (BYTE)SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_GETCURSEL, 0, 0);
if (cfg::dat.dualRowMode == CB_ERR)
@@ -685,7 +685,7 @@ static INT_PTR CALLBACK DlgProcClcMainOpts(HWND hwndDlg, UINT msg, WPARAM wParam Clist_ClcOptionsChanged();
CoolSB_SetupScrollBar();
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_clc_main_changed = 0;
return TRUE;
}
@@ -810,7 +810,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, db_set_b(NULL, "CLUI", "UseBkSkin", (BYTE)cfg::dat.bWallpaperMode);
Clist_ClcOptionsChanged();
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_clc_bkg_changed = 0;
return TRUE;
}
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 0e4b9795cc..2872e69e22 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -229,7 +229,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c }
int hit = RowHeight::hitTest(dat, dat->yScroll + testy);
if (hit != -1)
- hit = pcli->pfnGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
+ hit = g_CLI.pfnGetRowByIndex(dat, hit, &hitcontact, &hitgroup);
if (hit == -1) {
if (flags)
@@ -409,7 +409,7 @@ void RecalcScrollBar(HWND hwnd, struct ClcData *dat) si.cbSize = sizeof(si);
si.fMask = SIF_ALL;
si.nMin = 0;
- si.nMax = pcli->pfnGetRowTotalHeight(dat) - 1;
+ si.nMax = g_CLI.pfnGetRowTotalHeight(dat) - 1;
si.nPage = clRect.bottom;
si.nPos = dat->yScroll;
@@ -454,11 +454,11 @@ void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newStat group->expanded = newState != 0;
}
InvalidateRect(hwnd, nullptr, FALSE);
- contentCount = pcli->pfnGetGroupContentsCount(group, 1);
+ contentCount = g_CLI.pfnGetGroupContentsCount(group, 1);
- groupy = pcli->pfnGetRowsPriorTo(&dat->list, group, -1);
+ groupy = g_CLI.pfnGetRowsPriorTo(&dat->list, group, -1);
if (dat->selection > groupy && dat->selection < groupy + contentCount) dat->selection = groupy;
- pcli->pfnRecalcScrollBar(hwnd, dat);
+ g_CLI.pfnRecalcScrollBar(hwnd, dat);
GetClientRect(hwnd, &clRect);
newy = dat->yScroll;
@@ -518,7 +518,7 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat) KillTimer(hwnd, TIMERID_RENAME);
ReleaseCapture();
dat->iHotTrack = -1;
- dat->selection = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, &group);
+ dat->selection = g_CLI.pfnGetRowByIndex(dat, dat->selection, &contact, &group);
if (dat->selection == -1)
return;
if (contact->type != CLCIT_CONTACT && contact->type != CLCIT_GROUP)
@@ -608,11 +608,11 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) cfg::dat.bmpBackground = dat->hBmpBackground;
if (cfg::dat.bmpBackground) {
- HDC hdcThis = GetDC(pcli->hwndContactList);
+ HDC hdcThis = GetDC(g_CLI.hwndContactList);
GetObject(cfg::dat.bmpBackground, sizeof(cfg::dat.bminfoBg), &(cfg::dat.bminfoBg));
cfg::dat.hdcPic = CreateCompatibleDC(hdcThis);
cfg::dat.hbmPicOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcPic, cfg::dat.bmpBackground));
- ReleaseDC(pcli->hwndContactList, hdcThis);
+ ReleaseDC(g_CLI.hwndContactList, hdcThis);
}
}
@@ -631,11 +631,11 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) cfg::dat.bmpBackground = dat->hBmpBackground;
if (cfg::dat.bmpBackground) {
- HDC hdcThis = GetDC(pcli->hwndContactList);
+ HDC hdcThis = GetDC(g_CLI.hwndContactList);
GetObject(cfg::dat.bmpBackground, sizeof(cfg::dat.bminfoBg), &(cfg::dat.bminfoBg));
cfg::dat.hdcPic = CreateCompatibleDC(hdcThis);
cfg::dat.hbmPicOld = reinterpret_cast<HBITMAP>(SelectObject(cfg::dat.hdcPic, cfg::dat.bmpBackground));
- ReleaseDC(pcli->hwndContactList, hdcThis);
+ ReleaseDC(g_CLI.hwndContactList, hdcThis);
}
}
}
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index d697cb6728..9dce2f7897 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -66,7 +66,7 @@ void HideShowNotifyFrame() static CLISTEVENT* MyGetEvent(int iSelection)
{
- for (auto &p : *pcli->events)
+ for (auto &p : *g_CLI.events)
if (p->menuId == iSelection)
return p;
@@ -161,7 +161,7 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa // event we're interested in was removed by the service (nasty one...)
cle1 = MyGetEvent(iSelection);
if (cle1 != nullptr)
- pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
+ g_CLI.pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
}
@@ -289,14 +289,14 @@ CListEvent* AddEvent(CLISTEVENT *cle) }
if (cfg::dat.dwFlags & CLUI_STICKYEVENTS) {
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_FINDCONTACT, (WPARAM)p->hContact, 0);
+ HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_FINDCONTACT, (WPARAM)p->hContact, 0);
if (hItem) {
- SendMessage(pcli->hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 1);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 1);
Clist_Broadcast(INTM_PROTOCHANGED, (WPARAM)p->hContact, 0);
}
}
- if (pcli->events->getCount() > 0) {
+ if (g_CLI.events->getCount() > 0) {
cfg::dat.bEventAreaEnabled = TRUE;
if (cfg::dat.notifyActive == 0) {
cfg::dat.notifyActive = 1;
@@ -316,7 +316,7 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) {
// Find the event that should be removed
CListEvent *e = nullptr;
- for (auto &it : *pcli->events)
+ for (auto &it : *g_CLI.events)
if (it->hContact == hContact && it->hDbEvent == hDbEvent) {
e = it;
break;
@@ -343,7 +343,7 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) int res = coreCli.pfnRemoveEvent(hContact, hDbEvent);
- if (pcli->events->getCount() == 0) {
+ if (g_CLI.events->getCount() == 0) {
cfg::dat.bEventAreaEnabled = FALSE;
if (cfg::dat.dwFlags & CLUI_FRAME_AUTOHIDENOTIFY) {
cfg::dat.notifyActive = 0;
@@ -352,9 +352,9 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) }
// clear "sticky" (sort) status
- HANDLE hItem = (HANDLE)SendMessage(pcli->hwndContactTree, CLM_FINDCONTACT, hContact, 0);
+ HANDLE hItem = (HANDLE)SendMessage(g_CLI.hwndContactTree, CLM_FINDCONTACT, hContact, 0);
if (hItem) {
- SendMessage(pcli->hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_SETSTICKY, (WPARAM)hItem, 0);
Clist_Broadcast(INTM_PROTOCHANGED, hContact, 0);
}
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 6d49d47549..c934abf440 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -37,7 +37,7 @@ INT_PTR CloseAction(WPARAM, LPARAM) cfg::shutDown = 1;
if (Miranda_OkToExit()) {
- DestroyWindow(pcli->hwndContactList);
+ DestroyWindow(g_CLI.hwndContactList);
PostQuitMessage(0);
Sleep(0);
}
@@ -91,7 +91,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA SendDlgItemMessage(hWnd, IDC_SECONDLINEMODE, CB_INSERTSTRING, -1, (LPARAM)TranslateT("When needed by status message"));
if (cfg::clcdat) {
- Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
if (contact && contact->type != CLCIT_CONTACT) {
DestroyWindow(hWnd);
return FALSE;
@@ -147,7 +147,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_COMMAND:
switch (LOWORD(wParam)) {
case IDC_IGN_PRIORITY:
- SendMessage(pcli->hwndContactTree, CLM_TOGGLEPRIORITYCONTACT, hContact, 0);
+ SendMessage(g_CLI.hwndContactTree, CLM_TOGGLEPRIORITYCONTACT, hContact, 0);
return 0;
case IDC_IGN_ALL:
@@ -198,7 +198,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA DWORD dwFlags = db_get_dw(hContact, "CList", "CLN_Flags", 0), dwXMask = 0;
LRESULT checked = 0;
- Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
+ Clist_FindItem(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
if (iSel != CB_ERR) {
dwFlags &= ~(ECF_FORCEAVATAR | ECF_HIDEAVATAR);
@@ -285,7 +285,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_USER + 120: // set visibility status
{
ClcContact *contact = nullptr;
- if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
if (contact) {
WORD wApparentMode = db_get_w(contact->hContact, contact->proto, "ApparentMode", 0);
@@ -300,7 +300,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA {
ClcContact *contact = nullptr;
- if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
+ if (Clist_FindItem(g_CLI.hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
if (contact) {
WORD wApparentMode = 0;
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index 03933ec48c..409a88fbfc 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -35,7 +35,7 @@ extern ImageItem *g_CLUIImageItem; static INT_PTR GetStatusMode(WPARAM, LPARAM)
{
- return(g_maxStatus == ID_STATUS_OFFLINE ? pcli->currentDesiredStatusMode : g_maxStatus);
+ return(g_maxStatus == ID_STATUS_OFFLINE ? g_CLI.currentDesiredStatusMode : g_maxStatus);
}
int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact)
@@ -166,10 +166,10 @@ int ShowHide() {
BOOL bShow = FALSE;
- int iVisibleState = pcli->pfnGetWindowVisibleState(pcli->hwndContactList, 0, 0);
+ int iVisibleState = g_CLI.pfnGetWindowVisibleState(g_CLI.hwndContactList, 0, 0);
- if (IsIconic(pcli->hwndContactList)) {
- SendMessage(pcli->hwndContactList, WM_SYSCOMMAND, SC_RESTORE, 0);
+ if (IsIconic(g_CLI.hwndContactList)) {
+ SendMessage(g_CLI.hwndContactList, WM_SYSCOMMAND, SC_RESTORE, 0);
bShow = TRUE;
}
else {
@@ -193,22 +193,22 @@ int ShowHide() if (bShow == TRUE) {
RECT rcWindow;
- SetWindowPos(pcli->hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
+ SetWindowPos(g_CLI.hwndContactList, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
if (!db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT))
- SetWindowPos(pcli->hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
- SetForegroundWindow(pcli->hwndContactList);
- //SetActiveWindow(pcli->hwndContactList);
- ShowWindow(pcli->hwndContactList, SW_SHOW);
+ SetWindowPos(g_CLI.hwndContactList, HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOREDRAW | SWP_NOSENDCHANGING | SWP_NOCOPYBITS);
+ SetForegroundWindow(g_CLI.hwndContactList);
+ //SetActiveWindow(g_CLI.hwndContactList);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
db_set_b(NULL, "CList", "State", SETTING_STATE_NORMAL);
- GetWindowRect(pcli->hwndContactList, &rcWindow);
+ GetWindowRect(g_CLI.hwndContactList, &rcWindow);
if (Utils_AssertInsideScreen(&rcWindow) == 1) {
- MoveWindow(pcli->hwndContactList, rcWindow.left, rcWindow.top,
+ MoveWindow(g_CLI.hwndContactList, rcWindow.left, rcWindow.top,
rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, TRUE);
}
}
else { //It needs to be hidden
- ShowWindow(pcli->hwndContactList, SW_HIDE);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
db_set_b(NULL, "CList", "State", SETTING_STATE_HIDDEN);
if (db_get_b(NULL, "CList", "DisableWorkingSet", 1))
SetProcessWorkingSetSize(GetCurrentProcess(), -1, -1);
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index 92b0e48002..2c8ffaab60 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -171,11 +171,11 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP ConfigureCLUIGeometry(1);
ConfigureEventArea();
HideShowNotifyFrame();
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
Clist_LoadContactTree(); /* this won't do job properly since it only really works when changes happen */
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_gen_opts_changed = 0;
return TRUE;
diff --git a/plugins/Clist_nicer/src/clistsettings.cpp b/plugins/Clist_nicer/src/clistsettings.cpp index de3ffa6c26..7b2c55bac8 100644 --- a/plugins/Clist_nicer/src/clistsettings.cpp +++ b/plugins/Clist_nicer/src/clistsettings.cpp @@ -27,6 +27,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. INT_PTR GetContactStatusMessage(WPARAM wParam, LPARAM lParam)
{
if (!cfg::shutDown)
- return SendMessage(pcli->hwndContactTree, CLM_GETSTATUSMSG, wParam, lParam);
+ return SendMessage(g_CLI.hwndContactTree, CLM_GETSTATUSMSG, wParam, lParam);
return 0;
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 93ef355b69..e5ec38b3c6 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -105,8 +105,8 @@ HWND hTbMenu, hTbGlobalStatus; static void Tweak_It(COLORREF clr) { - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); - SetLayeredWindowAttributes(pcli->hwndContactList, clr, 0, LWA_COLORKEY); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED); + SetLayeredWindowAttributes(g_CLI.hwndContactList, clr, 0, LWA_COLORKEY); cfg::dat.colorkey = clr; } @@ -152,7 +152,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) g_hPenCLUIFrames = CreatePen(PS_SOLID, 1, clr_cluiframes); Clist_ClcOptionsChanged(); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -160,7 +160,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) // last frame of all. static HWND PreCreateCLC(HWND parent) { - pcli->hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"", + g_CLI.hwndContactTree = CreateWindow(CLISTCONTROL_CLASSW, L"", WS_CHILD | CLS_CONTACTLIST | (db_get_b(NULL, "CList", "UseGroups", SETTING_USEGROUPS_DEFAULT) ? CLS_USEGROUPS : 0) | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0) @@ -168,15 +168,15 @@ static HWND PreCreateCLC(HWND parent) | CLS_MULTICOLUMN, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), (LPVOID)0xff00ff00); - cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0); - return pcli->hwndContactTree; + cfg::clcdat = (struct ClcData *)GetWindowLongPtr(g_CLI.hwndContactTree, 0); + return g_CLI.hwndContactTree; } // create internal frames, including the last frame (actual CLC control) static int CreateCLC() { ExtraIcon_Reload(); - pcli->pfnSetHideOffline(oldhideoffline); + g_CLI.pfnSetHideOffline(oldhideoffline); disableautoupd = 0; { CLISTFrame frame = { 0 }; @@ -187,7 +187,7 @@ static int CreateCLC() frame.height = 20; frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_UNICODE; frame.align = alBottom; - frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr); + frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, g_CLI.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr); g_hwndEventArea = frame.hWnd; hNotifyFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0); CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hNotifyFrame, FU_FMPOS); @@ -197,7 +197,7 @@ static int CreateCLC() { CLISTFrame Frame = { 0 }; Frame.cbSize = sizeof(CLISTFrame); - Frame.hWnd = pcli->hwndContactTree; + Frame.hWnd = g_CLI.hwndContactTree; Frame.align = alClient; Frame.hIcon = Skin_LoadIcon(SKINICON_OTHER_FRAME); Frame.Flags = F_VISIBLE | F_SHOWTB | F_SHOWTBTIP | F_NOBORDER | F_UNICODE; @@ -352,8 +352,8 @@ void ConfigureCLUIGeometry(int mode) if (mode) { if (cfg::dat.dwFlags & CLUI_FRAME_SBARSHOW) { - SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0); - GetWindowRect(pcli->hwndStatus, &rcStatus); + SendMessage(g_CLI.hwndStatus, WM_SIZE, 0, 0); + GetWindowRect(g_CLI.hwndStatus, &rcStatus); cfg::dat.statusBarHeight = (rcStatus.bottom - rcStatus.top); } else cfg::dat.statusBarHeight = 0; @@ -379,7 +379,7 @@ void SetDBButtonStates(MCONTACT hPassedContact) ClcContact *contact = nullptr; if (cfg::clcdat && hPassedContact == 0) { - pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); + g_CLI.pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); if (contact && contact->type == CLCIT_CONTACT) { hContact = contact->hContact; } @@ -590,8 +590,8 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc) rcOld = rcWindow; GetWindowRect(hwnd, &rcWindow); - GetWindowRect(pcli->hwndContactTree, &rcTree); - winstyle = GetWindowLongPtr(pcli->hwndContactTree, GWL_STYLE); + GetWindowRect(g_CLI.hwndContactTree, &rcTree); + winstyle = GetWindowLongPtr(g_CLI.hwndContactTree, GWL_STYLE); SystemParametersInfo(SPI_GETWORKAREA, 0, &rcWorkArea, FALSE); HMONITOR hMon = MonitorFromWindow(hwnd, MONITOR_DEFAULTTONEAREST); @@ -656,12 +656,12 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) HRGN rgn = nullptr; RECT rc; - GetWindowRect(pcli->hwndContactTree, &rc); + GetWindowRect(g_CLI.hwndContactTree, &rc); POINT pt; pt.x = rc.left; pt.y = rc.top; - ScreenToClient(pcli->hwndContactList, &pt); + ScreenToClient(g_CLI.hwndContactList, &pt); hdcScroll = hdc; BitBlt(hdcScroll, nmcsbcd->rect.left, nmcsbcd->rect.top, nmcsbcd->rect.right - nmcsbcd->rect.left, nmcsbcd->rect.bottom - nmcsbcd->rect.top, cfg::dat.hdcBg, pt.x + nmcsbcd->rect.left, pt.y + nmcsbcd->rect.top, SRCCOPY); @@ -735,25 +735,25 @@ static void ShowCLUI(HWND hwnd) SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE); if (!db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT)) - SetMenu(pcli->hwndContactList, nullptr); + SetMenu(g_CLI.hwndContactList, nullptr); if (state == SETTING_STATE_NORMAL) { - SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); - ShowWindow(pcli->hwndContactList, SW_SHOWNORMAL); - SendMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); + SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0); + ShowWindow(g_CLI.hwndContactList, SW_SHOWNORMAL); + SendMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0); } else if (state == SETTING_STATE_MINIMIZED) { cfg::dat.forceResize = TRUE; - ShowWindow(pcli->hwndContactList, SW_HIDE); + ShowWindow(g_CLI.hwndContactList, SW_HIDE); } else if (state == SETTING_STATE_HIDDEN) { cfg::dat.forceResize = TRUE; - ShowWindow(pcli->hwndContactList, SW_HIDE); + ShowWindow(g_CLI.hwndContactList, SW_HIDE); } - SetWindowPos(pcli->hwndContactList, onTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOSENDCHANGING); + SetWindowPos(g_CLI.hwndContactList, onTop ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOSENDCHANGING); DrawMenuBar(hwnd); if (cfg::dat.autosize) { - SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); - SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); + SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0); + SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); } } @@ -779,13 +779,13 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l int flags = WS_CHILD | CCS_BOTTOM; flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0; flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0; - pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_plugin.getInst(), nullptr); + g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_plugin.getInst(), nullptr); if (flags & WS_VISIBLE) { - ShowWindow(pcli->hwndStatus, SW_SHOW); - SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0); + ShowWindow(g_CLI.hwndStatus, SW_SHOW); + SendMessage(g_CLI.hwndStatus, WM_SIZE, 0, 0); } - mir_subclassWindow(pcli->hwndStatus, NewStatusBarWndProc); - SetClassLong(pcli->hwndStatus, GCL_STYLE, GetClassLong(pcli->hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW)); + mir_subclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc); + SetClassLong(g_CLI.hwndStatus, GCL_STYLE, GetClassLong(g_CLI.hwndStatus, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW)); } g_oldSize.cx = g_oldSize.cy = 0; old_cliststate = db_get_b(NULL, "CList", "State", SETTING_STATE_NORMAL); @@ -831,8 +831,8 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l { LONG style; BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_TOOLWINDOW); - ShowWindow(pcli->hwndContactList, SW_HIDE); - style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE); + ShowWindow(g_CLI.hwndContactList, SW_HIDE); + style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE); if (windowStyle != SETTING_WINDOWSTYLE_DEFAULT) { style |= WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE; style &= ~WS_EX_APPWINDOW; @@ -845,10 +845,10 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l style |= WS_EX_APPWINDOW; } - SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style); + SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, style); ApplyCLUIBorderStyle(); - SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE); + SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE); } if (cfg::dat.bSkinnedButtonMode) @@ -857,7 +857,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l SetButtonStates(); CreateCLC(); - cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0); + cfg::clcdat = (struct ClcData *)GetWindowLongPtr(g_CLI.hwndContactTree, 0); if (cfg::dat.bFullTransparent) { if (g_CLUISkinnedBkColorRGB) @@ -884,7 +884,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l ShowCLUI(hwnd); else { show_on_first_autosize = TRUE; - RecalcScrollBar(pcli->hwndContactTree, cfg::clcdat); + RecalcScrollBar(g_CLI.hwndContactTree, cfg::clcdat); } return 0; } @@ -1044,7 +1044,7 @@ skipbg: break; case WM_WINDOWPOSCHANGING: - if (pcli->hwndContactList != nullptr) { + if (g_CLI.hwndContactList != nullptr) { WINDOWPOS *wp = (WINDOWPOS *)lParam; if (!wp || (wp->flags & SWP_NOSIZE)) return FALSE; @@ -1059,12 +1059,12 @@ skipbg: if (cfg::dat.dwFlags & CLUI_FRAME_SBARSHOW) { RECT rcStatus; - SetWindowPos(pcli->hwndStatus, nullptr, 0, new_window_rect.bottom - 20, new_window_rect.right, 20, SWP_NOZORDER); - GetWindowRect(pcli->hwndStatus, &rcStatus); + SetWindowPos(g_CLI.hwndStatus, nullptr, 0, new_window_rect.bottom - 20, new_window_rect.right, 20, SWP_NOZORDER); + GetWindowRect(g_CLI.hwndStatus, &rcStatus); cfg::dat.statusBarHeight = (rcStatus.bottom - rcStatus.top); if (wp->cx != g_oldSize.cx) SendMessage(hwnd, CLUIINTM_STATUSBARUPDATE, 0, 0); - RedrawWindow(pcli->hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); + RedrawWindow(g_CLI.hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); } else cfg::dat.statusBarHeight = 0; @@ -1088,7 +1088,7 @@ skipbg: if (IsZoomed(hwnd)) ShowWindow(hwnd, SW_SHOWNORMAL); - if (pcli->hwndContactList != nullptr) { + if (g_CLI.hwndContactList != nullptr) { SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0); GetWindowRect(hwnd, &rc); WINDOWPOS wp = {}; @@ -1127,7 +1127,7 @@ skipbg: return TRUE; case WM_SETFOCUS: - SetFocus(pcli->hwndContactTree); + SetFocus(g_CLI.hwndContactTree); return 0; case CLUIINTM_REMOVEFROMTASKBAR: { @@ -1154,7 +1154,7 @@ skipbg: 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, db_get_b(NULL, "CList", "OnTop", SETTING_ONTOP_DEFAULT) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOREDRAW | SWP_NOSENDCHANGING); + SetWindowPos(g_CLI.hwndContactList, db_get_b(NULL, "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); @@ -1308,11 +1308,11 @@ skipbg: db_set_b(NULL, "CList", "State", SETTING_STATE_MINIMIZED); break; } - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); return 0; } if (wParam == SC_RESTORE) { - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); return 0; } } @@ -1334,7 +1334,7 @@ skipbg: int serviceFailure = FALSE; if (cfg::clcdat) { - pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); + g_CLI.pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); if (contact && contact->type == CLCIT_CONTACT) hContact = contact->hContact; } @@ -1483,17 +1483,17 @@ buttons_done: case ID_TRAY_HIDE: case IDC_TBMINIMIZE: case IDC_STBMINIMIZE: - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); break; case POPUP_NEWGROUP: - SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0); - SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, 1, 0); + SendMessage(g_CLI.hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0); + SendMessage(g_CLI.hwndContactTree, CLM_SETUSEGROUPS, 1, 0); Clist_GroupCreate(NULL, nullptr); break; case POPUP_HIDEOFFLINE: case IDC_TBHIDEOFFLINE: case IDC_STBHIDEOFFLINE: - pcli->pfnSetHideOffline(-1); + g_CLI.pfnSetHideOffline(-1); break; case POPUP_HIDEOFFLINEROOT: CallService(MS_CLIST_TOGGLEHIDEOFFLINEROOT, 0, 0); @@ -1508,11 +1508,11 @@ buttons_done: SetButtonStates(); break; case POPUP_HIDEMIRANDA: - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); break; case POPUP_SHOWMETAICONS: cfg::dat.dwFlags ^= CLUI_USEMETAICONS; - Clist_InitAutoRebuild(pcli->hwndContactTree); + Clist_InitAutoRebuild(g_CLI.hwndContactTree); break; case POPUP_FRAME: cfg::dat.dwFlags ^= CLUI_FRAME_CLISTSUNKEN; @@ -1525,15 +1525,15 @@ buttons_done: break; } if (dwOldFlags != cfg::dat.dwFlags) { - InvalidateRect(pcli->hwndContactTree, nullptr, FALSE); + InvalidateRect(g_CLI.hwndContactTree, nullptr, FALSE); db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags); if ((dwOldFlags & (CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN)) != (cfg::dat.dwFlags & (CLUI_FRAME_SHOWBOTTOMBUTTONS | CLUI_FRAME_CLISTSUNKEN))) { ConfigureFrame(); ConfigureCLUIGeometry(1); } ConfigureEventArea(); - PostMessage(pcli->hwndContactList, WM_SIZE, 0, 0); - PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); + PostMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0); + PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0); } } return FALSE; @@ -1547,11 +1547,11 @@ buttons_done: break; case WM_DISPLAYCHANGE: - SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged + SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0); //forces it to send a cln_listsizechanged break; case WM_NOTIFY: - if (((LPNMHDR)lParam)->hwndFrom == pcli->hwndContactTree) { + if (((LPNMHDR)lParam)->hwndFrom == g_CLI.hwndContactTree) { switch (((LPNMHDR)lParam)->code) { case CLN_LISTSIZECHANGE: sttProcessResize(hwnd, (NMCLISTCONTROL *)lParam); @@ -1561,14 +1561,14 @@ buttons_done: { NMCLISTCONTROL *nm = (NMCLISTCONTROL *)lParam; DWORD hitFlags; - SendMessage(pcli->hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y)); + SendMessage(g_CLI.hwndContactTree, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y)); if ((hitFlags & (CLCHT_NOWHERE | CLCHT_INLEFTMARGIN | CLCHT_BELOWITEMS)) == 0) break; if (db_get_b(NULL, "CLUI", "ClientAreaDrag", SETTING_CLIENTDRAG_DEFAULT)) { POINT pt; pt = nm->pt; - ClientToScreen(pcli->hwndContactTree, &pt); + ClientToScreen(g_CLI.hwndContactTree, &pt); return SendMessage(hwnd, WM_SYSCOMMAND, SC_MOVE | HTCAPTION, MAKELPARAM(pt.x, pt.y)); } } @@ -1578,7 +1578,7 @@ buttons_done: break; case WM_CONTEXTMENU: - GetWindowRect(pcli->hwndContactTree, &rc); + GetWindowRect(g_CLI.hwndContactTree, &rc); { // x/y might be -1 if it was generated by a kb click POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) }; @@ -1597,7 +1597,7 @@ buttons_done: Menu_DestroyNestedMenu(hMenu); return 0; } - GetWindowRect(pcli->hwndStatus, &rc); + GetWindowRect(g_CLI.hwndStatus, &rc); if (PtInRect(&rc, pt)) { HMENU hMenu; if (db_get_b(NULL, "CLUI", "SBarRightClk", 0)) @@ -1627,7 +1627,7 @@ buttons_done: hbmLockedPoint = CreateCompatibleBitmap(dis->hDC, 5, 5); hbmOldLockedPoint = reinterpret_cast<HBITMAP>(SelectObject(hdcLockedPoint, hbmLockedPoint)); } - if (dis->hwndItem == pcli->hwndStatus) { + if (dis->hwndItem == g_CLI.hwndStatus) { ProtocolData *pd = (ProtocolData *)dis->itemData; if (IsBadCodePtr((FARPROC)pd)) return TRUE; @@ -1639,7 +1639,7 @@ buttons_done: if (pa == nullptr) return TRUE; - int nParts = SendMessage(pcli->hwndStatus, SB_GETPARTS, 0, 0); + int nParts = SendMessage(g_CLI.hwndStatus, SB_GETPARTS, 0, 0); SIZE textSize; BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1); @@ -1723,7 +1723,7 @@ buttons_done: PostMessage(hwnd, WM_SYSCOMMAND, SC_MINIMIZE, 0); return 0; } - pcli->pfnShowHide(); + g_CLI.pfnShowHide(); return 0; case CLUIINTM_REDRAW: @@ -1787,7 +1787,7 @@ static INT_PTR CLN_ShowMainMenu(WPARAM, LPARAM) { POINT pt; GetCursorPos(&pt); - TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr); + TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr); return 0; } @@ -1795,7 +1795,7 @@ static INT_PTR CLN_ShowStatusMenu(WPARAM, LPARAM) { POINT pt; GetCursorPos(&pt); - TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr); + TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, g_CLI.hwndContactList, nullptr); return 0; } @@ -1848,7 +1848,7 @@ void OnCreateClc() InitGroupMenus(); LoadExtBkSettingsFromDB(); - PreCreateCLC(pcli->hwndContactList); + PreCreateCLC(g_CLI.hwndContactList); } struct diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index 245206e3e9..2c50952b3a 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -214,7 +214,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) } memset(&fakeMainWindow, 0, sizeof(fakeMainWindow)); - fakeMainWindow.ContainerWnd = pcli->hwndContactList; + fakeMainWindow.ContainerWnd = g_CLI.hwndContactList; fakeMainWindow.floating = TRUE; memset(&fakeTaskBarWindow, 0, sizeof(fakeTaskBarWindow)); @@ -840,7 +840,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) SetWindowLongPtr(Frames[pos].TitleBar.hwnd, GWL_STYLE, (LONG_PTR)style & ~(WS_VSCROLL | WS_HSCROLL)); lck.unlock(); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); SetWindowPos(Frames[pos].TitleBar.hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } return 0; @@ -903,7 +903,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) retval = Frames[pos].height; if (Frames[pos].height != oldHeight) { - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); if (Frames[pos].Skinned) RedrawWindow(Frames[pos].hWnd, nullptr, nullptr, RDW_FRAME | RDW_UPDATENOW | RDW_INVALIDATE); } @@ -942,7 +942,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) } lck.unlock(); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); return -1; } @@ -954,7 +954,7 @@ static INT_PTR CLUIFramesShowAll(WPARAM, LPARAM) for (int i = 0; i < nFramescount; i++) Frames[i].visible = TRUE; - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); return 0; } @@ -968,8 +968,8 @@ INT_PTR CLUIFramesShowAllTitleBars(WPARAM, LPARAM) F.TitleBar.ShowTitleBar = TRUE; SetWindowPos(F.hWnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -983,8 +983,8 @@ INT_PTR CLUIFramesHideAllTitleBars(WPARAM, LPARAM) F.TitleBar.ShowTitleBar = FALSE; SetWindowPos(F.hWnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1008,8 +1008,8 @@ INT_PTR CLUIFramesShowHideFrame(WPARAM frameId, LPARAM) } if (!Frames[pos].floating) - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1027,8 +1027,8 @@ INT_PTR CLUIFramesShowHideFrameTitleBar(WPARAM frameId, LPARAM) } } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1081,8 +1081,8 @@ INT_PTR CLUIFramesMoveUpDown(WPARAM frameId, LPARAM lParam) lck.unlock(); CLUIFramesReSort(); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0); return 0; } @@ -1102,8 +1102,8 @@ INT_PTR CLUIFramesSetAlign(WPARAM frameId, LPARAM lParam) if (FramesSysNotStarted) return -1; CLUIFramesSetFrameOptions(MAKEWPARAM(FO_ALIGN, frameId), lParam); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1223,7 +1223,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) if (db_get_b(NULL, "CLUI", "AutoSize", 0)) return 0; - GetWindowRect(pcli->hwndContactList, &rc); + GetWindowRect(g_CLI.hwndContactList, &rc); if (Frames[FrameId].collapsed == TRUE) { rc.bottom -= rc.top; @@ -1237,11 +1237,11 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) Frames[FrameId].collapsed = TRUE; } - SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE); + SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE); CLUIFramesStoreAllFrames(); lck.unlock(); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1298,7 +1298,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) } lck.unlock(); if (!Frames[FrameId].floating) - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); else { RECT contwnd; GetWindowRect(Frames[FrameId].ContainerWnd, &contwnd); @@ -1308,7 +1308,7 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) contwnd.top -= (oldHeight - Frames[FrameId].height);//newheight SetWindowPos(Frames[FrameId].ContainerWnd, HWND_TOP, 0, 0, contwnd.left, contwnd.top, SWP_SHOWWINDOW | SWP_NOMOVE); } - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); CLUIFramesStoreAllFrames(); return 0; } @@ -1373,11 +1373,9 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO HWND hwndParent = GetParent(hwnd); LRESULT result = 0; - if (pcli == nullptr) - return 0; - if (hwndParent != pcli->hwndContactList || !cfg::dat.bSkinnedScrollbar) + if (hwndParent != g_CLI.hwndContactList || !cfg::dat.bSkinnedScrollbar) result = CallWindowProc(oldWndProc, hwnd, WM_NCPAINT, wParam, lParam); - if (!pcli->hwndContactList || hwndParent != pcli->hwndContactList) + if (!g_CLI.hwndContactList || hwndParent != g_CLI.hwndContactList) return result; if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SKINNEDFRAME) { @@ -1391,7 +1389,7 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO rc.bottom = rcWindow.bottom - rcWindow.top; HDC hdc = GetWindowDC(hwnd); - if (hwnd == pcli->hwndContactTree) { + if (hwnd == g_CLI.hwndContactTree) { HDC realDC = CreateCompatibleDC(hdc); HBITMAP hbmDraw = CreateCompatibleBitmap(hdc, rc.right, rc.bottom); HBITMAP hbmOld = reinterpret_cast<HBITMAP>(SelectObject(realDC, hbmDraw)); @@ -1440,10 +1438,10 @@ int FrameNCCalcSize(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, NCCALCSIZE_PARAMS *nccp = (NCCALCSIZE_PARAMS *)lParam; DWORD dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE); - if (item == nullptr || pcli == nullptr) + if (item == nullptr) return orig; - if (item->IGNORED || !(dwStyle & CLS_SKINNEDFRAME) || GetParent(hwnd) != pcli->hwndContactList) + if (item->IGNORED || !(dwStyle & CLS_SKINNEDFRAME) || GetParent(hwnd) != g_CLI.hwndContactList) return orig; nccp->rgrc[0].left += item->MARGIN_LEFT; @@ -1533,7 +1531,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) int style; CLISTFrame *clfrm = (CLISTFrame *)wParam; - if (pcli->hwndContactList == nullptr) return -1; + if (g_CLI.hwndContactList == nullptr) return -1; if (FramesSysNotStarted) return -1; if (clfrm->cbSize != sizeof(CLISTFrame)) return -1; @@ -1558,13 +1556,13 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) if (clfrm->Flags & F_NO_SUBCONTAINER) Frames[nFramescount].OwnerWindow = (HWND)-2; else - Frames[nFramescount].OwnerWindow = pcli->hwndContactList; + Frames[nFramescount].OwnerWindow = g_CLI.hwndContactList; SetClassLong(clfrm->hWnd, GCL_STYLE, GetClassLong(clfrm->hWnd, GCL_STYLE) & ~(CS_VREDRAW | CS_HREDRAW)); SetWindowLongPtr(clfrm->hWnd, GWL_STYLE, GetWindowLongPtr(clfrm->hWnd, GWL_STYLE) | WS_CLIPCHILDREN); if (GetCurrentThreadId() == GetWindowThreadProcessId(clfrm->hWnd, nullptr)) { - if (clfrm->hWnd != pcli->hwndContactTree && clfrm->hWnd != g_hwndViewModeFrame && clfrm->hWnd != g_hwndEventArea) { + if (clfrm->hWnd != g_CLI.hwndContactTree && clfrm->hWnd != g_hwndViewModeFrame && clfrm->hWnd != g_hwndEventArea) { Frames[nFramescount].wndProc = (WNDPROC)GetWindowLongPtr(clfrm->hWnd, GWLP_WNDPROC); SetWindowLongPtr(clfrm->hWnd, GWLP_WNDPROC, (LONG_PTR)FramesSubClassProc); } @@ -1572,7 +1570,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) if (clfrm->hWnd == g_hwndEventArea) wndFrameEventArea = &Frames[nFramescount]; - else if (clfrm->hWnd == pcli->hwndContactTree) + else if (clfrm->hWnd == g_CLI.hwndContactTree) wndFrameCLC = &Frames[nFramescount]; else if (clfrm->hWnd == g_hwndViewModeFrame) wndFrameViewMode = &Frames[nFramescount]; @@ -1607,13 +1605,13 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) CreateWindow(CLUIFrameTitleBarClassName, Frames[nFramescount].name, (db_get_b(NULL, CLUIFrameModule, "RemoveAllTitleBarBorders", 1) ? 0 : WS_BORDER) | WS_CHILD | WS_CLIPCHILDREN | (Frames[nFramescount].TitleBar.ShowTitleBar ? WS_VISIBLE : 0) | - WS_CLIPCHILDREN, 0, 0, 0, 0, pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr); + WS_CLIPCHILDREN, 0, 0, 0, 0, g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr); SetWindowLongPtr(Frames[nFramescount].TitleBar.hwnd, GWLP_USERDATA, Frames[nFramescount].id); Frames[nFramescount].TitleBar.hwndTip = CreateWindowExA(0, TOOLTIPS_CLASSA, nullptr, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, - pcli->hwndContactList, nullptr, g_plugin.getInst(), nullptr); + g_CLI.hwndContactList, nullptr, g_plugin.getInst(), nullptr); SetWindowPos(Frames[nFramescount].TitleBar.hwndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); { @@ -1651,13 +1649,13 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) lck.unlock(); alclientFrame = -1;//recalc it - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); if (Frames[nFramescount - 1].floating) { Frames[nFramescount - 1].floating = FALSE; CLUIFrameSetFloat(retval, 1);//lparam=1 use stored width and height } - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return retval; } @@ -1675,7 +1673,7 @@ static INT_PTR CLUIFramesRemoveFrame(WPARAM wParam, LPARAM) FRAMEWND* F = &Frames[pos]; if (F->hWnd == g_hwndEventArea) wndFrameEventArea = nullptr; - else if (F->hWnd == pcli->hwndContactTree) + else if (F->hWnd == g_CLI.hwndContactTree) wndFrameCLC = nullptr; else if (F->hWnd == g_hwndViewModeFrame) wndFrameViewMode = nullptr; @@ -1696,9 +1694,9 @@ static INT_PTR CLUIFramesRemoveFrame(WPARAM wParam, LPARAM) } if (!cfg::shutDown) { - InvalidateRect(pcli->hwndContactList, nullptr, TRUE); - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + InvalidateRect(g_CLI.hwndContactList, nullptr, TRUE); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); } return 0; } @@ -1771,7 +1769,7 @@ bool CLUIFramesFitInSize(void) int CLUIFramesGetMinHeight() { - if (pcli->hwndContactList == nullptr) + if (g_CLI.hwndContactList == nullptr) return 0; int i, tbh, clientfrm, sumheight = 0; @@ -1798,7 +1796,7 @@ int CLUIFramesGetMinHeight() } } - GetBorderSize(pcli->hwndContactList, &border); + GetBorderSize(g_CLI.hwndContactList, &border); return(sumheight + border.top + border.bottom + allbord + tbh + 3); } @@ -1958,12 +1956,12 @@ INT_PTR CLUIFramesUpdateFrame(WPARAM wParam, LPARAM lParam) return -1; if (wParam == -1) { - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); return 0; } if (lParam & FU_FMPOS) - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 1); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 1); mir_cslock lck(csFrameHook); int pos = id2pos(wParam); @@ -2070,7 +2068,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) { mir_cslock lck(csFrameHook); - GetClientRect(pcli->hwndContactList, &nRect); + GetClientRect(g_CLI.hwndContactList, &nRect); if (lParam && lParam != 1) { RECT oldRect; POINT pt; @@ -2079,7 +2077,7 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) GetWindowRect((HWND)wParam, &oldRect); pt.x = nRect.left; pt.y = nRect.top; - ClientToScreen(pcli->hwndContactList, &pt); + ClientToScreen(g_CLI.hwndContactList, &pt); dl = pt.x - oldRect.left; dt = pt.y - oldRect.top; dr = (oldRect.right - oldRect.left) - (nRect.right - nRect.left) - dl; @@ -2106,10 +2104,10 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) tick = GetTickCount() - tick; - if (pcli->hwndContactList != nullptr) - InvalidateRect(pcli->hwndContactList, nullptr, TRUE); - if (pcli->hwndContactList != nullptr) - UpdateWindow(pcli->hwndContactList); + if (g_CLI.hwndContactList != nullptr) + InvalidateRect(g_CLI.hwndContactList, nullptr, TRUE); + if (g_CLI.hwndContactList != nullptr) + UpdateWindow(g_CLI.hwndContactList); Sleep(0); @@ -2283,7 +2281,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA CLUIFrameSetFloat(Frameid, 0); break; } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); } break; @@ -2354,7 +2352,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA lbypos = -1; oldframeheight = -1; ReleaseCapture(); - RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); break; case WM_LBUTTONDOWN: @@ -2421,8 +2419,8 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA rcwnd.left = curpt.x; rcwnd.right = curpt.x + 5; - GetWindowRect(pcli->hwndContactList, &rcMiranda); - if (IsWindowVisible(pcli->hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) { + GetWindowRect(g_CLI.hwndContactList, &rcMiranda); + if (IsWindowVisible(g_CLI.hwndContactList) && IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) { int id = Frames[pos].id; lck.unlock(); @@ -2453,7 +2451,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA rcwnd.left = curpt.x; rcwnd.right = curpt.x + 5; - GetWindowRect(pcli->hwndContactList, &rcMiranda); + GetWindowRect(g_CLI.hwndContactList, &rcMiranda); if (!IntersectRect(&rcOverlap, &rcwnd, &rcMiranda)) { lck.unlock(); @@ -2576,7 +2574,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA lck.unlock(); if (newh > 0) - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); break; } curdragbar = -1; @@ -2794,8 +2792,8 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) wParam = id2pos(wParam); if ((int)wParam >= 0 && (int)wParam < nFramescount) { if (Frames[wParam].floating) { - SetParent(Frames[wParam].hWnd, pcli->hwndContactList); - SetParent(Frames[wParam].TitleBar.hwnd, pcli->hwndContactList); + SetParent(Frames[wParam].hWnd, g_CLI.hwndContactList); + SetParent(Frames[wParam].TitleBar.hwnd, g_CLI.hwndContactList); Frames[wParam].floating = FALSE; DestroyWindow(Frames[wParam].ContainerWnd); Frames[wParam].ContainerWnd = nullptr; @@ -2816,7 +2814,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) if (!Frames[wParam].TitleBar.ShowTitleBar) recttb.top = recttb.bottom = recttb.left = recttb.right = 0; - Frames[wParam].ContainerWnd = CreateContainerWindow(pcli->hwndContactList, Frames[wParam].FloatingPos.x, Frames[wParam].FloatingPos.y, 10, 10); + Frames[wParam].ContainerWnd = CreateContainerWindow(g_CLI.hwndContactList, Frames[wParam].FloatingPos.x, Frames[wParam].FloatingPos.y, 10, 10); SetParent(Frames[wParam].hWnd, Frames[wParam].ContainerWnd); SetParent(Frames[wParam].TitleBar.hwnd, Frames[wParam].ContainerWnd); @@ -2869,7 +2867,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) hwndtmp = Frames[wParam].ContainerWnd; } - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); SendMessage(hwndtmp, WM_SIZE, 0, 0); SetWindowPos(hwndtooltiptmp, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE); return 0; @@ -3022,7 +3020,7 @@ void LoadExtraIconModule() int UnLoadCLUIFramesModule(void) { - CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); + CLUIFramesOnClistResize((WPARAM)g_CLI.hwndContactList, 0); CLUIFramesStoreAllFrames(); DeleteObject(g_hPenCLUIFrames); diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index e291388d67..9e6a279af3 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -176,7 +176,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_dw(NULL, "CLUIFrames", "GapBetweenFrames", cfg::dat.gapBetweenFrames);
db_set_b(NULL, "CList", "OnTop", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ONTOP));
- SetWindowPos(pcli->hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
+ SetWindowPos(g_CLI.hwndContactList, IsDlgButtonChecked(hwndDlg, IDC_ONTOP) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
cfg::dat.bCLeft = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CLEFTSPIN, UDM_GETPOS, 0, 0);
cfg::dat.bCRight = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CRIGHTSPIN, UDM_GETPOS, 0, 0);
@@ -184,7 +184,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l cfg::dat.bCBottom = (BYTE)SendDlgItemMessage(hwndDlg, IDC_CBOTTOMSPIN, UDM_GETPOS, 0, 0);
db_set_dw(NULL, "CLUI", "clmargins", MAKELONG(MAKEWORD(cfg::dat.bCLeft, cfg::dat.bCRight), MAKEWORD(cfg::dat.bCTop, cfg::dat.bCBottom)));
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
db_set_b(NULL, "CList", "BringToFront", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_BRINGTOFRONT));
db_set_b(NULL, "CList", "AlwaysHideOnTB", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_ALWAYSHIDEONTASKBAR));
@@ -195,28 +195,28 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l // 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);
+ GetWindowPlacement(g_CLI.hwndContactList, &p);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
- style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
+ style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
style |= WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE;
style &= ~WS_EX_APPWINDOW;
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, style);
- SetWindowPlacement(pcli->hwndContactList, &p);
- ShowWindow(pcli->hwndContactList, SW_SHOW);
+ SetWindowPlacement(g_CLI.hwndContactList, &p);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
}
else {
LONG style;
- style = GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE);
+ style = GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE);
style &= ~(WS_EX_TOOLWINDOW | WS_EX_WINDOWEDGE);
if (db_get_b(NULL, "CList", "AlwaysHideOnTB", 1))
style &= ~WS_EX_APPWINDOW;
else {
style |= WS_EX_APPWINDOW;
- AddToTaskBar(pcli->hwndContactList);
+ AddToTaskBar(g_CLI.hwndContactList);
}
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, style);
}
cfg::dat.bClipBorder = (BYTE)GetDlgItemInt(hwndDlg, IDC_CLIPBORDER, &translated, FALSE);
@@ -229,21 +229,21 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ApplyCLUIBorderStyle();
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
- SetMenu(pcli->hwndContactList, nullptr);
+ SetMenu(g_CLI.hwndContactList, nullptr);
else
- SetMenu(pcli->hwndContactList, pcli->hMenuMain);
+ SetMenu(g_CLI.hwndContactList, g_CLI.hMenuMain);
wchar_t title[256];
GetDlgItemText(hwndDlg, IDC_TITLETEXT, title, _countof(title));
db_set_ws(NULL, "CList", "TitleText", title);
- SetWindowText(pcli->hwndContactList, title);
+ SetWindowText(g_CLI.hwndContactList, title);
cfg::dat.dwFlags = IsDlgButtonChecked(hwndDlg, IDC_ROUNDEDBORDER) ? cfg::dat.dwFlags | CLUI_FRAME_ROUNDEDFRAME : cfg::dat.dwFlags & ~CLUI_FRAME_ROUNDEDFRAME;
db_set_b(NULL, "CLUI", "AutoSize", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE));
if ((cfg::dat.autosize = IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZE) ? 1 : 0)) {
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactTree, WM_SIZE, 0, 0);
}
db_set_b(NULL, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
@@ -264,36 +264,36 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_b(NULL, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
if (cfg::dat.bLayeredHack)
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
if (g_CLUISkinnedBkColorRGB)
cfg::dat.colorkey = g_CLUISkinnedBkColorRGB;
else if (cfg::dat.bClipBorder == 0 && !(cfg::dat.dwFlags & CLUI_FRAME_ROUNDEDFRAME))
cfg::dat.colorkey = db_get_dw(NULL, "CLC", "BkColour", CLCDEFAULT_BKCOLOUR);
else {
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
cfg::dat.colorkey = RGB(255, 0, 255);
}
if (cfg::dat.isTransparent || cfg::dat.bFullTransparent) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(pcli->hwndContactList, 0, 255, LWA_ALPHA | LWA_COLORKEY);
- SetLayeredWindowAttributes(pcli->hwndContactList,
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList, 0, 255, LWA_ALPHA | LWA_COLORKEY);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList,
(COLORREF)(cfg::dat.bFullTransparent ? cfg::dat.colorkey : 0),
(BYTE)(cfg::dat.isTransparent ? cfg::dat.autoalpha : 255),
(DWORD)((cfg::dat.isTransparent ? LWA_ALPHA : 0L) | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0L)));
}
else {
- SetLayeredWindowAttributes(pcli->hwndContactList, RGB(0, 0, 0), (BYTE)255, LWA_ALPHA);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList, RGB(0, 0, 0), (BYTE)255, LWA_ALPHA);
if (!cfg::dat.bLayeredHack)
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) & ~WS_EX_LAYERED);
}
ConfigureCLUIGeometry(1);
- ShowWindow(pcli->hwndContactList, SW_SHOW);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOW);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
cfg::dat.fadeinout = oldFading;
opt_clui_changed = 0;
@@ -377,33 +377,33 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_b(NULL, "CLUI", "xstatus_sbar", (BYTE)cfg::dat.bShowXStatusOnSbar);
db_set_b(NULL, "CLUI", "SBarBevel", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SBPANELBEVEL));
if (db_get_b(NULL, "CLUI", "ShowGrip", 1) != (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP)) {
- HWND parent = GetParent(pcli->hwndStatus);
+ HWND parent = GetParent(g_CLI.hwndStatus);
int flags = WS_CHILD | CCS_BOTTOM;
db_set_b(NULL, "CLUI", "ShowGrip", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWGRIP));
- ShowWindow(pcli->hwndStatus, SW_HIDE);
- mir_unsubclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
- DestroyWindow(pcli->hwndStatus);
+ ShowWindow(g_CLI.hwndStatus, SW_HIDE);
+ mir_unsubclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc);
+ DestroyWindow(g_CLI.hwndStatus);
flags |= db_get_b(NULL, "CLUI", "ShowSBar", 1) ? WS_VISIBLE : 0;
flags |= db_get_b(NULL, "CLUI", "ShowGrip", 1) ? SBARS_SIZEGRIP : 0;
- pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
- mir_subclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
+ g_CLI.hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_plugin.getInst(), nullptr);
+ mir_subclassWindow(g_CLI.hwndStatus, NewStatusBarWndProc);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
- ShowWindow(pcli->hwndStatus, SW_SHOW);
- SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0);
+ ShowWindow(g_CLI.hwndStatus, SW_SHOW);
+ SendMessage(g_CLI.hwndStatus, WM_SIZE, 0, 0);
cfg::dat.dwFlags |= CLUI_FRAME_SBARSHOW;
}
else {
- ShowWindow(pcli->hwndStatus, SW_HIDE);
+ ShowWindow(g_CLI.hwndStatus, SW_HIDE);
cfg::dat.dwFlags &= ~CLUI_FRAME_SBARSHOW;
}
db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
ConfigureCLUIGeometry(1);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
CluiProtocolStatusChanged(0, nullptr);
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_sbar_changed = 0;
return TRUE;
}
@@ -433,26 +433,26 @@ void ApplyCLUIBorderStyle() bool minToTray = TRUE;
p.length = sizeof(p);
- GetWindowPlacement(pcli->hwndContactList, &p);
- ShowWindow(pcli->hwndContactList, SW_HIDE);
+ GetWindowPlacement(g_CLI.hwndContactList, &p);
+ ShowWindow(g_CLI.hwndContactList, SW_HIDE);
if (windowStyle == SETTING_WINDOWSTYLE_DEFAULT || windowStyle == SETTING_WINDOWSTYLE_TOOLWINDOW) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME);
if (SETTING_WINDOWSTYLE_DEFAULT == windowStyle) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_MAXIMIZEBOX/* | WS_MINIMIZEBOX*/));
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_MAXIMIZEBOX/* | WS_MINIMIZEBOX*/));
minToTray = FALSE;
}
}
else if (windowStyle == SETTING_WINDOWSTYLE_THINBORDER) {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_BORDER | WS_CLIPCHILDREN);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_BORDER | WS_CLIPCHILDREN);
}
else {
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
- SetWindowLongPtr(pcli->hwndContactList, GWL_STYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_STYLE) | WS_CLIPCHILDREN);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) & ~(WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_POPUPWINDOW | WS_THICKFRAME));
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_STYLE) | WS_CLIPCHILDREN);
}
p.showCmd = SW_HIDE;
- SetWindowPlacement(pcli->hwndContactList, &p);
+ SetWindowPlacement(g_CLI.hwndContactList, &p);
db_set_b(0, "CList", "Min2Tray", minToTray);
}
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 9f83842bac..9e64b242d2 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -30,11 +30,11 @@ extern ButtonItem *g_ButtonItems; void FreeProtocolData(void)
{
// free protocol data
- int nParts = SendMessage(pcli->hwndStatus, SB_GETPARTS, 0, 0);
+ int nParts = SendMessage(g_CLI.hwndStatus, SB_GETPARTS, 0, 0);
for (int nPanel = 0; nPanel < nParts; nPanel++) {
- ProtocolData *PD = (ProtocolData *)SendMessage(pcli->hwndStatus, SB_GETTEXT, nPanel, 0);
+ ProtocolData *PD = (ProtocolData *)SendMessage(g_CLI.hwndStatus, SB_GETTEXT, nPanel, 0);
if (PD != nullptr && !IsBadCodePtr((FARPROC)PD)) {
- SendMessage(pcli->hwndStatus, SB_SETTEXT, (WPARAM)nPanel | SBT_OWNERDRAW, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SETTEXT, (WPARAM)nPanel | SBT_OWNERDRAW, 0);
if (PD->RealName) mir_free(PD->RealName);
if (PD) mir_free(PD);
}
@@ -45,7 +45,7 @@ int g_maxStatus = ID_STATUS_OFFLINE; void CluiProtocolStatusChanged(int, const char*)
{
- if (pcli->hwndStatus == nullptr || cfg::shutDown)
+ if (g_CLI.hwndStatus == nullptr || cfg::shutDown)
return;
auto &accs = Accounts();
@@ -56,7 +56,7 @@ void CluiProtocolStatusChanged(int, const char*) g_maxStatus = ID_STATUS_OFFLINE;
int borders[3];
- SendMessage(pcli->hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
+ SendMessage(g_CLI.hwndStatus, SB_GETBORDERS, 0, (LPARAM)&borders);
int *partWidths = (int*)_alloca((accs.getCount() + 1)*sizeof(int));
@@ -64,7 +64,7 @@ void CluiProtocolStatusChanged(int, const char*) int partCount;
if (cfg::dat.bEqualSections) {
RECT rc;
- GetClientRect(pcli->hwndStatus, &rc);
+ GetClientRect(g_CLI.hwndStatus, &rc);
rc.right -= borders[0] * 2;
int toshow = 0;
for (auto &pa : accs)
@@ -91,7 +91,7 @@ void CluiProtocolStatusChanged(int, const char*) wchar_t szName[32];
HDC hdc = GetDC(nullptr);
- HFONT hofont = reinterpret_cast<HFONT>(SelectObject(hdc, (HFONT)SendMessage(pcli->hwndStatus, WM_GETFONT, 0, 0)));
+ HFONT hofont = reinterpret_cast<HFONT>(SelectObject(hdc, (HFONT)SendMessage(g_CLI.hwndStatus, WM_GETFONT, 0, 0)));
// count down since built in ones tend to go at the end
partCount = 0;
@@ -128,15 +128,15 @@ void CluiProtocolStatusChanged(int, const char*) ReleaseDC(nullptr, hdc);
}
if (partCount == 0) {
- SendMessage(pcli->hwndStatus, SB_SIMPLE, TRUE, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SIMPLE, TRUE, 0);
return;
}
- SendMessage(pcli->hwndStatus, SB_SIMPLE, FALSE, 0);
+ SendMessage(g_CLI.hwndStatus, SB_SIMPLE, FALSE, 0);
partWidths[partCount - 1] = -1;
BYTE windowStyle = db_get_b(NULL, "CLUI", "WindowStyle", 0);
- SendMessage(pcli->hwndStatus, SB_SETMINHEIGHT, 18 + cfg::dat.bClipBorder + ((windowStyle == SETTING_WINDOWSTYLE_THINBORDER || windowStyle == SETTING_WINDOWSTYLE_NOBORDER) ? 3 : 0), 0);
- SendMessage(pcli->hwndStatus, SB_SETPARTS, partCount, (LPARAM)partWidths);
+ SendMessage(g_CLI.hwndStatus, SB_SETMINHEIGHT, 18 + cfg::dat.bClipBorder + ((windowStyle == SETTING_WINDOWSTYLE_THINBORDER || windowStyle == SETTING_WINDOWSTYLE_NOBORDER) ? 3 : 0), 0);
+ SendMessage(g_CLI.hwndStatus, SB_SETPARTS, partCount, (LPARAM)partWidths);
// count down since built in ones tend to go at the end
partCount = 0;
@@ -156,7 +156,7 @@ void CluiProtocolStatusChanged(int, const char*) int flags = SBT_OWNERDRAW;
if (db_get_b(NULL, "CLUI", "SBarBevel", 1) == 0)
flags |= SBT_NOBORDERS;
- SendMessageA(pcli->hwndStatus, SB_SETTEXTA, partCount | flags, (LPARAM)PD);
+ SendMessageA(g_CLI.hwndStatus, SB_SETTEXTA, partCount | flags, (LPARAM)PD);
partCount++;
}
@@ -188,8 +188,8 @@ void CluiProtocolStatusChanged(int, const char*) * set the global status icon and display the global (most online) status mode on the
* status mode button
*/
- if (szStatus && pcli->hwndContactList) {
- HWND hwndClistBtn = GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS);
+ if (szStatus && g_CLI.hwndContactList) {
+ HWND hwndClistBtn = GetDlgItem(g_CLI.hwndContactList, IDC_TBGLOBALSTATUS);
if (IsWindow(hwndClistBtn)) {
SetWindowText(hwndClistBtn, szStatus);
SendMessage(hwndClistBtn, BUTTONSETIMLICON, (WPARAM)hCListImages, (LPARAM)iIcon);
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index d3e0ac5fda..0aa41471b7 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -387,8 +387,8 @@ void SetButtonToSkinned() CustomizeButton(BTNS[i].hwndButton, bSkinned, !bSkinned, bFlat, true);
}
- CustomizeButton(GetDlgItem(pcli->hwndContactList, IDC_TBMENU), bSkinned, !bSkinned, bSkinned);
- CustomizeButton(GetDlgItem(pcli->hwndContactList, IDC_TBGLOBALSTATUS), bSkinned, !bSkinned, bSkinned);
+ CustomizeButton(GetDlgItem(g_CLI.hwndContactList, IDC_TBMENU), bSkinned, !bSkinned, bSkinned);
+ CustomizeButton(GetDlgItem(g_CLI.hwndContactList, IDC_TBGLOBALSTATUS), bSkinned, !bSkinned, bSkinned);
SendMessage(g_hwndViewModeFrame, WM_USER + 100, 0, 0);
}
@@ -769,7 +769,7 @@ void IMG_ReadItem(const char *itemname, const char *szFileName) ImageItem tmpItem, *newItem = nullptr;
char buffer[512], szItemNr[30];
char szFinalName[MAX_PATH];
- HDC hdc = GetDC(pcli->hwndContactList);
+ HDC hdc = GetDC(g_CLI.hwndContactList);
int n;
BOOL alloced = FALSE;
char szDrive[MAX_PATH], szPath[MAX_PATH];
@@ -817,7 +817,7 @@ done_with_glyph: tmpItem.dwFlags |= IMAGE_PERPIXEL_ALPHA;
tmpItem.bf.AlphaFormat = AC_SRC_ALPHA;
if (tmpItem.inner_height <= 0 || tmpItem.inner_width <= 0) {
- ReleaseDC(pcli->hwndContactList, hdc);
+ ReleaseDC(g_CLI.hwndContactList, hdc);
return;
}
}
@@ -929,7 +929,7 @@ done_with_glyph: }
}
imgread_done:
- ReleaseDC(pcli->hwndContactList, hdc);
+ ReleaseDC(g_CLI.hwndContactList, hdc);
}
void IMG_DeleteItems()
@@ -1170,7 +1170,7 @@ static void BTN_ReadItem(char *itemName, char *file) newItem->nextItem = nullptr;
curItem->nextItem = newItem;
}
- newItem->hWnd = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 5, 5, pcli->hwndContactList, (HMENU)newItem->uId, g_plugin.getInst(), nullptr);
+ newItem->hWnd = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 5, 5, g_CLI.hwndContactList, (HMENU)newItem->uId, g_plugin.getInst(), nullptr);
CustomizeButton(newItem->hWnd, false, false, true);
SendMessage(newItem->hWnd, BUTTONSETBTNITEM, 0, (LPARAM)newItem);
if (newItem->dwFlags & BUTTON_ISTOGGLE)
@@ -1219,7 +1219,7 @@ void IMG_LoadItems() BTN_ReadItem(p, szFileName);
p += (mir_strlen(p) + 1);
}
- if (pcli && pcli->hwndContactList)
+ if (g_CLI.hwndContactList)
SetButtonStates();
free(szSections);
@@ -1233,8 +1233,8 @@ void IMG_LoadItems() db_set_b(NULL, "CLUI", "fulltransparent", (BYTE)cfg::dat.bFullTransparent);
db_set_b(NULL, "CLUI", "WindowStyle", SETTING_WINDOWSTYLE_NOBORDER);
ApplyCLUIBorderStyle();
- SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
- SetLayeredWindowAttributes(pcli->hwndContactList, cfg::dat.colorkey, 0, LWA_COLORKEY);
+ SetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE, GetWindowLongPtr(g_CLI.hwndContactList, GWL_EXSTYLE) | WS_EX_LAYERED);
+ SetLayeredWindowAttributes(g_CLI.hwndContactList, cfg::dat.colorkey, 0, LWA_COLORKEY);
}
CoolSB_SetupScrollBar();
}
@@ -1451,8 +1451,8 @@ void extbk_import(char *file, HWND hwndDlg) CallService(MS_CLNSE_FILLBYCURRENTSEL, (WPARAM)hwndDlg, 0);
Clist_ClcOptionsChanged();
ConfigureCLUIGeometry(1);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
static void ApplyCLUISkin()
@@ -1471,10 +1471,10 @@ static void ApplyCLUISkin() db_set_b(NULL, "CLUI", "skin_changed", 0);
}
IMG_LoadItems();
- ShowWindow(pcli->hwndContactList, SW_SHOWNORMAL);
- SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE);
+ ShowWindow(g_CLI.hwndContactList, SW_SHOWNORMAL);
+ SetWindowPos(g_CLI.hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ RedrawWindow(g_CLI.hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE);
db_free(&dbv);
}
}
@@ -1534,8 +1534,8 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L IMG_DeleteItems();
ConfigureFrame();
SetButtonStates();
- SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ SendMessage(g_CLI.hwndContactList, WM_SIZE, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
break;
case IDC_GETSKINS:
@@ -1609,7 +1609,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L case PSN_APPLY:
SaveNonStatusItemsSettings(hwndDlg);
Clist_ClcOptionsChanged();
- PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
+ PostMessage(g_CLI.hwndContactList, CLUIINTM_REDRAW, 0, 0);
return TRUE;
}
break;
@@ -1654,7 +1654,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara sd.lastItem = ID_STATUS_OFFLINE + arStatusItems.getCount();
sd.firstItem = ID_STATUS_OFFLINE;
sd.pfnClcOptionsChanged = &Clist_ClcOptionsChanged;
- sd.hwndCLUI = pcli->hwndContactList;
+ sd.hwndCLUI = g_CLI.hwndContactList;
hwndSkinEdit = (HWND)CallService(MS_CLNSE_INVOKE, 0, (LPARAM)&sd);
}
@@ -1788,14 +1788,14 @@ int CoolSB_SetupScrollBar() cfg::dat.bSkinnedScrollbar = FALSE;
if (db_get_b(NULL, "CLC", "NoVScrollBar", 0)) {
- UninitializeCoolSB(pcli->hwndContactTree);
+ UninitializeCoolSB(g_CLI.hwndContactTree);
return 0;
}
if (cfg::dat.bSkinnedScrollbar) {
- InitializeCoolSB(pcli->hwndContactTree);
- CoolSB_SetStyle(pcli->hwndContactTree, SB_VERT, CSBS_HOTTRACKED);
+ InitializeCoolSB(g_CLI.hwndContactTree);
+ CoolSB_SetStyle(g_CLI.hwndContactTree, SB_VERT, CSBS_HOTTRACKED);
}
- else UninitializeCoolSB(pcli->hwndContactTree);
+ else UninitializeCoolSB(g_CLI.hwndContactTree);
return 0;
}
diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp index 11fef9cd61..e1e34d2131 100644 --- a/plugins/Clist_nicer/src/groupmenu.cpp +++ b/plugins/Clist_nicer/src/groupmenu.cpp @@ -68,7 +68,7 @@ static INT_PTR GroupMenu_OnAddService(WPARAM wParam, LPARAM lParam) static INT_PTR CommandHelper(WPARAM wParam, LPARAM)
{
- SendMessage(pcli->hwndContactList, WM_COMMAND, MAKELONG(wParam, BN_CLICKED), 1);
+ SendMessage(g_CLI.hwndContactList, WM_COMMAND, MAKELONG(wParam, BN_CLICKED), 1);
return 0;
}
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 5c8d4348d3..5acbf75006 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -28,7 +28,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma comment(lib, "shlwapi.lib")
CMPlugin g_plugin;
-CLIST_INTERFACE *pcli, coreCli;
+CLIST_INTERFACE coreCli;
#define DEFAULT_TB_VISIBILITY (1 | 2 | 4 | 8 | 16 | 32 | 64 | 8192)
@@ -109,8 +109,8 @@ static int systemModulesLoaded(WPARAM, LPARAM) extern "C" int __declspec(dllexport) CListInitialise()
{
- pcli = Clist_GetInterface();
- coreCli = *pcli;
+ Clist_GetInterface();
+ coreCli = g_CLI;
API::onInit();
@@ -172,41 +172,41 @@ extern "C" int __declspec(dllexport) CListInitialise() wcslwr(cfg::dat.tszProfilePath);
// get the clist interface
- pcli->hInst = g_plugin.getInst();
- pcli->pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
- pcli->pfnCompareContacts = CompareContacts;
- pcli->pfnCreateClcContact = CreateClcContact;
- pcli->pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
- pcli->pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
- pcli->pfnGetDefaultFontSetting = GetDefaultFontSetting;
- pcli->pfnGetRowBottomY = RowHeight::getItemBottomY;
- pcli->pfnGetRowHeight = RowHeight::getHeight;
- pcli->pfnGetRowTopY = RowHeight::getItemTopY;
- pcli->pfnGetRowTotalHeight = RowHeight::getTotalHeight;
- pcli->pfnGetWindowVisibleState = GetWindowVisibleState;
- pcli->pfnHitTest = HitTest;
- pcli->pfnOnCreateClc = OnCreateClc;
- pcli->pfnPaintClc = PaintClc;
- pcli->pfnRebuildEntireList = RebuildEntireList;
- pcli->pfnRowHitTest = RowHeight::hitTest;
- pcli->pfnScrollTo = ScrollTo;
- pcli->pfnSetHideOffline = SetHideOffline;
- pcli->pfnShowHide = ShowHide;
-
- pcli->pfnAddContactToGroup = AddContactToGroup;
-
- pcli->pfnAddEvent = AddEvent;
- pcli->pfnRemoveEvent = RemoveEvent;
-
- pcli->pfnAddGroup = AddGroup;
- pcli->pfnAddInfoItemToGroup = AddInfoItemToGroup;
- pcli->pfnContactListControlWndProc = ContactListControlWndProc;
- pcli->pfnContactListWndProc = ContactListWndProc;
- pcli->pfnIconFromStatusMode = IconFromStatusMode;
- pcli->pfnLoadClcOptions = LoadClcOptions;
- pcli->pfnProcessExternalMessages = ProcessExternalMessages;
- pcli->pfnRecalcScrollBar = RecalcScrollBar;
- pcli->pfnTrayIconProcessMessage = TrayIconProcessMessage;
+ g_CLI.hInst = g_plugin.getInst();
+ g_CLI.pfnCluiProtocolStatusChanged = CluiProtocolStatusChanged;
+ g_CLI.pfnCompareContacts = CompareContacts;
+ g_CLI.pfnCreateClcContact = CreateClcContact;
+ g_CLI.pfnDocking_ProcessWindowMessage = Docking_ProcessWindowMessage;
+ g_CLI.pfnGetContactHiddenStatus = CLVM_GetContactHiddenStatus;
+ g_CLI.pfnGetDefaultFontSetting = GetDefaultFontSetting;
+ g_CLI.pfnGetRowBottomY = RowHeight::getItemBottomY;
+ g_CLI.pfnGetRowHeight = RowHeight::getHeight;
+ g_CLI.pfnGetRowTopY = RowHeight::getItemTopY;
+ g_CLI.pfnGetRowTotalHeight = RowHeight::getTotalHeight;
+ g_CLI.pfnGetWindowVisibleState = GetWindowVisibleState;
+ g_CLI.pfnHitTest = HitTest;
+ g_CLI.pfnOnCreateClc = OnCreateClc;
+ g_CLI.pfnPaintClc = PaintClc;
+ g_CLI.pfnRebuildEntireList = RebuildEntireList;
+ g_CLI.pfnRowHitTest = RowHeight::hitTest;
+ g_CLI.pfnScrollTo = ScrollTo;
+ g_CLI.pfnSetHideOffline = SetHideOffline;
+ g_CLI.pfnShowHide = ShowHide;
+
+ g_CLI.pfnAddContactToGroup = AddContactToGroup;
+
+ g_CLI.pfnAddEvent = AddEvent;
+ g_CLI.pfnRemoveEvent = RemoveEvent;
+
+ g_CLI.pfnAddGroup = AddGroup;
+ g_CLI.pfnAddInfoItemToGroup = AddInfoItemToGroup;
+ g_CLI.pfnContactListControlWndProc = ContactListControlWndProc;
+ g_CLI.pfnContactListWndProc = ContactListWndProc;
+ g_CLI.pfnIconFromStatusMode = IconFromStatusMode;
+ g_CLI.pfnLoadClcOptions = LoadClcOptions;
+ g_CLI.pfnProcessExternalMessages = ProcessExternalMessages;
+ g_CLI.pfnRecalcScrollBar = RecalcScrollBar;
+ g_CLI.pfnTrayIconProcessMessage = TrayIconProcessMessage;
int rc = LoadContactListModule();
if (rc == 0)
@@ -230,8 +230,8 @@ extern "C" int __declspec(dllexport) Load(void) extern "C" int __declspec(dllexport) Unload(void)
{
- if (IsWindow(pcli->hwndContactList))
- DestroyWindow(pcli->hwndContactList);
+ if (IsWindow(g_CLI.hwndContactList))
+ DestroyWindow(g_CLI.hwndContactList);
ClcShutdown(0, 0);
UnLoadCLUIFramesModule();
return 0;
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index 47ddaf4948..62cef006e7 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -94,7 +94,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM GetWindowRect(hwnd, &rcWindow);
pt.x = rcWindow.left;
pt.y = rcWindow.top;
- ScreenToClient(pcli->hwndContactList, &pt);
+ ScreenToClient(g_CLI.hwndContactList, &pt);
HBITMAP hbmMem = CreateCompatibleBitmap(hdc, rcClient.right, rcClient.bottom);
HBITMAP hbmOld = reinterpret_cast<HBITMAP>(SelectObject(hdcMem, hbmMem));
@@ -123,7 +123,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&dis.rcItem);
OffsetRect(&dis.rcItem, 0, -b_offset);
dis.itemData = SendMessage(hwnd, SB_GETTEXTA, i, 0);
- SendMessage(pcli->hwndContactList, WM_DRAWITEM, 0, (LPARAM)&dis);
+ SendMessage(g_CLI.hwndContactList, WM_DRAWITEM, 0, (LPARAM)&dis);
}
BitBlt(hdc, 0, 0, rcClient.right, rcClient.bottom, hdcMem, 0, 0, SRCCOPY);
if (hOldFont)
@@ -163,7 +163,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM mir_snwprintf(szTipText, L"<b>%s</b>: %s%s", PD->RealName, Clist_GetStatusModeDescription(pa->iRealStatus, 0), pa->bIsLocked ? L" (LOCKED)" : L"");
CLCINFOTIP ti = { sizeof(ti) };
- ti.isTreeFocused = (GetFocus() == pcli->hwndContactList);
+ ti.isTreeFocused = (GetFocus() == g_CLI.hwndContactList);
CallService("mToolTip/ShowTipW", (WPARAM)szTipText, (LPARAM)&ti);
}
break;
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 6770ce9cd3..1e9e674432 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -912,7 +912,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM POINT pt;
RECT rcCLUI;
- GetWindowRect(pcli->hwndContactList, &rcCLUI);
+ GetWindowRect(g_CLI.hwndContactList, &rcCLUI);
GetCursorPos(&pt);
if (PtInRect(&rcCLUI, pt))
break;
@@ -962,7 +962,7 @@ clvm_reset_command: cfg::dat.bFilterEffective = 0;
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetDlgItemText(hwnd, IDC_SELECTMODE, TranslateT("No view mode"));
- pcli->pfnSetHideOffline(cfg::dat.boldHideOffline);
+ g_CLI.pfnSetHideOffline(cfg::dat.boldHideOffline);
cfg::dat.boldHideOffline = (BYTE)-1;
SetButtonStates();
cfg::dat.current_viewmode[0] = 0;
@@ -1012,7 +1012,7 @@ void CreateViewModeFrame() frame.height = 22;
frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_UNICODE;
frame.align = alBottom;
- frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", L"CLVM", WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
+ frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", L"CLVM", WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, g_CLI.hwndContactList, (HMENU)nullptr, g_plugin.getInst(), nullptr);
g_hwndViewModeFrame = frame.hWnd;
hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
@@ -1101,7 +1101,7 @@ void ApplyViewMode(const char *name) if (cfg::dat.boldHideOffline == (BYTE)-1)
cfg::dat.boldHideOffline = db_get_b(NULL, "CList", "HideOffline", 0);
- pcli->pfnSetHideOffline(false);
+ g_CLI.pfnSetHideOffline(false);
SetWindowTextA(hwndSelector, name);
Clist_Broadcast(CLM_AUTOREBUILD, 0, 0);
SetButtonStates();
|