summaryrefslogtreecommitdiff
path: root/plugins/NewAwaySysMod
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/NewAwaySysMod
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/NewAwaySysMod')
-rw-r--r--plugins/NewAwaySysMod/src/AwayOpt.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/AwaySys.cpp8
-rw-r--r--plugins/NewAwaySysMod/src/Client.cpp8
-rw-r--r--plugins/NewAwaySysMod/src/ContactList.cpp32
-rw-r--r--plugins/NewAwaySysMod/src/GroupCheckbox.cpp22
-rw-r--r--plugins/NewAwaySysMod/src/MsgEventAdded.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/MsgTree.cpp34
-rw-r--r--plugins/NewAwaySysMod/src/Options.cpp8
-rw-r--r--plugins/NewAwaySysMod/src/Properties.cpp4
-rw-r--r--plugins/NewAwaySysMod/src/ReadAwayMsg.cpp6
-rw-r--r--plugins/NewAwaySysMod/src/Services.cpp2
-rw-r--r--plugins/NewAwaySysMod/src/SetAwayMsg.cpp44
12 files changed, 90 insertions, 90 deletions
diff --git a/plugins/NewAwaySysMod/src/AwayOpt.cpp b/plugins/NewAwaySysMod/src/AwayOpt.cpp
index b0b313b999..3ded4b59c6 100644
--- a/plugins/NewAwaySysMod/src/AwayOpt.cpp
+++ b/plugins/NewAwaySysMod/src/AwayOpt.cpp
@@ -56,7 +56,7 @@ void MySetPos(HWND hwndParent)
pt.x = CWOldPos.left;
pt.y = CWOldPos.top;
ScreenToClient(hwndParent, &pt);
- SetWindowPos(hCurWnd, NULL, pt.x + dx, pt.y + dy, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
+ SetWindowPos(hCurWnd, nullptr, pt.x + dx, pt.y + dy, 0, 0, SWP_NOSIZE | SWP_NOZORDER);
hCurWnd = GetNextWindow(hCurWnd, GW_HWNDNEXT);
}
}
@@ -124,7 +124,7 @@ static Dlg1Buttons[] = {
static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
static int ChangeLock = 0;
- static CMsgTree* MsgTree = NULL;
+ static CMsgTree* MsgTree = nullptr;
switch (msg) {
case WM_INITDIALOG:
@@ -317,7 +317,7 @@ static INT_PTR CALLBACK MessagesOptDlg(HWND hwndDlg, UINT msg, WPARAM wParam, LP
case WM_DESTROY:
delete MsgTree;
- MsgTree = NULL;
+ MsgTree = nullptr;
g_MessagesOptPage.SetWnd(NULL);
break;
}
diff --git a/plugins/NewAwaySysMod/src/AwaySys.cpp b/plugins/NewAwaySysMod/src/AwaySys.cpp
index 9d97e205b9..4ab5f98280 100644
--- a/plugins/NewAwaySysMod/src/AwaySys.cpp
+++ b/plugins/NewAwaySysMod/src/AwaySys.cpp
@@ -73,7 +73,7 @@ HICON GetIcon(int iconId, bool size)
if (iconList[i].defIconID == iconId)
return IcoLib_GetIconByHandle(iconList[i].hIcolib, size);
- return NULL;
+ return nullptr;
}
PLUGININFOEX pluginInfo = {
@@ -265,7 +265,7 @@ int StatusChanged(WPARAM wParam, LPARAM lParam)
memset(dat, 0, sizeof(SetAwayMsgData));
dat->szProtocol = (char*)lParam;
dat->IsModeless = false;
- DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_SETAWAYMSG), NULL, SetAwayMsgDlgProc, (LPARAM)dat);
+ DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_SETAWAYMSG), nullptr, SetAwayMsgDlgProc, (LPARAM)dat);
}
return 0;
}
@@ -312,7 +312,7 @@ int PreBuildContactMenu(WPARAM hContact, LPARAM)
int iContactMode = db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE);
wchar_t szSetStr[256], szReadStr[256];
szSetStr[0] = szReadStr[0] = 0;
- HICON hReadMsgIcon = NULL;
+ HICON hReadMsgIcon = nullptr;
if (szProto) {
int i;
@@ -383,7 +383,7 @@ static INT_PTR SetContactStatMsg(WPARAM hContact, LPARAM)
dat->hInitContact = hContact;
dat->szProtocol = GetContactProto(hContact);
dat->IsModeless = false;
- DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_SETAWAYMSG), NULL, SetAwayMsgDlgProc, (LPARAM)dat);
+ DialogBoxParam(g_hInstance, MAKEINTRESOURCE(IDD_SETAWAYMSG), nullptr, SetAwayMsgDlgProc, (LPARAM)dat);
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/Client.cpp b/plugins/NewAwaySysMod/src/Client.cpp
index f83dc3a0be..92dbffb9c4 100644
--- a/plugins/NewAwaySysMod/src/Client.cpp
+++ b/plugins/NewAwaySysMod/src/Client.cpp
@@ -25,8 +25,8 @@
#define PARSE_INTERVAL 10000
-HANDLE g_hTerminateUpdateMsgsThread = NULL;
-HANDLE g_hUpdateMsgsThread = NULL;
+HANDLE g_hTerminateUpdateMsgsThread = nullptr;
+HANDLE g_hUpdateMsgsThread = nullptr;
void __cdecl UpdateMsgsThreadProc(void *)
{
@@ -71,11 +71,11 @@ void InitUpdateMsgs()
SetEvent(g_hTerminateUpdateMsgsThread);
QueueUserAPC(DummyAPCFunc, g_hUpdateMsgsThread, 0); // wake up the thread, as it's most probably in SleepEx() now
WaitForSingleObject(g_hUpdateMsgsThread, INFINITE);
- g_hUpdateMsgsThread = NULL;
+ g_hUpdateMsgsThread = nullptr;
CloseHandle(g_hTerminateUpdateMsgsThread);
}
else if (!g_hUpdateMsgsThread && UpdateMsgs) {
- g_hTerminateUpdateMsgsThread = CreateEvent(NULL, TRUE, FALSE, NULL);
+ g_hTerminateUpdateMsgsThread = CreateEvent(nullptr, TRUE, FALSE, nullptr);
g_hUpdateMsgsThread = (HANDLE)mir_forkthread(UpdateMsgsThreadProc, NULL);
}
}
diff --git a/plugins/NewAwaySysMod/src/ContactList.cpp b/plugins/NewAwaySysMod/src/ContactList.cpp
index 561292c9b1..99a50335fa 100644
--- a/plugins/NewAwaySysMod/src/ContactList.cpp
+++ b/plugins/NewAwaySysMod/src/ContactList.cpp
@@ -171,7 +171,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA
tvi.iImage = tvi.iSelectedImage = lParam;
TreeView_SetItem(hWnd, &tvi);
dat->SortContacts();
- InvalidateRect(hWnd, NULL, false);
+ InvalidateRect(hWnd, nullptr, false);
}
break;
@@ -252,7 +252,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA
// if it was a click on the selected item and there's need to do something in this case, then send SELCHANGED notification by ourselves, as the tree control doesn't do anything
if (hItem == TreeView_GetSelection(hWnd) && (dat->SelectedItems.GetSize() != 1 || (dat->SelectedItems.GetSize() == 1 && dat->SelectedItems[0] != hItem))) {
TreeView_SetItemState(hWnd, hItem, TVIS_SELECTED, TVIS_SELECTED);
- NMTREEVIEW nm = { 0 };
+ NMTREEVIEW nm = {};
nm.hdr.code = TVN_SELCHANGED;
nm.hdr.hwndFrom = hWnd;
nm.hdr.idFrom = GetDlgCtrlID(hWnd);
@@ -277,7 +277,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA
case WM_SIZE:
case WM_HSCROLL:
- InvalidateRect(hWnd, NULL, false);
+ InvalidateRect(hWnd, nullptr, false);
break;
case WM_MEASUREITEM:
@@ -293,7 +293,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA
case WM_CONTEXTMENU:
{
POINT pt = { GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam) };
- HTREEITEM hItem = NULL;
+ HTREEITEM hItem = nullptr;
if (pt.x == -1 && pt.y == -1) {
if (dat->SelectedItems.GetSize() == 1) {
hItem = dat->SelectedItems[0];
@@ -309,7 +309,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA
ScreenToClient(hWnd, &pt);
hItem = dat->HitTest(&pt, &hitFlags);
if (!(hitFlags & MCLCHT_ONITEM))
- hItem = NULL;
+ hItem = nullptr;
}
if (hItem) {
MCONTACT hContact = dat->GetItemData(hItem).hContact;
@@ -338,7 +338,7 @@ LRESULT CALLBACK ContactListSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPA
CCList::CCList(HWND hTreeView) :
hTreeView(hTreeView),
- ExtraImageList(NULL)
+ ExtraImageList(nullptr)
{
CWndUserData(GetParent(hTreeView)).SetCList(this);
OrigTreeViewProc = (WNDPROC)SetWindowLongPtr(hTreeView, GWLP_WNDPROC, (LONG_PTR)ContactListSubclassProc);
@@ -354,7 +354,7 @@ CCList::~CCList()
_ASSERT(GetWindowLongPtr(GetParent(hTreeView), GWLP_WNDPROC) == (LONG_PTR)ParentSubclassProc); // we won't allow anyone to change our WNDPROC. otherwise we're not sure that we're setting the right WNDPROC back
SetWindowLongPtr(hTreeView, GWLP_WNDPROC, (LONG_PTR)OrigTreeViewProc);
SetWindowLongPtr(GetParent(hTreeView), GWLP_WNDPROC, (LONG_PTR)OrigParentProc);
- CWndUserData(GetParent(hTreeView)).SetCList(NULL);
+ CWndUserData(GetParent(hTreeView)).SetCList(nullptr);
}
// adds a new contact if it doesn't exist yet; returns its hItem
@@ -384,14 +384,14 @@ HTREEITEM CCList::AddGroup(TCString GroupName)
MGROUP hGroupId = Clist_GroupExists(GroupName);
if (hGroupId == NULL)
- return NULL;
+ return nullptr;
MCONTACT hContact = UINT_PTR(hGroupId) - 1 + HCONTACT_ISGROUP;
HTREEITEM hGroupItem = FindContact(hContact);
if (hGroupItem)
return hGroupItem; // exists already, just return its handle
- TVINSERTSTRUCT tvIns = { 0 };
+ TVINSERTSTRUCT tvIns = {};
tvIns.hParent = TVI_ROOT;
tvIns.item.pszText = wcsrchr(GroupName, '\\');
if (tvIns.item.pszText) {
@@ -411,7 +411,7 @@ HTREEITEM CCList::AddGroup(TCString GroupName)
HTREEITEM CCList::AddInfo(TCString Title, HTREEITEM hParent, HTREEITEM hInsertAfter, LPARAM lParam, HICON hIcon)
{
- TVINSERTSTRUCT tvi = { 0 };
+ TVINSERTSTRUCT tvi = {};
tvi.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_PARAM;
tvi.item.pszText = Title;
tvi.hParent = hParent;
@@ -463,7 +463,7 @@ int CALLBACK CompareItemsCallback(LPARAM lParam1, LPARAM lParam2, LPARAM lParamS
void CCList::SortContacts()
{
- TVSORTCB tvSort = { 0 };
+ TVSORTCB tvSort = {};
tvSort.lpfnCompare = CompareItemsCallback;
tvSort.hParent = TVI_ROOT;
tvSort.lParam = (LPARAM)this;
@@ -491,7 +491,7 @@ void CCList::SetExtraImage(HTREEITEM hItem, int iColumn, int iImage) // set iIma
void CCList::SetExtraImageList(HIMAGELIST hImgList)
{
ExtraImageList = hImgList;
- InvalidateRect(hTreeView, NULL, false);
+ InvalidateRect(hTreeView, nullptr, false);
}
int CCList::GetItemType(HTREEITEM hItem) // returns a MCLCIT_ (see below)
@@ -519,7 +519,7 @@ HTREEITEM CCList::GetNextItem(DWORD Flags, HTREEITEM hItem)
hItem = hNextItem;
hNextItem = TreeView_GetLastChild(hTreeView, hNextItem);
} while (hNextItem);
- return (hItem == TVI_ROOT) ? NULL : hItem;
+ return (hItem == TVI_ROOT) ? nullptr : hItem;
}
case MCLGN_CHILD:
@@ -534,7 +534,7 @@ HTREEITEM CCList::GetNextItem(DWORD Flags, HTREEITEM hItem)
case MCLGN_NEXT:
do {
if (Flags & MCLGN_MULTILEVEL) {
- HTREEITEM hNextItem = NULL;
+ HTREEITEM hNextItem = nullptr;
if ((Flags & MCLGN_NOTCHILD) != MCLGN_NOTCHILD)
hNextItem = TreeView_GetChild(hTreeView, hItem);
@@ -582,7 +582,7 @@ HTREEITEM CCList::GetNextItem(DWORD Flags, HTREEITEM hItem)
default:
_ASSERT(0);
}
- return NULL;
+ return nullptr;
}
MCONTACT CCList::GethContact(HTREEITEM hItem) // returns hContact, hGroup or hInfo
@@ -688,7 +688,7 @@ HTREEITEM CCList::FindContact(MCONTACT hContact)
}
tvi.hItem = GetNextItem(MCLGN_NEXT | MCLGN_ANY | MCLGN_MULTILEVEL, tvi.hItem);
}
- return NULL;
+ return nullptr;
}
void CCList::SelectGroups(HTREEITEM hCurItem, bool bSelected)
diff --git a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
index 4ec48644bb..8fda499b09 100644
--- a/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
+++ b/plugins/NewAwaySysMod/src/GroupCheckbox.cpp
@@ -51,7 +51,7 @@
class CCheckboxData
{
public:
- CCheckboxData(): OldWndProc(NULL), Style(0), State(0), hFont(NULL) {};
+ CCheckboxData(): OldWndProc(nullptr), Style(0), State(0), hFont(nullptr) {};
WNDPROC OldWndProc;
int Style; // BS_CHECKBOX, BS_AUTOCHECKBOX, BS_3STATE or BS_AUTO3STATE
@@ -90,7 +90,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
if (hTheme) {
WCHAR *szText = (WCHAR*)_alloca(Len * sizeof(WCHAR));
GetWindowTextW(hWnd, szText, Len);
- GetThemeTextExtent(hTheme, hdc, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szText, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, 0, &rcText);
+ GetThemeTextExtent(hTheme, hdc, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szText, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, nullptr, &rcText);
}
else {
SIZE size;
@@ -109,7 +109,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
OffsetRect(&rcText, CG_CHECKBOX_INDENT + CG_CHECKBOX_WIDTH + CG_TEXT_INDENT, 0);
RECT rc;
GetClientRect(hWnd, &rc);
- SetWindowPos(hWnd, 0, 0, 0, rcText.right + CG_ADDITIONAL_WIDTH, rc.bottom, SWP_NOMOVE | SWP_NOZORDER);
+ SetWindowPos(hWnd, nullptr, 0, 0, rcText.right + CG_ADDITIONAL_WIDTH, rc.bottom, SWP_NOMOVE | SWP_NOZORDER);
}
break;
@@ -126,7 +126,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
wParam = BST_CHECKED;
dat->State &= ~CGSM_ISCHECKED;
dat->State |= wParam;
- InvalidateRect(hWnd, NULL, false);
+ InvalidateRect(hWnd, nullptr, false);
SendMessage(GetParent(hWnd), WM_COMMAND, MAKEWPARAM(GetDlgCtrlID(hWnd), BN_CLICKED), (LPARAM)hWnd);
return 0;
@@ -135,7 +135,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
dat->State |= CGS_PRESSED;
else
dat->State &= ~CGS_PRESSED;
- InvalidateRect(hWnd, NULL, false);
+ InvalidateRect(hWnd, nullptr, false);
return 0;
case BM_GETSTATE:
@@ -146,7 +146,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
case WM_THEMECHANGED:
case WM_ENABLE:
- InvalidateRect(hWnd, NULL, false);
+ InvalidateRect(hWnd, nullptr, false);
return 0;
case WM_SETTEXT:
@@ -203,21 +203,21 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
GetCursorPos(&pt);
if ((WindowFromPoint(pt) == hWnd) ^ ((dat->State & CGS_HOVERED) != 0)) {
dat->State ^= CGS_HOVERED;
- InvalidateRect(hWnd, NULL, false);
+ InvalidateRect(hWnd, nullptr, false);
}
return 0;
case WM_MOUSELEAVE:
if (dat->State & CGS_HOVERED) {
dat->State &= ~CGS_HOVERED;
- InvalidateRect(hWnd, NULL, false);
+ InvalidateRect(hWnd, nullptr, false);
}
return 0;
case WM_SETFOCUS:
case WM_KILLFOCUS:
case WM_SYSCOLORCHANGE:
- InvalidateRect(hWnd, NULL, false);
+ InvalidateRect(hWnd, nullptr, false);
return 0;
case WM_PAINT:
@@ -232,7 +232,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
HBITMAP hbmOld = (HBITMAP)SelectObject(hdcMem, hbmMem);
HTHEME hTheme = OpenThemeData(hWnd, L"BUTTON");
if (hTheme)
- DrawThemeParentBackground(hWnd, hdcMem, NULL);
+ DrawThemeParentBackground(hWnd, hdcMem, nullptr);
else
FillRect(hdcMem, &rc, GetSysColorBrush(COLOR_3DFACE));
@@ -287,7 +287,7 @@ static int CALLBACK CheckboxWndProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM l
if (GetFocus() == hWnd) {
RECT rcText = { 0 };
if (hTheme)
- GetThemeTextExtent(hTheme, hdcMem, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szTextT, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, 0, &rcText);
+ GetThemeTextExtent(hTheme, hdcMem, BP_GROUPBOX, IsWindowEnabled(hWnd) ? GBS_NORMAL : GBS_DISABLED, szTextT, -1, DT_CALCRECT | DT_LEFT | DT_VCENTER | DT_SINGLELINE, nullptr, &rcText);
else {
SIZE size;
GetTextExtentPoint32(hdcMem, szTextT, (int)mir_wstrlen(szTextT), &size);
diff --git a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
index 97b64d22e3..6316a5d50f 100644
--- a/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
+++ b/plugins/NewAwaySysMod/src/MsgEventAdded.cpp
@@ -133,7 +133,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam)
return 0;
// remove outdated events first
- DWORD CurTime = time(NULL);
+ DWORD CurTime = time(nullptr);
int i;
for (i = MetacontactEvents.GetSize() - 1; i >= 0; i--)
if (CurTime - MetacontactEvents[i].timestamp > MAX_REPLY_TIMEDIFF)
@@ -155,7 +155,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam)
// ugly workaround for metacontacts, part i; store all metacontacts' events to a temporary array, so we'll be able to get the 'source' protocol when subcontact event happens later. we need the protocol to get its status and per-status settings properly
if (!mir_strcmp(szProto, META_PROTO)) {
// remove outdated events first
- DWORD CurTime = time(NULL);
+ DWORD CurTime = time(nullptr);
for (int i = MetacontactEvents.GetSize() - 1; i >= 0; i--)
if (CurTime - MetacontactEvents[i].timestamp > MAX_REPLY_TIMEDIFF)
MetacontactEvents.RemoveElem(i);
@@ -224,7 +224,7 @@ int MsgEventAdded(WPARAM hContact, LPARAM lParam)
TCString Reply(*(TCString*)AutoreplyOptData.GetValue(IDC_REPLYDLG_PREFIX));
if (Reply != NULL && ServiceExists(MS_VARS_FORMATSTRING) && !g_SetAwayMsgPage.GetDBValueCopy(IDS_SAWAYMSG_DISABLEVARIABLES)) {
wchar_t *szResult = variables_parse(Reply, VarParseData.Message, hContact);
- if (szResult != NULL) {
+ if (szResult != nullptr) {
Reply = szResult;
mir_free(szResult);
}
diff --git a/plugins/NewAwaySysMod/src/MsgTree.cpp b/plugins/NewAwaySysMod/src/MsgTree.cpp
index 57720cc77f..3dc99705b2 100644
--- a/plugins/NewAwaySysMod/src/MsgTree.cpp
+++ b/plugins/NewAwaySysMod/src/MsgTree.cpp
@@ -73,7 +73,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
case TVN_BEGINDRAG:
{
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
COptItem_TreeCtrl *TreeCtrl = dat->GetTreeCtrl();
int Order = TreeCtrl->hItemToOrder(pnmtv->itemNew.hItem);
_ASSERT(Order != -1);
@@ -97,7 +97,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
return 0;
else {
LPNMTREEVIEW pnmtv = (LPNMTREEVIEW)lParam;
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
COptItem_TreeCtrl *TreeCtrl = dat->GetTreeCtrl();
if (pnmtv->itemOld.hItem) {
int Order = TreeCtrl->IDToOrder(pnmtv->itemOld.lParam);
@@ -134,7 +134,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
if (Order >= 0) {
TreeCtrl->m_value[Order].Title = ptvdi->item.pszText;
TreeCtrl->SetModified(true);
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
nm.ItemNew = &TreeCtrl->m_value[Order];
nm.hdr.code = MTN_ITEMRENAMED;
nm.hdr.hwndFrom = dat->hTreeView;
@@ -195,7 +195,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
TreeView_HitTest(dat->hTreeView, &hti);
if (hti.hItem) {
TreeView_SelectDropTarget(dat->hTreeView, hti.hItem);
- SetTimer(hWnd, MSGTREE_TIMER_ID, MSGTREE_DRAGANDDROP_GROUPEXPANDTIME, NULL);
+ SetTimer(hWnd, MSGTREE_TIMER_ID, MSGTREE_DRAGANDDROP_GROUPEXPANDTIME, nullptr);
}
else {
if (hti.flags & TVHT_ABOVE)
@@ -221,7 +221,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
ScreenToClient(dat->hTreeView, &hti.pt);
TreeView_HitTest(dat->hTreeView, &hti);
if (hti.hItem && dat->hDragItem != hti.hItem) {
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
COptItem_TreeCtrl *TreeCtrl = dat->GetTreeCtrl();
int OrderOld = TreeCtrl->hItemToOrder(dat->hDragItem);
int OrderNew = TreeCtrl->hItemToOrder(hti.hItem);
@@ -237,7 +237,7 @@ static LRESULT CALLBACK ParentSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, L
dat->UpdateLock--;
}
}
- dat->hDragItem = NULL;
+ dat->hDragItem = nullptr;
}
break;
@@ -285,7 +285,7 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
dat->UpdateLock++;
dat->MsgTreePage.DBToMemToPage();
dat->UpdateLock--;
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
int Order = TreeCtrl->IDToOrder(TreeCtrl->GetSelectedItemID(GetParent(hWnd)));
if (Order != -1) {
nm.ItemNew = (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
@@ -400,7 +400,7 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
if (TreeCtrl->m_value[Order].ID == (int)dat->MsgTreePage.GetValue(SettingsList[i].DBSetting))
SetMenuItemInfo(hPopupMenu, SettingsList[i].MenuItemID, false, &mii);
- int MenuResult = TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, ht.pt.x, ht.pt.y, 0, hWnd, NULL);
+ int MenuResult = TrackPopupMenu(hPopupMenu, TPM_RIGHTBUTTON | TPM_RETURNCMD, ht.pt.x, ht.pt.y, 0, hWnd, nullptr);
switch (MenuResult) {
case IDM_MSGTREEMENU_NEWMESSAGE:
dat->AddMessage();
@@ -461,7 +461,7 @@ LRESULT CALLBACK MsgTreeSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam, LPARAM
return CallWindowProc(dat->OrigTreeViewProc, hWnd, Msg, wParam, lParam);
}
-CMsgTree::CMsgTree(HWND hTreeView) : MsgTreePage(g_MsgTreePage), hTreeView(hTreeView), hDragItem(NULL), hPrevDropTarget(NULL), UpdateLock(0)
+CMsgTree::CMsgTree(HWND hTreeView) : MsgTreePage(g_MsgTreePage), hTreeView(hTreeView), hDragItem(nullptr), hPrevDropTarget(nullptr), UpdateLock(0)
{
CWndUserData(GetParent(hTreeView)).SetMsgTree(this);
OrigParentProc = (WNDPROC)SetWindowLongPtr(GetParent(hTreeView), GWLP_WNDPROC, (LONG_PTR)ParentSubclassProc);
@@ -485,7 +485,7 @@ CMsgTree::~CMsgTree()
_ASSERT(GetWindowLongPtr(GetParent(hTreeView), GWLP_WNDPROC) == (LONG_PTR)ParentSubclassProc); // we won't allow anyone to change our WNDPROC. otherwise we're not sure that we're setting the right WNDPROC back
SetWindowLongPtr(hTreeView, GWLP_WNDPROC, (GetWindowLongPtr(GetParent(hTreeView), GWLP_WNDPROC) == (LONG_PTR)ParentSubclassProc) ? (LONG_PTR)OrigTreeViewProc : (LONG_PTR)DefDlgProc); // yeah, if that crazy Help plugin substituted MY WndProc again, he won't get his WndProc back.. he-he >:)
SetWindowLongPtr(GetParent(hTreeView), GWLP_WNDPROC, (LONG_PTR)OrigParentProc);
- CWndUserData(GetParent(hTreeView)).SetMsgTree(NULL);
+ CWndUserData(GetParent(hTreeView)).SetMsgTree(nullptr);
WindowList_Remove(hMTWindowList, hTreeView);
ImageList_Destroy(hImageList);
}
@@ -495,7 +495,7 @@ CBaseTreeItem* CMsgTree::GetSelection() // returns NULL if there's nothing selec
COptItem_TreeCtrl *TreeCtrl = GetTreeCtrl();
int Order = TreeCtrl->IDToOrder(TreeCtrl->GetSelectedItemID(GetParent(hTreeView)));
if (Order == -1)
- return NULL;
+ return nullptr;
return (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
}
@@ -573,7 +573,7 @@ void CMsgTree::UpdateItem(int ID) // updates item title, and expanded/collapsed
TreeView_GetItem(hTreeView, &tvi);
if (TreeItem->Title != (const wchar_t*)tvi.pszText) {
TreeCtrl->SetModified(true);
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
nm.ItemNew = TreeItem;
nm.hdr.code = MTN_ITEMRENAMED;
nm.hdr.hwndFrom = hTreeView;
@@ -600,7 +600,7 @@ bool CMsgTree::DeleteSelectedItem() // returns true if the item was deleted
TranslateT("Do you really want to delete this category with its messages?") :
TranslateT("Do you really want to delete this message?")),
TranslateT("New Away System"), MB_ICONQUESTION | MB_YESNO | MB_DEFBUTTON2) == IDYES) {
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
nm.ItemOld = SelectedItem;
nm.hdr.code = MTN_DELETEITEM;
nm.hdr.hwndFrom = hTreeView;
@@ -623,7 +623,7 @@ CTreeItem* CMsgTree::AddCategory()
TreeItem->Title = tvi.pszText = TranslateT("New category");
TreeView_SetItem(hTreeView, &tvi);
TreeView_EditLabel(hTreeView, TreeItem->hItem);
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
nm.ItemNew = TreeItem;
nm.hdr.code = MTN_NEWCATEGORY;
nm.hdr.hwndFrom = hTreeView;
@@ -642,7 +642,7 @@ CTreeItem* CMsgTree::AddMessage()
TreeItem->Title = tvi.pszText = TranslateT("New message");
TreeView_SetItem(hTreeView, &tvi);
TreeView_EditLabel(hTreeView, TreeItem->hItem);
- NMMSGTREE nm = { 0 };
+ NMMSGTREE nm = {};
nm.ItemNew = TreeItem;
nm.hdr.code = MTN_NEWMESSAGE;
nm.hdr.hwndFrom = hTreeView;
@@ -671,9 +671,9 @@ CBaseTreeItem* CMsgTree::GetNextItem(int Flags, CBaseTreeItem *Item) // Item is
default: _ASSERT(0);
}
- int Order = TreeCtrl->hItemToOrder(TreeView_GetNextItem(hTreeView, TreeItem ? TreeItem->hItem : NULL, TVFlag));
+ int Order = TreeCtrl->hItemToOrder(TreeView_GetNextItem(hTreeView, TreeItem ? TreeItem->hItem : nullptr, TVFlag));
if (Order == -1)
- return NULL;
+ return nullptr;
return (Order <= TREECTRL_ROOTORDEROFFS) ? (CBaseTreeItem*)&TreeCtrl->RootItems[ROOT_ORDER_TO_INDEX(Order)] : (CBaseTreeItem*)&TreeCtrl->m_value[Order];
}
diff --git a/plugins/NewAwaySysMod/src/Options.cpp b/plugins/NewAwaySysMod/src/Options.cpp
index dd33eb8d02..0afce411de 100644
--- a/plugins/NewAwaySysMod/src/Options.cpp
+++ b/plugins/NewAwaySysMod/src/Options.cpp
@@ -98,7 +98,7 @@ COptItem *COptPage::Find(int m_dlgItemID)
return Items[i];
_ASSERT(0);
- return 0;
+ return nullptr;
}
COptPage& COptPage::operator = (const COptPage& Page)
@@ -282,7 +282,7 @@ int TreeReadEnum(const char *szSetting, LPARAM lParam)
pItem.ID = ID;
pItem.ParentID = ParentID;
pItem.Flags = Flags;
- pItem.hItem = NULL;
+ pItem.hItem = nullptr;
pItem.Title = db_get_s(NULL, pData->sModule, *pData->sDBSettingPrefix + szSetting, L"");
pItem.User_Str1 = (pData->TreeCtrl->User_Str1_DBName == NULL) ? NULL :
db_get_s(NULL, pData->sModule,
@@ -372,7 +372,7 @@ void COptItem_TreeCtrl::MemToWnd(HWND hWnd)
SetWindowLongPtr(hTreeView, GWL_STYLE, Style | TVS_CHECKBOXES);
}
- TVINSERTSTRUCT tvIn = { 0 };
+ TVINSERTSTRUCT tvIn = {};
int ScrollPos = GetScrollPos(hTreeView, SB_VERT);
int SelectOrder = IDToOrder(GetSelectedItemID(hWnd));
SendMessage(hTreeView, WM_SETREDRAW, false, 0);
@@ -524,7 +524,7 @@ CTreeItem* COptItem_TreeCtrl::InsertItem(HWND hWnd, CTreeItem &Item)
TVITEM tvi;
int SelOrder = -1;
Item.ParentID = RootItems[0].ID;
- TVINSERTSTRUCT tvIn = { 0 };
+ TVINSERTSTRUCT tvIn = {};
tvIn.hParent = RootItems[0].hItem;
tvIn.hInsertAfter = TVI_FIRST;
if (tvi.hItem = TreeView_GetSelection(hTreeView)) {
diff --git a/plugins/NewAwaySysMod/src/Properties.cpp b/plugins/NewAwaySysMod/src/Properties.cpp
index 6f1fbdef28..a48da5b3ee 100644
--- a/plugins/NewAwaySysMod/src/Properties.cpp
+++ b/plugins/NewAwaySysMod/src/Properties.cpp
@@ -29,7 +29,7 @@ void ResetContactSettingsOnStatusChange(MCONTACT hContact)
db_unset(hContact, MOD_NAME, DB_MESSAGECOUNT);
}
-void ResetSettingsOnStatusChange(const char *szProto = NULL, int bResetPersonalMsgs = false, int Status = 0)
+void ResetSettingsOnStatusChange(const char *szProto = nullptr, int bResetPersonalMsgs = false, int Status = 0)
{
if (bResetPersonalMsgs)
bResetPersonalMsgs = !g_MoreOptPage.GetDBValueCopy(IDC_MOREOPTDLG_SAVEPERSONALMSGS);
@@ -87,7 +87,7 @@ CProtoState::CStatus& CProtoState::CStatus::operator = (int Status)
}
}
if (bStatusModified)
- ResetSettingsOnStatusChange(NULL, true, Status);
+ ResetSettingsOnStatusChange(nullptr, true, Status);
}
if (bModified && g_SetAwayMsgPage.GetWnd())
SendMessage(g_SetAwayMsgPage.GetWnd(), UM_SAM_PROTOSTATUSCHANGED, (WPARAM)(char*)m_szProto, 0);
diff --git a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
index 25ee3f12f7..75c0c05758 100644
--- a/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/ReadAwayMsg.cpp
@@ -86,7 +86,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
// done with the event
if (awayData->hAwayMsgEvent) {
UnhookEvent(awayData->hAwayMsgEvent);
- awayData->hAwayMsgEvent = NULL;
+ awayData->hAwayMsgEvent = nullptr;
}
const wchar_t *ptszStatusMsg = (const wchar_t*)ack->lParam;
SetDlgItemText(hwndDlg, IDC_READAWAYMSG_MSG, ptszStatusMsg);
@@ -121,7 +121,7 @@ static INT_PTR CALLBACK ReadAwayMsgDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam
READAWAYMSGDATA *awayData = (READAWAYMSGDATA*)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
if (awayData->hAwayMsgEvent) {
UnhookEvent(awayData->hAwayMsgEvent);
- awayData->hAwayMsgEvent = NULL;
+ awayData->hAwayMsgEvent = nullptr;
}
delete awayData;
Utils_SaveWindowPosition(hwndDlg, NULL, MOD_NAME, RAMDLGSIZESETTING);
@@ -135,6 +135,6 @@ INT_PTR GetContactStatMsg(WPARAM wParam, LPARAM)
if (HWND hWnd = WindowList_Find(g_hReadWndList, wParam)) // already have it
SetForegroundWindow(hWnd);
else
- CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_READAWAYMSG), NULL, ReadAwayMsgDlgProc, wParam);
+ CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_READAWAYMSG), nullptr, ReadAwayMsgDlgProc, wParam);
return 0;
}
diff --git a/plugins/NewAwaySysMod/src/Services.cpp b/plugins/NewAwaySysMod/src/Services.cpp
index f2884ee947..9f5ea5db36 100644
--- a/plugins/NewAwaySysMod/src/Services.cpp
+++ b/plugins/NewAwaySysMod/src/Services.cpp
@@ -182,5 +182,5 @@ INT_PTR InvokeStatusWindow(WPARAM wParam, LPARAM)
dat->IsModeless = true;
if (iswi->cbSize > sizeof(NAS_ISWINFOv1))
dat->ISW_Flags = iswi->Flags;
- return (INT_PTR)CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_SETAWAYMSG), NULL, SetAwayMsgDlgProc, (LPARAM)dat);
+ return (INT_PTR)CreateDialogParam(g_hInstance, MAKEINTRESOURCE(IDD_SETAWAYMSG), nullptr, SetAwayMsgDlgProc, (LPARAM)dat);
}
diff --git a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
index 426e8c97b3..56aedf56e1 100644
--- a/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
+++ b/plugins/NewAwaySysMod/src/SetAwayMsg.cpp
@@ -105,7 +105,7 @@ static LRESULT CALLBACK SplitterSubclassProc(HWND hWnd, UINT Msg, WPARAM wParam,
return HTCLIENT;
case WM_SETCURSOR:
- SetCursor(LoadCursor(NULL, IDC_SIZEWE));
+ SetCursor(LoadCursor(nullptr, IDC_SIZEWE));
return true;
case WM_LBUTTONDOWN:
@@ -305,7 +305,7 @@ void SetExtraIcon(CCList *CList, int nColumn, HTREEITEM hItem, int nIcon)
void SetCListGroupIcons(CCList *CList)
{
_ASSERT(CList);
- HTREEITEM hItem = CList->GetNextItem(MCLGN_LAST, NULL); // start from last item, so every item is processed before its parents
+ HTREEITEM hItem = CList->GetNextItem(MCLGN_LAST, nullptr); // start from last item, so every item is processed before its parents
if (!hItem)
return;
@@ -340,7 +340,7 @@ void SetCListGroupIcons(CCList *CList)
}
-int GetSelContactsNum(CCList *CList, PTREEITEMARRAY Selection = NULL, bool *bOnlyInfo = NULL) // "SelContacts" mean not only contacts, but everything with "personal" status messages and settings - i.e. "All contacts" and protocol items are counted too.
+int GetSelContactsNum(CCList *CList, PTREEITEMARRAY Selection = nullptr, bool *bOnlyInfo = nullptr) // "SelContacts" mean not only contacts, but everything with "personal" status messages and settings - i.e. "All contacts" and protocol items are counted too.
{
if (!CList)
return (Selection == CLSEL_DAT_NOTHING) ? 0 : 1; // Selection == NULL means we need to retrieve current selection by ourselves, and current selection is always CLSEL_DAT_CONTACT in this case
@@ -362,7 +362,7 @@ int GetSelContactsNum(CCList *CList, PTREEITEMARRAY Selection = NULL, bool *bOnl
return nContacts;
}
-void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY Selection = NULL)
+void ApplySelContactsMessage(SetAwayMsgData* dat, CCList *CList, PTREEITEMARRAY Selection = nullptr)
{
TCString Message;
HWND hwndDlg = g_SetAwayMsgPage.GetWnd();
@@ -466,8 +466,8 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
static HWND hWndTooltips;
static int UpdateLock = 0;
static int Countdown;
- static CMsgTree *MsgTree = NULL;
- static CCList *CList = NULL;
+ static CMsgTree *MsgTree = nullptr;
+ static CCList *CList = nullptr;
NMCLIST nm;
@@ -534,7 +534,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
DlgPosX = rcWorkArea.left;
DlgPosY = rcWorkArea.top;
}
- SetWindowPos(hwndDlg, NULL, DlgPosX, DlgPosY, DlgSizeX, DlgSizeY, SWP_NOZORDER);
+ SetWindowPos(hwndDlg, nullptr, DlgPosX, DlgPosY, DlgSizeX, DlgSizeY, SWP_NOZORDER);
g_MsgSplitterX = MsgSplitterX;
g_ContactSplitterX = ContactSplitterX;
}
@@ -545,7 +545,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
// Attention: it's important to call NEW and DELETE in a proper order, as CMsgTree and CCList are setting their own WNDPROCs for the parent window, so we must prevent WNDPROC conflicts.
MsgTree = new CMsgTree(GetDlgItem(hwndDlg, IDC_SAWAYMSG_TREE));
- CList = NULL;
+ CList = nullptr;
if (g_SetAwayMsgPage.GetValue(IDS_SAWAYMSG_SHOWCONTACTTREE))
SendMessage(hwndDlg, UM_SAM_INITCLIST, 0, 0);
else {
@@ -591,7 +591,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
SetDlgItemText(hwndDlg, IDC_OK, TranslateT("OK"));
else {
SendMessage(hwndDlg, WM_TIMER, SAM_TIMER_ID, NULL);
- SetTimer(hwndDlg, SAM_TIMER_ID, 1000, NULL);
+ SetTimer(hwndDlg, SAM_TIMER_ID, 1000, nullptr);
}
// init image buttons
@@ -759,7 +759,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (nNewContacts == 1) {
WindowTitle += TCString(TranslateT("\" ("));
MCONTACT hContact = NULL;
- char *szProto = NULL;
+ char *szProto = nullptr;
if (CList) {
for (int i = 0; i < pnm->NewSelection->GetSize(); i++) {
HTREEITEM hItem = (*pnm->NewSelection)[i];
@@ -908,7 +908,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
case UM_SAM_APPLYANDCLOSE:
KillTimer(hwndDlg, SAM_TIMER_ID);
if (CList)
- CList->SelectItem(NULL);
+ CList->SelectItem(nullptr);
else {
nm.hdr.code = MCLN_SELCHANGED;
nm.hdr.hwndFrom = GetDlgItem(hwndDlg, IDC_SAWAYMSG_CONTACTSTREE);
@@ -1071,7 +1071,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
if (!VariablesInstalled)
EnableMenuItem(hPopupMenu, IDM_SAM_OPTIONS_DISABLEVARIABLES, MF_BYCOMMAND | MF_GRAYED);
- switch (TrackPopupMenu(hPopupMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, (short)LOWORD(GetMessagePos()), (short)HIWORD(GetMessagePos()), 0, hwndDlg, NULL)) {
+ switch (TrackPopupMenu(hPopupMenu, TPM_LEFTALIGN | TPM_RIGHTBUTTON | TPM_NONOTIFY | TPM_RETURNCMD, (short)LOWORD(GetMessagePos()), (short)HIWORD(GetMessagePos()), 0, hwndDlg, nullptr)) {
case IDM_SAM_OPTIONS_SHOWMSGTREE:
{
int bShow = !g_SetAwayMsgPage.GetValue(IDS_SAWAYMSG_SHOWMSGTREE);
@@ -1080,7 +1080,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
GetWindowRect(hwndDlg, &rcDlg);
rcDlg.left -= bShow ? g_MsgSplitterX : -g_MsgSplitterX;
SendMessage(hwndDlg, WM_SIZING, WMSZ_LEFT, (LPARAM)&rcDlg);
- SetWindowPos(hwndDlg, NULL, rcDlg.left, rcDlg.top, rcDlg.right - rcDlg.left, rcDlg.bottom - rcDlg.top, SWP_NOZORDER);
+ SetWindowPos(hwndDlg, nullptr, rcDlg.left, rcDlg.top, rcDlg.right - rcDlg.left, rcDlg.bottom - rcDlg.top, SWP_NOZORDER);
SendMessage(hwndDlg, WM_SIZE, 0, 0); // show/hide dialog controls accordingly
}
break;
@@ -1101,7 +1101,7 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
GetWindowRect(hwndDlg, &rcDlg);
rcDlg.right += bShow ? g_ContactSplitterX : -g_ContactSplitterX;
SendMessage(hwndDlg, WM_SIZING, WMSZ_RIGHT, (LPARAM)&rcDlg);
- SetWindowPos(hwndDlg, NULL, 0, 0, rcDlg.right - rcDlg.left, rcDlg.bottom - rcDlg.top, SWP_NOZORDER | SWP_NOMOVE);
+ SetWindowPos(hwndDlg, nullptr, 0, 0, rcDlg.right - rcDlg.left, rcDlg.bottom - rcDlg.top, SWP_NOZORDER | SWP_NOMOVE);
SendMessage(hwndDlg, WM_SIZE, 0, 0); // show/hide dialog controls accordingly
}
break;
@@ -1309,20 +1309,20 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(hTreeView, &pt);
CList->HitTest(&pt, &hitFlags);
- HCURSOR hCursor = NULL;
+ HCURSOR hCursor = nullptr;
if (hitFlags & (MCLCHT_ONITEM | MCLCHT_ONITEMEXTRA)) {
SetClassLong(hTreeView, GCLP_HCURSOR, NULL);
- hCursor = LoadCursor(NULL, IDC_HAND); // set mouse cursor to a hand when hovering over items or their extra images
+ hCursor = LoadCursor(nullptr, IDC_HAND); // set mouse cursor to a hand when hovering over items or their extra images
}
- else SetClassLongPtr(hTreeView, GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, IDC_ARROW));
+ else SetClassLongPtr(hTreeView, GCLP_HCURSOR, (LONG_PTR)LoadCursor(nullptr, IDC_ARROW));
if (!hCursor)
- hCursor = LoadCursor(NULL, IDC_ARROW);
+ hCursor = LoadCursor(nullptr, IDC_ARROW);
SetCursor(hCursor);
return true;
}
- else SetClassLongPtr(hTreeView, GCLP_HCURSOR, (LONG_PTR)LoadCursor(NULL, IDC_ARROW));
+ else SetClassLongPtr(hTreeView, GCLP_HCURSOR, (LONG_PTR)LoadCursor(nullptr, IDC_ARROW));
}
break;
@@ -1338,11 +1338,11 @@ INT_PTR CALLBACK SetAwayMsgDlgProc(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARA
delete dat;
if (CList) {
delete CList;
- CList = NULL;
+ CList = nullptr;
}
delete MsgTree;
- MsgTree = NULL;
- g_SetAwayMsgPage.SetWnd(NULL);
+ MsgTree = nullptr;
+ g_SetAwayMsgPage.SetWnd(nullptr);
DestroyWindow(hWndTooltips);
return false;
}