diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/Clist_nicer/src | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/Clist_nicer/src')
29 files changed, 545 insertions, 545 deletions
diff --git a/plugins/Clist_nicer/src/CLCButton.cpp b/plugins/Clist_nicer/src/CLCButton.cpp index 42ce47c46c..49bbfd86f9 100644 --- a/plugins/Clist_nicer/src/CLCButton.cpp +++ b/plugins/Clist_nicer/src/CLCButton.cpp @@ -26,19 +26,19 @@ HANDLE hToolbarFrame = (HANDLE)-1; struct CluiTopButton BTNS[] =
{
- { IDC_TBTOPMENU, "CLN_topmenu", NULL, LPGEN("Show menu"), 1, 1, 1 },
- { IDC_TBHIDEOFFLINE, "CLN_online", NULL, LPGEN("Show/Hide offline contacts"), 0, 1, 0 },
- { IDC_TBHIDEGROUPS, "CLN_groups", NULL, LPGEN("Use/Disable groups"), 0, 1, 0 },
- { IDC_TBFINDANDADD, "CLN_findadd", NULL, LPGEN("Find and add contacts"), 1, 1, 0 },
- { IDC_TBACCOUNTS, "CLN_accounts", NULL, LPGEN("Accounts"), 1, 1, 0 },
- { IDC_TBOPTIONS, "CLN_options", NULL, LPGEN("Open preferences"), 1, 1, 0 },
+ { IDC_TBTOPMENU, "CLN_topmenu", nullptr, LPGEN("Show menu"), 1, 1, 1 },
+ { IDC_TBHIDEOFFLINE, "CLN_online", nullptr, LPGEN("Show/Hide offline contacts"), 0, 1, 0 },
+ { IDC_TBHIDEGROUPS, "CLN_groups", nullptr, LPGEN("Use/Disable groups"), 0, 1, 0 },
+ { IDC_TBFINDANDADD, "CLN_findadd", nullptr, LPGEN("Find and add contacts"), 1, 1, 0 },
+ { IDC_TBACCOUNTS, "CLN_accounts", nullptr, LPGEN("Accounts"), 1, 1, 0 },
+ { IDC_TBOPTIONS, "CLN_options", nullptr, LPGEN("Open preferences"), 1, 1, 0 },
{ IDC_TBSOUND, "CLN_sound", "CLN_soundsoff", LPGEN("Enable/Disable sounds"), 0, 1, 0 },
- { IDC_TBMINIMIZE, "CLN_minimize", NULL, LPGEN("Minimize contact list"), 1, 0, 0 },
- { IDC_TBTOPSTATUS, "CLN_topstatus", NULL, LPGEN("Status menu"), 1, 0, 1 },
+ { IDC_TBMINIMIZE, "CLN_minimize", nullptr, LPGEN("Minimize contact list"), 1, 0, 0 },
+ { IDC_TBTOPSTATUS, "CLN_topstatus", nullptr, LPGEN("Status menu"), 1, 0, 1 },
- { IDC_TBSELECTVIEWMODE, "CLN_CLVM_select", NULL, LPGEN("Select view mode"), 1, 0, 1 },
- { IDC_TBCONFIGUREVIEWMODE, "CLN_CLVM_options", NULL, LPGEN("Setup view modes"), 1, 0, 0 },
- { IDC_TBCLEARVIEWMODE, "CLN_CLVM_reset", NULL, LPGEN("Clear view mode"), 1, 0, 0 }
+ { IDC_TBSELECTVIEWMODE, "CLN_CLVM_select", nullptr, LPGEN("Select view mode"), 1, 0, 1 },
+ { IDC_TBCONFIGUREVIEWMODE, "CLN_CLVM_options", nullptr, LPGEN("Setup view modes"), 1, 0, 0 },
+ { IDC_TBCLEARVIEWMODE, "CLN_CLVM_reset", nullptr, LPGEN("Clear view mode"), 1, 0, 0 }
};
static int g_index = -1;
@@ -46,7 +46,7 @@ static int g_index = -1; static void InitDefaultButtons()
{
for (int i = 0; i < _countof(BTNS); i++) {
- TTBButton tbb = { 0 };
+ TTBButton tbb = {};
g_index = i;
if (BTNS[i].pszButtonID) {
@@ -85,7 +85,7 @@ HWND ClcGetButtonWindow(int ctrlid) if (BTNS[i].ctrlid == ctrlid)
return BTNS[i].hwndButton;
- return NULL;
+ return nullptr;
}
int ClcGetButtonId(HWND hwnd)
@@ -137,9 +137,9 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) if (hdcPaint) {
HDC hdcMem;
HBITMAP hbmMem;
- HBITMAP hbmOld = 0;
+ HBITMAP hbmOld = nullptr;
RECT rcClient;
- HFONT hOldFont = 0;
+ HFONT hOldFont = nullptr;
int xOffset = 0;
GetClientRect(ctl->hwnd, &rcClient);
@@ -259,7 +259,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) DeleteObject(hbr);
}
}
- if (!ctl->bIsSkinned && ctl->buttonItem == 0) {
+ if (!ctl->bIsSkinned && ctl->buttonItem == nullptr) {
if (ctl->stateId == PBS_HOT || ctl->focus) {
if (ctl->bIsPushed)
DrawEdge(hdcMem, &rc, EDGE_ETCHED, BF_RECT | BF_SOFT);
@@ -317,12 +317,12 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) if (ctl->hIcon || ctl->hIconPrivate || ctl->iIcon) {
int ix = (rcClient.right - rcClient.left) / 2 - (g_cxsmIcon / 2);
int iy = (rcClient.bottom - rcClient.top) / 2 - (g_cxsmIcon / 2);
- HICON hIconNew = ctl->hIconPrivate != 0 ? ctl->hIconPrivate : ctl->hIcon;
+ HICON hIconNew = ctl->hIconPrivate != nullptr ? ctl->hIconPrivate : ctl->hIcon;
if (ctl->szText[0] == 0) {
if (ctl->iIcon)
ImageList_DrawEx(ctl->hIml, ctl->iIcon, hdcMem, ix, iy, g_cxsmIcon, g_cysmIcon, CLR_NONE, CLR_NONE, ILD_NORMAL);
else
- DrawState(hdcMem, NULL, NULL, (LPARAM)hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
ctl->sLabel.cx = ctl->sLabel.cy = 0;
}
else {
@@ -337,7 +337,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) if (ctl->iIcon)
ImageList_DrawEx(ctl->hIml, ctl->iIcon, hdcMem, ix, iy, g_cxsmIcon, g_cysmIcon, CLR_NONE, CLR_NONE, ILD_NORMAL);
else
- DrawState(hdcMem, NULL, NULL, (LPARAM)hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)hIconNew, 0, ix, iy, g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON | DSS_NORMAL : DST_ICON | DSS_DISABLED);
xOffset = ix + g_cxsmIcon + 4;
}
}
@@ -352,7 +352,7 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) ix++;
iy++;
}
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->hBitmap, 0, ix, iy, bminfo.bmWidth, bminfo.bmHeight, IsWindowEnabled(ctl->hwnd) ? DST_BITMAP : DST_BITMAP | DSS_DISABLED);
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)ctl->hBitmap, 0, ix, iy, bminfo.bmWidth, bminfo.bmHeight, IsWindowEnabled(ctl->hwnd) ? DST_BITMAP : DST_BITMAP | DSS_DISABLED);
}
if (GetWindowTextLength(ctl->hwnd)) {
// Draw the text and optinally the arrow
@@ -364,8 +364,8 @@ static void PaintWorker(MButtonExtension *ctl, HDC hdcPaint) if (!ctl->bIsSkinned)
SetTextColor(hdcMem, IsWindowEnabled(ctl->hwnd) || !ctl->hThemeButton ? GetSysColor(COLOR_BTNTEXT) : GetSysColor(COLOR_GRAYTEXT));
if (ctl->arrow)
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - g_cxsmIcon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - g_cysmIcon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
- DrawState(hdcMem, NULL, NULL, (LPARAM)ctl->szText, 0, xOffset + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - ctl->sLabel.cy) / 2 + 1 : (rcText.bottom - rcText.top - ctl->sLabel.cy) / 2 + (ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->sLabel.cx, ctl->sLabel.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)ctl->arrow, 0, rcClient.right - rcClient.left - 5 - g_cxsmIcon + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), (rcClient.bottom - rcClient.top) / 2 - g_cysmIcon / 2 + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), g_cxsmIcon, g_cysmIcon, IsWindowEnabled(ctl->hwnd) ? DST_ICON : DST_ICON | DSS_DISABLED);
+ DrawState(hdcMem, nullptr, nullptr, (LPARAM)ctl->szText, 0, xOffset + (!ctl->hThemeButton && ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->hThemeButton ? (rcText.bottom - rcText.top - ctl->sLabel.cy) / 2 + 1 : (rcText.bottom - rcText.top - ctl->sLabel.cy) / 2 + (ctl->stateId == PBS_PRESSED ? 1 : 0), ctl->sLabel.cx, ctl->sLabel.cy, IsWindowEnabled(ctl->hwnd) || ctl->hThemeButton ? DST_PREFIXTEXT | DSS_NORMAL : DST_PREFIXTEXT | DSS_DISABLED);
}
if (hOldFont)
SelectObject(hdcMem, hOldFont);
@@ -400,7 +400,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (!lParam)
break;
- bct->hIml = 0;
+ bct->hIml = nullptr;
bct->iIcon = 0;
if (wParam == IMAGE_ICON) {
ICONINFO ii = { 0 };
@@ -408,7 +408,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR if (bct->hIconPrivate) {
DestroyIcon(bct->hIconPrivate);
- bct->hIconPrivate = 0;
+ bct->hIconPrivate = nullptr;
}
GetIconInfo((HICON)lParam, &ii);
@@ -420,24 +420,24 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR bct->hIconPrivate = ImageList_GetIcon(hImageList, 0, ILD_NORMAL);
ImageList_RemoveAll(hImageList);
ImageList_Destroy(hImageList);
- bct->hIcon = 0;
+ bct->hIcon = nullptr;
}
else {
bct->hIcon = (HICON)lParam;
- bct->hIconPrivate = 0;
+ bct->hIconPrivate = nullptr;
}
DeleteObject(ii.hbmMask);
DeleteObject(ii.hbmColor);
- bct->hBitmap = NULL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ bct->hBitmap = nullptr;
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
else if (wParam == IMAGE_BITMAP) {
bct->hBitmap = (HBITMAP)lParam;
if (bct->hIconPrivate)
DestroyIcon(bct->hIconPrivate);
- bct->hIcon = bct->hIconPrivate = NULL;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ bct->hIcon = bct->hIconPrivate = nullptr;
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
}
return 1;
@@ -446,14 +446,14 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR DestroyIcon(bct->hIconPrivate);
bct->hIml = (HIMAGELIST)wParam;
bct->iIcon = (int)lParam;
- bct->hIcon = bct->hIconPrivate = 0;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ bct->hIcon = bct->hIconPrivate = nullptr;
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case BUTTONSETSKINNED:
bct->bIsSkinned = wParam != 0;
bct->bIsThemed = bct->bIsSkinned ? FALSE : bct->bIsThemed;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case BUTTONSETBTNITEM:
@@ -462,7 +462,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPAR case BUTTONSETTTBUTTON:
bct->bIsTTButton = wParam != 0;
- InvalidateRect(bct->hwnd, NULL, TRUE);
+ InvalidateRect(bct->hwnd, nullptr, TRUE);
break;
case WM_NCHITTEST:
@@ -501,7 +501,7 @@ static LRESULT CALLBACK ToolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA SelectObject(cfg::dat.hdcToolbar, cfg::dat.hbmToolbarOld);
DeleteObject(cfg::dat.hbmToolbar);
DeleteDC(cfg::dat.hdcToolbar);
- cfg::dat.hdcToolbar = NULL;
+ cfg::dat.hdcToolbar = nullptr;
}
cfg::dat.hdcToolbar = CreateCompatibleDC(hdc);
cfg::dat.hbmToolbar = CreateCompatibleBitmap(hdc, rcClient.right, rcClient.bottom);
@@ -546,7 +546,7 @@ static LRESULT CALLBACK ToolbarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA SelectObject(cfg::dat.hdcToolbar, cfg::dat.hbmToolbarOld);
DeleteObject(cfg::dat.hbmToolbar);
DeleteDC(cfg::dat.hdcToolbar);
- cfg::dat.hdcToolbar = NULL;
+ cfg::dat.hdcToolbar = nullptr;
}
break;
}
diff --git a/plugins/Clist_nicer/src/Docking.cpp b/plugins/Clist_nicer/src/Docking.cpp index b4f3f9c54b..e6732b348d 100644 --- a/plugins/Clist_nicer/src/Docking.cpp +++ b/plugins/Clist_nicer/src/Docking.cpp @@ -157,7 +157,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) if ((ptCursor.x < rcMonitor.left + EDGESENSITIVITY) || (ptCursor.x >= rcMonitor.right - EDGESENSITIVITY)) {
if (!(GetWindowLongPtr(msg->hwnd, GWL_EXSTYLE) & WS_EX_TOOLWINDOW)) {
SendMessage(msg->hwnd, CLUIINTM_REDRAW, 0, 0);
- MessageBox(0, TranslateT("The contact list cannot be docked when using the default title bar and border. Use a toolwindow or borderless style instead."),
+ MessageBox(nullptr, TranslateT("The contact list cannot be docked when using the default title bar and border. Use a toolwindow or borderless style instead."),
TranslateT("Contact list docking"), MB_OK);
return 0;
}
@@ -261,7 +261,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) docked = 0;
GetCursorPos(&pt);
PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, 0, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, cluiPos.right, cluiPos.bottom, SWP_NOZORDER);
+ SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, cluiPos.right, cluiPos.bottom, SWP_NOZORDER);
}
}
return 1;
diff --git a/plugins/Clist_nicer/src/alphablend.cpp b/plugins/Clist_nicer/src/alphablend.cpp index ab74b3363c..63010edbd8 100644 --- a/plugins/Clist_nicer/src/alphablend.cpp +++ b/plugins/Clist_nicer/src/alphablend.cpp @@ -48,7 +48,7 @@ DWORD __forceinline argb_from_cola(COLORREF col, UINT32 alpha) void __forceinline DrawBorderStyle(HDC hdcwnd, RECT *rc, DWORD BORDERSTYLE)
{
- HPEN hPenOld = 0;
+ HPEN hPenOld = nullptr;
POINT pt;
switch (BORDERSTYLE) {
@@ -81,7 +81,7 @@ void __forceinline DrawBorderStyle(HDC hdcwnd, RECT *rc, DWORD BORDERSTYLE) }
void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor2, BOOL transparent, BYTE FLG_GRADIENT, BYTE FLG_CORNER, DWORD BORDERSTYLE, ImageItem *imageItem)
{
- if (rc == NULL)
+ if (rc == nullptr)
return;
int ulBitmapWidth, ulBitmapHeight;
@@ -215,8 +215,8 @@ void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor bmi.bmiHeader.biSizeImage = ulBitmapWidth * ulBitmapHeight * 4;
void *pvBits;
- HBITMAP hbitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &pvBits, NULL, 0x0);
- if (hbitmap == NULL || pvBits == NULL) {
+ HBITMAP hbitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &pvBits, nullptr, 0x0);
+ if (hbitmap == nullptr || pvBits == nullptr) {
DeleteDC(hdc);
return;
}
@@ -290,9 +290,9 @@ void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor }
// TL+BL CORNER
- hbitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &pvBits, NULL, 0x0);
+ hbitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &pvBits, nullptr, 0x0);
- if (hbitmap == 0 || pvBits == NULL) {
+ if (hbitmap == nullptr || pvBits == nullptr) {
DeleteObject(BrMask);
DeleteDC(hdc);
return;
@@ -330,7 +330,7 @@ void DrawAlpha(HDC hdcwnd, PRECT rc, DWORD basecolor, int alpha, DWORD basecolor DeleteObject(hbitmap);
// TR+BR CORNER
- hbitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &pvBits, NULL, 0x0);
+ hbitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &pvBits, nullptr, 0x0);
//SelectObject(hdc, BrMask); // already BrMask?
holdbitmap = reinterpret_cast<HBITMAP>(SelectObject(hdc, hbitmap));
diff --git a/plugins/Clist_nicer/src/clc.cpp b/plugins/Clist_nicer/src/clc.cpp index a939ab948f..756e7ba60d 100644 --- a/plugins/Clist_nicer/src/clc.cpp +++ b/plugins/Clist_nicer/src/clc.cpp @@ -40,7 +40,7 @@ extern int during_sizing; HIMAGELIST hCListImages;
-HANDLE hSvc_GetContactStatusMsg = 0;
+HANDLE hSvc_GetContactStatusMsg = nullptr;
static HRESULT(WINAPI *MyCloseThemeData)(HANDLE);
@@ -67,7 +67,7 @@ static int ClcEventAdded(WPARAM hContact, LPARAM lParam) {
DWORD new_freq = 0;
- cfg::dat.t_now = time(NULL);
+ cfg::dat.t_now = time(nullptr);
if (hContact && lParam) {
DBEVENTINFO dbei = {};
@@ -80,7 +80,7 @@ static int ClcEventAdded(WPARAM hContact, LPARAM lParam) db_set_dw(hContact, "CList", "mf_freq", new_freq);
db_set_dw(hContact, "CList", "mf_count", count);
- TExtraCache *p = cfg::getCache(hContact, NULL);
+ TExtraCache *p = cfg::getCache(hContact, nullptr);
if (p) {
p->dwLastMsgTime = dbei.timestamp;
if (new_freq)
@@ -103,7 +103,7 @@ static int ClcMetamodeChanged(WPARAM bMetaEnabled, LPARAM) static int ClcSettingChanged(WPARAM hContact, LPARAM lParam)
{
- char *szProto = NULL;
+ char *szProto = nullptr;
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
if (hContact) {
@@ -117,15 +117,15 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) else if (!__strcmp(cws->szSetting, "Timezone") || !__strcmp(cws->szSetting, "TzName"))
ReloadExtraInfo(hContact);
}
- else if (hContact != 0 && (szProto = GetContactProto(hContact)) != NULL) {
+ else if (hContact != 0 && (szProto = GetContactProto(hContact)) != nullptr) {
if (!__strcmp(cws->szModule, "Protocol") && !__strcmp(cws->szSetting, "p")) {
char *szProto_s;
Clist_Broadcast(INTM_PROTOCHANGED, hContact, lParam);
if (cws->value.type == DBVT_DELETED)
- szProto_s = NULL;
+ szProto_s = nullptr;
else
szProto_s = cws->value.pszVal;
- pcli->pfnChangeContactIcon(hContact, IconFromStatusMode(szProto_s, szProto_s == NULL ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto_s, "Status", ID_STATUS_OFFLINE), hContact, NULL));
+ pcli->pfnChangeContactIcon(hContact, IconFromStatusMode(szProto_s, szProto_s == nullptr ? ID_STATUS_OFFLINE : db_get_w(hContact, szProto_s, "Status", ID_STATUS_OFFLINE), hContact, nullptr));
}
// something is being written to a protocol module
if (!__strcmp(szProto, cws->szModule)) {
@@ -167,7 +167,7 @@ static int ClcSettingChanged(WPARAM hContact, LPARAM lParam) else if (!__strcmp(cws->szModule, "TopToolBar") && !__strcmp(cws->szSetting, "UseFlatButton")) {
SetButtonToSkinned();
}
- else if (szProto == NULL) {
+ else if (szProto == nullptr) {
if (!__strcmp(cws->szSetting, "XStatusId"))
CluiProtocolStatusChanged(0, cws->szModule);
}
@@ -248,7 +248,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L dat->bHideSubcontacts = true;
cfg::clcdat = dat;
if (cfg::dat.bShowLocalTime)
- SetTimer(hwnd, TIMERID_REFRESH, 65000, NULL);
+ SetTimer(hwnd, TIMERID_REFRESH, 65000, nullptr);
}
else
dat->bisEmbedded = TRUE;
@@ -275,16 +275,16 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L {
WORD iExtraImage[EXTRA_ICON_COUNT];
BYTE flags = 0;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
memset(iExtraImage, 0xFF, sizeof(iExtraImage));
else {
memcpy(iExtraImage, contact->iExtraImage, sizeof(iExtraImage));
flags = contact->flags;
}
pcli->pfnDeleteItemFromTree(hwnd, wParam);
- if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(wParam, NULL, dat)) {
+ if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SHOWHIDDEN || !CLVM_GetContactHiddenStatus(wParam, nullptr, dat)) {
pcli->pfnAddContactToTree(hwnd, dat, wParam, 1, 1);
- if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
memcpy(contact->iExtraImage, iExtraImage, sizeof(iExtraImage));
if (flags & CONTACTF_CHECKED)
contact->flags |= CONTACTF_CHECKED;
@@ -310,10 +310,10 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L WORD status = ID_STATUS_OFFLINE;
int contactRemoved = 0;
MCONTACT hSelItem = NULL;
- ClcContact *selcontact = NULL;
+ ClcContact *selcontact = nullptr;
char *szProto = GetContactProto(hContact);
- if (szProto == NULL)
+ if (szProto == nullptr)
status = ID_STATUS_OFFLINE;
else
status = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
@@ -322,13 +322,13 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L !CLVM_GetContactHiddenStatus(hContact, szProto, dat)) && ((cfg::dat.bFilterEffective ? TRUE : !pcli->pfnIsHiddenMode(dat, status)) ||
pcli->pfnGetContactIcon(hContact) != lParam); // XXX CLVM changed - this means an offline msg is flashing, so the contact should be shown
- if (!Clist_FindItem(hwnd, dat, hContact, &contact, &group, NULL)) {
+ 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, NULL) != -1)
+ if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
pcli->pfnAddContactToTree(hwnd, dat, hContact, 0, 0);
recalcScrollBar = 1;
- Clist_FindItem(hwnd, dat, hContact, &contact, NULL, NULL);
+ Clist_FindItem(hwnd, dat, hContact, &contact, nullptr, nullptr);
if (contact) {
contact->iImage = (WORD)lParam;
pcli->pfnNotifyNewContact(hwnd, hContact);
@@ -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, NULL) != -1)
+ if (dat->selection >= 0 && pcli->pfnGetRowByIndex(dat, dat->selection, &selcontact, nullptr) != -1)
hSelItem = Clist_ContactToHItem(selcontact);
pcli->pfnRemoveItemFromGroup(hwnd, group, contact, 0);
contactRemoved = TRUE;
@@ -357,7 +357,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
if (hSelItem) {
ClcGroup *selgroup;
- if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, NULL))
+ if (Clist_FindItem(hwnd, dat, hSelItem, &selcontact, &selgroup, nullptr))
dat->selection = pcli->pfnGetRowsPriorTo(&dat->list, selgroup, selgroup->cl.indexOf(selcontact));
else
dat->selection = -1;
@@ -371,7 +371,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_METACHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
break;
if (contact->bIsMeta && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
@@ -381,7 +381,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (contact->pExtra) {
TExtraCache *pSub = cfg::getCache(contact->hSubContact, contact->metaProto);
ClcContact *subContact;
- if (!Clist_FindItem(hwnd, dat, contact->hSubContact, &subContact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, contact->hSubContact, &subContact, nullptr, nullptr))
break;
contact->pExtra->proto_status_item = GetProtocolStatusItem(contact->metaProto);
@@ -395,14 +395,14 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_METACHANGEDEVENT:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
break;
if (lParam == 0)
pcli->pfnInitAutoRebuild(hwnd);
return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_NAMECHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
break;
mir_wstrncpy(contact->szText, pcli->pfnGetContactDisplayName(wParam, 0), _countof(contact->szText));
@@ -413,7 +413,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_CODEPAGECHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
break;
contact->codePage = db_get_dw(wParam, "Tab_SRMsg", "ANSIcodepage", db_get_dw(wParam, "UserInfo", "ANSIcodepage", CP_ACP));
@@ -421,23 +421,23 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_AVATARCHANGED:
- contact = NULL;
+ contact = nullptr;
{
AVATARCACHEENTRY *cEntry = (struct AVATARCACHEENTRY *)lParam;
if (wParam == 0) {
//RemoveFromImgCache(0, cEntry);
cfg::dat.bForceRefetchOnPaint = TRUE;
- RedrawWindow(hwnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW);
+ RedrawWindow(hwnd, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE | RDW_UPDATENOW);
cfg::dat.bForceRefetchOnPaint = FALSE;
return DefWindowProc(hwnd, msg, wParam, lParam);
}
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
return 0;
contact->ace = cEntry;
- if (cEntry == NULL)
+ if (cEntry == nullptr)
contact->cFlags &= ~ECF_AVATAR;
else {
DWORD dwFlags;
@@ -458,10 +458,10 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_STATUSMSGCHANGED:
{
TExtraCache *p;
- char *szProto = NULL;
+ char *szProto = nullptr;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
- p = cfg::getCache(wParam, NULL);
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
+ p = cfg::getCache(wParam, nullptr);
else {
p = contact->pExtra;
szProto = contact->proto;
@@ -472,11 +472,11 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_STATUSCHANGED:
- if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
WORD wStatus = db_get_w(wParam, contact->proto, "Status", ID_STATUS_OFFLINE);
if (cfg::dat.bNoOfflineAvatars && wStatus != ID_STATUS_OFFLINE && contact->wStatus == ID_STATUS_OFFLINE) {
contact->wStatus = wStatus;
- if (cfg::dat.bAvatarServiceAvail && contact->ace == NULL)
+ if (cfg::dat.bAvatarServiceAvail && contact->ace == nullptr)
LoadAvatarForContact(contact);
}
contact->wStatus = wStatus;
@@ -485,7 +485,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L break;
case INTM_PROTOCHANGED:
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
break;
contact->proto = GetContactProto(wParam);
@@ -501,7 +501,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case INTM_INVALIDATE:
if (!dat->bNeedPaint) {
KillTimer(hwnd, TIMERID_PAINT);
- SetTimer(hwnd, TIMERID_PAINT, 100, NULL);
+ SetTimer(hwnd, TIMERID_PAINT, 100, nullptr);
dat->bNeedPaint = true;
}
return DefWindowProc(hwnd, msg, wParam, lParam);
@@ -520,10 +520,10 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L return DefWindowProc(hwnd, msg, wParam, lParam);
case INTM_IDLECHANGED:
- if (Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL)) {
+ if (Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr)) {
DBCONTACTWRITESETTING *cws = (DBCONTACTWRITESETTING *)lParam;
char *szProto = (char*)cws->szModule;
- if (szProto == NULL)
+ if (szProto == nullptr)
break;
contact->flags &= ~CONTACTF_IDLE;
@@ -542,7 +542,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L MCONTACT hContact = wParam;
TExtraCache *p;
- if (!Clist_FindItem(hwnd, dat, hContact, &contact, NULL, NULL)) {
+ if (!Clist_FindItem(hwnd, dat, hContact, &contact, nullptr, nullptr)) {
p = cfg::getCache(hContact, szProto);
if (!dat->bisEmbedded && szProto) { // may be a subcontact, forward the xstatus
MCONTACT hMasterContact = db_mc_tryMeta(hContact);
@@ -556,7 +556,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L p = contact->pExtra;
}
- if (szProto == NULL)
+ if (szProto == nullptr)
break;
if (contact) {
@@ -582,7 +582,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L dat->lastRepaint = GetTickCount();
}
EndPaint(hwnd, &ps);
- if (dat->selection != dat->oldSelection && !dat->bisEmbedded && g_ButtonItems != NULL) {
+ if (dat->selection != dat->oldSelection && !dat->bisEmbedded && g_ButtonItems != nullptr) {
SetDBButtonStates(0);
dat->oldSelection = dat->selection;
}
@@ -596,12 +596,12 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L case WM_TIMER:
if (wParam == TIMERID_PAINT) {
KillTimer(hwnd, TIMERID_PAINT);
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
return DefWindowProc(hwnd, msg, wParam, lParam);
}
if (wParam == TIMERID_REFRESH) {
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
return DefWindowProc(hwnd, msg, wParam, lParam);
}
break;
@@ -614,11 +614,11 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L KillTimer(hwnd, TIMERID_INFOTIP);
DWORD hitFlags;
- dat->selection = HitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, NULL, &hitFlags);
+ dat->selection = HitTest(hwnd, dat, (short)LOWORD(lParam), (short)HIWORD(lParam), &contact, nullptr, &hitFlags);
if (hitFlags & CLCHT_ONITEMEXTRA)
break;
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
if (hitFlags & CLCHT_ONAVATAR && cfg::dat.bDblClkAvatars) {
@@ -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, NULL);
+ dat->selection = pcli->pfnGetRowByIndex(dat, dat->selection, &contact, nullptr);
if (dat->selection != -1)
pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
pt.x = dat->iconXSpace + 15;
@@ -652,19 +652,19 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
else {
ScreenToClient(hwnd, &pt);
- dat->selection = HitTest(hwnd, dat, pt.x, pt.y, &contact, NULL, &hitFlags);
+ dat->selection = HitTest(hwnd, dat, pt.x, pt.y, &contact, nullptr, &hitFlags);
}
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
if (dat->selection != -1)
pcli->pfnEnsureVisible(hwnd, dat, dat->selection, 0);
UpdateWindow(hwnd);
- HMENU hMenu = NULL;
+ HMENU hMenu = nullptr;
if (dat->selection != -1 && hitFlags & (CLCHT_ONITEMICON | CLCHT_ONITEMCHECK | CLCHT_ONITEMLABEL)) {
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, NULL);
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr);
CheckMenuItem(hMenu, POPUP_GROUPHIDEOFFLINE, contact->group->hideOffline ? MF_CHECKED : MF_UNCHECKED);
DestroyMenu(hMenu);
return 0;
@@ -679,7 +679,7 @@ LRESULT CALLBACK ContactListControlWndProc(HWND hwnd, UINT msg, WPARAM wParam, L }
if (hMenu != nullptr) {
ClientToScreen(hwnd, &pt);
- TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
+ TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, nullptr);
DestroyMenu(hMenu);
}
}
diff --git a/plugins/Clist_nicer/src/clcitems.cpp b/plugins/Clist_nicer/src/clcitems.cpp index 2a39378da1..18859042a4 100644 --- a/plugins/Clist_nicer/src/clcitems.cpp +++ b/plugins/Clist_nicer/src/clcitems.cpp @@ -38,7 +38,7 @@ static void TZ_LoadTimeZone(MCONTACT hContact, struct TExtraCache *c) DWORD flags = 0;
if (cfg::dat.bShowLocalTimeSelective)
flags |= TZF_DIFONLY;
- c->hTimeZone = TimeZone_CreateByContact(hContact, 0, flags);
+ c->hTimeZone = TimeZone_CreateByContact(hContact, nullptr, flags);
}
//routines for managing adding/removal of items in the list, including sorting
@@ -46,7 +46,7 @@ static void TZ_LoadTimeZone(MCONTACT hContact, struct TExtraCache *c) ClcContact* CreateClcContact(void)
{
ClcContact* p = (ClcContact*)mir_calloc(sizeof(ClcContact));
- if (p != NULL)
+ if (p != nullptr)
p->avatarLeft = p->extraIconRightBegin = p->xStatusIcon = -1;
return p;
@@ -82,15 +82,15 @@ void LoadAvatarForContact(ClcContact *p) else
p->cFlags = (dwFlags & ECF_FORCEAVATAR ? p->cFlags | ECF_AVATAR : p->cFlags & ~ECF_AVATAR);
- p->ace = NULL;
+ p->ace = nullptr;
if (cfg::dat.bAvatarServiceAvail && (p->cFlags & ECF_AVATAR) && (!cfg::dat.bNoOfflineAvatars || p->wStatus != ID_STATUS_OFFLINE)) {
p->ace = (struct AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, (WPARAM)p->hContact, 0);
- if (p->ace != NULL && p->ace->cbSize != sizeof(struct AVATARCACHEENTRY))
- p->ace = NULL;
- if (p->ace != NULL)
+ if (p->ace != nullptr && p->ace->cbSize != sizeof(struct AVATARCACHEENTRY))
+ p->ace = nullptr;
+ if (p->ace != nullptr)
p->ace->t_lastAccess = cfg::dat.t_now;
}
- if (p->ace == NULL)
+ if (p->ace == nullptr)
p->cFlags &= ~ECF_AVATAR;
}
@@ -112,14 +112,14 @@ ClcContact* AddContactToGroup(struct ClcData *dat, ClcGroup *group, MCONTACT hCo }
else {
p->iImage = pcli->pfnGetContactIcon(hContact);
- p->metaProto = NULL;
+ p->metaProto = nullptr;
}
p->codePage = db_get_dw(hContact, "Tab_SRMsg", "ANSIcodepage", db_get_dw(hContact, "UserInfo", "ANSIcodepage", CP_ACP));
p->bSecondLine = db_get_b(hContact, "CList", "CLN_2ndline", cfg::dat.dualRowMode);
if (dat->bisEmbedded)
- p->pExtra = 0;
+ p->pExtra = nullptr;
else {
p->pExtra = cfg::getCache(p->hContact, p->proto);
GetExtendedInfo(p, dat);
@@ -156,7 +156,7 @@ void RebuildEntireList(HWND hwnd, struct ClcData *dat) BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto)
{
- if (p == NULL)
+ if (p == nullptr)
return 0;
p->bStatusMsgValid = STATUSMSG_NOTFOUND;
@@ -241,7 +241,7 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) }
}
- if (p->hTimeZone == NULL)
+ if (p->hTimeZone == nullptr)
TZ_LoadTimeZone(hContact, p);
return p->bStatusMsgValid;
}
@@ -249,10 +249,10 @@ BYTE GetCachedStatusMsg(TExtraCache *p, char *szProto) void ReloadExtraInfo(MCONTACT hContact)
{
if (hContact && pcli->hwndContactTree) {
- TExtraCache *p = cfg::getCache(hContact, NULL);
+ TExtraCache *p = cfg::getCache(hContact, nullptr);
if (p) {
TZ_LoadTimeZone(hContact, p);
- InvalidateRect(pcli->hwndContactTree, NULL, FALSE);
+ InvalidateRect(pcli->hwndContactTree, nullptr, FALSE);
}
}
}
@@ -270,9 +270,9 @@ void RTL_DetectAndSet(ClcContact *contact, MCONTACT hContact) memset(infoTypeC2, 0, sizeof(infoTypeC2));
- if (contact == NULL) {
+ if (contact == nullptr) {
szText = pcli->pfnGetContactDisplayName(hContact, 0);
- p = cfg::getCache(hContact, NULL);
+ p = cfg::getCache(hContact, nullptr);
}
else {
szText = contact->szText;
@@ -316,14 +316,14 @@ void RTL_DetectGroupName(ClcContact *group) void GetExtendedInfo(ClcContact *contact, ClcData *dat)
{
- if (dat->bisEmbedded || contact == NULL)
+ if (dat->bisEmbedded || contact == nullptr)
return;
- if (contact->proto == NULL || contact->hContact == 0)
+ if (contact->proto == nullptr || contact->hContact == 0)
return;
TExtraCache *p = contact->pExtra;
- if (p == NULL)
+ if (p == nullptr)
return;
p->msgFrequency = db_get_dw(contact->hContact, "CList", "mf_freq", 0x7fffffff);
@@ -339,7 +339,7 @@ void LoadSkinItemToCache(TExtraCache *cEntry) MCONTACT hContact = cEntry->hContact;
if (db_get_b(hContact, "EXTBK", "VALID", 0)) {
- if (cEntry->status_item == NULL)
+ if (cEntry->status_item == nullptr)
cEntry->status_item = reinterpret_cast<StatusItems_t *>(malloc(sizeof(StatusItems_t)));
memset(cEntry->status_item, 0, sizeof(StatusItems_t));
mir_strcpy(cEntry->status_item->szName, "{--CONTACT--}"); // mark as "per contact" item
@@ -363,7 +363,7 @@ void LoadSkinItemToCache(TExtraCache *cEntry) }
else if (cEntry->status_item) {
free(cEntry->status_item);
- cEntry->status_item = NULL;
+ cEntry->status_item = nullptr;
}
}
@@ -378,13 +378,13 @@ int CLVM_GetContactHiddenStatus(MCONTACT hContact, char *szProto, struct ClcData int dbHidden = db_get_b(hContact, "CList", "Hidden", 0); // default hidden state, always respect it.
// always hide subcontacts (but show them on embedded contact lists)
- if (dat != NULL && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && db_mc_isSub(hContact))
+ if (dat != nullptr && dat->bHideSubcontacts && cfg::dat.bMetaEnabled && db_mc_isSub(hContact))
return 1;
if (!cfg::dat.bFilterEffective)
return dbHidden;
- if (szProto == NULL)
+ if (szProto == nullptr)
szProto = GetContactProto(hContact);
// check stickies first (priority), only if we really have stickies defined (CLVM_STICKY_CONTACTS is set).
if (cfg::dat.bFilterEffective & CLVM_STICKY_CONTACTS) {
diff --git a/plugins/Clist_nicer/src/clcmsgs.cpp b/plugins/Clist_nicer/src/clcmsgs.cpp index 3250d07ef1..d7f776e607 100644 --- a/plugins/Clist_nicer/src/clcmsgs.cpp +++ b/plugins/Clist_nicer/src/clcmsgs.cpp @@ -33,7 +33,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM {
ClcContact *contact;
ClcGroup *group;
- if (wParam == 0 || !Clist_FindItem(hwnd, dat, wParam, &contact, &group, NULL))
+ if (wParam == 0 || !Clist_FindItem(hwnd, dat, wParam, &contact, &group, nullptr))
return 0;
if (lParam)
@@ -45,8 +45,8 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM case CLM_GETSTATUSMSG:
if (wParam) {
- ClcContact *contact = NULL;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ ClcContact *contact = nullptr;
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
return 0;
if (contact->type != CLCIT_CONTACT)
@@ -64,8 +64,8 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM case CLM_TOGGLEPRIORITYCONTACT:
if (wParam) {
- ClcContact *contact = NULL;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ ClcContact *contact = nullptr;
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
return 0;
if (contact->type != CLCIT_CONTACT)
return 0;
@@ -77,8 +77,8 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM case CLM_QUERYPRIORITYCONTACT:
if (wParam) {
- ClcContact *contact = NULL;
- if (!Clist_FindItem(hwnd, dat, wParam, &contact, NULL, NULL))
+ ClcContact *contact = nullptr;
+ if (!Clist_FindItem(hwnd, dat, wParam, &contact, nullptr, nullptr))
return 0;
if (contact->type != CLCIT_CONTACT)
return 0;
@@ -96,7 +96,7 @@ LRESULT ProcessExternalMessages(HWND hwnd, struct ClcData *dat, UINT msg, WPARAM RowHeight::getMaxRowHeight(dat, hwnd);
if (LOWORD(lParam))
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
return 0;
case CLM_ISMULTISELECT:
diff --git a/plugins/Clist_nicer/src/clcopts.cpp b/plugins/Clist_nicer/src/clcopts.cpp index 6a9b10a5b8..199026fc71 100644 --- a/plugins/Clist_nicer/src/clcopts.cpp +++ b/plugins/Clist_nicer/src/clcopts.cpp @@ -83,7 +83,7 @@ static void FillCheckBoxTree(HWND hwndTree, const struct CheckBoxValues_t *value TVINSERTSTRUCT tvis;
int i;
- tvis.hParent = NULL;
+ tvis.hParent = nullptr;
tvis.hInsertAfter = TVI_LAST;
tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_STATE;
for (i = 0; i < nValues; i++) {
@@ -457,7 +457,7 @@ static INT_PTR CALLBACK DlgProcDspAdvanced(HWND hwndDlg, UINT msg, WPARAM wParam KillTimer(pcli->hwndContactTree, TIMERID_REFRESH);
if (cfg::dat.bShowLocalTime)
- SetTimer(pcli->hwndContactTree, TIMERID_REFRESH, 65000, NULL);
+ SetTimer(pcli->hwndContactTree, TIMERID_REFRESH, 65000, nullptr);
cfg::dat.dualRowMode = (BYTE)SendDlgItemMessage(hwndDlg, IDC_DUALROWMODE, CB_GETCURSEL, 0, 0);
if (cfg::dat.dualRowMode == CB_ERR)
@@ -750,7 +750,7 @@ static INT_PTR CALLBACK DlgProcClcBkgOpts(HWND hwndDlg, UINT msg, WPARAM wParam, OPENFILENAME ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
- ofn.hInstance = NULL;
+ ofn.hInstance = nullptr;
ofn.lpstrFilter = filter;
ofn.lpstrFile = str;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
diff --git a/plugins/Clist_nicer/src/clcpaint.cpp b/plugins/Clist_nicer/src/clcpaint.cpp index 78d4f341fa..28c0c73405 100644 --- a/plugins/Clist_nicer/src/clcpaint.cpp +++ b/plugins/Clist_nicer/src/clcpaint.cpp @@ -225,7 +225,7 @@ void PaintNotifyArea(HDC hDC, RECT *rc) else {
HICON hIcon = reinterpret_cast<HICON>(LoadImage(g_hInst, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0));
DrawText(hDC, TranslateT("No events..."), -1, rc, DT_VCENTER | DT_SINGLELINE);
- DrawIconEx(hDC, 4, (rc->bottom + rc->top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT);
+ DrawIconEx(hDC, 4, (rc->bottom + rc->top - 16) / 2, hIcon, 16, 16, 0, nullptr, DI_NORMAL | DI_COMPAT);
DestroyIcon(hIcon);
}
}
@@ -251,7 +251,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int LONG bmWidth, bmHeight;
float dAspect;
HBITMAP hbm, hbmOldAV;
- HRGN rgn = 0;
+ HRGN rgn = nullptr;
int avatar_size = cfg::dat.avatarSize;
DWORD av_saved_left;
StatusItems_t *item = contact->wStatus == ID_STATUS_OFFLINE ? arStatusItems[ID_EXTBKAVATARFRAMEOFFLINE - ID_STATUS_OFFLINE] : arStatusItems[ID_EXTBKAVATARFRAME - ID_STATUS_OFFLINE];
@@ -262,7 +262,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int if (!cfg::dat.bAvatarServiceAvail || dat->bisEmbedded)
return 0;
- if (contact->ace != NULL && contact->ace->cbSize == sizeof(struct AVATARCACHEENTRY)) {
+ if (contact->ace != nullptr && contact->ace->cbSize == sizeof(struct AVATARCACHEENTRY)) {
if (contact->ace->dwFlags & AVS_HIDEONCLIST)
return (cfg::dat.dwFlags & CLUI_FRAME_ALWAYSALIGNNICK) ? avatar_size + 2 : 0;
@@ -277,7 +277,7 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int }
else return (cfg::dat.dwFlags & CLUI_FRAME_ALWAYSALIGNNICK) ? avatar_size + 2 : 0;
- if (bmHeight == 0 || bmWidth == 0 || hbm == 0)
+ if (bmHeight == 0 || bmWidth == 0 || hbm == nullptr)
return 0;
g_maxAV_X = max(bmWidth, g_maxAV_X);
@@ -344,15 +344,15 @@ static int __fastcall DrawAvatar(HDC hdcMem, RECT *rc, ClcContact *contact, int fOverlay = (dwFlags & ECF_FORCEOVERLAY) ? 1 : 0;
if (fOverlay && cstatus && (int)newHeight >= g_cysmIcon)
- DrawIconEx(hdcMem, rc->left + (int)newWidth - 15, y + topoffset + (int)newHeight - 15, overlayicons[cstatus - ID_STATUS_OFFLINE], g_cxsmIcon, g_cysmIcon, 0, 0, DI_NORMAL | DI_COMPAT);
+ DrawIconEx(hdcMem, rc->left + (int)newWidth - 15, y + topoffset + (int)newHeight - 15, overlayicons[cstatus - ID_STATUS_OFFLINE], g_cxsmIcon, g_cysmIcon, 0, nullptr, DI_NORMAL | DI_COMPAT);
- SelectClipRgn(hdcMem, NULL);
+ SelectClipRgn(hdcMem, nullptr);
DeleteObject(rgn);
if (!item->IGNORED) {
RECT rcFrame;
BOOL inClCPaint_save = g_inCLCpaint;
- HDC hdcTemp = 0;
+ HDC hdcTemp = nullptr;
HBITMAP hbmOld, hbmTemp;
g_inCLCpaint = FALSE;
@@ -412,7 +412,7 @@ void __inline PaintItem(HDC hdcMem, ClcGroup *group, ClcContact *contact, int in DWORD leftOffset = 0, rightOffset = 0;
int iconXSpace = dat->iconXSpace;
//BOOL xStatusValid = 0;
- HFONT hPreviousFont = 0;
+ HFONT hPreviousFont = nullptr;
COLORREF oldGroupColor = -1;
DWORD qLeft = 0;
int leftX = dat->leftMargin + indent * dat->groupIndent;
@@ -426,7 +426,7 @@ void __inline PaintItem(HDC hdcMem, ClcGroup *group, ClcContact *contact, int in rowHeight -= cfg::dat.bRowSpacing;
savedCORNER = -1;
- if (group == NULL || contact == NULL)
+ if (group == nullptr || contact == nullptr)
return;
g_RTL = FALSE;
@@ -499,7 +499,7 @@ set_bg_l: else
ChangeToFont(hdcMem, dat, FONTID_CONTACTS, &fontHeight);
- wchar_t *szCounts = NULL;
+ wchar_t *szCounts = nullptr;
if (type == CLCIT_GROUP) {
GetTextExtentPoint32(hdcMem, contact->szText, (int)mir_wstrlen(contact->szText), &textSize);
int width = textSize.cx;
@@ -589,7 +589,7 @@ set_bg_l: // check for special cases (first item, single item, last item)
// this will only change the shape for this status. Color will be blended over with ALPHA value
- if (!ssingleitem->IGNORED && scanIndex == 0 && group->cl.getCount() == 1 && group->parent != NULL) {
+ if (!ssingleitem->IGNORED && scanIndex == 0 && group->cl.getCount() == 1 && group->parent != nullptr) {
rc.left = ssingleitem->MARGIN_LEFT + bg_indent_l;
rc.top = y + ssingleitem->MARGIN_TOP;
rc.right = clRect->right - ssingleitem->MARGIN_RIGHT - bg_indent_r;
@@ -613,7 +613,7 @@ set_bg_l: if (check_selected)
DrawAlpha(hdcMem, &rc, ssingleitem->COLOR, ssingleitem->ALPHA, ssingleitem->COLOR2, ssingleitem->COLOR2_TRANSPARENT, ssingleitem->GRADIENT, ssingleitem->CORNER, ssingleitem->BORDERSTYLE, ssingleitem->imageItem);
}
- else if (scanIndex == 0 && group->cl.getCount() > 1 && !sfirstitem->IGNORED && group->parent != NULL) {
+ else if (scanIndex == 0 && group->cl.getCount() > 1 && !sfirstitem->IGNORED && group->parent != nullptr) {
rc.left = sfirstitem->MARGIN_LEFT + bg_indent_l;
rc.top = y + sfirstitem->MARGIN_TOP;
rc.right = clRect->right - sfirstitem->MARGIN_RIGHT - bg_indent_r;
@@ -637,7 +637,7 @@ set_bg_l: if (check_selected)
DrawAlpha(hdcMem, &rc, sfirstitem->COLOR, sfirstitem->ALPHA, sfirstitem->COLOR2, sfirstitem->COLOR2_TRANSPARENT, sfirstitem->GRADIENT, sfirstitem->CORNER, sfirstitem->BORDERSTYLE, sfirstitem->imageItem);
}
- else if (scanIndex == group->cl.getCount() - 1 && !slastitem->IGNORED && group->parent != NULL) {
+ else if (scanIndex == group->cl.getCount() - 1 && !slastitem->IGNORED && group->parent != nullptr) {
// last item of group
rc.left = slastitem->MARGIN_LEFT + bg_indent_l;
rc.top = y + slastitem->MARGIN_TOP;
@@ -663,7 +663,7 @@ set_bg_l: DrawAlpha(hdcMem, &rc, slastitem->COLOR, slastitem->ALPHA, slastitem->COLOR2, slastitem->COLOR2_TRANSPARENT, slastitem->GRADIENT, slastitem->CORNER, slastitem->BORDERSTYLE, slastitem->imageItem);
}
// --- Non-grouped items ---
- else if (type != CLCIT_GROUP && group->parent == NULL && !sfirstitem_NG->IGNORED && scanIndex != group->cl.getCount() - 1 && !(*bFirstNGdrawn)) {
+ else if (type != CLCIT_GROUP && group->parent == nullptr && !sfirstitem_NG->IGNORED && scanIndex != group->cl.getCount() - 1 && !(*bFirstNGdrawn)) {
// first NON-grouped
*bFirstNGdrawn = TRUE;
rc.left = sfirstitem_NG->MARGIN_LEFT + bg_indent_l;
@@ -689,7 +689,7 @@ set_bg_l: if (check_selected)
DrawAlpha(hdcMem, &rc, sfirstitem_NG->COLOR, sfirstitem_NG->ALPHA, sfirstitem_NG->COLOR2, sfirstitem_NG->COLOR2_TRANSPARENT, sfirstitem_NG->GRADIENT, sfirstitem_NG->CORNER, sfirstitem->BORDERSTYLE, sfirstitem->imageItem);
}
- else if (type != CLCIT_GROUP && group->parent == NULL && !slastitem_NG->IGNORED && scanIndex == group->cl.getCount() - 1 && (*bFirstNGdrawn)) {
+ else if (type != CLCIT_GROUP && group->parent == nullptr && !slastitem_NG->IGNORED && scanIndex == group->cl.getCount() - 1 && (*bFirstNGdrawn)) {
// last item of list (NON-group)
// last NON-grouped
rc.left = slastitem_NG->MARGIN_LEFT + bg_indent_l;
@@ -715,7 +715,7 @@ set_bg_l: if (check_selected)
DrawAlpha(hdcMem, &rc, slastitem_NG->COLOR, slastitem_NG->ALPHA, slastitem_NG->COLOR2, slastitem_NG->COLOR2_TRANSPARENT, slastitem_NG->GRADIENT, slastitem_NG->CORNER, slastitem->BORDERSTYLE, slastitem->imageItem);
}
- else if (type != CLCIT_GROUP && group->parent == NULL && !slastitem_NG->IGNORED && !(*bFirstNGdrawn)) {
+ else if (type != CLCIT_GROUP && group->parent == nullptr && !slastitem_NG->IGNORED && !(*bFirstNGdrawn)) {
// single item of NON-group
// single NON-grouped
rc.left = ssingleitem_NG->MARGIN_LEFT + bg_indent_l;
@@ -848,11 +848,11 @@ bgskipped: rcContent.right = clRect->right - dat->rightMargin;
twoRows = ((dat->fontInfo[FONTID_STATUS].fontHeight + fontHeight <= rowHeight + 1) && (contact->bSecondLine != MULTIROW_NEVER)) && !dat->bisEmbedded;
- pi_avatar = !dat->bisEmbedded && type == CLCIT_CONTACT && (contact->cFlags & ECF_AVATAR) && contact->ace != 0 && !(contact->ace->dwFlags & AVS_HIDEONCLIST);
+ pi_avatar = !dat->bisEmbedded && type == CLCIT_CONTACT && (contact->cFlags & ECF_AVATAR) && contact->ace != nullptr && !(contact->ace->dwFlags & AVS_HIDEONCLIST);
//checkboxes
if (checkboxWidth) {
- HANDLE hTheme = 0;
+ HANDLE hTheme = nullptr;
if (IS_THEMED)
hTheme = OpenThemeData(hwnd, L"BUTTON");
@@ -864,7 +864,7 @@ bgskipped: if (hTheme) {
DrawThemeBackground(hTheme, hdcMem, BP_CHECKBOX, flags & CONTACTF_CHECKED ? (g_hottrack ? CBS_CHECKEDHOT : CBS_CHECKEDNORMAL) : (g_hottrack ? CBS_UNCHECKEDHOT : CBS_UNCHECKEDNORMAL), &rc2, &rc2);
CloseThemeData(hTheme);
- hTheme = 0;
+ hTheme = nullptr;
}
else DrawFrameControl(hdcMem, &rc2, DFC_BUTTON, DFCS_BUTTONCHECK | DFCS_FLAT | (flags & CONTACTF_CHECKED ? DFCS_CHECKED : 0) | (g_hottrack ? DFCS_HOT : 0));
@@ -1136,7 +1136,7 @@ bgskipped: rc2.left = rcContent.right - szTime.cx - 2;
}
DrawText(hdcMem, szResult, -1, &rc2, DT_NOPREFIX | DT_NOCLIP | DT_SINGLELINE);
- ChangeToFont(hdcMem, dat, idOldFont, 0);
+ ChangeToFont(hdcMem, dat, idOldFont, nullptr);
SetTextColor(hdcMem, oldColor);
verticalfit = (rowHeight - fontHeight >= g_cysmIcon + 1);
@@ -1278,11 +1278,11 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint) hbmTempAV = CreateCompatibleBitmap(g_HDC, g_maxAV_X, g_maxAV_Y);
hbmTempOldAV = reinterpret_cast<HBITMAP>(SelectObject(hdcTempAV, hbmTempAV));
- cfg::dat.t_now = time(NULL);
+ cfg::dat.t_now = time(nullptr);
GetSystemTime(&cfg::dat.st);
SystemTimeToFileTime(&cfg::dat.st, &cfg::dat.ft);
- cfg::dat.bUseFastGradients = cfg::dat.bWantFastGradients && (GdiGradientFill != 0);
+ cfg::dat.bUseFastGradients = cfg::dat.bWantFastGradients && (GdiGradientFill != nullptr);
av_left = (cfg::dat.dwFlags & CLUI_FRAME_AVATARSLEFT);
av_right = (cfg::dat.dwFlags & CLUI_FRAME_AVATARSRIGHT);
@@ -1300,7 +1300,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint) else if (GetFocus() != hwnd && dat->greyoutFlags & GREYF_UNFOCUS)
grey = 1;
GetClientRect(hwnd, &clRect);
- if (rcPaint == NULL)
+ if (rcPaint == nullptr)
rcPaint = &clRect;
if (IsRectEmpty(rcPaint)) {
SelectObject(hdcTempAV, hbmTempOldAV);
@@ -1313,7 +1313,7 @@ void PaintClc(HWND hwnd, struct ClcData *dat, HDC hdc, RECT *rcPaint) int y = -dat->yScroll;
HDC hdcMem = CreateCompatibleDC(hdc);
- HBITMAP hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), NULL);
+ HBITMAP hBmpOsb = CreateBitmap(clRect.right, clRect.bottom, 1, GetDeviceCaps(hdc, BITSPIXEL), nullptr);
HBITMAP hOldBitmap = reinterpret_cast<HBITMAP>(SelectObject(hdcMem, hBmpOsb));
@@ -1414,7 +1414,7 @@ bgdone: ClcGroup *group = &dat->list;
group->scanIndex = 0;
- if (dat->row_heights == NULL)
+ if (dat->row_heights == nullptr)
RowHeight::calcRowHeights(dat, hwnd);
group = &dat->list;
@@ -1423,7 +1423,7 @@ bgdone: g_list_avatars = 0;
while (true) {
if (group->scanIndex == group->cl.getCount()) {
- if ((group = group->parent) == NULL)
+ if ((group = group->parent) == nullptr)
break;
group->scanIndex++;
continue;
@@ -1448,7 +1448,7 @@ bgdone: int indent = 0;
for (int index = 0; y < rcPaint->bottom;) {
if (group->scanIndex == group->cl.getCount()) {
- if ((group = group->parent) == NULL)
+ if ((group = group->parent) == nullptr)
break;
group->scanIndex++;
indent--;
diff --git a/plugins/Clist_nicer/src/clcutils.cpp b/plugins/Clist_nicer/src/clcutils.cpp index 81b1839869..c898aec8c3 100644 --- a/plugins/Clist_nicer/src/clcutils.cpp +++ b/plugins/Clist_nicer/src/clcutils.cpp @@ -115,7 +115,7 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac right = clRect.right;
// avatar check
- if (hitcontact->type == CLCIT_CONTACT && cfg::dat.dwFlags & CLUI_FRAME_AVATARS && hitcontact->ace != NULL && hitcontact->avatarLeft != -1)
+ if (hitcontact->type == CLCIT_CONTACT && cfg::dat.dwFlags & CLUI_FRAME_AVATARS && hitcontact->ace != nullptr && hitcontact->avatarLeft != -1)
if (testx < right - hitcontact->avatarLeft && testx > right - hitcontact->avatarLeft - cfg::dat.avatarSize)
if (flags)
*flags |= CLCHT_ONAVATAR;
@@ -196,8 +196,8 @@ int RTL_HitTest(HWND hwnd, struct ClcData *dat, int testx, ClcContact *hitcontac int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **contact, ClcGroup **group, DWORD *flags)
{
- ClcContact *hitcontact = NULL;
- ClcGroup *hitgroup = NULL;
+ ClcContact *hitcontact = nullptr;
+ ClcGroup *hitgroup = nullptr;
int indent, width, i;
int checkboxWidth;
SIZE textSize;
@@ -256,7 +256,7 @@ int HitTest(HWND hwnd, struct ClcData *dat, int testx, int testy, ClcContact **c }
// avatar check
- if (hitcontact->type == CLCIT_CONTACT && cfg::dat.dwFlags & CLUI_FRAME_AVATARS && hitcontact->ace != NULL && hitcontact->avatarLeft != -1) {
+ if (hitcontact->type == CLCIT_CONTACT && cfg::dat.dwFlags & CLUI_FRAME_AVATARS && hitcontact->ace != nullptr && hitcontact->avatarLeft != -1) {
if (testx > hitcontact->avatarLeft && testx < hitcontact->avatarLeft + cfg::dat.avatarSize) {
if (flags)
*flags |= CLCHT_ONAVATAR;
@@ -366,10 +366,10 @@ void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth) if (nowTick >= startTick + dat->scrollTime)
break;
dat->yScroll = oldy + (desty - oldy) * (int)(nowTick - startTick) / dat->scrollTime;
- if (dat->backgroundBmpUse & CLBF_SCROLL || dat->hBmpBackground == NULL)
- ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE);
+ if (dat->backgroundBmpUse & CLBF_SCROLL || dat->hBmpBackground == nullptr)
+ ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, nullptr, nullptr, nullptr, nullptr, SW_INVALIDATE);
else
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
previousy = dat->yScroll;
if (cfg::dat.bSkinnedScrollbar && !dat->bisEmbedded)
CoolSB_SetScrollPos(hwnd, SB_VERT, dat->yScroll, TRUE);
@@ -379,14 +379,14 @@ void ScrollTo(HWND hwnd, struct ClcData *dat, int desty, int noSmooth) }
}
dat->yScroll = desty;
- if (dat->backgroundBmpUse & CLBF_SCROLL || dat->hBmpBackground == NULL) {
+ if (dat->backgroundBmpUse & CLBF_SCROLL || dat->hBmpBackground == nullptr) {
if (!noSmooth)
- ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, NULL, NULL, NULL, NULL, SW_INVALIDATE);
+ ScrollWindowEx(hwnd, 0, previousy - dat->yScroll, nullptr, nullptr, nullptr, nullptr, SW_INVALIDATE);
else
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
}
else
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
if (cfg::dat.bSkinnedScrollbar && !dat->bisEmbedded)
CoolSB_SetScrollPos(hwnd, SB_VERT, dat->yScroll, TRUE);
@@ -453,7 +453,7 @@ void SetGroupExpand(HWND hwnd, struct ClcData *dat, ClcGroup *group, int newStat return;
group->expanded = newState != 0;
}
- InvalidateRect(hwnd, NULL, FALSE);
+ InvalidateRect(hwnd, nullptr, FALSE);
contentCount = pcli->pfnGetGroupContentsCount(group, 1);
groupy = pcli->pfnGetRowsPriorTo(&dat->list, group, -1);
@@ -536,7 +536,7 @@ void BeginRenameSelection(HWND hwnd, struct ClcData *dat) if (h < dat->fontInfo[i].fontHeight + 2) h = dat->fontInfo[i].fontHeight + 2;
}
- dat->hwndRenameEdit = CreateWindowEx(0, L"RICHEDIT50W", contact->szText, WS_CHILD | WS_BORDER | ES_MULTILINE | ES_AUTOHSCROLL, x, y, clRect.right - x, h, hwnd, NULL, g_hInst, NULL);
+ dat->hwndRenameEdit = CreateWindowEx(0, L"RICHEDIT50W", contact->szText, WS_CHILD | WS_BORDER | ES_MULTILINE | ES_AUTOHSCROLL, x, y, clRect.right - x, h, hwnd, nullptr, g_hInst, nullptr);
{
if ((contact->type == CLCIT_CONTACT && contact->pExtra->dwCFlags & ECF_RTLNICK) || (contact->type == CLCIT_GROUP && contact->isRtl)) {
PARAFORMAT2 pf2;
@@ -599,8 +599,8 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) if (cfg::dat.hdcPic) {
SelectObject(cfg::dat.hdcPic, cfg::dat.hbmPicOld);
DeleteDC(cfg::dat.hdcPic);
- cfg::dat.hdcPic = 0;
- cfg::dat.hbmPicOld = 0;
+ cfg::dat.hdcPic = nullptr;
+ cfg::dat.hbmPicOld = nullptr;
}
}
@@ -618,14 +618,14 @@ void LoadClcOptions(HWND hwnd, struct ClcData *dat, BOOL bFirst) char wpbuf[MAX_PATH];
if (dat->hBmpBackground) {
DeleteObject(dat->hBmpBackground);
- dat->hBmpBackground = NULL;
+ dat->hBmpBackground = nullptr;
}
SystemParametersInfoA(SPI_GETDESKWALLPAPER, MAX_PATH, wpbuf, 0);
// we have a wallpaper string
if (wpbuf[0] != 0)
- dat->hBmpBackground = reinterpret_cast<HBITMAP>(LoadImageA(NULL, wpbuf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE));
+ dat->hBmpBackground = reinterpret_cast<HBITMAP>(LoadImageA(nullptr, wpbuf, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE));
cfg::dat.bmpBackground = dat->hBmpBackground;
if (cfg::dat.bmpBackground) {
diff --git a/plugins/Clist_nicer/src/clistevents.cpp b/plugins/Clist_nicer/src/clistevents.cpp index e2cd2825d2..c56e691fa1 100644 --- a/plugins/Clist_nicer/src/clistevents.cpp +++ b/plugins/Clist_nicer/src/clistevents.cpp @@ -25,14 +25,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
#include "cluiframes.h"
-static HWND hwndEventFrame = 0;
+static HWND hwndEventFrame = nullptr;
HFONT __fastcall ChangeToFont(HDC hdc, struct ClcData *dat, int id, int *fontHeight);
extern FRAMEWND *wndFrameEventArea;
extern HPEN g_hPenCLUIFrames;
-HWND g_hwndEventArea = 0;
+HWND g_hwndEventArea = nullptr;
struct CListImlIcon
{
@@ -71,7 +71,7 @@ static CLISTEVENT* MyGetEvent(int iSelection) if (p.menuId == iSelection)
return &p;
}
- return NULL;
+ return nullptr;
}
LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -110,7 +110,7 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa if (dis->hwndItem == (HWND)cfg::dat.hMenuNotify) {
MENUITEMINFOA mii = { 0 };
- struct NotifyMenuItemExData *nmi = 0;
+ struct NotifyMenuItemExData *nmi = nullptr;
int iIcon;
HICON hIcon;
@@ -136,7 +136,7 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa case WM_COMMAND:
if (LOWORD(wParam) == IDC_NOTIFYBUTTON) {
int iSelection;
- struct NotifyMenuItemExData *nmi = 0;
+ struct NotifyMenuItemExData *nmi = nullptr;
int iCount = GetMenuItemCount(cfg::dat.hMenuNotify);
POINT pt;
@@ -146,7 +146,7 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa mii.cbSize = sizeof(mii);
mii.fMask = MIIM_DATA;
if (iCount > 1)
- iSelection = TrackPopupMenu(cfg::dat.hMenuNotify, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, NULL);
+ iSelection = TrackPopupMenu(cfg::dat.hMenuNotify, TPM_RETURNCMD, pt.x, pt.y, 0, hwnd, nullptr);
else
iSelection = GetMenuItemID(cfg::dat.hMenuNotify, 0);
@@ -156,12 +156,12 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa if (nmi) {
CLISTEVENT *cle = MyGetEvent(iSelection);
if (cle) {
- CLISTEVENT *cle1 = NULL;
+ CLISTEVENT *cle1 = nullptr;
CallService(cle->pszService, (WPARAM)NULL, (LPARAM)cle);
// re-obtain the pointer, it may already be invalid/point to another event if the
// event we're interested in was removed by the service (nasty one...)
cle1 = MyGetEvent(iSelection);
- if (cle1 != NULL)
+ if (cle1 != nullptr)
pcli->pfnRemoveEvent(cle->hContact, cle->hDbEvent);
}
}
@@ -186,7 +186,7 @@ LRESULT CALLBACK EventAreaWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa HBITMAP hbmold = reinterpret_cast<HBITMAP>(SelectObject(hdcMem, hbm));
SetBkMode(hdcMem, TRANSPARENT);
- HFONT hFontOld = 0;
+ HFONT hFontOld = nullptr;
if (cfg::clcdat) {
int height;
hFontOld = ChangeToFont(hdcMem, cfg::clcdat, FONTID_EVENTAREA, &height);
@@ -247,7 +247,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) for (int j = 0; j < GetMenuItemCount(cfg::dat.hMenuNotify); j++) {
if (GetMenuItemInfo(cfg::dat.hMenuNotify, j, TRUE, &mii) != 0) {
NotifyMenuItemExData *nmi = (NotifyMenuItemExData*)mii.dwItemData;
- if (nmi != 0 && (HANDLE)nmi->hContact == (HANDLE)p->hContact && nmi->iIcon == p->imlIconIndex)
+ if (nmi != nullptr && (HANDLE)nmi->hContact == (HANDLE)p->hContact && nmi->iIcon == p->imlIconIndex)
return p;
}
}
@@ -304,7 +304,7 @@ CListEvent* AddEvent(CLISTEVENT *cle) HideShowNotifyFrame();
}
}
- InvalidateRect(hwndEventFrame, NULL, FALSE);
+ InvalidateRect(hwndEventFrame, nullptr, FALSE);
return p;
}
@@ -363,7 +363,7 @@ int RemoveEvent(MCONTACT hContact, MEVENT hDbEvent) cfg::dat.hUpdateContact = 0;
if (cfg::dat.notifyActive)
- InvalidateRect(hwndEventFrame, NULL, FALSE);
+ InvalidateRect(hwndEventFrame, nullptr, FALSE);
return res;
}
diff --git a/plugins/Clist_nicer/src/clistmenus.cpp b/plugins/Clist_nicer/src/clistmenus.cpp index 7f33b59866..0aef011081 100644 --- a/plugins/Clist_nicer/src/clistmenus.cpp +++ b/plugins/Clist_nicer/src/clistmenus.cpp @@ -45,7 +45,7 @@ INT_PTR CloseAction(WPARAM, LPARAM) return 0;
}
-static MWindowList hWindowListIGN = 0;
+static MWindowList hWindowListIGN = nullptr;
// dialog procedure for handling the contact ignore dialog (available from the contact menu
static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -56,7 +56,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_INITDIALOG:
{
DWORD dwMask;
- ClcContact *contact = NULL;
+ ClcContact *contact = nullptr;
int pCaps;
HWND hwndAdd;
@@ -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, NULL, NULL);
+ Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
if (contact && contact->type != CLCIT_CONTACT) {
DestroyWindow(hWnd);
return FALSE;
@@ -192,7 +192,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case IDOK:
{
DWORD newMask = 0;
- ClcContact *contact = NULL;
+ ClcContact *contact = nullptr;
SendMessage(hWnd, WM_USER + 110, 0, (LPARAM)&newMask);
db_set_dw(hContact, "Ignore", "Mask1", newMask);
@@ -203,7 +203,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, NULL, NULL);
+ Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr);
if (iSel != CB_ERR) {
dwFlags &= ~(ECF_FORCEAVATAR | ECF_HIDEAVATAR);
@@ -249,7 +249,7 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA contact->pExtra->dwDFlags = dwFlags;
}
else {
- TExtraCache *p = cfg::getCache(hContact, NULL);
+ TExtraCache *p = cfg::getCache(hContact, nullptr);
if (p)
p->dwDFlags = dwFlags;
}
@@ -289,8 +289,8 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_USER + 120: // set visibility status
{
- ClcContact *contact = NULL;
- if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
+ ClcContact *contact = nullptr;
+ if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
if (contact) {
WORD wApparentMode = db_get_w(contact->hContact, contact->proto, "ApparentMode", 0);
@@ -303,9 +303,9 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA case WM_USER + 130: // update apparent mode
{
- ClcContact *contact = NULL;
+ ClcContact *contact = nullptr;
- if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, NULL, NULL)) {
+ if (Clist_FindItem(pcli->hwndContactTree, cfg::clcdat, hContact, &contact, nullptr, nullptr)) {
if (contact) {
WORD wApparentMode = 0;
@@ -343,15 +343,15 @@ static INT_PTR CALLBACK IgnoreDialogProc(HWND hWnd, UINT msg, WPARAM wParam, LPA static INT_PTR SetContactIgnore(WPARAM wParam, LPARAM)
{
- HWND hWnd = 0;
+ HWND hWnd = nullptr;
- if (hWindowListIGN == 0)
+ if (hWindowListIGN == nullptr)
hWindowListIGN = WindowList_Create();
hWnd = WindowList_Find(hWindowListIGN, wParam);
if (wParam) {
- if (hWnd == 0)
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_QUICKIGNORE), 0, IgnoreDialogProc, (LPARAM)wParam);
+ if (hWnd == nullptr)
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_QUICKIGNORE), nullptr, IgnoreDialogProc, (LPARAM)wParam);
else if (IsWindow(hWnd))
SetFocus(hWnd);
}
diff --git a/plugins/Clist_nicer/src/clistmod.cpp b/plugins/Clist_nicer/src/clistmod.cpp index f064fe4a3a..782ada2086 100644 --- a/plugins/Clist_nicer/src/clistmod.cpp +++ b/plugins/Clist_nicer/src/clistmod.cpp @@ -40,13 +40,13 @@ static INT_PTR GetStatusMode(WPARAM, LPARAM) int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact, HICON *phIcon)
{
- if (phIcon != NULL)
- *phIcon = NULL;
+ if (phIcon != nullptr)
+ *phIcon = nullptr;
char *szFinalProto;
int finalStatus;
- if (szProto != NULL && !mir_strcmp(szProto, META_PROTO) && hContact != 0 && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
+ if (szProto != nullptr && !mir_strcmp(szProto, META_PROTO) && hContact != 0 && !(cfg::dat.dwFlags & CLUI_USEMETAICONS)) {
MCONTACT hSubContact = db_mc_getMostOnline(hContact);
szFinalProto = GetContactProto(hSubContact);
finalStatus = (status == 0) ? (WORD)db_get_w(hSubContact, szFinalProto, "Status", ID_STATUS_OFFLINE) : status;
@@ -57,7 +57,7 @@ int IconFromStatusMode(const char *szProto, int status, MCONTACT hContact, HICON finalStatus = status;
}
- if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_OFFLINE && phIcon != NULL) {
+ if (status >= ID_STATUS_CONNECTING && status < ID_STATUS_OFFLINE && phIcon != nullptr) {
if (szProto) {
char szBuf[128];
mir_snprintf(szBuf, "%s_conn", szProto);
@@ -100,9 +100,9 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) POINT pt = { 0 };
register int i = 0, j = 0, width = 0, height = 0, iCountedDots = 0, iNotCoveredDots = 0;
BOOL bPartiallyCovered = FALSE;
- HWND hAux = 0;
+ HWND hAux = nullptr;
- if (hWnd == NULL) {
+ if (hWnd == nullptr) {
SetLastError(0x00000006); //Wrong handle
return -1;
}
@@ -111,7 +111,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) if (IsIconic(hWnd) || !IsWindowVisible(hWnd))
return GWVS_HIDDEN;
- HRGN rgn = 0;
+ HRGN rgn = nullptr;
POINT ptOrig;
RECT rcClient;
int clip = (int)cfg::dat.bClipBorder;
@@ -153,7 +153,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) for (j = rc.left + clip; j < rc.right; j += (width / iStepX)) {
pt.x = j;
hAux = WindowFromPoint(pt);
- while (GetParent(hAux) != NULL)
+ while (GetParent(hAux) != nullptr)
hAux = GetParent(hAux);
if (hAux != hWnd && hAux) //There's another window!
bPartiallyCovered = TRUE;
diff --git a/plugins/Clist_nicer/src/clistopts.cpp b/plugins/Clist_nicer/src/clistopts.cpp index ce0708eb27..c2aa4a74d8 100644 --- a/plugins/Clist_nicer/src/clistopts.cpp +++ b/plugins/Clist_nicer/src/clistopts.cpp @@ -38,7 +38,7 @@ INT_PTR CALLBACK DlgProcGenOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lP {
MCONTACT hContact = wParam;
DBCONTACTWRITESETTING *ws = (DBCONTACTWRITESETTING *)lParam;
- if (hContact == NULL && ws != NULL && ws->szModule != NULL && ws->szSetting != NULL && strcmp(ws->szModule, "CList") == 0 && strcmp(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg))
+ if (hContact == NULL && ws != nullptr && ws->szModule != nullptr && ws->szSetting != nullptr && strcmp(ws->szModule, "CList") == 0 && strcmp(ws->szSetting, "UseGroups") == 0 && IsWindowVisible(hwndDlg))
CheckDlgButton(hwndDlg, IDC_DISABLEGROUPS, ws->value.bVal == 0 ? BST_CHECKED : BST_UNCHECKED);
}
break;
diff --git a/plugins/Clist_nicer/src/clisttray.cpp b/plugins/Clist_nicer/src/clisttray.cpp index 7196bb68e4..7669cfc678 100644 --- a/plugins/Clist_nicer/src/clisttray.cpp +++ b/plugins/Clist_nicer/src/clisttray.cpp @@ -44,31 +44,31 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
return pcli->pfnTrayIconSetBaseInfo(hIcon, szChangedProto);
}
- if (pcli->trayIcon == NULL || pcli->trayIcon[0].szProto == NULL) {
- iIcon = IconFromStatusMode(NULL, averageMode, 0, &hIcon);
+ if (pcli->trayIcon == nullptr || pcli->trayIcon[0].szProto == nullptr) {
+ iIcon = IconFromStatusMode(nullptr, averageMode, 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
}
pcli->pfnTrayIconDestroy(hwnd);
pcli->pfnTrayIconInit(hwnd);
}
else {
- iIcon = IconFromStatusMode(NULL, averageMode, 0, &hIcon);
+ iIcon = IconFromStatusMode(nullptr, averageMode, 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
}
}
else {
switch (db_get_b(NULL, "CList", "TrayIcon", SETTING_TRAYICON_DEFAULT)) {
case SETTING_TRAYICON_CYCLE:
iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
- pcli->cycleTimerId = SetTimer(NULL, 0, db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, pcli->pfnTrayCycleTimerProc);
+ pcli->cycleTimerId = SetTimer(nullptr, 0, db_get_w(NULL, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, pcli->pfnTrayCycleTimerProc);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
case SETTING_TRAYICON_MULTI:
if (!pcli->trayIcon)
- pcli->pfnTrayIconRemove(NULL, NULL);
+ pcli->pfnTrayIconRemove(nullptr, nullptr);
else if (db_get_b(NULL, "CList", "AlwaysMulti", SETTING_ALWAYSMULTI_DEFAULT)) {
iIcon = IconFromStatusMode(szChangedProto, CallProtoService(szChangedProto, PS_GETSTATUS, 0, 0), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
@@ -82,14 +82,14 @@ int TrayCalcChanged(const char *szChangedProto, int averageMode, int netProtoCou ptrA szProto(db_get_sa(NULL, "CList", "PrimaryStatus"));
iIcon = IconFromStatusMode(szProto, szProto ? CallProtoService(szProto, PS_GETSTATUS, 0, 0) : CallService(MS_CLIST_GETSTATUSMODE, 0, 0), 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
}
}
}
else {
- iIcon = IconFromStatusMode(NULL, averageMode, 0, &hIcon);
+ iIcon = IconFromStatusMode(nullptr, averageMode, 0, &hIcon);
hIcon = (hIcon) ? CopyIcon(hIcon) : ImageList_GetIcon(hCListImages, iIcon, ILD_NORMAL);
- return pcli->pfnTrayIconSetBaseInfo(hIcon, NULL);
+ return pcli->pfnTrayIconSetBaseInfo(hIcon, nullptr);
}
return -1;
diff --git a/plugins/Clist_nicer/src/clnplus.cpp b/plugins/Clist_nicer/src/clnplus.cpp index b150537963..789f599d34 100644 --- a/plugins/Clist_nicer/src/clnplus.cpp +++ b/plugins/Clist_nicer/src/clnplus.cpp @@ -11,7 +11,7 @@ void RemoveFromTaskBar(HWND hWnd)
{
CComPtr<ITaskbarList> pTaskbarList;
- if (SUCCEEDED(pTaskbarList.CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER)))
+ if (SUCCEEDED(pTaskbarList.CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER)))
if (SUCCEEDED(pTaskbarList->HrInit()))
pTaskbarList->DeleteTab(hWnd);
}
@@ -19,7 +19,7 @@ void RemoveFromTaskBar(HWND hWnd) void AddToTaskBar(HWND hWnd)
{
CComPtr<ITaskbarList> pTaskbarList;
- if (SUCCEEDED(pTaskbarList.CoCreateInstance(CLSID_TaskbarList, NULL, CLSCTX_INPROC_SERVER)))
+ if (SUCCEEDED(pTaskbarList.CoCreateInstance(CLSID_TaskbarList, nullptr, CLSCTX_INPROC_SERVER)))
if (SUCCEEDED(pTaskbarList->HrInit()))
pTaskbarList->AddTab(hWnd);
}
diff --git a/plugins/Clist_nicer/src/clui.cpp b/plugins/Clist_nicer/src/clui.cpp index 85bd05e0a4..9bdcd016e6 100644 --- a/plugins/Clist_nicer/src/clui.cpp +++ b/plugins/Clist_nicer/src/clui.cpp @@ -79,8 +79,8 @@ POINT g_oldPos = { 0 }; int during_sizing = 0; extern int dock_prevent_moving; -static HDC hdcLockedPoint = 0; -static HBITMAP hbmLockedPoint = 0, hbmOldLockedPoint = 0; +static HDC hdcLockedPoint = nullptr; +static HBITMAP hbmLockedPoint = nullptr, hbmOldLockedPoint = nullptr; HICON overlayicons[10]; @@ -118,7 +118,7 @@ static void LayoutButtons(HWND hwnd, RECT *rc) BYTE delta = left_offset + right_offset; ButtonItem *btnItems = g_ButtonItems; - if (rc == NULL) + if (rc == nullptr) GetClientRect(hwnd, &rect); else rect = *rc; @@ -130,15 +130,15 @@ static void LayoutButtons(HWND hwnd, RECT *rc) LONG x = (btnItems->xOff >= 0) ? rect.left + btnItems->xOff : rect.right - abs(btnItems->xOff); LONG y = (btnItems->yOff >= 0) ? rect.top + btnItems->yOff : rect.bottom - cfg::dat.statusBarHeight; - SetWindowPos(btnItems->hWnd, 0, x, y, btnItems->width, btnItems->height, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW); + SetWindowPos(btnItems->hWnd, nullptr, x, y, btnItems->width, btnItems->height, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW); btnItems = btnItems->nextItem; } } - SetWindowPos(hTbMenu, 0, 2 + left_offset, rect.bottom - cfg::dat.statusBarHeight - 21 - 1, + SetWindowPos(hTbMenu, nullptr, 2 + left_offset, rect.bottom - cfg::dat.statusBarHeight - 21 - 1, 21 * 3, 21 + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW); - SetWindowPos(hTbGlobalStatus, 0, left_offset + (3 * 21) + 3, rect.bottom - cfg::dat.statusBarHeight - 21 - 1, + SetWindowPos(hTbGlobalStatus, nullptr, left_offset + (3 * 21) + 3, rect.bottom - cfg::dat.statusBarHeight - 21 - 1, rect.right - delta - (3 * 21 + 5), 21 + 1, SWP_NOACTIVATE | SWP_NOZORDER | SWP_NOCOPYBITS | SWP_NOREDRAW); } @@ -152,7 +152,7 @@ static int FS_FontsChanged(WPARAM, LPARAM) g_hPenCLUIFrames = CreatePen(PS_SOLID, 1, clr_cluiframes); pcli->pfnClcOptionsChanged(); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -166,7 +166,7 @@ static HWND PreCreateCLC(HWND parent) | (db_get_b(NULL, "CList", "HideOffline", SETTING_HIDEOFFLINE_DEFAULT) ? CLS_HIDEOFFLINE : 0) | (db_get_b(NULL, "CList", "HideEmptyGroups", SETTING_HIDEEMPTYGROUPS_DEFAULT) ? CLS_HIDEEMPTYGROUPS : 0) | CLS_MULTICOLUMN, - 0, 0, 0, 0, parent, NULL, g_hInst, (LPVOID)0xff00ff00); + 0, 0, 0, 0, parent, nullptr, g_hInst, (LPVOID)0xff00ff00); cfg::clcdat = (struct ClcData *)GetWindowLongPtr(pcli->hwndContactTree, 0); return pcli->hwndContactTree; @@ -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)0, g_hInst, NULL); + frame.hWnd = CreateWindowExA(0, "EventAreaClass", "evt", WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)nullptr, g_hInst, nullptr); g_hwndEventArea = frame.hWnd; hNotifyFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0); CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hNotifyFrame, FU_FMPOS); @@ -224,15 +224,15 @@ static int CluiModulesLoaded(WPARAM, LPARAM) return 0; } -static HICON hIconSaved = 0; +static HICON hIconSaved = nullptr; void ClearIcons(int mode) { for (int i = IDI_OVL_OFFLINE; i <= IDI_OVL_OUTTOLUNCH; i++) { - if (overlayicons[i - IDI_OVL_OFFLINE] != 0) { + if (overlayicons[i - IDI_OVL_OFFLINE] != nullptr) { if (mode) DestroyIcon(overlayicons[i - IDI_OVL_OFFLINE]); - overlayicons[i - IDI_OVL_OFFLINE] = 0; + overlayicons[i - IDI_OVL_OFFLINE] = nullptr; } } } @@ -259,7 +259,7 @@ static void InitIcoLib() Icon_RegisterT(g_hInst, LPGENW("Contact list") L"/" LPGENW("Overlay icons"), &icon, 1); } - PROTOACCOUNT **accs = NULL; + PROTOACCOUNT **accs = nullptr; int p_count = 0; Proto_EnumAccounts(&p_count, &accs); for (int k = 0; k < p_count; k++) { @@ -281,14 +281,14 @@ static int IcoLibChanged(WPARAM, LPARAM) void CreateButtonBar(HWND hWnd) { - hTbMenu = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU)IDC_TBMENU, g_hInst, NULL); + hTbMenu = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU)IDC_TBMENU, g_hInst, nullptr); CustomizeButton(hTbMenu, false, false, false); SetWindowText(hTbMenu, TranslateT("Menu")); SendMessage(hTbMenu, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_OTHER_MAINMENU)); SendMessage(hTbMenu, BUTTONSETSENDONDOWN, TRUE, 0); SendMessage(hTbMenu, BUTTONADDTOOLTIP, (WPARAM)LPGEN("Open main menu"), 0); - hTbGlobalStatus = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU)IDC_TBGLOBALSTATUS, g_hInst, NULL); + hTbGlobalStatus = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20, hWnd, (HMENU)IDC_TBGLOBALSTATUS, g_hInst, nullptr); CustomizeButton(hTbGlobalStatus, false, false, false); SetWindowText(hTbGlobalStatus, TranslateT("Offline")); SendMessage(hTbGlobalStatus, BM_SETIMAGE, IMAGE_ICON, (LPARAM)Skin_LoadIcon(SKINICON_STATUS_OFFLINE)); @@ -379,10 +379,10 @@ void SetDBButtonStates(MCONTACT hPassedContact) ButtonItem *buttonItem = g_ButtonItems; MCONTACT hContact = 0, hFinalContact = 0; char *szModule, *szSetting; - ClcContact *contact = 0; + ClcContact *contact = nullptr; if (cfg::clcdat && hPassedContact == 0) { - pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, NULL); + pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); if (contact && contact->type == CLCIT_CONTACT) { hContact = contact->hContact; } @@ -475,7 +475,7 @@ void BlitWallpaper(HDC hdc, RECT *rc, struct ClcData *dat) BITMAP *bmp = &cfg::dat.bminfoBg; LONG clip = cfg::dat.bClipBorder; - if (dat == 0) + if (dat == nullptr) return; SetStretchBltMode(hdc, HALFTONE); @@ -545,7 +545,7 @@ void BlitWallpaper(HDC hdc, RECT *rc, struct ClcData *dat) for (x = rc->left; x < maxx; x += destw) StretchBlt(hdc, x, y, destw, desth, cfg::dat.hdcPic, bitx, bity, bmp->bmWidth, bmp->bmHeight, SRCCOPY); } - SelectClipRgn(hdc, NULL); + SelectClipRgn(hdc, nullptr); DeleteObject(my_rgn); } @@ -586,7 +586,7 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc) if (Docking_IsDocked(0, 0)) return; - if (hFrameContactTree == 0) + if (hFrameContactTree == nullptr) return; maxHeight = db_get_b(NULL, "CLUI", "MaxSizeHeight", 75); @@ -632,14 +632,14 @@ static void sttProcessResize(HWND hwnd, NMCLISTCONTROL *nmc) return; } KillTimer(hwnd, TIMERID_AUTOSIZE); - SetTimer(hwnd, TIMERID_AUTOSIZE, 100, 0); + SetTimer(hwnd, TIMERID_AUTOSIZE, 100, nullptr); } int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) { switch (nmcsbcd->hdr.code) { case NM_COOLSB_CUSTOMDRAW: - static HDC hdcScroll = 0; + static HDC hdcScroll = nullptr; static HBITMAP hbmScroll, hbmScrollOld; static LONG scrollLeft, scrollRight, scrollHeight, scrollYmin, scrollYmax; @@ -654,9 +654,9 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) case CDDS_ITEMPREPAINT: HDC hdc = nmcsbcd->hdc; - StatusItems_t *item = 0, *arrowItem = 0; + StatusItems_t *item = nullptr, *arrowItem = nullptr; UINT uItemID = ID_EXTBKSCROLLBACK; - HRGN rgn = 0; + HRGN rgn = nullptr; RECT rc; GetWindowRect(pcli->hwndContactTree, &rc); @@ -709,7 +709,7 @@ int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd) DrawFrameControl(hdcScroll, &nmcsbcd->rect, DFC_SCROLL, (nmcsbcd->uItem == HTSCROLL_UP ? DFCS_SCROLLUP : DFCS_SCROLLDOWN) | dfcFlags); if (rgn) { - SelectClipRgn(hdcScroll, NULL); + SelectClipRgn(hdcScroll, nullptr); DeleteObject(rgn); } } @@ -738,7 +738,7 @@ static void ShowCLUI(HWND hwnd) SendMessage(hwnd, WM_SETREDRAW, FALSE, FALSE); if (!db_get_b(NULL, "CLUI", "ShowMainMenu", SETTING_SHOWMAINMENU_DEFAULT)) - SetMenu(pcli->hwndContactList, NULL); + SetMenu(pcli->hwndContactList, nullptr); if (state == SETTING_STATE_NORMAL) { SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0); ShowWindow(pcli->hwndContactList, SW_SHOWNORMAL); @@ -782,7 +782,7 @@ 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, NULL, flags, 0, 0, 0, 0, hwnd, NULL, g_hInst, NULL); + pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, hwnd, nullptr, g_hInst, nullptr); if (flags & WS_VISIBLE) { ShowWindow(pcli->hwndStatus, SW_SHOW); SendMessage(pcli->hwndStatus, WM_SIZE, 0, 0); @@ -798,7 +798,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l if (!cfg::dat.bFirstRun) ConfigureEventArea(); ConfigureCLUIGeometry(0); - CluiProtocolStatusChanged(0, 0); + CluiProtocolStatusChanged(0, nullptr); for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++) statusNames[i - ID_STATUS_OFFLINE] = pcli->pfnGetStatusModeDescription(i, 0); @@ -853,7 +853,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l SetWindowLongPtr(pcli->hwndContactList, GWL_EXSTYLE, style); ApplyCLUIBorderStyle(); - SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE); + SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE); } if (cfg::dat.bSkinnedButtonMode) @@ -906,7 +906,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l PAINTSTRUCT ps; RECT rcFrame, rcClient; HDC hdc; - HRGN rgn = 0; + HRGN rgn = nullptr; HDC hdcReal = BeginPaint(hwnd, &ps); if (during_sizing) @@ -948,7 +948,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l CopyRect(&rcFrame, &rcClient); if (g_CLUISkinnedBkColor) { if (cfg::dat.fOnDesktop) { - HDC dc = GetDC(0); + HDC dc = GetDC(nullptr); RECT rcWin; GetWindowRect(hwnd, &rcWin); @@ -990,7 +990,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l rcFrame.top += (cfg::dat.topOffset - 1); if (cfg::dat.dwFlags & CLUI_FRAME_CLISTSUNKEN) { - if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) { + if (cfg::dat.bWallpaperMode && cfg::clcdat != nullptr) { InflateRect(&rcFrame, -1, -1); if (cfg::dat.bmpBackground) BlitWallpaper(hdc, &rcFrame, cfg::clcdat); @@ -1002,7 +1002,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l rcFrame.bottom -= (cfg::dat.bottomOffset); DrawEdge(hdc, &rcFrame, BDR_SUNKENOUTER, BF_RECT); } - else if (cfg::dat.bWallpaperMode && cfg::clcdat != NULL) { + else if (cfg::dat.bWallpaperMode && cfg::clcdat != nullptr) { if (cfg::dat.bmpBackground) BlitWallpaper(hdc, &rcFrame, cfg::clcdat); cfg::dat.ptW.x = cfg::dat.ptW.y = 0; @@ -1011,7 +1011,7 @@ LRESULT CALLBACK ContactListWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l skipbg: BitBlt(hdcReal, 0, 0, rcClient.right - rcClient.left, rcClient.bottom - rcClient.top, hdc, 0, 0, SRCCOPY); if (rgn) { - SelectClipRgn(hdc, NULL); + SelectClipRgn(hdc, nullptr); DeleteObject(rgn); } EndPaint(hwnd, &ps); @@ -1049,12 +1049,12 @@ skipbg: break; case WM_WINDOWPOSCHANGING: - if (pcli->hwndContactList != NULL) { + if (pcli->hwndContactList != nullptr) { WINDOWPOS *wp = (WINDOWPOS *)lParam; if (!wp || (wp->flags & SWP_NOSIZE)) return FALSE; - RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW); + RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); during_sizing = true; new_window_rect.left = 0; @@ -1064,12 +1064,12 @@ skipbg: 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); + SetWindowPos(pcli->hwndStatus, nullptr, 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); + RedrawWindow(pcli->hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW); } else cfg::dat.statusBarHeight = 0; @@ -1093,10 +1093,10 @@ skipbg: if (IsZoomed(hwnd)) ShowWindow(hwnd, SW_SHOWNORMAL); - if (pcli->hwndContactList != 0) { + if (pcli->hwndContactList != nullptr) { SendMessage(hwnd, WM_ENTERSIZEMOVE, 0, 0); GetWindowRect(hwnd, &rc); - WINDOWPOS wp = { 0 }; + WINDOWPOS wp = {}; wp.cx = rc.right - rc.left; wp.cy = rc.bottom - rc.top; wp.x = rc.left; @@ -1151,7 +1151,7 @@ skipbg: if ((HWND)wParam != hwnd) if (cfg::dat.isTransparent) if (transparentFocus) - SetTimer(hwnd, TM_AUTOALPHA, 250, NULL); + SetTimer(hwnd, TM_AUTOALPHA, 250, nullptr); } else { if (cfg::dat.isTransparent) { @@ -1169,7 +1169,7 @@ skipbg: if (!transparentFocus && GetForegroundWindow() != hwnd) { 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); + SetTimer(hwnd, TM_AUTOALPHA, 250, nullptr); } } return DefWindowProc(hwnd, msg, wParam, lParam); @@ -1239,7 +1239,7 @@ skipbg: } 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); + SetWindowPos(hwnd, nullptr, 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); } @@ -1273,7 +1273,7 @@ skipbg: SetLayeredWindowAttributes(hwnd, cfg::dat.bFullTransparent ? (COLORREF)cfg::dat.colorkey : RGB(0, 0, 0), (BYTE)sourceAlpha, LWA_ALPHA | (cfg::dat.bFullTransparent ? LWA_COLORKEY : 0)); noRecurse = 1; ShowWindow(hwnd, SW_SHOW); - RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN); noRecurse = 0; } else { @@ -1335,11 +1335,11 @@ skipbg: WPARAM wwParam = 0; LPARAM llParam = 0; MCONTACT hContact = 0; - ClcContact *contact = 0; + ClcContact *contact = nullptr; int serviceFailure = FALSE; if (cfg::clcdat) { - pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, NULL); + pcli->pfnGetRowByIndex(cfg::clcdat, cfg::clcdat->selection, &contact, nullptr); if (contact && contact->type == CLCIT_CONTACT) hContact = contact->hContact; } @@ -1413,11 +1413,11 @@ skipbg: SendMessage(item->hWnd, BM_SETCHECK, 0, 0); } if (!contactOK) - MessageBox(0, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat."), TranslateT("Parameter mismatch"), MB_OK); + MessageBox(nullptr, TranslateT("The requested action requires a valid contact selection. Please select a contact from the contact list and repeat."), TranslateT("Parameter mismatch"), MB_OK); if (serviceFailure) { wchar_t szError[512]; mir_snwprintf(szError, TranslateT("The service %S specified by the %S button definition was not found. You may need to install additional plugins."), item->szService, item->szName); - MessageBox(NULL, szError, TranslateT("Service failure"), MB_OK); + MessageBox(nullptr, szError, TranslateT("Service failure"), MB_OK); } break; } @@ -1431,14 +1431,14 @@ skipbg: case IDC_TBTOPMENU: case IDC_STBTOPMENU: GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc); - TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBMENU ? rc.top : rc.bottom, 0, hwnd, NULL); + TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBMENU ? rc.top : rc.bottom, 0, hwnd, nullptr); return 0; case IDC_TBTOPSTATUS: case IDC_STBTOPSTATUS: case IDC_TBGLOBALSTATUS: GetButtonRect(GetDlgItem(hwnd, LOWORD(wParam)), &rc); - TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBGLOBALSTATUS ? rc.top : rc.bottom, 0, hwnd, NULL); + TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, rc.left, LOWORD(wParam) == IDC_TBGLOBALSTATUS ? rc.top : rc.bottom, 0, hwnd, nullptr); return 0; case IDC_TBSOUND: @@ -1493,7 +1493,7 @@ buttons_done: case POPUP_NEWGROUP: SendMessage(pcli->hwndContactTree, CLM_SETHIDEEMPTYGROUPS, 0, 0); SendMessage(pcli->hwndContactTree, CLM_SETUSEGROUPS, 1, 0); - Clist_GroupCreate(NULL, NULL); + Clist_GroupCreate(NULL, nullptr); break; case POPUP_HIDEOFFLINE: case IDC_TBHIDEOFFLINE: @@ -1530,7 +1530,7 @@ buttons_done: break; } if (dwOldFlags != cfg::dat.dwFlags) { - InvalidateRect(pcli->hwndContactTree, NULL, FALSE); + InvalidateRect(pcli->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(); @@ -1598,7 +1598,7 @@ buttons_done: } if (PtInRect(&rc, pt)) { HMENU hMenu = Menu_BuildGroupMenu(); - TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL); + TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, nullptr); Menu_DestroyNestedMenu(hMenu); return 0; } @@ -1609,7 +1609,7 @@ buttons_done: hMenu = Menu_GetMainMenu(); else hMenu = Menu_GetStatusMenu(); - TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL); + TrackPopupMenu(hMenu, TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, nullptr); return 0; } } @@ -1627,7 +1627,7 @@ buttons_done: { LPDRAWITEMSTRUCT dis = (LPDRAWITEMSTRUCT)lParam; - if (hbmLockedPoint == 0) { + if (hbmLockedPoint == nullptr) { hdcLockedPoint = CreateCompatibleDC(dis->hDC); hbmLockedPoint = CreateCompatibleBitmap(dis->hDC, 5, 5); hbmOldLockedPoint = reinterpret_cast<HBITMAP>(SelectObject(hdcLockedPoint, hbmLockedPoint)); @@ -1674,14 +1674,14 @@ buttons_done: x += (cfg::dat.bEqualSections ? (cfg::dat.bCLeft / 2) : cfg::dat.bCLeft); else if (pd->protopos == nParts - 1) x -= (cfg::dat.bCRight / 2); - DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - 16) >> 1, hIcon, 16, 16, 0, NULL, DI_NORMAL); + DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - 16) >> 1, hIcon, 16, 16, 0, nullptr, DI_NORMAL); IcoLib_ReleaseIcon(hIcon); if (db_get_b(NULL, "CLUI", "sbar_showlocked", 1)) { if (db_get_b(NULL, szProto, "LockMainStatus", 0)) { hIcon = Skin_LoadIcon(SKINICON_OTHER_STATUS_LOCKED); - if (hIcon != NULL) { - DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - 16) >> 1, hIcon, 16, 16, 0, NULL, DI_NORMAL); + if (hIcon != nullptr) { + DrawIconEx(dis->hDC, x, (dis->rcItem.top + dis->rcItem.bottom - 16) >> 1, hIcon, 16, 16, 0, nullptr, DI_NORMAL); IcoLib_ReleaseIcon(hIcon); } } @@ -1739,11 +1739,11 @@ buttons_done: show_on_first_autosize = FALSE; ShowCLUI(hwnd); } - RedrawWindow(hwnd, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; case CLUIINTM_STATUSBARUPDATE: - CluiProtocolStatusChanged(0, 0); + CluiProtocolStatusChanged(0, nullptr); return 0; case WM_THEMECHANGED: @@ -1755,13 +1755,13 @@ buttons_done: SelectObject(cfg::dat.hdcBg, cfg::dat.hbmBgOld); DeleteObject(cfg::dat.hbmBg); DeleteDC(cfg::dat.hdcBg); - cfg::dat.hdcBg = NULL; + cfg::dat.hdcBg = nullptr; } if (cfg::dat.bmpBackground) { SelectObject(cfg::dat.hdcPic, cfg::dat.hbmPicOld); DeleteDC(cfg::dat.hdcPic); DeleteObject(cfg::dat.bmpBackground); - cfg::dat.bmpBackground = NULL; + cfg::dat.bmpBackground = nullptr; } FreeProtocolData(); if (hdcLockedPoint) { @@ -1795,7 +1795,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, NULL); + TrackPopupMenu(Menu_GetMainMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr); return 0; } @@ -1803,7 +1803,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, NULL); + TrackPopupMenu(Menu_GetStatusMenu(), TPM_TOPALIGN | TPM_LEFTALIGN | TPM_LEFTBUTTON, pt.x, pt.y, 0, pcli->hwndContactList, nullptr); return 0; } @@ -1820,10 +1820,10 @@ void LoadCLUIModule(void) wndclass.cbClsExtra = 0; wndclass.cbWndExtra = 0; wndclass.hInstance = g_hInst; - wndclass.hIcon = 0; - wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass.hIcon = nullptr; + wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW); wndclass.hbrBackground = (HBRUSH)COLOR_3DFACE; - wndclass.lpszMenuName = 0; + wndclass.lpszMenuName = nullptr; wndclass.lpszClassName = L"EventAreaClass"; RegisterClass(&wndclass); @@ -1840,7 +1840,7 @@ void LoadCLUIModule(void) CreateServiceFunction(MS_CLUI_SHOWSTATUSMENU, CLN_ShowStatusMenu); if (db_get_b(NULL, "CLUI", "FloaterMode", 0)) { - MessageBox(NULL, + MessageBox(nullptr, TranslateT("You need the FloatingContacts plugin, cause the embedded floating contacts were removed."), TranslateT("Warning"), MB_OK | MB_ICONWARNING); db_unset(NULL, "CLUI", "FloaterMode"); @@ -1887,7 +1887,7 @@ void FS_RegisterFonts() strncpy(fid.dbSettingsGroup, "CLC", 5); fid.flags = FIDF_DEFAULTVALID | FIDF_ALLOWEFFECTS | FIDF_APPENDNAME | FIDF_SAVEPOINTSIZE; - HDC hdc = GetDC(NULL); + HDC hdc = GetDC(nullptr); for (int i = 0; i < _countof(clistFontDescr); i++) { LOGFONT lf; pcli->pfnGetFontSetting(i, &lf, &fid.deffontsettings.colour); @@ -1909,7 +1909,7 @@ void FS_RegisterFonts() fid.order = i; Font_RegisterW(&fid); } - ReleaseDC(NULL, hdc); + ReleaseDC(nullptr, hdc); // and colours ColourIDW colourid = { 0 }; diff --git a/plugins/Clist_nicer/src/cluiframes.cpp b/plugins/Clist_nicer/src/cluiframes.cpp index b79eb720a5..0a2a2d1499 100644 --- a/plugins/Clist_nicer/src/cluiframes.cpp +++ b/plugins/Clist_nicer/src/cluiframes.cpp @@ -34,7 +34,7 @@ extern HANDLE hThreadMFUpdate; void MF_UpdateThread(LPVOID); HANDLE hStatusBarShowToolTipEvent, hStatusBarHideToolTipEvent; -HANDLE g_hEventThread = 0; +HANDLE g_hEventThread = nullptr; LOGFONT TitleBarLogFont = { 0 }; @@ -59,11 +59,11 @@ int CLUIFrameResizeFloatingFrame(int framepos); static int CLUIFramesReSort(); boolean FramesSysNotStarted = TRUE; -HPEN g_hPenCLUIFrames = 0; +HPEN g_hPenCLUIFrames = nullptr; static SortData g_sd[MAX_FRAMES]; -static HHOOK g_hFrameHook = 0; +static HHOOK g_hFrameHook = nullptr; static int sortfunc(const void *a, const void *b) { @@ -77,9 +77,9 @@ static int sortfunc(const void *a, const void *b) return 0; } -static FRAMEWND *Frames = NULL; +static FRAMEWND *Frames = nullptr; -FRAMEWND *wndFrameCLC = NULL, *wndFrameEventArea = NULL, *wndFrameViewMode = NULL; +FRAMEWND *wndFrameCLC = nullptr, *wndFrameEventArea = nullptr, *wndFrameViewMode = nullptr; static int nFramescount = 0; static int alclientFrame = -1;//for fast access to frame with alclient properties @@ -133,8 +133,8 @@ int __forceinline btoint(bool b) static FRAMEWND* FindFrameByWnd(HWND hwnd) { - if (hwnd == NULL) - return NULL; + if (hwnd == nullptr) + return nullptr; for (int i = 0; i < nFramescount; i++) { FRAMEWND &F = Frames[i]; @@ -142,12 +142,12 @@ static FRAMEWND* FindFrameByWnd(HWND hwnd) return &F; } - return NULL; + return nullptr; } static void DockThumbs(FRAMEWND *pThumbLeft, FRAMEWND *pThumbRight, BOOL) { - if ((pThumbRight->dockOpt.hwndLeft == NULL) && (pThumbLeft->dockOpt.hwndRight == NULL)) { + if ((pThumbRight->dockOpt.hwndLeft == nullptr) && (pThumbLeft->dockOpt.hwndRight == nullptr)) { pThumbRight->dockOpt.hwndLeft = pThumbLeft->ContainerWnd; pThumbLeft->dockOpt.hwndRight = pThumbRight->ContainerWnd; } @@ -155,20 +155,20 @@ static void DockThumbs(FRAMEWND *pThumbLeft, FRAMEWND *pThumbRight, BOOL) static void UndockThumbs(FRAMEWND *pThumb1, FRAMEWND *pThumb2) { - if ((pThumb1 == NULL) || (pThumb2 == NULL)) + if ((pThumb1 == nullptr) || (pThumb2 == nullptr)) return; if (pThumb1->dockOpt.hwndRight == pThumb2->ContainerWnd) - pThumb1->dockOpt.hwndRight = NULL; + pThumb1->dockOpt.hwndRight = nullptr; if (pThumb1->dockOpt.hwndLeft == pThumb2->ContainerWnd) - pThumb1->dockOpt.hwndLeft = NULL; + pThumb1->dockOpt.hwndLeft = nullptr; if (pThumb2->dockOpt.hwndRight == pThumb1->ContainerWnd) - pThumb2->dockOpt.hwndRight = NULL; + pThumb2->dockOpt.hwndRight = nullptr; if (pThumb2->dockOpt.hwndLeft == pThumb1->ContainerWnd) - pThumb2->dockOpt.hwndLeft = NULL; + pThumb2->dockOpt.hwndLeft = nullptr; } BOOLEAN bMoveTogether; @@ -191,7 +191,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) RECT rcBottom; int frmidx = 0; - if (pThumb == NULL) + if (pThumb == nullptr) return; sizeScreen.cx = GetSystemMetrics(SM_CXSCREEN); @@ -208,7 +208,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) int nNewY = nY < nOffs ? 0 : nY; nNewY = nNewY >(sizeScreen.cy - nHeight - nOffs) ? (sizeScreen.cy - nHeight) : nNewY; - bool bLeading = pThumb->dockOpt.hwndRight != NULL; + bool bLeading = pThumb->dockOpt.hwndRight != nullptr; if (bMoveTogether) { UndockThumbs(pThumb, FindFrameByWnd(pThumb->dockOpt.hwndLeft)); @@ -223,7 +223,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) fakeTaskBarWindow.ContainerWnd = hWndExplorerToolBar; fakeTaskBarWindow.floating = TRUE; - while (pCurThumb != NULL) { + while (pCurThumb != nullptr) { if (pCurThumb->floating) { if (pCurThumb != pThumb) { @@ -359,7 +359,7 @@ static void PositionThumb(FRAMEWND *pThumb, short nX, short nY) nNewX = nNewX > (sizeScreen.cx - nWidth - nOffs) ? (sizeScreen.cx - nWidth) : nNewX; nNewY = nNewY < nOffs ? 0 : nNewY; nNewY = nNewY > (sizeScreen.cy - nHeight - nOffs) ? (sizeScreen.cy - nHeight) : nNewY; - SetWindowPos(pThumb->ContainerWnd, 0, nNewX, nNewY, 0, 0, SWP_NOSIZE | SWP_NOZORDER); + SetWindowPos(pThumb->ContainerWnd, nullptr, nNewX, nNewY, 0, 0, SWP_NOSIZE | SWP_NOZORDER); // OK, move all docked thumbs if (bMoveTogether) { @@ -397,7 +397,7 @@ void GetBorderSize(HWND hwnd, RECT *rect) //append string char __forceinline *AS(char *str, const char *setting, char *addstr) { - if (str != NULL) { + if (str != nullptr) { mir_strcpy(str, setting); mir_strcat(str, addstr); } @@ -467,7 +467,7 @@ int DBStoreFrameSettingsAtPos(int pos, int Frameid) int LocateStorePosition(int Frameid, int maxstored) { - if (Frames[Frameid].name == NULL) return -1; + if (Frames[Frameid].name == nullptr) return -1; for (int i = 0; i < maxstored; i++) { char settingname[255]; @@ -572,7 +572,7 @@ int CLUIFramesGetalClientFrame(void) static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, int frameid, bool bMain) { HGENMENU res = (bMain) ? Menu_AddMainMenuItem(pmi) : Menu_AddContextFrameMenuItem(pmi); - if (pmi->pszService != NULL) + if (pmi->pszService != nullptr) Menu_ConfigureItem(res, MCI_OPT_EXECPARAM, frameid); return res; } @@ -580,7 +580,7 @@ static HGENMENU addFrameMenuItem(TMO_MenuItem *pmi, int frameid, bool bMain) HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, bool bMain) { if (FramesSysNotStarted) - return NULL; + return nullptr; int framepos = id2pos(frameid); FrameMenuHandles &fmh = (frameid == -1) ? cont : Frames[framepos].MenuHandles; @@ -595,7 +595,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, boo popuppos += 100000; - mi.hIcolibItem = NULL; + mi.hIcolibItem = nullptr; mi.position = popuppos++; mi.name.a = LPGEN("&Visible"); mi.flags = CMIF_SYSTEM | CMIF_CHECKED; @@ -648,7 +648,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, boo mi.position = popuppos++; mi.name.a = LPGEN("&Align"); mi.flags = CMIF_SYSTEM; - mi.pszService = NULL; + mi.pszService = nullptr; fmh.MIAlignRoot = addFrameMenuItem(&mi, frameid, bMain); // align top @@ -674,7 +674,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, boo mi.root = root; mi.position = popuppos++; mi.name.a = LPGEN("&Position"); - mi.pszService = NULL; + mi.pszService = nullptr; mi.root = addFrameMenuItem(&mi, frameid, bMain); mi.position = popuppos++; @@ -686,7 +686,7 @@ HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popuppos, boo mi.name.a = LPGEN("&Down"); mi.pszService = CLUIFRAMESMOVEDOWN; addFrameMenuItem(&mi, frameid, bMain); - return 0; + return nullptr; } static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM) @@ -858,7 +858,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) lck.unlock(); CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - SetWindowPos(Frames[pos].TitleBar.hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); + SetWindowPos(Frames[pos].TitleBar.hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } return 0; @@ -878,7 +878,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) Frames[pos].TitleBar.tbname = (wParam & FO_UNICODETEXT) ? mir_wstrdup((LPWSTR)lParam) : mir_a2u((LPSTR)lParam); lck.unlock(); - if (Frames[pos].floating && (Frames[pos].TitleBar.tbname != NULL)) + if (Frames[pos].floating && (Frames[pos].TitleBar.tbname != nullptr)) SetWindowText(Frames[pos].ContainerWnd, Frames[pos].TitleBar.tbname); return 0; @@ -922,7 +922,7 @@ INT_PTR CLUIFramesSetFrameOptions(WPARAM wParam, LPARAM lParam) if (Frames[pos].height != oldHeight) { CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); if (Frames[pos].Skinned) - RedrawWindow(Frames[pos].hWnd, 0, 0, RDW_FRAME | RDW_UPDATENOW | RDW_INVALIDATE); + RedrawWindow(Frames[pos].hWnd, nullptr, nullptr, RDW_FRAME | RDW_UPDATENOW | RDW_INVALIDATE); } } else { @@ -983,10 +983,10 @@ INT_PTR CLUIFramesShowAllTitleBars(WPARAM, LPARAM) for (int i = 0; i < nFramescount; i++) { FRAMEWND &F = Frames[i]; F.TitleBar.ShowTitleBar = TRUE; - SetWindowPos(F.hWnd, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); + SetWindowPos(F.hWnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -998,10 +998,10 @@ INT_PTR CLUIFramesHideAllTitleBars(WPARAM, LPARAM) for (int i = 0; i < nFramescount; i++) { FRAMEWND &F = Frames[i]; F.TitleBar.ShowTitleBar = FALSE; - SetWindowPos(F.hWnd, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); + SetWindowPos(F.hWnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1026,7 +1026,7 @@ INT_PTR CLUIFramesShowHideFrame(WPARAM frameId, LPARAM) if (!Frames[pos].floating) CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1040,12 +1040,12 @@ INT_PTR CLUIFramesShowHideFrameTitleBar(WPARAM frameId, LPARAM) int pos = id2pos(frameId); if (pos >= 0 && (int)pos < nFramescount) { Frames[pos].TitleBar.ShowTitleBar = !Frames[pos].TitleBar.ShowTitleBar; - SetWindowPos(Frames[pos].hWnd, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); + SetWindowPos(Frames[pos].hWnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED); } } CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1120,7 +1120,7 @@ INT_PTR CLUIFramesSetAlign(WPARAM frameId, LPARAM lParam) CLUIFramesSetFrameOptions(MAKEWPARAM(FO_ALIGN, frameId), lParam); CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1184,7 +1184,7 @@ INT_PTR CLUIFramesSetUnSetBorder(WPARAM wParam, LPARAM) } CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, wParam), oldflags); - SetWindowPos(hw, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_DRAWFRAME | SWP_NOZORDER); + SetWindowPos(hw, nullptr, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_DRAWFRAME | SWP_NOZORDER); return 0; } @@ -1212,7 +1212,7 @@ INT_PTR CLUIFramesSetUnSetSkinned(WPARAM wParam, LPARAM) } CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, wParam), oldflags); - SetWindowPos(hw, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_DRAWFRAME | SWP_NOZORDER); + SetWindowPos(hw, nullptr, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE | SWP_DRAWFRAME | SWP_NOZORDER); return 0; } @@ -1254,11 +1254,11 @@ INT_PTR CLUIFramesCollapseUnCollapseFrame(WPARAM wParam, LPARAM) Frames[FrameId].collapsed = TRUE; } - SetWindowPos(pcli->hwndContactList, NULL, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE); + SetWindowPos(pcli->hwndContactList, nullptr, 0, 0, rc.right - rc.left, rc.bottom, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOMOVE); CLUIFramesStoreAllFrames(); lck.unlock(); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return 0; } @@ -1325,7 +1325,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, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); CLUIFramesStoreAllFrames(); return 0; } @@ -1349,7 +1349,7 @@ static int CLUIFramesLoadMainMenu() mi.hIcolibItem = F.TitleBar.hicon; mi.position = separator; mi.name.w = F.TitleBar.tbname ? F.TitleBar.tbname : F.name; - mi.pszService = 0; + mi.pszService = nullptr; g_frameMenus.insert(F.MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi)); CLUIFramesCreateMenuForFrame(F.id, F.MenuHandles.MainMenuItem, separator, true); CLUIFramesModifyMainMenuItems(F.id, 0); @@ -1390,7 +1390,7 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO HWND hwndParent = GetParent(hwnd); LRESULT result = 0; - if (pcli == NULL) + if (pcli == nullptr) return 0; if (hwndParent != pcli->hwndContactList || !cfg::dat.bSkinnedScrollbar) result = CallWindowProc(oldWndProc, hwnd, WM_NCPAINT, wParam, lParam); @@ -1398,8 +1398,8 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO return result; if (GetWindowLongPtr(hwnd, GWL_STYLE) & CLS_SKINNEDFRAME) { - StatusItems_t *item = (arStatusItems.getCount() != 0) ? (hasTitleBar ? arStatusItems[ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE] : arStatusItems[ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE]) : 0; - if (item == 0) + StatusItems_t *item = (arStatusItems.getCount() != 0) ? (hasTitleBar ? arStatusItems[ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE] : arStatusItems[ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE]) : nullptr; + if (item == nullptr) return 0; GetWindowRect(hwnd, &rcWindow); @@ -1452,12 +1452,12 @@ int FrameNCPaint(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BO int FrameNCCalcSize(HWND hwnd, WNDPROC oldWndProc, WPARAM wParam, LPARAM lParam, BOOL hasTitleBar) { - StatusItems_t *item = (arStatusItems.getCount() != 0) ? (hasTitleBar ? arStatusItems[ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE] : arStatusItems[ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE]) : 0; + StatusItems_t *item = (arStatusItems.getCount() != 0) ? (hasTitleBar ? arStatusItems[ID_EXTBKOWNEDFRAMEBORDERTB - ID_STATUS_OFFLINE] : arStatusItems[ID_EXTBKOWNEDFRAMEBORDER - ID_STATUS_OFFLINE]) : nullptr; LRESULT orig = oldWndProc ? CallWindowProc(oldWndProc, hwnd, WM_NCCALCSIZE, wParam, lParam) : 0; NCCALCSIZE_PARAMS *nccp = (NCCALCSIZE_PARAMS *)lParam; DWORD dwStyle = GetWindowLongPtr(hwnd, GWL_STYLE); - if (item == 0 || pcli == NULL) + if (item == nullptr || pcli == nullptr) return orig; if (item->IGNORED || !(dwStyle & CLS_SKINNEDFRAME) || GetParent(hwnd) != pcli->hwndContactList) @@ -1474,7 +1474,7 @@ static LRESULT CALLBACK FramesSubClassProc(HWND hwnd, UINT msg, WPARAM wParam, L { int i; - WNDPROC oldWndProc = 0; + WNDPROC oldWndProc = nullptr; BOOL hasTitleBar = FALSE; for (i = 0; i < nFramescount; i++) { @@ -1550,7 +1550,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) int style; CLISTFrame *clfrm = (CLISTFrame *)wParam; - if (pcli->hwndContactList == 0) return -1; + if (pcli->hwndContactList == nullptr) return -1; if (FramesSysNotStarted) return -1; if (clfrm->cbSize != sizeof(CLISTFrame)) return -1; @@ -1558,7 +1558,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) if (nFramescount >= MAX_FRAMES) return -1; - if (Frames == NULL) { + if (Frames == nullptr) { Frames = (FRAMEWND*)malloc(sizeof(FRAMEWND) * (MAX_FRAMES + 2)); memset(Frames, 0, (sizeof(FRAMEWND) * (MAX_FRAMES + 2))); } @@ -1580,7 +1580,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) 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, NULL)) { + if (GetCurrentThreadId() == GetWindowThreadProcessId(clfrm->hWnd, nullptr)) { if (clfrm->hWnd != pcli->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); @@ -1596,14 +1596,14 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) Frames[nFramescount].dwFlags = clfrm->Flags; - if (clfrm->name == NULL || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) { + if (clfrm->name == nullptr || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->wname) : mir_strlen(clfrm->name)) == 0) { wchar_t ptszClassName[256]; GetClassName(Frames[nFramescount].hWnd, ptszClassName, _countof(ptszClassName)); Frames[nFramescount].name = mir_wstrdup(ptszClassName); } else Frames[nFramescount].name = (clfrm->Flags & F_UNICODE) ? mir_wstrdup(clfrm->wname) : mir_a2u(clfrm->name); - if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == NULL + if (IsBadCodePtr((FARPROC)clfrm->TBname) || clfrm->TBname == nullptr || ((clfrm->Flags&F_UNICODE) ? mir_wstrlen(clfrm->TBwname) : mir_strlen(clfrm->TBname)) == 0) Frames[nFramescount].TitleBar.tbname = mir_wstrdup(Frames[nFramescount].name); else @@ -1624,13 +1624,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, NULL, g_hInst, NULL); + WS_CLIPCHILDREN, 0, 0, 0, 0, pcli->hwndContactList, nullptr, g_hInst, nullptr); SetWindowLongPtr(Frames[nFramescount].TitleBar.hwnd, GWLP_USERDATA, Frames[nFramescount].id); - Frames[nFramescount].TitleBar.hwndTip = CreateWindowExA(0, TOOLTIPS_CLASSA, NULL, WS_POPUP | TTS_NOPREFIX | TTS_ALWAYSTIP, + 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, NULL, g_hInst, NULL); + pcli->hwndContactList, nullptr, g_hInst, nullptr); SetWindowPos(Frames[nFramescount].TitleBar.hwndTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE); { @@ -1674,7 +1674,7 @@ INT_PTR CLUIFramesAddFrame(WPARAM wParam, LPARAM) Frames[nFramescount - 1].floating = FALSE; CLUIFrameSetFloat(retval, 1);//lparam=1 use stored width and height } - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); return retval; } @@ -1691,11 +1691,11 @@ static INT_PTR CLUIFramesRemoveFrame(WPARAM wParam, LPARAM) FRAMEWND* F = &Frames[pos]; if (F->hWnd == g_hwndEventArea) - wndFrameEventArea = NULL; + wndFrameEventArea = nullptr; else if (F->hWnd == pcli->hwndContactTree) - wndFrameCLC = NULL; + wndFrameCLC = nullptr; else if (F->hWnd == g_hwndViewModeFrame) - wndFrameViewMode = NULL; + wndFrameViewMode = nullptr; mir_free(F->name); mir_free(F->TitleBar.tbname); @@ -1713,27 +1713,27 @@ static INT_PTR CLUIFramesRemoveFrame(WPARAM wParam, LPARAM) } if (!cfg::shutDown) { - InvalidateRect(pcli->hwndContactList, NULL, TRUE); + InvalidateRect(pcli->hwndContactList, nullptr, TRUE); CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); } return 0; } INT_PTR CLUIFramesForceUpdateTB(const FRAMEWND *Frame) { - if (Frame->TitleBar.hwnd != 0) - RedrawWindow(Frame->TitleBar.hwnd, NULL, NULL, RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); + if (Frame->TitleBar.hwnd != nullptr) + RedrawWindow(Frame->TitleBar.hwnd, nullptr, nullptr, RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); return 0; } INT_PTR CLUIFramesForceUpdateFrame(const FRAMEWND *Frame) { - if (Frame->hWnd != 0) - RedrawWindow(Frame->hWnd, NULL, NULL, RDW_UPDATENOW | RDW_FRAME | RDW_ERASE | RDW_INVALIDATE); + if (Frame->hWnd != nullptr) + RedrawWindow(Frame->hWnd, nullptr, nullptr, RDW_UPDATENOW | RDW_FRAME | RDW_ERASE | RDW_INVALIDATE); if (Frame->floating) - if (Frame->ContainerWnd != 0) RedrawWindow(Frame->ContainerWnd, NULL, NULL, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); + if (Frame->ContainerWnd != nullptr) RedrawWindow(Frame->ContainerWnd, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); return 0; } @@ -1751,11 +1751,11 @@ int CLUIFrameMoveResize(const FRAMEWND *Frame) return 0; } - SetWindowPos(Frame->hWnd, NULL, Frame->wndSize.left + cfg::dat.bCLeft, Frame->wndSize.top + cfg::dat.topOffset, + SetWindowPos(Frame->hWnd, nullptr, Frame->wndSize.left + cfg::dat.bCLeft, Frame->wndSize.top + cfg::dat.topOffset, (Frame->wndSize.right - Frame->wndSize.left), (Frame->wndSize.bottom - Frame->wndSize.top), SWP_NOZORDER | SWP_NOREDRAW); if (Frame->TitleBar.ShowTitleBar) { - SetWindowPos(Frame->TitleBar.hwnd, NULL, Frame->wndSize.left + cfg::dat.bCLeft, Frame->wndSize.top + cfg::dat.topOffset - TitleBarH, + SetWindowPos(Frame->TitleBar.hwnd, nullptr, Frame->wndSize.left + cfg::dat.bCLeft, Frame->wndSize.top + cfg::dat.topOffset - TitleBarH, (Frame->wndSize.right - Frame->wndSize.left), TitleBarH + (Frame->UseBorder ? (!Frame->collapsed ? (Frame->align == alClient ? 0 : 2) : 1) : 0), SWP_NOZORDER); } @@ -1788,7 +1788,7 @@ bool CLUIFramesFitInSize(void) int CLUIFramesGetMinHeight() { - if (pcli->hwndContactList == NULL) + if (pcli->hwndContactList == nullptr) return 0; int i, tbh, clientfrm, sumheight = 0; @@ -2039,25 +2039,25 @@ int SizeFramesByWindowRect(RECT *r) FRAMEWND &F = Frames[i]; if (!F.floating) { if (F.OwnerWindow && F.OwnerWindow != (HWND)-2) { - SetWindowPos(F.hWnd, NULL, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset, + SetWindowPos(F.hWnd, nullptr, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset, (F.wndSize.right - F.wndSize.left), (F.wndSize.bottom - F.wndSize.top), SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS); if (F.TitleBar.ShowTitleBar) { - SetWindowPos(F.TitleBar.hwnd, NULL, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset - TitleBarH, + SetWindowPos(F.TitleBar.hwnd, nullptr, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset - TitleBarH, (F.wndSize.right - F.wndSize.left), TitleBarH + (F.UseBorder ? (!F.collapsed ? (F.align == alClient ? 0 : 2) : 1) : 0), SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS); } } else { // set frame position - SetWindowPos(F.hWnd, NULL, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset, + SetWindowPos(F.hWnd, nullptr, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset, (F.wndSize.right - F.wndSize.left), (F.wndSize.bottom - F.wndSize.top), SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOSENDCHANGING | SWP_NOCOPYBITS | SWP_NOREDRAW); // set titlebar position if (F.TitleBar.ShowTitleBar) { - SetWindowPos(F.TitleBar.hwnd, NULL, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset - TitleBarH, + SetWindowPos(F.TitleBar.hwnd, nullptr, F.wndSize.left + cfg::dat.bCLeft, F.wndSize.top + cfg::dat.topOffset - TitleBarH, (F.wndSize.right - F.wndSize.left), TitleBarH + (F.UseBorder ? (!F.collapsed ? (F.align == alClient ? 0 : 2) : 1) : 0), SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOCOPYBITS | SWP_NOREDRAW); } @@ -2123,9 +2123,9 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) tick = GetTickCount() - tick; - if (pcli->hwndContactList != 0) - InvalidateRect(pcli->hwndContactList, NULL, TRUE); - if (pcli->hwndContactList != 0) + if (pcli->hwndContactList != nullptr) + InvalidateRect(pcli->hwndContactList, nullptr, TRUE); + if (pcli->hwndContactList != nullptr) UpdateWindow(pcli->hwndContactList); Sleep(0); @@ -2150,7 +2150,7 @@ int OnFrameTitleBarBackgroundChange() if (hBmpBackground) { DeleteObject(hBmpBackground); - hBmpBackground = NULL; + hBmpBackground = nullptr; } if (db_get_b(NULL, "FrameTitleBar", "UseBitmap", CLCDEFAULT_USEBITMAP)) { ptrW tszBitmapName(db_get_wsa(NULL, "FrameTitleBar", "BkBitmap")); @@ -2222,8 +2222,8 @@ static int DrawTitleBar(HDC dc, RECT rect, int Frameid) } if (!AlignCOLLIconToLeft) { - if (Frames[pos].TitleBar.hicon != NULL) { - DrawIconEx(hdcMem, 6 + cfg::dat.bClipBorder, ((TitleBarH >> 1) - 8), Frames[pos].TitleBar.hicon, 16, 16, 0, NULL, DI_NORMAL); + if (Frames[pos].TitleBar.hicon != nullptr) { + DrawIconEx(hdcMem, 6 + cfg::dat.bClipBorder, ((TitleBarH >> 1) - 8), Frames[pos].TitleBar.hicon, 16, 16, 0, nullptr, DI_NORMAL); TextOut(hdcMem, 24 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname)); } else TextOut(hdcMem, 6 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname)); @@ -2231,9 +2231,9 @@ static int DrawTitleBar(HDC dc, RECT rect, int Frameid) else TextOut(hdcMem, 18 + cfg::dat.bClipBorder, fontTop, Frames[pos].TitleBar.tbname, (int)mir_wstrlen(Frames[pos].TitleBar.tbname)); if (!AlignCOLLIconToLeft) - DrawIconEx(hdcMem, Frames[pos].TitleBar.wndSize.right - 22, ((TitleBarH >> 1) - 8), Frames[pos].collapsed ? Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN) : Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT), 16, 16, 0, NULL, DI_NORMAL); + DrawIconEx(hdcMem, Frames[pos].TitleBar.wndSize.right - 22, ((TitleBarH >> 1) - 8), Frames[pos].collapsed ? Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN) : Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT), 16, 16, 0, nullptr, DI_NORMAL); else - DrawIconEx(hdcMem, 0, ((TitleBarH >> 1) - 8), Frames[pos].collapsed ? Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN) : Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT), 16, 16, 0, NULL, DI_NORMAL); + DrawIconEx(hdcMem, 0, ((TitleBarH >> 1) - 8), Frames[pos].collapsed ? Skin_LoadIcon(SKINICON_OTHER_GROUPOPEN) : Skin_LoadIcon(SKINICON_OTHER_GROUPSHUT), 16, 16, 0, nullptr, DI_NORMAL); SelectObject(hdcMem, oFont); } } @@ -2272,7 +2272,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA return Menu_DrawItem(lParam); case WM_ENABLE: - if (hwnd != 0) InvalidateRect(hwnd, NULL, FALSE); + if (hwnd != nullptr) InvalidateRect(hwnd, nullptr, FALSE); return 0; case WM_SIZE: return 0; @@ -2347,7 +2347,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA } POINT pt; GetCursorPos(&pt); - TrackPopupMenu(hmenu, TPM_LEFTALIGN, pt.x, pt.y, 0, hwnd, 0); + TrackPopupMenu(hmenu, TPM_LEFTALIGN, pt.x, pt.y, 0, hwnd, nullptr); DestroyMenu(hmenu); } break; @@ -2371,7 +2371,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA lbypos = -1; oldframeheight = -1; ReleaseCapture(); - RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); + RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN); break; case WM_LBUTTONDOWN: @@ -2536,7 +2536,7 @@ LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam, LPARA if (!(wParam & MK_CONTROL)) PositionThumb(&Frames[pos], nLeft, nTop); else - SetWindowPos(Frames[pos].ContainerWnd, 0, nLeft, nTop, 0, 0, SWP_NOSIZE | SWP_NOZORDER); + SetWindowPos(Frames[pos].ContainerWnd, nullptr, nLeft, nTop, 0, 0, SWP_NOSIZE | SWP_NOZORDER); ptOld = ptNew; @@ -2648,7 +2648,7 @@ int CLUIFrameResizeFloatingFrame(int framepos) { if (!Frames[framepos].floating) return 0; - if (Frames[framepos].ContainerWnd == 0) + if (Frames[framepos].ContainerWnd == nullptr) return 0; RECT rect; @@ -2667,7 +2667,7 @@ int CLUIFrameResizeFloatingFrame(int framepos) ShowWindow(Frames[framepos].TitleBar.hwnd, SW_SHOWNOACTIVATE); Frames[framepos].height = height - floatingHeight; SetWindowPos(Frames[framepos].TitleBar.hwnd, HWND_TOP, 0, 0, width, floatingHeight, SWP_SHOWWINDOW | SWP_DRAWFRAME | SWP_NOACTIVATE); - InvalidateRect(Frames[framepos].TitleBar.hwnd, NULL, FALSE); + InvalidateRect(Frames[framepos].TitleBar.hwnd, nullptr, FALSE); SetWindowPos(Frames[framepos].hWnd, HWND_TOP, 0, floatingHeight, width, height - floatingHeight, SWP_SHOWWINDOW | SWP_NOACTIVATE); } @@ -2677,14 +2677,14 @@ int CLUIFrameResizeFloatingFrame(int framepos) SetWindowPos(Frames[framepos].hWnd, HWND_TOP, 0, 0, width, height, SWP_SHOWWINDOW | SWP_NOACTIVATE); } - if (Frames[framepos].ContainerWnd != 0) + if (Frames[framepos].ContainerWnd != nullptr) UpdateWindow(Frames[framepos].ContainerWnd); GetWindowRect(Frames[framepos].hWnd, &Frames[framepos].wndSize); if (Frames[framepos].TitleBar.ShowTitleBar) - RedrawWindow(Frames[framepos].TitleBar.hwnd, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW); + RedrawWindow(Frames[framepos].TitleBar.hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW); - RedrawWindow(Frames[framepos].hWnd, NULL, NULL, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW); + RedrawWindow(Frames[framepos].hWnd, nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW); return 0; } @@ -2719,7 +2719,7 @@ LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (!Frames[framepos].minmaxenabled) break; - if (Frames[framepos].ContainerWnd == 0) + if (Frames[framepos].ContainerWnd == nullptr) break; if (Frames[framepos].Locked) { @@ -2754,7 +2754,7 @@ LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (framepos < 0 || framepos >= nFramescount) break; - if (Frames[framepos].ContainerWnd == 0) + if (Frames[framepos].ContainerWnd == nullptr) return 0; GetWindowRect(Frames[framepos].ContainerWnd, &rect); @@ -2773,7 +2773,7 @@ LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wParam, L if (framepos < 0 || framepos >= nFramescount) break; - if (Frames[framepos].ContainerWnd == 0) + if (Frames[framepos].ContainerWnd == nullptr) return 0; CLUIFrameResizeFloatingFrame(framepos); @@ -2800,7 +2800,7 @@ LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wParam, L static HWND CreateContainerWindow(HWND parent, int x, int y, int width, int height) { - return(CreateWindowA("FramesContainer", "aaaa", WS_POPUP | WS_THICKFRAME, x, y, width, height, parent, 0, g_hInst, 0)); + return(CreateWindowA("FramesContainer", "aaaa", WS_POPUP | WS_THICKFRAME, x, y, width, height, parent, nullptr, g_hInst, nullptr)); } INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) @@ -2815,7 +2815,7 @@ INT_PTR CLUIFrameSetFloat(WPARAM wParam, LPARAM lParam) SetParent(Frames[wParam].TitleBar.hwnd, pcli->hwndContactList); Frames[wParam].floating = FALSE; DestroyWindow(Frames[wParam].ContainerWnd); - Frames[wParam].ContainerWnd = 0; + Frames[wParam].ContainerWnd = nullptr; } else { RECT recttb, rectw, border; @@ -2897,11 +2897,11 @@ wchar_t g_ptszEventName[100]; static int CLUIFrameOnModulesLoad(WPARAM, LPARAM) { mir_snwprintf(g_ptszEventName, L"mf_update_evt_%d", GetCurrentThreadId()); - g_hEventThread = CreateEvent(NULL, TRUE, FALSE, g_ptszEventName); - hThreadMFUpdate = mir_forkthread(MF_UpdateThread, NULL); + g_hEventThread = CreateEvent(nullptr, TRUE, FALSE, g_ptszEventName); + hThreadMFUpdate = mir_forkthread(MF_UpdateThread, nullptr); SetThreadPriority(hThreadMFUpdate, THREAD_PRIORITY_IDLE); CLUIFramesLoadMainMenu(); - CLUIFramesCreateMenuForFrame(-1, NULL, 000010000, false); + CLUIFramesCreateMenuForFrame(-1, nullptr, 000010000, false); return 0; } @@ -2943,7 +2943,7 @@ int LoadCLUIFramesModule(void) wndclass.style = CS_DBLCLKS; wndclass.lpfnWndProc = CLUIFrameTitleBarProc; wndclass.hInstance = g_hInst; - wndclass.hCursor = LoadCursor(NULL, IDC_ARROW); + wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW); wndclass.lpszClassName = CLUIFrameTitleBarClassName; RegisterClass(&wndclass); @@ -2951,7 +2951,7 @@ int LoadCLUIFramesModule(void) cntclass.style = CS_DBLCLKS | CS_DROPSHADOW; cntclass.lpfnWndProc = CLUIFrameContainerWndProc; cntclass.hInstance = g_hInst; - cntclass.hCursor = LoadCursor(NULL, IDC_ARROW); + cntclass.hCursor = LoadCursor(nullptr, IDC_ARROW); cntclass.lpszClassName = L"FramesContainer"; RegisterClass(&cntclass); @@ -2961,7 +2961,7 @@ int LoadCLUIFramesModule(void) mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_FRAME); mi.position = 3000090000; mi.name.a = LPGEN("Frames"); - mi.pszService = 0; + mi.pszService = nullptr; cont.MainMenuItem = Menu_AddMainMenuItem(&mi); UNSET_UID(mi); @@ -3023,7 +3023,7 @@ int LoadCLUIFramesModule(void) CreateServiceFunction(CLUIFRAMESSETALIGNALBOTTOM, CLUIFramesSetAlignalBottom); CreateServiceFunction("Set_Floating", CLUIFrameSetFloat); - hWndExplorerToolBar = FindWindowExA(0, 0, "Shell_TrayWnd", NULL); + hWndExplorerToolBar = FindWindowExA(nullptr, nullptr, "Shell_TrayWnd", nullptr); OnFrameTitleBarBackgroundChange(); FramesSysNotStarted = FALSE; @@ -3055,13 +3055,13 @@ int UnLoadCLUIFramesModule(void) F.ContainerWnd = (HWND)-1; DestroyMenu(F.TitleBar.hmenu); - if (F.name != NULL) + if (F.name != nullptr) mir_free(F.name); - if (F.TitleBar.tbname != NULL) + if (F.TitleBar.tbname != nullptr) mir_free(F.TitleBar.tbname); } free(Frames); - Frames = NULL; + Frames = nullptr; nFramescount = 0; UnregisterClass(CLUIFrameTitleBarClassName, g_hInst); return 0; diff --git a/plugins/Clist_nicer/src/cluiopts.cpp b/plugins/Clist_nicer/src/cluiopts.cpp index 6e3dacbd9f..f8636fdb21 100644 --- a/plugins/Clist_nicer/src/cluiopts.cpp +++ b/plugins/Clist_nicer/src/cluiopts.cpp @@ -229,7 +229,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ApplyCLUIBorderStyle();
if (BST_UNCHECKED == IsDlgButtonChecked(hwndDlg, IDC_SHOWMAINMENU))
- SetMenu(pcli->hwndContactList, NULL);
+ SetMenu(pcli->hwndContactList, nullptr);
else
SetMenu(pcli->hwndContactList, pcli->hMenuMain);
@@ -246,7 +246,7 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l SendMessage(pcli->hwndContactTree, WM_SIZE, 0, 0);
}
- db_set_b(NULL, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, NULL, FALSE));
+ db_set_b(NULL, "CLUI", "MaxSizeHeight", (BYTE)GetDlgItemInt(hwndDlg, IDC_MAXSIZEHEIGHT, nullptr, FALSE));
db_set_b(NULL, "CLUI", "AutoSizeUpward", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOSIZEUPWARD));
db_set_b(NULL, "CList", "AutoHide", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_AUTOHIDE));
db_set_w(NULL, "CList", "HideTime", (WORD)SendDlgItemMessage(hwndDlg, IDC_HIDETIMESPIN, UDM_GETPOS, 0, 0));
@@ -292,8 +292,8 @@ INT_PTR CALLBACK DlgProcCluiOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l ConfigureCLUIGeometry(1);
ShowWindow(pcli->hwndContactList, SW_SHOW);
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
- RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
+ 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);
cfg::dat.fadeinout = oldFading;
opt_clui_changed = 0;
@@ -387,7 +387,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l 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, NULL, flags, 0, 0, 0, 0, parent, NULL, g_hInst, NULL);
+ pcli->hwndStatus = CreateWindow(STATUSCLASSNAME, nullptr, flags, 0, 0, 0, 0, parent, nullptr, g_hInst, nullptr);
mir_subclassWindow(pcli->hwndStatus, NewStatusBarWndProc);
}
if (IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR)) {
@@ -402,7 +402,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_dw(NULL, "CLUI", "Frameflags", cfg::dat.dwFlags);
ConfigureCLUIGeometry(1);
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- CluiProtocolStatusChanged(0, 0);
+ CluiProtocolStatusChanged(0, nullptr);
PostMessage(pcli->hwndContactList, CLUIINTM_REDRAW, 0, 0);
opt_sbar_changed = 0;
return TRUE;
diff --git a/plugins/Clist_nicer/src/cluiservices.cpp b/plugins/Clist_nicer/src/cluiservices.cpp index 7e8b5c8c56..f97d264643 100644 --- a/plugins/Clist_nicer/src/cluiservices.cpp +++ b/plugins/Clist_nicer/src/cluiservices.cpp @@ -33,7 +33,7 @@ void FreeProtocolData(void) int nParts = SendMessage(pcli->hwndStatus, SB_GETPARTS, 0, 0);
for (int nPanel = 0; nPanel < nParts; nPanel++) {
ProtocolData *PD = (ProtocolData *)SendMessage(pcli->hwndStatus, SB_GETTEXT, nPanel, 0);
- if (PD != NULL && !IsBadCodePtr((FARPROC)PD)) {
+ if (PD != nullptr && !IsBadCodePtr((FARPROC)PD)) {
SendMessage(pcli->hwndStatus, SB_SETTEXT, (WPARAM)nPanel | SBT_OWNERDRAW, 0);
if (PD->RealName) mir_free(PD->RealName);
if (PD) mir_free(PD);
@@ -50,11 +50,11 @@ void CluiProtocolStatusChanged(int, const char*) WORD maxStatus = ID_STATUS_OFFLINE;
DBVARIANT dbv = { 0 };
int iIcon = 0;
- HICON hIcon = 0;
+ HICON hIcon = nullptr;
int rdelta = cfg::dat.bCLeft + cfg::dat.bCRight;
BYTE windowStyle;
- if (pcli->hwndStatus == 0 || cfg::shutDown)
+ if (pcli->hwndStatus == nullptr || cfg::shutDown)
return;
int protoCount;
@@ -101,7 +101,7 @@ void CluiProtocolStatusChanged(int, const char*) BYTE showOpts = db_get_b(NULL, "CLUI", "SBarShow", 1);
wchar_t szName[32];
- HDC hdc = GetDC(NULL);
+ HDC hdc = GetDC(nullptr);
HFONT hofont = reinterpret_cast<HFONT>(SelectObject(hdc, (HFONT)SendMessage(pcli->hwndStatus, WM_GETFONT, 0, 0)));
// count down since built in ones tend to go at the end
@@ -135,7 +135,7 @@ void CluiProtocolStatusChanged(int, const char*) partCount++;
}
SelectObject(hdc, hofont);
- ReleaseDC(NULL, hdc);
+ ReleaseDC(nullptr, hdc);
}
if (partCount == 0) {
SendMessage(pcli->hwndStatus, SB_SIMPLE, TRUE, 0);
@@ -149,7 +149,7 @@ void CluiProtocolStatusChanged(int, const char*) SendMessage(pcli->hwndStatus, SB_SETPARTS, partCount, (LPARAM)partWidths);
// count down since built in ones tend to go at the end
- char *szMaxProto = NULL;
+ char *szMaxProto = nullptr;
partCount = 0;
for (int i = 0; i < protoCount; i++) {
int idx = pcli->pfnGetAccountIndexByPos(i);
@@ -195,7 +195,7 @@ void CluiProtocolStatusChanged(int, const char*) }
else {
wStatus = maxStatus;
- iIcon = IconFromStatusMode((wStatus >= ID_STATUS_CONNECTING && wStatus < ID_STATUS_OFFLINE) ? szMaxProto : NULL, (int)wStatus, 0, &hIcon);
+ iIcon = IconFromStatusMode((wStatus >= ID_STATUS_CONNECTING && wStatus < ID_STATUS_OFFLINE) ? szMaxProto : nullptr, (int)wStatus, 0, &hIcon);
g_maxStatus = (int)wStatus;
if (szMaxProto)
strncpy_s(g_maxProto, _countof(g_maxProto), szMaxProto, _TRUNCATE);
@@ -221,18 +221,18 @@ void CluiProtocolStatusChanged(int, const char*) SendMessage(hwndClistBtn, BUTTONSETIMLICON, (WPARAM)hCListImages, (LPARAM)iIcon);
else
SendMessage(hwndClistBtn, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
- InvalidateRect(hwndClistBtn, NULL, TRUE);
+ InvalidateRect(hwndClistBtn, nullptr, TRUE);
}
HWND hwndTtbStatus = ClcGetButtonWindow(IDC_TBTOPSTATUS);
if (IsWindow(hwndTtbStatus)) {
- if (g_ButtonItems == NULL) {
+ if (g_ButtonItems == nullptr) {
if (!hIcon)
SendMessage(hwndTtbStatus, BUTTONSETIMLICON, (WPARAM)hCListImages, (LPARAM)iIcon);
else
SendMessage(hwndTtbStatus, BM_SETIMAGE, IMAGE_ICON, (LPARAM)hIcon);
}
- InvalidateRect(hwndTtbStatus, NULL, TRUE);
+ InvalidateRect(hwndTtbStatus, nullptr, TRUE);
}
}
}
diff --git a/plugins/Clist_nicer/src/config.cpp b/plugins/Clist_nicer/src/config.cpp index 577d813333..18d2844705 100644 --- a/plugins/Clist_nicer/src/config.cpp +++ b/plugins/Clist_nicer/src/config.cpp @@ -25,7 +25,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "stdafx.h"
TCluiData cfg::dat = { 0 };
-ClcData* cfg::clcdat = 0;
+ClcData* cfg::clcdat = nullptr;
static mir_cs cachecs;
LIST<TExtraCache> cfg::arCache(100, NumericKeySortT);
@@ -35,8 +35,8 @@ bool cfg::shutDown = false; TSysConfig API::sysConfig = { 0 };
TSysState API::sysState = { 0 };
-pfnDwmExtendFrameIntoClientArea_t API::pfnDwmExtendFrameIntoClientArea = 0;
-pfnDwmIsCompositionEnabled_t API::pfnDwmIsCompositionEnabled = 0;
+pfnDwmExtendFrameIntoClientArea_t API::pfnDwmExtendFrameIntoClientArea = nullptr;
+pfnDwmIsCompositionEnabled_t API::pfnDwmIsCompositionEnabled = nullptr;
EXCEPTION_RECORD API::exRecord = { 0 };
CONTEXT API::exCtx = { 0 };
@@ -45,7 +45,7 @@ char API::exSzFile[MAX_PATH] = ""; wchar_t API::exReason[256] = L"";
int API::exLine = 0;
bool API::exAllowContinue = false;
-HMODULE API::hDwm = 0;
+HMODULE API::hDwm = nullptr;
TExtraCache* cfg::getCache(const MCONTACT hContact, const char *szProto)
{
@@ -82,10 +82,10 @@ void CSH_Destroy() StatusItems_t *item = p->status_item;
free(p->status_item);
- p->status_item = 0;
+ p->status_item = nullptr;
for (int j = i; j < cfg::arCache.getCount(); j++) // avoid duplicate free()'ing status item pointers (there are references from sub to master contacts, so compare the pointers...
if (cfg::arCache[j]->status_item == item)
- cfg::arCache[j]->status_item = 0;
+ cfg::arCache[j]->status_item = nullptr;
}
free(p);
}
@@ -204,7 +204,7 @@ int API::Ex_ShowDialog(EXCEPTION_POINTERS *ep, const char *szFile, int line, wch mir_snprintf(exSzFile, "%s%s", szName, szExt);
mir_snwprintf(exReason, L"An application error has occured: %s", szReason);
exLine = line;
- exLastResult = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_EXCEPTION), 0, Ex_DlgProc, 0);
+ exLastResult = DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_EXCEPTION), nullptr, Ex_DlgProc, 0);
exAllowContinue = fAllowContinue;
if (IDCANCEL == exLastResult)
ExitProcess(1);
@@ -233,7 +233,7 @@ void TSAPI Utils::showDlgControl(const HWND hwnd, UINT id, int showCmd) HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle)
{
wchar_t sysPathName[MAX_PATH + 2];
- HMODULE _h = 0;
+ HMODULE _h = nullptr;
try {
if (0 == ::GetSystemDirectory(sysPathName, MAX_PATH))
@@ -248,12 +248,12 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename, bool useGetHandle) _h = ::GetModuleHandle(sysPathName);
else
_h = LoadLibrary(sysPathName);
- if (0 == _h)
+ if (nullptr == _h)
throw(CRTException("Error while loading system library", szFilename));
}
catch (CRTException& ex) {
ex.display();
- return 0;
+ return nullptr;
}
return (_h);
}
@@ -269,6 +269,6 @@ void CRTException::display() const wchar_t tszBoxMsg[500];
mir_snwprintf(tszBoxMsg, L"%s\n\n(%s)", tszMsg, m_szParam);
- ::MessageBox(0, tszBoxMsg, L"Clist_nicer runtime error", MB_OK | MB_ICONERROR);
+ ::MessageBox(nullptr, tszBoxMsg, L"Clist_nicer runtime error", MB_OK | MB_ICONERROR);
mir_free(tszMsg);
}
diff --git a/plugins/Clist_nicer/src/contact.cpp b/plugins/Clist_nicer/src/contact.cpp index ed7ddefb5b..49d78b9ab3 100644 --- a/plugins/Clist_nicer/src/contact.cpp +++ b/plugins/Clist_nicer/src/contact.cpp @@ -47,7 +47,7 @@ static int GetContactStatus(MCONTACT hContact) char *szProto;
szProto = GetContactProto(hContact);
- if (szProto == NULL)
+ if (szProto == nullptr)
return ID_STATUS_OFFLINE;
return db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
}
@@ -62,11 +62,11 @@ int __forceinline GetStatusModeOrdering(int statusMode) }
int mf_updatethread_running = TRUE;
-HANDLE hThreadMFUpdate = 0;
+HANDLE hThreadMFUpdate = nullptr;
static void MF_CalcFrequency(MCONTACT hContact, DWORD dwCutoffDays, int doSleep)
{
- DWORD curTime = time(NULL);
+ DWORD curTime = time(nullptr);
DWORD frequency, eventCount;
MEVENT hEvent = db_event_last(hContact);
@@ -153,7 +153,7 @@ int __forceinline GetProtoIndex(char * szName) return -1;
PROTOACCOUNT *pa = Proto_GetAccount(szName);
- return (pa == NULL) ? -1 : pa->iOrder;
+ return (pa == nullptr) ? -1 : pa->iOrder;
}
int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact* c2, UINT bywhat)
@@ -163,7 +163,7 @@ int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact char *szProto1, *szProto2;
int rc;
- if (c1 == 0 || c2 == 0)
+ if (c1 == nullptr || c2 == nullptr)
return 0;
szProto1 = c1->proto;
@@ -227,7 +227,7 @@ int __forceinline INTSORT_CompareContacts(const ClcContact* c1, const ClcContact rc = GetProtoIndex(szProto1) - GetProtoIndex(szProto2);
- if (rc != 0 && (szProto1 != NULL && szProto2 != NULL))
+ if (rc != 0 && (szProto1 != nullptr && szProto2 != nullptr))
return rc;
}
return 0;
diff --git a/plugins/Clist_nicer/src/coolsblib.cpp b/plugins/Clist_nicer/src/coolsblib.cpp index 61da1b3567..f669a400a9 100644 --- a/plugins/Clist_nicer/src/coolsblib.cpp +++ b/plugins/Clist_nicer/src/coolsblib.cpp @@ -44,13 +44,13 @@ SCROLLBAR* GetScrollBarFromHwnd(HWND hwnd, UINT nBar) {
SCROLLWND *sw = GetScrollWndFromHwnd(hwnd);
if (!sw)
- return 0;
+ return nullptr;
if (nBar == SB_HORZ)
return &sw->sbarHorz;
if (nBar == SB_VERT)
return &sw->sbarVert;
- return 0;
+ return nullptr;
}
BOOL WINAPI CoolSB_IsCoolScrollEnabled(HWND hwnd)
@@ -74,7 +74,7 @@ BOOL GetScrollRect(SCROLLWND *sw, UINT nBar, HWND hwnd, RECT *rect); typedef BOOL(WINAPI *WPROC)(HWND, UINT, UINT);
-static WPROC pEnableScrollBar = 0;
+static WPROC pEnableScrollBar = nullptr;
void WINAPI CoolSB_SetESBProc(WPROC proc)
{
@@ -106,7 +106,7 @@ static void RedrawNonClient(HWND hwnd, BOOL fFrameChanged) SendMessage(hwnd, WM_NCPAINT, 1, 0);
}
else {
- SetWindowPos(hwnd, 0, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE
+ SetWindowPos(hwnd, nullptr, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE
| SWP_FRAMECHANGED | SWP_DRAWFRAME);
}
}
@@ -135,7 +135,7 @@ static SCROLLINFO *GetScrollInfoFromHwnd(HWND hwnd, int fnBar) {
SCROLLBAR *sb = GetScrollBarFromHwnd(hwnd, fnBar);
- if (sb == 0)
+ if (sb == nullptr)
return FALSE;
if (fnBar == SB_HORZ) {
@@ -145,7 +145,7 @@ static SCROLLINFO *GetScrollInfoFromHwnd(HWND hwnd, int fnBar) return &sb->scrollInfo;
}
else
- return NULL;
+ return nullptr;
}
//
// Initialize the cool scrollbars for a window by subclassing it
@@ -161,14 +161,14 @@ BOOL WINAPI InitializeCoolSB(HWND hwnd) DWORD dwCurStyle;
//BOOL fDisabled;
- if (pEnableScrollBar == 0)
+ if (pEnableScrollBar == nullptr)
pEnableScrollBar = EnableScrollBar;
GetClientRect(hwnd, &rect);
//if we have already initialized Cool Scrollbars for this window,
//then stop the user from doing it again
- if (GetScrollWndFromHwnd(hwnd) != 0) {
+ if (GetScrollWndFromHwnd(hwnd) != nullptr) {
return FALSE;
}
@@ -254,7 +254,7 @@ BOOL WINAPI InitializeCoolSB(HWND hwnd) UNREFERENCED_PARAMETER(ice);
UNREFERENCED_PARAMETER(ti);
- sw->hwndToolTip = 0;
+ sw->hwndToolTip = nullptr;
#endif
@@ -385,7 +385,7 @@ int WINAPI CoolSB_SetScrollInfo(HWND hwnd, int fnBar, LPSCROLLINFO lpsi, BOOL fR }
SCROLLBAR *sbar = GetScrollBarFromHwnd(hwnd, fnBar);
- if (sbar == NULL)
+ if (sbar == nullptr)
return 0;
if ((lpsi->fMask & SIF_DISABLENOSCROLL) || (sbar->fScrollFlags & CSBS_THUMBALWAYS)) {
@@ -497,7 +497,7 @@ BOOL WINAPI CoolSB_ShowScrollBar(HWND hwnd, int wBar, BOOL fShow) //if (s
//SetWindowLongPtr(hwnd, GWL_STYLE, style);
- SetWindowPos(hwnd, 0, 0, 0, 0, 0,
+ SetWindowPos(hwnd, nullptr, 0, 0, 0, 0,
SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER |
SWP_NOACTIVATE | SWP_FRAMECHANGED);
diff --git a/plugins/Clist_nicer/src/coolscroll.cpp b/plugins/Clist_nicer/src/coolscroll.cpp index 1e8f5b98ff..cd9f0750e7 100644 --- a/plugins/Clist_nicer/src/coolscroll.cpp +++ b/plugins/Clist_nicer/src/coolscroll.cpp @@ -85,7 +85,7 @@ static RECT MouseOverRect; static UINT uScrollTimerMsg = 0;
static UINT uScrollTimerPortion = HTSCROLL_NONE;
static UINT_PTR uScrollTimerId = 0;
-static HWND hwndCurCoolSB = 0;
+static HWND hwndCurCoolSB = nullptr;
extern int CustomDrawScrollBars(NMCSBCUSTOMDRAW *nmcsbcd);
@@ -105,7 +105,7 @@ BOOL WINAPI CoolSB_IsThumbTracking(HWND hwnd) {
SCROLLWND *sw;
- if ((sw = GetScrollWndFromHwnd(hwnd)) == NULL)
+ if ((sw = GetScrollWndFromHwnd(hwnd)) == nullptr)
return FALSE;
else
return sw->fThumbTracking;
@@ -194,7 +194,7 @@ static int DrawScrollArrow(SCROLLBAR *sbar, HDC hdc, RECT *rect, UINT arrow, BOO //MONOCHROME bitmap to convert the arrow to black/white mask
hdcmem1 = CreateCompatibleDC(hdc);
- hbm1 = CreateBitmap(width, height, 1, 1, NULL);
+ hbm1 = CreateBitmap(width, height, 1, 1, nullptr);
UnrealizeObject(hbm1);
oldbm1 = reinterpret_cast<HBITMAP>(SelectObject(hdcmem1, hbm1));
@@ -347,7 +347,7 @@ static void DrawCheckedRect(HDC hdc, RECT *rect, COLORREF fg, COLORREF bg) hbr = CreatePatternBrush(hbmp);
UnrealizeObject(hbr);
- SetBrushOrgEx(hdc, rect->left, rect->top, 0);
+ SetBrushOrgEx(hdc, rect->left, rect->top, nullptr);
hbrold = (HBRUSH)SelectObject(hdc, hbr);
@@ -373,7 +373,7 @@ static void DrawCheckedRect(HDC hdc, RECT *rect, COLORREF fg, COLORREF bg) static void PaintRect(HDC hdc, RECT *rect, COLORREF color)
{
COLORREF oldcol = SetBkColor(hdc, color);
- ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, rect, "", 0, NULL);
+ ExtTextOutA(hdc, 0, 0, ETO_OPAQUE, rect, "", 0, nullptr);
SetBkColor(hdc, oldcol);
}
@@ -1373,7 +1373,7 @@ static LRESULT NCPaint(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam) SCROLLBAR *sb;
HDC hdc;
RECT winrect, rect;
- HRGN clip = 0;
+ HRGN clip = nullptr;
BOOL fCustomDraw = FALSE;
LRESULT ret;
DWORD dwStyle;
@@ -1481,7 +1481,7 @@ static LRESULT NCPaint(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lParam) HWND hwndParent = GetParent(hwnd);
GetClientRect(hwndParent, &parent);
- MapWindowPoints(hwndParent, 0, (POINT *)&parent, 2);
+ MapWindowPoints(hwndParent, nullptr, (POINT *)&parent, 2);
CopyRect(&rect2, &rect);
OffsetRect(&rect2, winrect.left, winrect.top);
@@ -1969,7 +1969,7 @@ static LRESULT NCLButtonDown(SCROLLWND *sw, HWND hwnd, WPARAM wParam, LPARAM lPa //set a timer going on the first click.
//if this one expires, then we can start off a more regular timer
//to generate the auto-scroll behaviour
- uScrollTimerId = SetTimer(hwnd, COOLSB_TIMERID1, COOLSB_TIMERINTERVAL1, 0);
+ uScrollTimerId = SetTimer(hwnd, COOLSB_TIMERID1, COOLSB_TIMERINTERVAL1, nullptr);
break;
default:
return mir_callNextSubclass(hwnd, CoolSBWndProc, WM_NCLBUTTONDOWN, wParam, lParam);
@@ -2634,7 +2634,7 @@ static LRESULT NCMouseMove(SCROLLWND *sw, HWND hwnd, WPARAM wHitTest, LPARAM lPa uHitTestPortion = HTSCROLL_NONE;
GetScrollRect(sw, SB_HORZ, hwnd, &MouseOverRect);
uMouseOverScrollbar = SB_HORZ;
- uMouseOverId = SetTimer(hwnd, COOLSB_TIMERID3, COOLSB_TIMERINTERVAL3, 0);
+ uMouseOverId = SetTimer(hwnd, COOLSB_TIMERID3, COOLSB_TIMERINTERVAL3, nullptr);
NCPaint(sw, hwnd, 1, 0);
}
@@ -2647,7 +2647,7 @@ static LRESULT NCMouseMove(SCROLLWND *sw, HWND hwnd, WPARAM wHitTest, LPARAM lPa uHitTestPortion = HTSCROLL_NONE;
GetScrollRect(sw, SB_VERT, hwnd, &MouseOverRect);
uMouseOverScrollbar = SB_VERT;
- uMouseOverId = SetTimer(hwnd, COOLSB_TIMERID3, COOLSB_TIMERINTERVAL3, 0);
+ uMouseOverId = SetTimer(hwnd, COOLSB_TIMERID3, COOLSB_TIMERINTERVAL3, nullptr);
NCPaint(sw, hwnd, 1, 0);
}
@@ -2731,7 +2731,7 @@ static LRESULT CoolSB_Timer(SCROLLWND *swnd, HWND hwnd, WPARAM wTimerId, LPARAM if (wTimerId == COOLSB_TIMERID1)
{
KillTimer(hwnd, uScrollTimerId);
- uScrollTimerId = SetTimer(hwnd, COOLSB_TIMERID2, COOLSB_TIMERINTERVAL2, 0);
+ uScrollTimerId = SetTimer(hwnd, COOLSB_TIMERID2, COOLSB_TIMERINTERVAL2, nullptr);
return 0;
}
//send the scrollbar message repeatedly
diff --git a/plugins/Clist_nicer/src/extBackg.cpp b/plugins/Clist_nicer/src/extBackg.cpp index 8fcf49c63e..b575696943 100644 --- a/plugins/Clist_nicer/src/extBackg.cpp +++ b/plugins/Clist_nicer/src/extBackg.cpp @@ -31,10 +31,10 @@ extern HWND g_hwndViewModeFrame; extern struct CluiTopButton BTNS[];
LIST<StatusItems_t> arStatusItems(10);
-ImageItem *g_ImageItems = NULL, *g_glyphItem = NULL;
-ButtonItem *g_ButtonItems = NULL;
-ImageItem *g_CLUIImageItem = NULL;
-HBRUSH g_CLUISkinnedBkColor = 0;
+ImageItem *g_ImageItems = nullptr, *g_glyphItem = nullptr;
+ButtonItem *g_ButtonItems = nullptr;
+ImageItem *g_CLUIImageItem = nullptr;
+HBRUSH g_CLUISkinnedBkColor = nullptr;
COLORREF g_CLUISkinnedBkColorRGB = 0;
int ID_EXTBK_LAST = ID_EXTBK_LAST_D;
@@ -257,15 +257,15 @@ BOOL __forceinline GetItemByStatus(int status, StatusItems_t *retitem) StatusItems_t *GetProtocolStatusItem(const char *szProto)
{
- if (szProto == NULL)
- return NULL;
+ if (szProto == nullptr)
+ return nullptr;
for (int i = _countof(_StatusItems); i < arStatusItems.getCount(); i++) {
StatusItems_t *p = arStatusItems[i];
if (!mir_strcmp(p->szName[0] == '{' ? p->szName+3 : p->szName, szProto))
return p;
}
- return NULL;
+ return nullptr;
}
// fills the struct with the settings in the database
@@ -301,7 +301,7 @@ void LoadExtBkSettingsFromDB() if (p->statusID == ID_EXTBKSEPARATOR)
continue;
- p->imageItem = 0;
+ p->imageItem = nullptr;
char buffer[255], *pszEnd = buffer + mir_snprintf(buffer, "%s_", p->szDBname);
mir_strcpy(pszEnd, "IGNORE"); p->IGNORED = (BYTE)db_get_b(NULL, "CLCExt", buffer, p->IGNORED);
mir_strcpy(pszEnd, "GRADIENT"); p->GRADIENT = (BYTE)db_get_dw(NULL, "CLCExt", buffer, p->GRADIENT);
@@ -374,9 +374,9 @@ void SetButtonToSkinned() bool bFlat = bSkinned || (db_get_b(NULL, "TopToolBar", "UseFlatButton", 0) != 0);
for (int i = 0;; i++) {
- if (BTNS[i].pszButtonID == NULL)
+ if (BTNS[i].pszButtonID == nullptr)
break;
- if (BTNS[i].hwndButton != 0 && BTNS[i].ctrlid != IDC_TBGLOBALSTATUS && BTNS[i].ctrlid != IDC_TBMENU)
+ if (BTNS[i].hwndButton != nullptr && BTNS[i].ctrlid != IDC_TBGLOBALSTATUS && BTNS[i].ctrlid != IDC_TBMENU)
CustomizeButton(BTNS[i].hwndButton, bSkinned, !bSkinned, bFlat, true);
}
@@ -450,7 +450,7 @@ struct { char *szModule; char *szSetting; unsigned int size; int defaultval; } _ "WorldTime", "BgColour", 4, 0,
"WorldTime", "FontCol", 4, 0,
- NULL, NULL, 0, 0
+ nullptr, nullptr, 0, 0
};
void extbk_export(char *file)
@@ -520,7 +520,7 @@ void extbk_export(char *file) }
i = 0;
- while (_tagSettings[i].szModule != NULL) {
+ while (_tagSettings[i].szModule != nullptr) {
data = 0;
switch (_tagSettings[i].size) {
case 1:
@@ -569,7 +569,7 @@ static void PreMultiply(HBITMAP hBitmap, int mode) int height = bmp.bmHeight;
DWORD dwLen = width * height * 4;
BYTE *p = (BYTE *)malloc(dwLen);
- if (p == NULL)
+ if (p == nullptr)
return;
GetBitmapBits(hBitmap, dwLen, p);
@@ -600,7 +600,7 @@ static void CorrectBitmap32Alpha(HBITMAP hBitmap) DWORD dwLen = bmp.bmWidth * bmp.bmHeight * (bmp.bmBitsPixel / 8);
BYTE *p = (BYTE*)calloc(1, dwLen);
- if (p == NULL)
+ if (p == nullptr)
return;
GetBitmapBits(hBitmap, dwLen, p);
@@ -627,7 +627,7 @@ static void CorrectBitmap32Alpha(HBITMAP hBitmap) static HBITMAP LoadPNG(const char *szFilename)
{
HBITMAP hBitmap = Bitmap_Load(_A2T(szFilename));
- if (hBitmap != 0)
+ if (hBitmap != nullptr)
CorrectBitmap32Alpha(hBitmap);
return hBitmap;
@@ -657,7 +657,7 @@ static void IMG_CreateItem(ImageItem *item, const char *fileName, HDC hdc) item->dwFlags |= IMAGE_FLAG_DIVIDED;
if (item->inner_height <= 0 || item->inner_width <= 0) {
DeleteObject(hbm);
- item->hbm = 0;
+ item->hbm = nullptr;
return;
}
}
@@ -749,7 +749,7 @@ static void ReadItem(StatusItems_t *this_item, char *szItem, char *file) void IMG_ReadItem(const char *itemname, const char *szFileName)
{
- ImageItem tmpItem, *newItem = NULL;
+ ImageItem tmpItem, *newItem = nullptr;
char buffer[512], szItemNr[30];
char szFinalName[MAX_PATH];
HDC hdc = GetDC(pcli->hwndContactList);
@@ -776,7 +776,7 @@ done_with_glyph: strncpy(tmpItem.szName, &itemname[1], sizeof(tmpItem.szName));
tmpItem.szName[sizeof(tmpItem.szName) - 1] = 0;
- _splitpath(szFileName, szDrive, szPath, NULL, NULL);
+ _splitpath(szFileName, szDrive, szPath, nullptr, nullptr);
mir_snprintf(szFinalName, "%s\\%s\\%s", szDrive, szPath, buffer);
tmpItem.alpha = GetPrivateProfileIntA(itemname, "Alpha", 100, szFileName);
tmpItem.alpha = min(tmpItem.alpha, 100);
@@ -811,7 +811,7 @@ done_with_glyph: tmpItem.dwFlags |= IMAGE_FILLSOLID;
}
else
- tmpItem.fillBrush = 0;
+ tmpItem.fillBrush = nullptr;
GetPrivateProfileStringA(itemname, "Stretch", "None", buffer, 500, szFileName);
if (buffer[0] == 'B' || buffer[0] == 'b')
@@ -820,7 +820,7 @@ done_with_glyph: tmpItem.bStretch = IMAGE_STRETCH_V;
else if (buffer[0] == 'w' || buffer[0] == 'W')
tmpItem.bStretch = IMAGE_STRETCH_H;
- tmpItem.hbm = 0;
+ tmpItem.hbm = nullptr;
if (!_stricmp(itemname, "$glyphs")) {
IMG_CreateItem(&tmpItem, szFinalName, hdc);
@@ -840,12 +840,12 @@ done_with_glyph: memset(newItem, 0, sizeof(ImageItem));
*newItem = tmpItem;
- if (g_ImageItems == NULL)
+ if (g_ImageItems == nullptr)
g_ImageItems = newItem;
else {
ImageItem *pItem = g_ImageItems;
- while (pItem->nextItem != 0)
+ while (pItem->nextItem != nullptr)
pItem = pItem->nextItem;
pItem->nextItem = newItem;
}
@@ -893,19 +893,19 @@ done_with_glyph: memset(newItem, 0, sizeof(ImageItem));
*newItem = tmpItem;
p->imageItem = newItem;
- if (g_ImageItems == NULL)
+ if (g_ImageItems == nullptr)
g_ImageItems = newItem;
else {
ImageItem *pItem = g_ImageItems;
- while (pItem->nextItem != 0)
+ while (pItem->nextItem != nullptr)
pItem = pItem->nextItem;
pItem->nextItem = newItem;
}
alloced = TRUE;
}
}
- else if (newItem != NULL)
+ else if (newItem != nullptr)
p->imageItem = newItem;
}
}
@@ -928,29 +928,29 @@ void IMG_DeleteItems() free(pItem);
pItem = pNextItem;
}
- g_ImageItems = NULL;
+ g_ImageItems = nullptr;
while (pbItem) {
DestroyWindow(pbItem->hWnd);
pbNextItem = pbItem->nextItem;
free(pbItem);
pbItem = pbNextItem;
}
- g_ButtonItems = NULL;
+ g_ButtonItems = nullptr;
if (g_CLUIImageItem) {
IMG_DeleteItem(g_CLUIImageItem);
free(g_CLUIImageItem);
}
- g_CLUIImageItem = NULL;
+ g_CLUIImageItem = nullptr;
if (g_glyphItem) {
IMG_DeleteItem(g_glyphItem);
free(g_glyphItem);
}
- g_glyphItem = NULL;
+ g_glyphItem = nullptr;
for (i = 0; i < arStatusItems.getCount(); i++)
- arStatusItems[i]->imageItem = NULL;
+ arStatusItems[i]->imageItem = nullptr;
}
static UINT nextButtonID = IDC_TBFIRSTUID;
@@ -1139,20 +1139,20 @@ static void BTN_ReadItem(char *itemName, char *file) newItem = (ButtonItem *)malloc(sizeof(ButtonItem));
memset(newItem, 0, sizeof(ButtonItem));
- if (g_ButtonItems == NULL) {
+ if (g_ButtonItems == nullptr) {
g_ButtonItems = newItem;
*newItem = tmpItem;
- newItem->nextItem = 0;
+ newItem->nextItem = nullptr;
}
else {
ButtonItem *curItem = g_ButtonItems;
while (curItem->nextItem)
curItem = curItem->nextItem;
*newItem = tmpItem;
- newItem->nextItem = 0;
+ 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_hInst, NULL);
+ newItem->hWnd = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 5, 5, pcli->hwndContactList, (HMENU)newItem->uId, g_hInst, nullptr);
CustomizeButton(newItem->hWnd, false, false, true);
SendMessage(newItem->hWnd, BUTTONSETBTNITEM, 0, (LPARAM)newItem);
if (newItem->dwFlags & BUTTON_ISTOGGLE)
@@ -1174,7 +1174,7 @@ void IMG_LoadItems() // TODO: rewrite the skin loading in wchar_t manner
char szFileName[MAX_PATH];
- WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, szFileName, MAX_PATH, 0, 0);
+ WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, szFileName, MAX_PATH, nullptr, nullptr);
db_free(&dbv);
@@ -1227,11 +1227,11 @@ void LoadPerContactSkins(wchar_t *tszFileName) ptrA szSections(LPSTR(calloc(3002, 1)));
char *p = szSections;
- StatusItems_t *items = NULL, *this_item;
+ StatusItems_t *items = nullptr, *this_item;
int i = 1;
char file[MAX_PATH];
- WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, file, MAX_PATH, 0, 0);
+ WideCharToMultiByte(CP_ACP, 0, tszFileName, MAX_PATH, file, MAX_PATH, nullptr, nullptr);
file[MAX_PATH - 1] = 0;
ReadItem(&default_item, "%Default", file);
@@ -1262,11 +1262,11 @@ void LoadPerContactSkins(wchar_t *tszFileName) if (items) {
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
char *szProto = GetContactProto(hContact);
- if (szProto == NULL)
+ if (szProto == nullptr)
continue;
char *uid = (char *)CallProtoService(szProto, PS_GETCAPS, PFLAG_UNIQUEIDSETTING, 0);
- if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid != NULL) {
+ if ((INT_PTR)uid != CALLSERVICE_NOTFOUND && uid != nullptr) {
DBVARIANT dbv = { 0 };
if (db_get(hContact, szProto, uid, &dbv))
break;
@@ -1405,7 +1405,7 @@ void extbk_import(char *file, HWND hwndDlg) char szString[MAX_PATH];
szString[0] = 0;
- while (_tagSettings[i].szModule != NULL) {
+ while (_tagSettings[i].szModule != nullptr) {
data = 0;
GetPrivateProfileStructA("Global", _tagSettings[i].szSetting, &data, _tagSettings[i].size, file);
switch (_tagSettings[i].size) {
@@ -1435,7 +1435,7 @@ void extbk_import(char *file, HWND hwndDlg) pcli->pfnClcOptionsChanged();
ConfigureCLUIGeometry(1);
SendMessage(pcli->hwndContactList, WM_SIZE, 0, 0);
- RedrawWindow(pcli->hwndContactList, NULL, NULL, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
static void ApplyCLUISkin()
@@ -1446,18 +1446,18 @@ static void ApplyCLUISkin() if (!db_get_ws(NULL, "CLC", "AdvancedSkin", &dbv)) {
MY_pathToAbsolute(dbv.ptszVal, tszFinalName);
- WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, 0, 0);
+ WideCharToMultiByte(CP_ACP, 0, tszFinalName, MAX_PATH, szFinalName, MAX_PATH, nullptr, nullptr);
if (db_get_b(NULL, "CLUI", "skin_changed", 0)) {
- extbk_import(szFinalName, 0);
+ extbk_import(szFinalName, nullptr);
SaveCompleteStructToDB();
db_set_b(NULL, "CLUI", "skin_changed", 0);
}
IMG_LoadItems();
ShowWindow(pcli->hwndContactList, SW_SHOWNORMAL);
- SetWindowPos(pcli->hwndContactList, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED);
+ 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, NULL, NULL, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE);
+ RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE);
db_free(&dbv);
}
}
@@ -1528,7 +1528,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwndDlg;
- ofn.hInstance = NULL;
+ ofn.hInstance = nullptr;
ofn.lpstrFilter = L"*.clist\0";
ofn.lpstrFile = str;
ofn.Flags = OFN_FILEMUSTEXIST | OFN_DONTADDTORECENT;
@@ -1600,7 +1600,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int iInit = TRUE;
- static HWND hwndSkinEdit = 0;
+ static HWND hwndSkinEdit = nullptr;
switch (msg) {
case WM_INITDIALOG:
@@ -1662,7 +1662,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara OPENFILENAMEA ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwnd;
- ofn.hInstance = NULL;
+ ofn.hInstance = nullptr;
ofn.lpstrFilter = "*.clist";
ofn.lpstrFile = str;
ofn.Flags = OFN_HIDEREADONLY;
@@ -1680,7 +1680,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara OPENFILENAMEA ofn = { 0 };
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
ofn.hwndOwner = hwnd;
- ofn.hInstance = NULL;
+ ofn.hInstance = nullptr;
ofn.lpstrFilter = "*.clist";
ofn.lpstrFile = str;
ofn.Flags = OFN_FILEMUSTEXIST;
@@ -1733,7 +1733,7 @@ INT_PTR CALLBACK OptionsDlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPara }
break;
case WM_DESTROY:
- hwndSkinEdit = 0;
+ hwndSkinEdit = nullptr;
break;
}
return FALSE;
diff --git a/plugins/Clist_nicer/src/groupmenu.cpp b/plugins/Clist_nicer/src/groupmenu.cpp index 9ba48eac12..62b955c8c7 100644 --- a/plugins/Clist_nicer/src/groupmenu.cpp +++ b/plugins/Clist_nicer/src/groupmenu.cpp @@ -51,7 +51,7 @@ static HMENU hMenuOldContext; static INT_PTR GroupMenu_OnAddService(WPARAM wParam, LPARAM lParam)
{
MENUITEMINFO *mii = (MENUITEMINFO*)wParam;
- if (mii == NULL)
+ if (mii == nullptr)
return 0;
if (hGroupMainMenuItemProxy == (HANDLE)lParam) {
@@ -133,7 +133,7 @@ void InitGroupMenus(void) mi.root = Menu_AddGroupMenuItem(&mi);
UNSET_UID(mi);
- mi.hIcolibItem = NULL;
+ mi.hIcolibItem = nullptr;
mi.pszService = "CLISTMENUSGroup/CommandHelper";
CreateServiceFunction(mi.pszService, CommandHelper);
for (int i = 0; i < _countof(hAppearanceItems); i++) {
@@ -145,7 +145,7 @@ void InitGroupMenus(void) }
SET_UID(mi, 0xc2895531, 0x98e9, 0x40bc, 0x9b, 0x8e, 0xfb, 0x33, 0xe8, 0xab, 0xcc, 0xef);
- mi.root = NULL;
+ mi.root = nullptr;
mi.position = 400000;
mi.hIcolibItem = Skin_GetIconHandle(SKINICON_OTHER_OPTIONS);
mi.pszService = "Options/OptionsCommand";
diff --git a/plugins/Clist_nicer/src/init.cpp b/plugins/Clist_nicer/src/init.cpp index 503d67591b..7bd7c4077b 100644 --- a/plugins/Clist_nicer/src/init.cpp +++ b/plugins/Clist_nicer/src/init.cpp @@ -27,7 +27,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #pragma comment(lib, "shlwapi.lib")
-HINSTANCE g_hInst = 0;
+HINSTANCE g_hInst = nullptr;
CLIST_INTERFACE *pcli, coreCli;
int hLangpack;
@@ -115,7 +115,7 @@ static int systemModulesLoaded(WPARAM, LPARAM) static int fnIconFromStatusMode(const char *szProto, int status, MCONTACT hContact)
{
- return IconFromStatusMode(szProto, status, hContact, NULL);
+ return IconFromStatusMode(szProto, status, hContact, nullptr);
}
extern "C" int __declspec(dllexport) CListInitialise()
diff --git a/plugins/Clist_nicer/src/rowheight_funcs.cpp b/plugins/Clist_nicer/src/rowheight_funcs.cpp index 95f1907c5d..e916ac3b74 100644 --- a/plugins/Clist_nicer/src/rowheight_funcs.cpp +++ b/plugins/Clist_nicer/src/rowheight_funcs.cpp @@ -30,16 +30,16 @@ BOOL RowHeight::Init(ClcData *dat) dat->rowHeight = 0;
dat->row_heights_size = 0;
dat->row_heights_allocated = 0;
- dat->row_heights = NULL;
+ dat->row_heights = nullptr;
return TRUE;
}
void RowHeight::Free(ClcData *dat)
{
- if (dat->row_heights != NULL) {
+ if (dat->row_heights != nullptr) {
free(dat->row_heights);
- dat->row_heights = NULL;
+ dat->row_heights = nullptr;
}
dat->row_heights_allocated = 0;
@@ -60,10 +60,10 @@ BOOL RowHeight::Alloc(ClcData *dat, int size) size_grow += 100 - (size_grow % 100);
- if (dat->row_heights != NULL) {
+ if (dat->row_heights != nullptr) {
int *tmp = (int *)realloc((void *)dat->row_heights, sizeof(int) * size_grow);
- if (tmp == NULL) {
+ if (tmp == nullptr) {
Free(dat);
return FALSE;
}
@@ -73,7 +73,7 @@ BOOL RowHeight::Alloc(ClcData *dat, int size) else {
dat->row_heights = (int *)malloc(sizeof(int) * size_grow);
- if (dat->row_heights == NULL) {
+ if (dat->row_heights == nullptr) {
Free(dat);
return FALSE;
}
@@ -141,7 +141,7 @@ void RowHeight::calcRowHeights(ClcData *dat, HWND hwnd) while (true) {
if (group->scanIndex == group->cl.getCount()) {
group = group->parent;
- if (group == NULL) break; // Finished list
+ if (group == nullptr) break; // Finished list
group->scanIndex++;
continue;
}
@@ -216,7 +216,7 @@ int RowHeight::hitTest(ClcData *dat, int pos_y) int RowHeight::getHeight(ClcData *dat, int item)
{
- if (dat->row_heights == 0)
+ if (dat->row_heights == nullptr)
return 0;
return dat->row_heights[item];
diff --git a/plugins/Clist_nicer/src/statusbar.cpp b/plugins/Clist_nicer/src/statusbar.cpp index c63cb5fb27..e69c39732e 100644 --- a/plugins/Clist_nicer/src/statusbar.cpp +++ b/plugins/Clist_nicer/src/statusbar.cpp @@ -53,7 +53,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM tooltip_active = FALSE;
}
KillTimer(hwnd, TIMERID_HOVER);
- SetTimer(hwnd, TIMERID_HOVER, 750, 0);
+ SetTimer(hwnd, TIMERID_HOVER, 750, nullptr);
break;
case WM_NCHITTEST:
@@ -150,7 +150,7 @@ LRESULT CALLBACK NewStatusBarWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendMessage(hwnd, SB_GETRECT, i, (LPARAM)&rc);
if (PtInRect(&rc, pt)) {
ProtocolData *PD = (ProtocolData *)SendMessageA(hwnd, SB_GETTEXTA, i, 0);
- if (PD == NULL)
+ if (PD == nullptr)
continue;
if (NotifyEventHooks(hStatusBarShowToolTipEvent, (WPARAM)PD->RealName, 0) > 0) // a plugin handled this event
diff --git a/plugins/Clist_nicer/src/viewmodes.cpp b/plugins/Clist_nicer/src/viewmodes.cpp index 9e444712e7..7032fb95b6 100644 --- a/plugins/Clist_nicer/src/viewmodes.cpp +++ b/plugins/Clist_nicer/src/viewmodes.cpp @@ -31,14 +31,14 @@ extern HPEN g_hPenCLUIFrames; extern FRAMEWND *wndFrameViewMode;
typedef int(__cdecl *pfnEnumCallback)(char *szName);
-static HWND sttClvmHwnd = 0;
+static HWND sttClvmHwnd = nullptr;
static int sttClvm_curItem = 0;
-HMENU hViewModeMenu = 0;
+HMENU hViewModeMenu = nullptr;
static int nullImage;
-static HWND hwndSelector = 0;
-static HANDLE hInfoItem = 0;
-static HIMAGELIST himlViewModes = 0;
+static HWND hwndSelector = nullptr;
+static HANDLE hInfoItem = nullptr;
+static HIMAGELIST himlViewModes = nullptr;
static DWORD sttStickyStatusMask = 0;
static char sttModeName[2048];
@@ -60,7 +60,7 @@ static UINT _page2Controls[] = { IDC_CLIST, IDC_STATIC9, IDC_STATIC8, IDC_CLEARA int CLVM_EnumProc(const char *szSetting, LPARAM lParam)
{
pfnEnumCallback EnumCallback = (pfnEnumCallback)lParam;
- if (szSetting != NULL)
+ if (szSetting != nullptr)
EnumCallback((char *)szSetting);
return 0;
}
@@ -109,7 +109,7 @@ static void ShowPage(HWND hwnd, int page) }
if (pageChange) {
SendMessage(hwnd, WM_SETREDRAW, TRUE, 0);
- RedrawWindow(hwnd, NULL, NULL, RDW_ERASE | RDW_INVALIDATE);
+ RedrawWindow(hwnd, nullptr, nullptr, RDW_ERASE | RDW_INVALIDATE);
}
}
@@ -161,7 +161,7 @@ static int FillDialog(HWND hwnd) HWND hwndList = GetDlgItem(hwnd, IDC_PROTOCOLS);
LVITEM item = { 0 };
int protoCount = 0, i;
- PROTOACCOUNT **accs = 0;
+ PROTOACCOUNT **accs = nullptr;
CLVM_EnumModes(FillModes);
ListView_SetExtendedListViewStyle(hwndList, LVS_EX_CHECKBOXES);
@@ -195,7 +195,7 @@ static int FillDialog(HWND hwnd) SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
wchar_t *grpName;
- for (i = 1; (grpName = Clist_GroupGetName(i, NULL)) != NULL; i++) {
+ for (i = 1; (grpName = Clist_GroupGetName(i, nullptr)) != nullptr; i++) {
item.pszText = grpName;
SendMessage(hwndList, LVM_INSERTITEM, 0, (LPARAM)&item);
}
@@ -551,7 +551,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP himlViewModes = ImageList_Create(16, 16, ILC_MASK | ILC_COLOR32, 12, 0);
for (int i = ID_STATUS_OFFLINE; i <= ID_STATUS_OUTTOLUNCH; i++)
- ImageList_AddIcon(himlViewModes, Skin_LoadProtoIcon(NULL, i));
+ ImageList_AddIcon(himlViewModes, Skin_LoadProtoIcon(nullptr, i));
{
HICON hIcon = (HICON)LoadImage(g_hInst, MAKEINTRESOURCE(IDI_MINIMIZE), IMAGE_ICON, 16, 16, 0);
nullImage = ImageList_AddIcon(himlViewModes, hIcon);
@@ -581,7 +581,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP {
CLCINFOITEM cii = { 0 };
cii.cbSize = sizeof(cii);
- cii.hParentGroup = 0;
+ cii.hParentGroup = nullptr;
cii.pszText = LPGENW("*** All contacts ***");
hInfoItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
}
@@ -629,7 +629,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP Utils::enableDlgControl(hwndDlg, IDC_APPLY, TRUE);
break;
case IDC_DELETEVIEWMODE:
- if (MessageBox(0, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if (MessageBox(nullptr, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
char szSetting[256];
int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
if (iLen) {
@@ -677,7 +677,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP if (mir_strlen(szBuf) > 2) {
if (db_get_dw(NULL, CLVM_MODULE, szBuf, -1) != -1)
- MessageBox(0, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK);
+ MessageBox(nullptr, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK);
else {
int iNewItem = SendDlgItemMessageA(hwndDlg, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)szBuf);
if (iNewItem != LB_ERR) {
@@ -742,7 +742,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP DWORD hitFlags;
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_HITTEST, (WPARAM)&hitFlags, MAKELPARAM(nm->pt.x, nm->pt.y));
- if (hItem == NULL || !(hitFlags & CLCHT_ONITEMEXTRA))
+ if (hItem == nullptr || !(hitFlags & CLCHT_ONITEMEXTRA))
break;
int iImage = SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETEXTRAIMAGE, (WPARAM)hItem, MAKELPARAM(nm->iColumn, 0));
@@ -798,7 +798,7 @@ void BuildViewModeMenu() CLVM_EnumModes(FillMenuCallback);
if (GetMenuItemCount(hViewModeMenu) > 0)
- AppendMenu(hViewModeMenu, MF_SEPARATOR, 0, NULL);
+ AppendMenu(hViewModeMenu, MF_SEPARATOR, 0, nullptr);
AppendMenu(hViewModeMenu, MF_STRING, 10001, TranslateT("Setup view modes..."));
AppendMenu(hViewModeMenu, MF_STRING, 10002, TranslateT("Clear current view mode"));
@@ -821,18 +821,18 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM switch (msg) {
case WM_CREATE:
hwndSelector = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU)IDC_SELECTMODE, g_hInst, NULL);
+ hwnd, (HMENU)IDC_SELECTMODE, g_hInst, nullptr);
CustomizeButton(hwndSelector, false, false, false);
SendMessage(hwndSelector, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Select a view mode"), BATF_UNICODE);
SendMessage(hwndSelector, BUTTONSETSENDONDOWN, TRUE, 0);
{
HWND hwndButton = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU)IDC_CONFIGUREMODES, g_hInst, NULL);
+ hwnd, (HMENU)IDC_CONFIGUREMODES, g_hInst, nullptr);
CustomizeButton(hwndButton, false, false, false);
SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Setup view modes"), BATF_UNICODE);
hwndButton = CreateWindowEx(0, MIRANDABUTTONCLASS, L"", BS_PUSHBUTTON | WS_VISIBLE | WS_CHILD | WS_TABSTOP, 0, 0, 20, 20,
- hwnd, (HMENU)IDC_RESETMODES, g_hInst, NULL);
+ hwnd, (HMENU)IDC_RESETMODES, g_hInst, nullptr);
CustomizeButton(hwndButton, false, false, false);
SendMessage(hwndButton, BUTTONADDTOOLTIP, (WPARAM)TranslateT("Clear view mode and return to default display"), BATF_UNICODE);
}
@@ -856,11 +856,11 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM {
HDWP PosBatch = BeginDeferWindowPos(3);
GetClientRect(hwnd, &rcCLVMFrame);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), 0,
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), nullptr,
rcCLVMFrame.right - 24, 1, 22, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), 0,
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), nullptr,
rcCLVMFrame.right - 47, 1, 22, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), 0,
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), nullptr,
2, 1, rcCLVMFrame.right - 50, 20, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
EndDeferWindowPos(PosBatch);
}
@@ -942,7 +942,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM POINT pt;
pt.x = rc.left;
pt.y = rc.bottom;
- int selection = TrackPopupMenu(hViewModeMenu, TPM_RETURNCMD | TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, NULL);
+ int selection = TrackPopupMenu(hViewModeMenu, TPM_RETURNCMD | TPM_TOPALIGN | TPM_LEFTALIGN | TPM_RIGHTBUTTON, pt.x, pt.y, 0, hwnd, nullptr);
if (selection) {
if (selection == 10001)
goto clvm_config_command;
@@ -977,7 +977,7 @@ clvm_reset_command: case IDC_CONFIGUREMODES:
clvm_config_command:
if (!g_ViewModeOptDlg)
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), nullptr, DlgProcViewModesSetup, 0);
break;
}
break;
@@ -1001,10 +1001,10 @@ void CreateViewModeFrame() wndclass.cbClsExtra = 0;
wndclass.cbWndExtra = 0;
wndclass.hInstance = g_hInst;
- wndclass.hIcon = 0;
- wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
+ wndclass.hIcon = nullptr;
+ wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)(COLOR_3DFACE);
- wndclass.lpszMenuName = 0;
+ wndclass.lpszMenuName = nullptr;
wndclass.lpszClassName = L"CLVMFrameWindow";
RegisterClass(&wndclass);
@@ -1016,7 +1016,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)0, g_hInst, NULL);
+ 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_hInst, nullptr);
g_hwndViewModeFrame = frame.hWnd;
hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
@@ -1063,7 +1063,7 @@ void ApplyViewMode(const char *name) timerexpire = LOWORD(db_get_dw(NULL, CLVM_MODULE, szSetting, 0));
strncpy(cfg::dat.old_viewmode, cfg::dat.current_viewmode, 256);
cfg::dat.old_viewmode[255] = 0;
- SetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, NULL);
+ SetTimer(g_hwndViewModeFrame, TIMERID_VIEWMODEEXPIRE, timerexpire * 1000, nullptr);
}
strncpy_s(cfg::dat.current_viewmode, name, _TRUNCATE);
|