summaryrefslogtreecommitdiff
path: root/plugins/TabSRMM
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/TabSRMM')
-rw-r--r--plugins/TabSRMM/src/TSButton.cpp36
-rw-r--r--plugins/TabSRMM/src/buttonsbar.cpp6
-rw-r--r--plugins/TabSRMM/src/chat_log.cpp2
-rw-r--r--plugins/TabSRMM/src/chat_main.cpp4
-rw-r--r--plugins/TabSRMM/src/chat_options.cpp14
-rw-r--r--plugins/TabSRMM/src/chat_tools.cpp8
-rw-r--r--plugins/TabSRMM/src/chat_window.cpp32
-rw-r--r--plugins/TabSRMM/src/contactcache.cpp34
-rw-r--r--plugins/TabSRMM/src/container.cpp86
-rw-r--r--plugins/TabSRMM/src/containeroptions.cpp8
-rw-r--r--plugins/TabSRMM/src/controls.cpp68
-rw-r--r--plugins/TabSRMM/src/eventpopups.cpp32
-rw-r--r--plugins/TabSRMM/src/generic_msghandlers.cpp46
-rw-r--r--plugins/TabSRMM/src/globals.cpp24
-rw-r--r--plugins/TabSRMM/src/hotkeyhandler.cpp76
-rw-r--r--plugins/TabSRMM/src/infopanel.cpp74
-rw-r--r--plugins/TabSRMM/src/mim.cpp56
-rw-r--r--plugins/TabSRMM/src/modplus.cpp4
-rw-r--r--plugins/TabSRMM/src/msgdialog.cpp64
-rw-r--r--plugins/TabSRMM/src/msgdlgutils.cpp28
-rw-r--r--plugins/TabSRMM/src/msglog.cpp10
-rw-r--r--plugins/TabSRMM/src/msgoptions.cpp20
-rw-r--r--plugins/TabSRMM/src/msgs.cpp38
-rw-r--r--plugins/TabSRMM/src/muchighlight.cpp18
-rw-r--r--plugins/TabSRMM/src/selectcontainer.cpp8
-rw-r--r--plugins/TabSRMM/src/sendlater.cpp32
-rw-r--r--plugins/TabSRMM/src/sendqueue.cpp16
-rw-r--r--plugins/TabSRMM/src/sidebar.cpp60
-rw-r--r--plugins/TabSRMM/src/srmm.cpp2
-rw-r--r--plugins/TabSRMM/src/tabctrl.cpp34
-rw-r--r--plugins/TabSRMM/src/taskbar.cpp44
-rw-r--r--plugins/TabSRMM/src/templates.cpp2
-rw-r--r--plugins/TabSRMM/src/themeio.cpp20
-rw-r--r--plugins/TabSRMM/src/themes.cpp148
-rw-r--r--plugins/TabSRMM/src/translator.cpp4
-rw-r--r--plugins/TabSRMM/src/trayicon.cpp32
-rw-r--r--plugins/TabSRMM/src/typingnotify.cpp4
-rw-r--r--plugins/TabSRMM/src/userprefs.cpp4
-rw-r--r--plugins/TabSRMM/src/utils.cpp46
39 files changed, 622 insertions, 622 deletions
diff --git a/plugins/TabSRMM/src/TSButton.cpp b/plugins/TabSRMM/src/TSButton.cpp
index 7bcc6c7f0b..167b604547 100644
--- a/plugins/TabSRMM/src/TSButton.cpp
+++ b/plugins/TabSRMM/src/TSButton.cpp
@@ -34,7 +34,7 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPA
// External theme methods and properties
static BLENDFUNCTION bf_buttonglyph;
-static HDC hdc_buttonglyph = 0;
+static HDC hdc_buttonglyph = nullptr;
static HBITMAP hbm_buttonglyph, hbm_buttonglyph_old;
// Used for our own cheap TrackMouseEvent
@@ -84,7 +84,7 @@ int TSAPI RBStateConvert2Flat(int state)
*/
static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
{
- if (hdc_buttonglyph == 0) {
+ if (hdc_buttonglyph == nullptr) {
hdc_buttonglyph = CreateCompatibleDC(hdcPaint);
hbm_buttonglyph = CreateCompatibleBitmap(hdcPaint, 16, 16);
hbm_buttonglyph_old = (HBITMAP)SelectObject(hdc_buttonglyph, hbm_buttonglyph);
@@ -103,7 +103,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
HDC hdcMem;
HBITMAP hbmMem, hOld;
- HANDLE hbp = 0;
+ HANDLE hbp = nullptr;
bool bAero = M.isAero();
RECT rcClient, rcContent;
@@ -112,7 +112,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
if (CMimAPI::m_haveBufferedPaint) {
hbp = CMimAPI::m_pfnBeginBufferedPaint(hdcPaint, &rcContent, BPBF_TOPDOWNDIB, nullptr, &hdcMem);
- hbmMem = hOld = 0;
+ hbmMem = hOld = nullptr;
}
else {
hdcMem = CreateCompatibleDC(hdcPaint);
@@ -127,7 +127,7 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
if (ctl->bIsFlat) {
if (ctl->pContainer && CSkin::m_skinEnabled) {
- CSkinItem *item, *realItem = 0;
+ CSkinItem *item, *realItem = nullptr;
if (ctl->bTitleButton)
item = &SkinItems[ctl->stateId == PBS_NORMAL ? ID_EXTBKTITLEBUTTON : (ctl->stateId == PBS_HOT ? ID_EXTBKTITLEBUTTONMOUSEOVER : ID_EXTBKTITLEBUTTONPRESSED)];
else {
@@ -236,13 +236,13 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
rcContent.right = rcContent.left;
DrawIconEx(hdcMem, rcClient.right - 15, (rcClient.bottom - rcClient.top) / 2 - (PluginConfig.m_smcyicon / 2),
- PluginConfig.g_buttonBarIcons[ICON_DEFAULT_PULLDOWN], 16, 16, 0, 0, DI_NORMAL);
+ PluginConfig.g_buttonBarIcons[ICON_DEFAULT_PULLDOWN], 16, 16, 0, nullptr, DI_NORMAL);
}
if (ctl->hIcon || ctl->hIconPrivate) {
int ix = (rcClient.right - rcClient.left) / 2 - 8;
int iy = (rcClient.bottom - rcClient.top) / 2 - 8;
- HICON hIconNew = ctl->hIconPrivate != 0 ? ctl->hIconPrivate : ctl->hIcon;
+ HICON hIconNew = ctl->hIconPrivate != nullptr ? ctl->hIconPrivate : ctl->hIcon;
if (ctl->stateId == PBS_PRESSED) {
ix++;
@@ -256,15 +256,15 @@ static void PaintWorker(TSButtonCtrl *ctl, HDC hdcPaint)
CSkin::DrawDimmedIcon(hdcMem, ix, iy, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, hIconNew, 180);
else {
if (ctl->stateId != PBS_DISABLED) {
- DrawIconEx(hdcMem, ix, iy, hIconNew, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(hdcMem, ix, iy, hIconNew, 16, 16, 0, nullptr, DI_NORMAL);
if (ctl->overlay)
- DrawIconEx(hdcMem, ix, iy, ctl->overlay, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(hdcMem, ix, iy, ctl->overlay, 16, 16, 0, nullptr, DI_NORMAL);
}
else {
BitBlt(hdc_buttonglyph, 0, 0, 16, 16, hdcMem, ix, iy, SRCCOPY);
- DrawIconEx(hdc_buttonglyph, 0, 0, hIconNew, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(hdc_buttonglyph, 0, 0, hIconNew, 16, 16, 0, nullptr, DI_NORMAL);
if (ctl->overlay)
- DrawIconEx(hdc_buttonglyph, 0, 0, ctl->overlay, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(hdc_buttonglyph, 0, 0, ctl->overlay, 16, 16, 0, nullptr, DI_NORMAL);
GdiAlphaBlend(hdcMem, ix, iy, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, hdc_buttonglyph, 0, 0, 16, 16, bf_buttonglyph);
}
}
@@ -354,11 +354,11 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
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);
@@ -465,12 +465,12 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (bct->sitem->testCloseButton() != -1) {
if (bct->sitem->m_sideBar->getHoveredClose() != bct->sitem) {
bct->sitem->m_sideBar->setHoveredClose(bct->sitem);
- InvalidateRect(hwndDlg, 0, FALSE);
+ InvalidateRect(hwndDlg, nullptr, FALSE);
}
}
else {
- bct->sitem->m_sideBar->setHoveredClose(0);
- InvalidateRect(hwndDlg, 0, FALSE);
+ bct->sitem->m_sideBar->setHoveredClose(nullptr);
+ InvalidateRect(hwndDlg, nullptr, FALSE);
}
}
break;
@@ -485,8 +485,8 @@ static LRESULT CALLBACK TSButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
PostMessage(hwndDlg, WM_MOUSELEAVE, 0, 0L);
KillTimer(hwndDlg, BUTTON_POLLID);
if (bct->sitem) {
- bct->sitem->m_sideBar->setHoveredClose(0);
- InvalidateRect(hwndDlg, 0, FALSE);
+ bct->sitem->m_sideBar->setHoveredClose(nullptr);
+ InvalidateRect(hwndDlg, nullptr, FALSE);
}
}
}
diff --git a/plugins/TabSRMM/src/buttonsbar.cpp b/plugins/TabSRMM/src/buttonsbar.cpp
index 4d05595db1..4024e3d918 100644
--- a/plugins/TabSRMM/src/buttonsbar.cpp
+++ b/plugins/TabSRMM/src/buttonsbar.cpp
@@ -92,8 +92,8 @@ static int CB_InitDefaultButtons(WPARAM, LPARAM)
bbd.dwButtonID = 1;
bbd.pszModuleName = "tb_splitter";
bbd.dwDefPos = 35;
- bbd.hIcon = 0;
- bbd.pwszTooltip = 0;
+ bbd.hIcon = nullptr;
+ bbd.pwszTooltip = nullptr;
Srmm_AddButton(&bbd);
bbd.dwButtonID = 2;
@@ -188,7 +188,7 @@ void CTabBaseDlg::BB_RedrawButtons()
HWND hwndToggleSideBar = GetDlgItem(m_hwnd, IDC_TOGGLESIDEBAR);
if (hwndToggleSideBar && IsWindow(hwndToggleSideBar))
- InvalidateRect(hwndToggleSideBar, 0, TRUE);
+ InvalidateRect(hwndToggleSideBar, nullptr, TRUE);
}
void CTabBaseDlg::BB_RefreshTheme()
diff --git a/plugins/TabSRMM/src/chat_log.cpp b/plugins/TabSRMM/src/chat_log.cpp
index 182c8f2618..2211f60496 100644
--- a/plugins/TabSRMM/src/chat_log.cpp
+++ b/plugins/TabSRMM/src/chat_log.cpp
@@ -828,7 +828,7 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData)
void CChatRoomDlg::StreamInEvents(LOGINFO *lin, bool bRedraw)
{
- if (m_hwnd == 0 || lin == 0 || m_si == 0)
+ if (m_hwnd == nullptr || lin == nullptr || m_si == nullptr)
return;
LOGSTREAMDATA streamData;
diff --git a/plugins/TabSRMM/src/chat_main.cpp b/plugins/TabSRMM/src/chat_main.cpp
index 9669930aea..93c5485407 100644
--- a/plugins/TabSRMM/src/chat_main.cpp
+++ b/plugins/TabSRMM/src/chat_main.cpp
@@ -44,7 +44,7 @@ static void OnCreateSession(SESSION_INFO *si, MODULEINFO *mi)
si->pDlg->UpdateStatusBar();
if (mi)
- mi->idleTimeStamp = time(0);
+ mi->idleTimeStamp = time(nullptr);
}
static void OnReplaceSession(SESSION_INFO *si)
@@ -77,7 +77,7 @@ static void OnChangeNick(SESSION_INFO *si)
static void OnCreateModule(MODULEINFO *mi)
{
- mi->idleTimeStamp = time(0);
+ mi->idleTimeStamp = time(nullptr);
}
static void OnLoadSettings()
diff --git a/plugins/TabSRMM/src/chat_options.cpp b/plugins/TabSRMM/src/chat_options.cpp
index 8d459906bd..2adbadfe10 100644
--- a/plugins/TabSRMM/src/chat_options.cpp
+++ b/plugins/TabSRMM/src/chat_options.cpp
@@ -172,7 +172,7 @@ static branch_t branch2[] = {
{ LPGENW("Scale down icons to 10x10 pixels in the chat log"), "ScaleIcons", 0, 1, nullptr }
};
-static HWND hPathTip = 0;
+static HWND hPathTip = nullptr;
void LoadMsgDlgFont(int section, int i, LOGFONT *lf, COLORREF* colour, char *szMod)
{
@@ -246,10 +246,10 @@ static HTREEITEM InsertBranch(HWND hwndTree, wchar_t* pszDescr, BOOL bExpanded)
static void FillBranch(HWND hwndTree, HTREEITEM hParent, branch_t *branch, int nValues, DWORD defaultval)
{
- if (hParent == 0)
+ if (hParent == nullptr)
return;
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
for (int i = 0; i < nValues; i++) {
tvis.hParent = hParent;
@@ -390,8 +390,8 @@ HWND CreateToolTip(HWND hwndParent, LPTSTR ptszText, LPTSTR ptszTitle)
INT_PTR CALLBACK DlgProcOptions1(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
- static HTREEITEM hListHeading1 = 0;
- static HTREEITEM hListHeading2 = 0;
+ static HTREEITEM hListHeading1 = nullptr;
+ static HTREEITEM hListHeading2 = nullptr;
switch (uMsg) {
case WM_INITDIALOG:
@@ -776,7 +776,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
LPMALLOC psMalloc;
if (SUCCEEDED(CoGetMalloc(1, &psMalloc))) {
- BROWSEINFO bi = { 0 };
+ BROWSEINFO bi = {};
bi.hwndOwner = hwndDlg;
bi.pszDisplayName = tszDirectory;
bi.lpszTitle = TranslateT("Select folder");
@@ -899,7 +899,7 @@ INT_PTR CALLBACK DlgProcOptions2(HWND hwndDlg, UINT uMsg, WPARAM wParam, LPARAM
if (hPathTip) {
KillTimer(hwndDlg, 0);
DestroyWindow(hPathTip);
- hPathTip = 0;
+ hPathTip = nullptr;
}
break;
}
diff --git a/plugins/TabSRMM/src/chat_tools.cpp b/plugins/TabSRMM/src/chat_tools.cpp
index 2377e9a7e4..29d612b30a 100644
--- a/plugins/TabSRMM/src/chat_tools.cpp
+++ b/plugins/TabSRMM/src/chat_tools.cpp
@@ -158,7 +158,7 @@ BOOL DoPopup(SESSION_INFO *si, GCEVENT *gce)
return 0;
}
}
- if (dat && pContainer != 0) { // message window is open, need to check the container config if we want to see a popup nonetheless
+ if (dat && pContainer != nullptr) { // message window is open, need to check the container config if we want to see a popup nonetheless
if (nen_options.bWindowCheck) { // no popups at all for open windows... no exceptions
if (!PluginConfig.m_bHideOnClose)
return 0;
@@ -207,7 +207,7 @@ void DoFlashAndSoundWorker(FLASH_PARAMS *p)
if (si == nullptr)
return;
- CTabBaseDlg *dat = 0;
+ CTabBaseDlg *dat = nullptr;
if (si->pDlg) {
dat = si->pDlg;
if (dat) {
@@ -288,7 +288,7 @@ void DoFlashAndSoundWorker(FLASH_PARAMS *p)
BOOL DoSoundsFlashPopupTrayStuff(SESSION_INFO *si, GCEVENT *gce, BOOL bHighlight, int bManyFix)
{
- if (gce == 0 || si == 0 || gce->bIsMe || si->iType == GCW_SERVER)
+ if (gce == nullptr || si == nullptr || gce->bIsMe || si->iType == GCW_SERVER)
return FALSE;
CTabBaseDlg *dat = nullptr;
@@ -565,7 +565,7 @@ bool IsHighlighted(SESSION_INFO *si, GCEVENT *gce)
if (si && g_Settings.bLogClassicIndicators) {
size_t len = mir_wstrlen(gce->ptszNick) + 1;
wchar_t *tmp = (wchar_t*)_alloca(sizeof(wchar_t)*(len + 1));
- *tmp = GetIndicator(si, gce->ptszNick, 0);
+ *tmp = GetIndicator(si, gce->ptszNick, nullptr);
mir_wstrcpy(tmp + 1, gce->ptszNick);
evTmp.ptszNick = tmp;
}
diff --git a/plugins/TabSRMM/src/chat_window.cpp b/plugins/TabSRMM/src/chat_window.cpp
index 1bc1ae0706..9ac5627bac 100644
--- a/plugins/TabSRMM/src/chat_window.cpp
+++ b/plugins/TabSRMM/src/chat_window.cpp
@@ -104,7 +104,7 @@ static BOOL CheckCustomLink(HWND hwndDlg, POINT *ptClient, UINT uMsg, WPARAM wPa
if (RichEditOle) RichEditOle->Release();
if (bIsCustomLink) {
- ENLINK enlink = { 0 };
+ ENLINK enlink = {};
enlink.nmhdr.hwndFrom = hwndDlg;
enlink.nmhdr.idFrom = IDC_SRMM_LOG;
enlink.nmhdr.code = EN_LINK;
@@ -156,7 +156,7 @@ void CChatRoomDlg::UpdateWindowState(UINT msg)
GetWindowRect(m_hwndFilter, &rcFilter);
if (!PtInRect(&rcFilter, pt)) {
SendMessage(m_hwndFilter, WM_CLOSE, 1, 1);
- m_hwndFilter = 0;
+ m_hwndFilter = nullptr;
}
}
@@ -169,7 +169,7 @@ void CChatRoomDlg::UpdateWindowState(UINT msg)
m_dwUnread = 0;
if (m_pWnd) {
m_pWnd->activateTab();
- m_pWnd->setOverlayIcon(0, true);
+ m_pWnd->setOverlayIcon(nullptr, true);
}
if (m_pContainer->hwndSaved == m_hwnd)
@@ -193,7 +193,7 @@ void CChatRoomDlg::UpdateWindowState(UINT msg)
if (KillTimer(m_hwnd, TIMERID_FLASHWND) || m_iFlashIcon) {
FlashTab(false);
m_bCanFlashTab = FALSE;
- m_iFlashIcon = 0;
+ m_iFlashIcon = nullptr;
}
if (m_pContainer->dwFlashingStarted != 0) {
FlashContainer(m_pContainer, 0, 0);
@@ -205,7 +205,7 @@ void CChatRoomDlg::UpdateWindowState(UINT msg)
PostMessage(m_hwnd, DM_SAVESIZE, 0, 0);
if (PluginConfig.m_bAutoLocaleSupport) {
- if (hkl == 0)
+ if (hkl == nullptr)
DM_LoadLocale();
else
SendMessage(m_hwnd, DM_SETLOCALE, 0, 0);
@@ -537,8 +537,8 @@ void CChatRoomDlg::OnInitDialog()
m_pPanel.loadHeight();
- if (PluginConfig.g_hMenuTrayUnread != 0 && m_hContact != 0 && m_szProto != nullptr)
- UpdateTrayMenu(0, m_wStatus, m_szProto, m_wszStatus, m_hContact, FALSE);
+ if (PluginConfig.g_hMenuTrayUnread != nullptr && m_hContact != 0 && m_szProto != nullptr)
+ UpdateTrayMenu(nullptr, m_wStatus, m_szProto, m_wszStatus, m_hContact, FALSE);
m_log.SendMsg(EM_HIDESELECTION, TRUE, 0);
@@ -660,7 +660,7 @@ void CChatRoomDlg::onClick_OK(CCtrlButton*)
if (ptszText[0] == '/' || m_si->iType == GCW_SERVER)
fSound = false;
Chat_DoEventHook(m_si, GC_USER_MESSAGE, nullptr, ptszText, 0);
- mi->idleTimeStamp = time(0);
+ mi->idleTimeStamp = time(nullptr);
mi->lastIdleCheck = 0;
UpdateStatusBar();
if (m_pContainer)
@@ -676,7 +676,7 @@ void CChatRoomDlg::onClick_Filter(CCtrlButton *pButton)
return;
if (m_iLogFilterFlags == 0 && !m_bFilterEnabled) {
- MessageBox(0, TranslateT("The filter cannot be enabled, because there are no event types selected either global or for this chat room"), TranslateT("Event filter error"), MB_OK);
+ MessageBox(nullptr, TranslateT("The filter cannot be enabled, because there are no event types selected either global or for this chat room"), TranslateT("Event filter error"), MB_OK);
m_bFilterEnabled = false;
}
else m_bFilterEnabled = !m_bFilterEnabled;
@@ -874,7 +874,7 @@ void CChatRoomDlg::UpdateOptions()
void CChatRoomDlg::UpdateStatusBar()
{
- if (m_pContainer->m_hwndActive != m_hwnd || m_pContainer->hwndStatus == 0 || CMimAPI::m_shutDown || m_wszStatusBar[0])
+ if (m_pContainer->m_hwndActive != m_hwnd || m_pContainer->hwndStatus == nullptr || CMimAPI::m_shutDown || m_wszStatusBar[0])
return;
if (m_si->pszModule == nullptr)
@@ -894,7 +894,7 @@ void CChatRoomDlg::UpdateStatusBar()
wchar_t szFinalStatusBarText[512];
if (m_pPanel.isActive()) {
- time_t now = time(0);
+ time_t now = time(nullptr);
DWORD diff = (now - mi->idleTimeStamp) / 60;
if ((diff >= 1 && diff != mi->lastIdleCheck)) {
@@ -936,7 +936,7 @@ void CChatRoomDlg::UpdateTitle()
}
wchar_t szTemp[100];
- HICON hIcon = 0;
+ HICON hIcon = nullptr;
switch (m_si->iType) {
case GCW_CHATROOM:
@@ -1932,7 +1932,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case WM_ACTIVATE:
if (LOWORD(wParam) != WA_ACTIVE) {
- m_pContainer->hwndSaved = 0;
+ m_pContainer->hwndSaved = nullptr;
break;
}
// fall through
@@ -2215,7 +2215,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
if (CMimAPI::m_haveBufferedPaint) {
hbp = CSkin::InitiateBufferedPaint(hdc, rcClient, hdcMem);
- hbm = hbmOld = 0;
+ hbm = hbmOld = nullptr;
}
else {
hdcMem = CreateCompatibleDC(hdc);
@@ -2343,7 +2343,7 @@ INT_PTR CChatRoomDlg::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
pt.x = pt.y = 0;
m_log.SendMsg(EM_SETSCROLLPOS, 0, (LPARAM)&pt);
if (PluginConfig.m_bAutoLocaleSupport) {
- if (hkl == 0)
+ if (hkl == nullptr)
DM_LoadLocale();
else
PostMessage(m_hwnd, DM_SETLOCALE, 0, 0);
@@ -2427,7 +2427,7 @@ void ShowRoom(TContainerData *pContainer, SESSION_INFO *si)
return; // smth went wrong, nothing to do here
MCONTACT hContact = si->hContact;
- if (Srmm_FindWindow(hContact) != 0)
+ if (Srmm_FindWindow(hContact) != nullptr)
return;
if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->m_wszName, L"default", 6))
diff --git a/plugins/TabSRMM/src/contactcache.cpp b/plugins/TabSRMM/src/contactcache.cpp
index 33a5aa1fc2..70626350a4 100644
--- a/plugins/TabSRMM/src/contactcache.cpp
+++ b/plugins/TabSRMM/src/contactcache.cpp
@@ -59,14 +59,14 @@ CContactCache::CContactCache(MCONTACT hContact)
void CContactCache::initPhaseTwo()
{
- m_szAccount = 0;
+ m_szAccount = nullptr;
if (cc->szProto) {
PROTOACCOUNT *acc = Proto_GetAccount(cc->szProto);
if (acc && acc->tszAccountName)
m_szAccount = acc->tszAccountName;
}
- m_isValid = (cc->szProto != 0 && m_szAccount != 0) ? true : false;
+ m_isValid = (cc->szProto != nullptr && m_szAccount != nullptr) ? true : false;
if (m_isValid) {
m_isMeta = db_mc_isMeta(cc->contactID) != 0; // don't use cc->IsMeta() here
if (m_isMeta)
@@ -87,7 +87,7 @@ void CContactCache::initPhaseTwo()
void CContactCache::resetMeta()
{
m_isMeta = false;
- m_szMetaProto = 0;
+ m_szMetaProto = nullptr;
m_iMetaStatus = ID_STATUS_OFFLINE;
initPhaseTwo();
}
@@ -167,7 +167,7 @@ bool CContactCache::updateUIN()
void CContactCache::updateStats(int iType, size_t value)
{
- if (m_stats == 0)
+ if (m_stats == nullptr)
allocStats();
switch (iType) {
@@ -180,7 +180,7 @@ void CContactCache::updateStats(int iType, size_t value)
m_stats->lastReceivedChars = 0;
break;
case TSessionStats::INIT_TIMER:
- m_stats->started = time(0);
+ m_stats->started = time(nullptr);
break;
case TSessionStats::SET_LAST_RCV:
m_stats->lastReceivedChars = (unsigned int)value;
@@ -195,7 +195,7 @@ void CContactCache::updateStats(int iType, size_t value)
void CContactCache::allocStats()
{
- if (m_stats == 0) {
+ if (m_stats == nullptr) {
m_stats = new TSessionStats;
memset(m_stats, 0, sizeof(TSessionStats));
}
@@ -359,7 +359,7 @@ void CContactCache::releaseAlloced()
{
if (m_stats) {
delete m_stats;
- m_stats = 0;
+ m_stats = nullptr;
}
if (m_history) {
@@ -367,7 +367,7 @@ void CContactCache::releaseAlloced()
mir_free(m_history[i].szText);
mir_free(m_history);
- m_history = 0;
+ m_history = nullptr;
}
mir_free(m_szStatusMsg);
@@ -413,26 +413,26 @@ void CContactCache::updateStatusMsg(const char *szKey)
MCONTACT hContact = getActiveContact();
- if (szKey == 0 || (szKey && !mir_strcmp("StatusMsg", szKey))) {
+ if (szKey == nullptr || (szKey && !mir_strcmp("StatusMsg", szKey))) {
if (m_szStatusMsg)
mir_free(m_szStatusMsg);
- m_szStatusMsg = 0;
+ m_szStatusMsg = nullptr;
ptrW szStatus(db_get_wsa(hContact, "CList", "StatusMsg"));
if (szStatus != 0)
- m_szStatusMsg = (mir_wstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : 0);
+ m_szStatusMsg = (mir_wstrlen(szStatus) > 0 ? getNormalizedStatusMsg(szStatus) : nullptr);
}
- if (szKey == 0 || (szKey && !mir_strcmp("ListeningTo", szKey))) {
+ if (szKey == nullptr || (szKey && !mir_strcmp("ListeningTo", szKey))) {
if (m_ListeningInfo)
mir_free(m_ListeningInfo);
- m_ListeningInfo = 0;
+ m_ListeningInfo = nullptr;
ptrW szListeningTo(db_get_wsa(hContact, cc->szProto, "ListeningTo"));
if (szListeningTo != 0 && *szListeningTo)
m_ListeningInfo = szListeningTo.detach();
}
- if (szKey == 0 || (szKey && !mir_strcmp("XStatusMsg", szKey))) {
+ if (szKey == nullptr || (szKey && !mir_strcmp("XStatusMsg", szKey))) {
if (m_xStatusMsg)
mir_free(m_xStatusMsg);
- m_xStatusMsg = 0;
+ m_xStatusMsg = nullptr;
ptrW szXStatusMsg(db_get_wsa(hContact, cc->szProto, "XStatusMsg"));
if (szXStatusMsg != 0 && *szXStatusMsg)
m_xStatusMsg = szXStatusMsg.detach();
@@ -493,8 +493,8 @@ int CContactCache::cacheUpdateMetaChanged(WPARAM bMetaEnabled, LPARAM)
wchar_t* CContactCache::getNormalizedStatusMsg(const wchar_t *src, bool fStripAll)
{
- if (src == 0 || mir_wstrlen(src) < 2)
- return 0;
+ if (src == nullptr || mir_wstrlen(src) < 2)
+ return nullptr;
CMStringW dest;
diff --git a/plugins/TabSRMM/src/container.cpp b/plugins/TabSRMM/src/container.cpp
index 6eb700c8c6..90348e7e05 100644
--- a/plugins/TabSRMM/src/container.cpp
+++ b/plugins/TabSRMM/src/container.cpp
@@ -33,7 +33,7 @@
#define CONTAINER_SUBKEY "containerW"
#define CONTAINER_PREFIX "CNTW_"
-TContainerData *pFirstContainer = 0; // the linked list of struct ContainerWindowData
+TContainerData *pFirstContainer = nullptr; // the linked list of struct ContainerWindowData
TContainerData *pLastActiveContainer = nullptr;
static TContainerData* TSAPI AppendToContainerList(TContainerData*);
@@ -158,7 +158,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_NCPAINT:
if (pContainer && bSkinned) {
if (CSkin::m_frameSkins) {
- HDC dcFrame = GetDCEx(hwndDlg, 0, DCX_WINDOW |/*DCX_INTERSECTRGN|*/0x10000); // GetWindowDC(hwndDlg);
+ HDC dcFrame = GetDCEx(hwndDlg, nullptr, DCX_WINDOW |/*DCX_INTERSECTRGN|*/0x10000); // GetWindowDC(hwndDlg);
LONG clip_top, clip_left;
RECT rcText;
HDC dcMem = CreateCompatibleDC(pContainer->cachedDC ? pContainer->cachedDC : dcFrame);
@@ -208,7 +208,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
// icon
HICON hIcon = (HICON)SendMessage(hwndDlg, WM_GETICON, ICON_SMALL, 0);
- DrawIconEx(dcMem, 4 + CSkin::m_SkinnedFrame_left + CSkin::m_bClipBorder + CSkin::m_titleBarLeftOff, rcText.top + (rcText.bottom - rcText.top) / 2 - 8, hIcon, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(dcMem, 4 + CSkin::m_SkinnedFrame_left + CSkin::m_bClipBorder + CSkin::m_titleBarLeftOff, rcText.top + (rcText.bottom - rcText.top) / 2 - 8, hIcon, 16, 16, 0, nullptr, DI_NORMAL);
// title buttons
pContainer->rcClose.top = pContainer->rcMin.top = pContainer->rcMax.top = CSkin::m_titleButtonTopOff;
@@ -247,7 +247,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (pRect) {
CSkinItem *item = pContainer->buttons[i].isPressed ? item_pressed : (pContainer->buttons[i].isHot ? item_hot : item_normal);
CSkin::DrawItem(dcMem, pRect, item);
- DrawIconEx(dcMem, pRect->left + ((pRect->right - pRect->left) / 2 - 8), pRect->top + ((pRect->bottom - pRect->top) / 2 - 8), hIcon, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(dcMem, pRect->left + ((pRect->right - pRect->left) / 2 - 8), pRect->top + ((pRect->bottom - pRect->top) / 2 - 8), hIcon, 16, 16, 0, nullptr, DI_NORMAL);
}
}
SetBkMode(dcMem, TRANSPARENT);
@@ -374,7 +374,7 @@ static LRESULT CALLBACK ContainerWndProc(HWND hwndDlg, UINT msg, WPARAM wParam,
if (rc) {
CSkinItem *item = &SkinItems[pContainer->buttons[i].isPressed ? ID_EXTBKTITLEBUTTONPRESSED : (pContainer->buttons[i].isHot ? ID_EXTBKTITLEBUTTONMOUSEOVER : ID_EXTBKTITLEBUTTON)];
CSkin::DrawItem(hdc, rc, item);
- DrawIconEx(hdc, rc->left + ((rc->right - rc->left) / 2 - 8), rc->top + ((rc->bottom - rc->top) / 2 - 8), hIcon, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(hdc, rc->left + ((rc->right - rc->left) / 2 - 8), rc->top + ((rc->bottom - rc->top) / 2 - 8), hIcon, 16, 16, 0, nullptr, DI_NORMAL);
}
}
}
@@ -582,7 +582,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
TabCtrl_SetToolTips(hwndTab, pContainer->m_hwndTip);
}
}
- else pContainer->m_hwndTip = 0;
+ else pContainer->m_hwndTip = nullptr;
if (pContainer->dwFlags & CNT_CREATE_MINIMIZED) {
WINDOWPLACEMENT wp = { 0 };
@@ -618,14 +618,14 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
if (Utils_RestoreWindowPositionNoMove(hwndDlg, pContainer->hContactFrom, SRMSGMOD_T, "split"))
if (Utils_RestoreWindowPosition(hwndDlg, 0, SRMSGMOD_T, "split"))
if (Utils_RestoreWindowPositionNoMove(hwndDlg, 0, SRMSGMOD_T, "split"))
- SetWindowPos(hwndDlg, 0, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(hwndDlg, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
}
}
else {
if (pContainer->dwFlags & CNT_GLOBALSIZE) {
if (Utils_RestoreWindowPosition(hwndDlg, 0, SRMSGMOD_T, "split"))
if (Utils_RestoreWindowPositionNoMove(hwndDlg, 0, SRMSGMOD_T, "split"))
- SetWindowPos(hwndDlg, 0, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(hwndDlg, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
}
else {
char szCName[CONTAINER_NAMELEN + 20];
@@ -634,7 +634,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
if (Utils_RestoreWindowPositionNoMove(hwndDlg, 0, SRMSGMOD_T, szCName))
if (Utils_RestoreWindowPosition(hwndDlg, 0, SRMSGMOD_T, "split"))
if (Utils_RestoreWindowPositionNoMove(hwndDlg, 0, SRMSGMOD_T, "split"))
- SetWindowPos(hwndDlg, 0, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(hwndDlg, nullptr, 50, 50, 450, 300, SWP_NOZORDER | SWP_NOACTIVATE);
}
}
}
@@ -672,7 +672,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
if (lParam) {
DWORD dwSWPFlags = SWP_NOACTIVATE | SWP_NOZORDER | SWP_DEFERERASE | SWP_NOCOPYBITS; // | SWP_NOSENDCHANGING | SWP_ASYNCWINDOWPOS;
- SetWindowPos(hwndTab, 0, pContainer->tBorder_outer_left + sbarWidth_left, pContainer->tBorder_outer_top + rebarHeight,
+ SetWindowPos(hwndTab, nullptr, pContainer->tBorder_outer_left + sbarWidth_left, pContainer->tBorder_outer_top + rebarHeight,
(rcClient.right - rcClient.left) - (pContainer->tBorder_outer_left + pContainer->tBorder_outer_right + sbarWidth),
(rcClient.bottom - rcClient.top) - pContainer->statusBarHeight - (pContainer->tBorder_outer_top + pContainer->tBorder_outer_bottom) - rebarHeight, dwSWPFlags);
}
@@ -699,7 +699,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
tci.mask = TCIF_PARAM;
TabCtrl_GetItem(hwndTab, i, &tci);
if ((HWND)tci.lParam == pContainer->m_hwndActive) {
- SetWindowPos((HWND)tci.lParam, 0, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top),
+ SetWindowPos((HWND)tci.lParam, nullptr, rcClient.left, rcClient.top, (rcClient.right - rcClient.left), (rcClient.bottom - rcClient.top),
SWP_NOSENDCHANGING | SWP_NOACTIVATE/*|SWP_NOCOPYBITS*/);
if (!pContainer->bSizingLoop && sizeChanged) {
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
@@ -750,7 +750,7 @@ static INT_PTR CALLBACK DlgProcContainer(HWND hwndDlg, UINT msg, WPARAM wParam,
}
}
- if (pContainer->hwndStatus != 0 && ((LPNMHDR)lParam)->hwndFrom == pContainer->hwndStatus) {
+ if (pContainer->hwndStatus != nullptr && ((LPNMHDR)lParam)->hwndFrom == pContainer->hwndStatus) {
switch (((LPNMHDR)lParam)->code) {
case NM_CLICK:
case NM_RCLICK:
@@ -883,7 +883,7 @@ panel_found:
}
break;
case ID_TABMENU_CONTAINEROPTIONS:
- if (pContainer->hWndOptions == 0)
+ if (pContainer->hWndOptions == nullptr)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), hwndDlg, DlgProcContainerOptions, (LPARAM)pContainer);
break;
case ID_TABMENU_CLOSECONTAINER:
@@ -1180,7 +1180,7 @@ panel_found:
BOOL fResult = TRUE;
BroadCastContainer(pContainer, DM_CHECKAUTOHIDE, (WPARAM)pContainer->settings->autoCloseSeconds, (LPARAM)&fResult);
- if (fResult && 0 == pContainer->hWndOptions)
+ if (fResult && nullptr == pContainer->hWndOptions)
PostMessage(hwndDlg, WM_CLOSE, 1, 0);
}
@@ -1211,7 +1211,7 @@ panel_found:
case IDM_MOREOPTIONS:
if (IsIconic(pContainer->m_hwnd))
SendMessage(pContainer->m_hwnd, WM_SYSCOMMAND, SC_RESTORE, 0);
- if (pContainer->hWndOptions == 0)
+ if (pContainer->hWndOptions == nullptr)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), hwndDlg, DlgProcContainerOptions, (LPARAM)pContainer);
break;
case SC_MAXIMIZE:
@@ -1303,7 +1303,7 @@ panel_found:
SetLayeredWindowAttributes(hwndDlg, Skin->getColorKey(), (BYTE)HIWORD(pContainer->settings->dwTransparency), (pContainer->dwFlags & CNT_TRANSPARENCY ? LWA_ALPHA : 0));
}
}
- pContainer->hwndSaved = 0;
+ pContainer->hwndSaved = nullptr;
if (LOWORD(wParam) != WA_ACTIVE) {
pContainer->MenuBar->Cancel();
@@ -1352,7 +1352,7 @@ panel_found:
pContainer->dwFlags &= ~CNT_DEFERREDCONFIGURE;
pContainer->m_hwndActive = (HWND)item.lParam;
SendMessage(hwndDlg, WM_SYSCOMMAND, SC_RESTORE, 0);
- if (pContainer->m_hwndActive != 0 && IsWindow(pContainer->m_hwndActive)) {
+ if (pContainer->m_hwndActive != nullptr && IsWindow(pContainer->m_hwndActive)) {
ShowWindow(pContainer->m_hwndActive, SW_SHOW);
SetFocus(pContainer->m_hwndActive);
SendMessage(pContainer->m_hwndActive, WM_ACTIVATE, WA_ACTIVE, 0);
@@ -1407,7 +1407,7 @@ panel_found:
if (M.isAero()) {
HDC hdcMem;
- HANDLE hbp = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rc, BPBF_TOPDOWNDIB, 0, &hdcMem);
+ HANDLE hbp = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rc, BPBF_TOPDOWNDIB, nullptr, &hdcMem);
FillRect(hdcMem, &rc, CSkin::m_BrushBack);
CSkin::FinalizeBufferedPaint(hbp, &rc);
}
@@ -1422,7 +1422,7 @@ panel_found:
HPEN hOldPen = reinterpret_cast<HPEN>(::SelectObject(hdc, hPen));
LONG x = (pContainer->SideBar->getFlags() & CSideBar::SIDEBARORIENTATION_LEFT ? pContainer->SideBar->getWidth() - 2 + pContainer->tBorder_outer_left :
rc.right - pContainer->SideBar->getWidth() + 1 - pContainer->tBorder_outer_right);
- ::MoveToEx(hdc, x, rc.top, 0);
+ ::MoveToEx(hdc, x, rc.top, nullptr);
::LineTo(hdc, x, rc.bottom);
::SelectObject(hdc, hOldPen);
::DeleteObject(hPen);
@@ -1468,7 +1468,7 @@ panel_found:
}
else pContainer->szAbsThemeFile[0] = pContainer->szRelThemeFile[0] = 0;
- pContainer->ltr_templates = pContainer->rtl_templates = 0;
+ pContainer->ltr_templates = pContainer->rtl_templates = nullptr;
}
break;
@@ -1476,11 +1476,11 @@ panel_found:
SendMessage(hwndDlg, WM_SIZE, 0, 0);
GetWindowRect(hwndDlg, &rc);
- SetWindowPos(hwndDlg, 0, rc.left, rc.top, rc.right - rc.left, (rc.bottom - rc.top) + 1, SWP_NOZORDER | SWP_NOACTIVATE);
- SetWindowPos(hwndDlg, 0, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(hwndDlg, nullptr, rc.left, rc.top, rc.right - rc.left, (rc.bottom - rc.top) + 1, SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(hwndDlg, nullptr, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOZORDER | SWP_NOACTIVATE);
RedrawWindow(hwndDlg, nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_ALLCHILDREN);
- if (pContainer->hwndStatus != 0 && pContainer->m_hwndActive != 0)
+ if (pContainer->hwndStatus != nullptr && pContainer->m_hwndActive != nullptr)
PostMessage(pContainer->m_hwndActive, DM_STATUSBARCHANGED, 0, 0);
return 0;
@@ -1526,9 +1526,9 @@ panel_found:
if (ws != wsold) {
GetWindowRect(hwndDlg, &rc);
if ((ws & WS_CAPTION) != (wsold & WS_CAPTION)) {
- SetWindowPos(hwndDlg, 0, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_NOCOPYBITS);
+ SetWindowPos(hwndDlg, nullptr, rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, SWP_NOACTIVATE | SWP_FRAMECHANGED | SWP_NOCOPYBITS);
RedrawWindow(hwndDlg, nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW);
- if (pContainer->m_hwndActive != 0) {
+ if (pContainer->m_hwndActive != nullptr) {
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
dat->DM_ScrollToBottom(0, 0);
}
@@ -1553,18 +1553,18 @@ panel_found:
if (pContainer->dwFlags & CNT_NOSTATUSBAR) {
if (pContainer->hwndStatus) {
DestroyWindow(pContainer->hwndStatus);
- pContainer->hwndStatus = 0;
+ pContainer->hwndStatus = nullptr;
pContainer->statusBarHeight = 0;
SendMessage(hwndDlg, DM_STATUSBARCHANGED, 0, 0);
}
}
- else if (pContainer->hwndStatus == 0) {
+ else if (pContainer->hwndStatus == nullptr) {
pContainer->hwndStatus = CreateWindowEx(0, L"TSStatusBarClass", nullptr, SBT_TOOLTIPS | WS_CHILD | WS_VISIBLE, 0, 0, 0, 0, hwndDlg, nullptr, g_hInst, nullptr);
if (sBarHeight && bSkinned)
SendMessage(pContainer->hwndStatus, SB_SETMINHEIGHT, sBarHeight, 0);
}
- if (pContainer->m_hwndActive != 0) {
+ if (pContainer->m_hwndActive != nullptr) {
hContact = 0;
SendMessage(pContainer->m_hwndActive, DM_QUERYHCONTACT, 0, (LPARAM)&hContact);
if (hContact)
@@ -1587,7 +1587,7 @@ panel_found:
RECENTINFO *ri = (RECENTINFO *)lParam;
ri->iFirstIndex = ri->iMostRecent = -1;
ri->dwFirst = ri->dwMostRecent = 0;
- ri->hwndFirst = ri->hwndMostRecent = 0;
+ ri->hwndFirst = ri->hwndMostRecent = nullptr;
for (int i = 0; i < iItems; i++) {
item.mask = TCIF_PARAM;
@@ -1631,7 +1631,7 @@ panel_found:
{
dat = (CTabBaseDlg*)wParam;
HICON hIconMsg = PluginConfig.g_IconMsgEvent;
- HICON hIconBig = (dat && dat->m_cache) ? Skin_LoadProtoIcon(dat->m_cache->getProto(), dat->m_cache->getStatus(), true) : 0;
+ HICON hIconBig = (dat && dat->m_cache) ? Skin_LoadProtoIcon(dat->m_cache->getProto(), dat->m_cache->getStatus(), true) : nullptr;
if (Win7Taskbar->haveLargeIcons()) {
if ((HICON)lParam == PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING] || (HICON)lParam == hIconMsg) {
@@ -1644,12 +1644,12 @@ panel_found:
}
if (dat) {
- if (dat->m_hTaskbarIcon == 0)
- dat->m_hTaskbarIcon = ((dat->m_pContainer->dwFlags & CNT_AVATARSONTASKBAR) ? dat->IconFromAvatar() : 0);
+ if (dat->m_hTaskbarIcon == nullptr)
+ dat->m_hTaskbarIcon = ((dat->m_pContainer->dwFlags & CNT_AVATARSONTASKBAR) ? dat->IconFromAvatar() : nullptr);
else {
if (!(dat->m_pContainer->dwFlags & CNT_AVATARSONTASKBAR)) {
DestroyIcon(dat->m_hTaskbarIcon);
- dat->m_hTaskbarIcon = 0;
+ dat->m_hTaskbarIcon = nullptr;
}
}
@@ -1659,7 +1659,7 @@ panel_found:
Win7Taskbar->setOverlayIcon(hwndDlg, (LPARAM)(dat->m_hTabIcon ? (LPARAM)dat->m_hTabIcon : lParam));
}
else {
- if (0 == hIconBig || (HICON)CALLSERVICE_NOTFOUND == hIconBig)
+ if (nullptr == hIconBig || (HICON)CALLSERVICE_NOTFOUND == hIconBig)
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)lParam);
else
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, (LPARAM)hIconBig);
@@ -1689,7 +1689,7 @@ panel_found:
hIconBig = Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true);
}
SendMessage(hwndDlg, WM_SETICON, ICON_SMALL, lParam);
- if (0 != hIconBig && reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) != hIconBig)
+ if (nullptr != hIconBig && reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) != hIconBig)
SendMessage(hwndDlg, WM_SETICON, ICON_BIG, LPARAM(hIconBig));
pContainer->hIcon = (lParam == (LPARAM)hIconMsg) ? STICK_ICON_MSG : 0;
}
@@ -1724,8 +1724,8 @@ panel_found:
return 0;
case WM_DESTROY:
- pContainer->m_hwnd = 0;
- pContainer->m_hwndActive = 0;
+ pContainer->m_hwnd = nullptr;
+ pContainer->m_hwndActive = nullptr;
if (pContainer->hwndStatus)
DestroyWindow(pContainer->hwndStatus);
@@ -1976,7 +1976,7 @@ int TSAPI ActivateTabFromHWND(HWND hwndTab, HWND hwnd)
if (iItem >= 0) {
TabCtrl_SetCurSel(hwndTab, iItem);
- NMHDR nmhdr = { 0 };
+ NMHDR nmhdr = {};
nmhdr.code = TCN_SELCHANGE;
SendMessage(GetParent(hwndTab), WM_NOTIFY, 0, (LPARAM)&nmhdr); // do it via a WM_NOTIFY / TCN_SELCHANGE to simulate user-activation
return iItem;
@@ -2027,7 +2027,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer)
}
TContainerData *p = pFirstContainer;
- while (p->pNext != 0)
+ while (p->pNext != nullptr)
p = p->pNext;
p->pNext = pContainer;
pContainer->pNext = nullptr;
@@ -2037,7 +2037,7 @@ static TContainerData* TSAPI AppendToContainerList(TContainerData *pContainer)
TContainerData* TSAPI FindContainerByName(const wchar_t *name)
{
if (name == nullptr || mir_wstrlen(name) == 0)
- return 0;
+ return nullptr;
if (M.GetByte("singlewinmode", 0)) // single window mode - always return 0 and force a new container
return nullptr;
@@ -2071,7 +2071,7 @@ static TContainerData* TSAPI RemoveContainerFromList(TContainerData *pContainer)
if (pLastActiveContainer == pContainer) // make sure, we don't reference this container anymore
pLastActiveContainer = pFirstContainer;
- return 0;
+ return nullptr;
}
}
return nullptr;
@@ -2219,11 +2219,11 @@ void TSAPI RenameContainer(int iIndex, const wchar_t *szNew)
HMENU TSAPI BuildContainerMenu()
{
- if (PluginConfig.g_hMenuContainer != 0) {
+ if (PluginConfig.g_hMenuContainer != nullptr) {
HMENU submenu = GetSubMenu(PluginConfig.g_hMenuContext, 0);
RemoveMenu(submenu, 6, MF_BYPOSITION);
DestroyMenu(PluginConfig.g_hMenuContainer);
- PluginConfig.g_hMenuContainer = 0;
+ PluginConfig.g_hMenuContainer = nullptr;
}
// no container attach menu, if we are using the "clist group mode"
diff --git a/plugins/TabSRMM/src/containeroptions.cpp b/plugins/TabSRMM/src/containeroptions.cpp
index 51306b17c7..79cc9c7acc 100644
--- a/plugins/TabSRMM/src/containeroptions.cpp
+++ b/plugins/TabSRMM/src/containeroptions.cpp
@@ -145,7 +145,7 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
case WM_INITDIALOG:
TranslateDialogDefault(hwndDlg);
{
- TVINSERTSTRUCT tvis = { 0 };
+ TVINSERTSTRUCT tvis = {};
int nr_layouts = 0;
const TSideBarLayout *sblayouts = CSideBar::getLayouts(nr_layouts);
@@ -369,8 +369,8 @@ INT_PTR CALLBACK DlgProcContainerOptions(HWND hwndDlg, UINT msg, WPARAM wParam,
{
RECT rc;
GetWindowRect(pContainer->m_hwnd, &rc);
- SetWindowPos(pContainer->m_hwnd, 0, rc.left, rc.top, (rc.right - rc.left) - 1, (rc.bottom - rc.top) - 1, SWP_NOZORDER | SWP_DRAWFRAME | SWP_FRAMECHANGED);
- SetWindowPos(pContainer->m_hwnd, 0, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), SWP_NOZORDER | SWP_DRAWFRAME | SWP_SHOWWINDOW);
+ SetWindowPos(pContainer->m_hwnd, nullptr, rc.left, rc.top, (rc.right - rc.left) - 1, (rc.bottom - rc.top) - 1, SWP_NOZORDER | SWP_DRAWFRAME | SWP_FRAMECHANGED);
+ SetWindowPos(pContainer->m_hwnd, nullptr, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), SWP_NOZORDER | SWP_DRAWFRAME | SWP_SHOWWINDOW);
}
if (LOWORD(wParam) == IDOK)
@@ -553,7 +553,7 @@ do_apply: Utils::enableDlgControl(hwndDlg, IDC_APPLY, true);
case WM_DESTROY:
Window_FreeIcon_IcoLib(hwndDlg);
- pContainer->hWndOptions = 0;
+ pContainer->hWndOptions = nullptr;
SetWindowLongPtr(hwndDlg, GWLP_USERDATA, 0);
HFONT hFont = (HFONT)SendDlgItemMessage(hwndDlg, IDC_TITLEBOX, WM_GETFONT, 0, 0);
diff --git a/plugins/TabSRMM/src/controls.cpp b/plugins/TabSRMM/src/controls.cpp
index 5e8a8eb8de..d66da586d5 100644
--- a/plugins/TabSRMM/src/controls.cpp
+++ b/plugins/TabSRMM/src/controls.cpp
@@ -28,13 +28,13 @@
#include "stdafx.h"
-static WNDPROC OldStatusBarproc = 0;
+static WNDPROC OldStatusBarproc = nullptr;
bool CMenuBar::m_buttonsInit = false;
-HHOOK CMenuBar::m_hHook = 0;
+HHOOK CMenuBar::m_hHook = nullptr;
TBBUTTON CMenuBar::m_TbButtons[8] = { 0 };
-CMenuBar *CMenuBar::m_Owner = 0;
-HBITMAP CMenuBar::m_MimIcon = 0;
+CMenuBar *CMenuBar::m_Owner = nullptr;
+HBITMAP CMenuBar::m_MimIcon = nullptr;
int CMenuBar::m_MimIconRefCount = 0;
static int resetLP(WPARAM, LPARAM, LPARAM obj)
@@ -52,7 +52,7 @@ CMenuBar::CMenuBar(HWND hwndParent, const TContainerData *pContainer)
{
m_pContainer = const_cast<TContainerData *>(pContainer);
- if (m_MimIcon == 0) {
+ if (m_MimIcon == nullptr) {
HDC hdc = ::GetDC(m_pContainer->m_hwnd);
HANDLE hIcon = Skin_GetIconHandle(SKINICON_OTHER_MIRANDA);
@@ -61,7 +61,7 @@ CMenuBar::CMenuBar(HWND hwndParent, const TContainerData *pContainer)
RECT rc = { 0, 0, 16, 16 };
m_MimIcon = CSkin::CreateAeroCompatibleBitmap(rc, hdcTemp);
HBITMAP hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(hdcTemp, m_MimIcon));
- ::DrawIconEx(hdcTemp, 0, 0, (HICON)hIcon, 16, 16, 0, 0, DI_NORMAL);
+ ::DrawIconEx(hdcTemp, 0, 0, (HICON)hIcon, 16, 16, 0, nullptr, DI_NORMAL);
::SelectObject(hdcTemp, hbmOld);
::DeleteDC(hdcTemp);
@@ -77,11 +77,11 @@ CMenuBar::CMenuBar(HWND hwndParent, const TContainerData *pContainer)
checkButtons();
- m_activeMenu = 0;
+ m_activeMenu = nullptr;
m_activeID = 0;
m_isAero = M.isAero();
m_mustAutoHide = false;
- m_activeSubMenu = 0;
+ m_activeSubMenu = nullptr;
m_fTracking = false;
m_isContactMenu = m_isMainMenu = false;
HookEventParam(ME_LANGPACK_CHANGED, &::resetLP, (LPARAM)this);
@@ -98,7 +98,7 @@ CMenuBar::~CMenuBar()
m_MimIconRefCount--;
if (m_MimIconRefCount == 0) {
::DeleteObject(m_MimIcon);
- m_MimIcon = 0;
+ m_MimIcon = nullptr;
}
}
@@ -117,8 +117,8 @@ const RECT& CMenuBar::getClientRect()
void CMenuBar::obtainHook()
{
releaseHook();
- if (m_hHook == 0)
- m_hHook = ::SetWindowsHookEx(WH_MSGFILTER, CMenuBar::MessageHook, 0, GetCurrentThreadId());
+ if (m_hHook == nullptr)
+ m_hHook = ::SetWindowsHookEx(WH_MSGFILTER, CMenuBar::MessageHook, nullptr, GetCurrentThreadId());
m_Owner = this;
}
@@ -126,7 +126,7 @@ void CMenuBar::releaseHook()
{
if (m_hHook) {
::UnhookWindowsHookEx(m_hHook);
- m_hHook = 0;
+ m_hHook = nullptr;
}
}
@@ -240,7 +240,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
m_rcItem.bottom -= 4;
m_hbmDraw = CSkin::CreateAeroCompatibleBitmap(m_rcItem, nmtb->nmcd.hdc);
m_hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(m_hdcDraw, m_hbmDraw));
- m_hTheme = M.isAero() || M.isVSThemed() ? OpenThemeData(m_hwndToolbar, L"REBAR") : 0;
+ m_hTheme = M.isAero() || M.isVSThemed() ? OpenThemeData(m_hwndToolbar, L"REBAR") : nullptr;
m_hOldFont = reinterpret_cast<HFONT>(::SelectObject(m_hdcDraw, reinterpret_cast<HFONT>(::GetStockObject(DEFAULT_GUI_FONT))));
if (m_isAero) {
nm->rc.bottom--;
@@ -250,7 +250,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
else if ((PluginConfig.m_fillColor || M.isVSThemed()) && !CSkin::m_skinEnabled) {
if (PluginConfig.m_fillColor && PluginConfig.m_tbBackgroundHigh && PluginConfig.m_tbBackgroundLow) {
::DrawAlpha(m_hdcDraw, &m_rcItem, PluginConfig.m_tbBackgroundHigh, 100, PluginConfig.m_tbBackgroundLow, 0,
- GRADIENT_TB, 0, 0, 0);
+ GRADIENT_TB, 0, 0, nullptr);
}
else {
m_rcItem.bottom--;
@@ -283,7 +283,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
nmtb->nmcd.rc.bottom--;
if (CSkin::m_skinEnabled) {
- CSkinItem *item = 0;
+ CSkinItem *item = nullptr;
::FillRect(m_hdcDraw, &nmtb->nmcd.rc, CSkin::m_MenuBGBrush);
@@ -300,13 +300,13 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
COLORREF clr = ::GetSysColor(COLOR_HOTLIGHT);
COLORREF clrRev = clr;
if (uState & CDIS_MARKED || uState & CDIS_CHECKED)
- ::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9, 31, 4, 0);
+ ::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9, 31, 4, nullptr);
if (uState & CDIS_SELECTED)
- ::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9, 31, 4, 0);
+ ::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9, 31, 4, nullptr);
if (uState & CDIS_HOT)
- ::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9, 31, 4, 0);
+ ::DrawAlpha(m_hdcDraw, &nmtb->nmcd.rc, clrRev, 80, clrRev, 0, 9, 31, 4, nullptr);
}
if (szText) {
@@ -320,7 +320,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
if (iIndex == 0)
::DrawIconEx(m_hdcDraw, (nmtb->nmcd.rc.left + nmtb->nmcd.rc.right) / 2 - 8,
(nmtb->nmcd.rc.top + nmtb->nmcd.rc.bottom) / 2 - 8, Skin_LoadIcon(SKINICON_OTHER_MIRANDA),
- 16, 16, 0, 0, DI_NORMAL);
+ 16, 16, 0, nullptr, DI_NORMAL);
return CDRF_SKIPDEFAULT;
}
@@ -342,7 +342,7 @@ LONG_PTR CMenuBar::customDrawWorker(NMCUSTOMDRAW *nm)
::DeleteObject(m_hbmDraw);
::SelectObject(m_hdcDraw, m_hOldFont);
::DeleteDC(m_hdcDraw);
- m_hdcDraw = 0;
+ m_hdcDraw = nullptr;
if (m_hTheme)
CloseThemeData(m_hTheme);
return CDRF_SKIPDEFAULT;
@@ -409,13 +409,13 @@ void CMenuBar::invoke(const int id)
cancel();
m_activeMenu = hMenu;
- m_activeSubMenu = 0;
+ m_activeSubMenu = nullptr;
m_activeID = id;
updateState(hMenu);
obtainHook();
m_fTracking = true;
::SendMessage(m_hwndToolbar, TB_SETSTATE, (WPARAM)id, TBSTATE_CHECKED | TBSTATE_ENABLED);
- ::TrackPopupMenu(hMenu, 0, pt.x, pt.y, 0, m_pContainer->m_hwnd, 0);
+ ::TrackPopupMenu(hMenu, 0, pt.x, pt.y, 0, m_pContainer->m_hwnd, nullptr);
}
void CMenuBar::cancel()
@@ -424,7 +424,7 @@ void CMenuBar::cancel()
if (m_activeID)
::SendMessage(m_hwndToolbar, TB_SETSTATE, (WPARAM)m_activeID, TBSTATE_ENABLED);
m_activeID = 0;
- m_activeMenu = 0;
+ m_activeMenu = nullptr;
m_isContactMenu = m_isMainMenu = false;
::EndMenu();
}
@@ -582,7 +582,7 @@ void CMenuBar::checkButtons()
TBADDBITMAP tb;
tb.nID = (UINT_PTR)m_MimIcon;
- tb.hInst = 0;
+ tb.hInst = nullptr;
::SendMessage(m_hwndToolbar, TB_ADDBITMAP, 1, (LPARAM)&tb);
}
@@ -624,9 +624,9 @@ LRESULT CALLBACK CMenuBar::MessageHook(int nCode, WPARAM wParam, LPARAM lParam)
case WM_LBUTTONDOWN:
::GetCursorPos(&pt);
- if (::MenuItemFromPoint(0, m_Owner->m_activeMenu, pt) >= 0) // inside menu
+ if (::MenuItemFromPoint(nullptr, m_Owner->m_activeMenu, pt) >= 0) // inside menu
break;
- if (m_Owner->m_activeSubMenu && ::MenuItemFromPoint(0, m_Owner->m_activeSubMenu, pt) >= 0)
+ if (m_Owner->m_activeSubMenu && ::MenuItemFromPoint(nullptr, m_Owner->m_activeSubMenu, pt) >= 0)
break;
else { // anywhere else, cancel the menu
::CallNextHookEx(m_hHook, nCode, wParam, lParam);
@@ -669,7 +669,7 @@ LONG_PTR CALLBACK CTabBaseDlg::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM
CTabBaseDlg *dat = nullptr;
POINT pt;
- if (OldStatusBarproc == 0) {
+ if (OldStatusBarproc == nullptr) {
WNDCLASSEX wc = { 0 };
wc.cbSize = sizeof(wc);
GetClassInfoEx(g_hInst, STATUSCLASSNAME, &wc);
@@ -722,7 +722,7 @@ LONG_PTR CALLBACK CTabBaseDlg::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM
CSkinItem *item = &SkinItems[ID_EXTBKSTATUSBARPANEL];
BOOL bAero = M.isAero();
- HANDLE hTheme = bAero ? OpenThemeData(hWnd, L"ButtonStyle") : 0;
+ HANDLE hTheme = bAero ? OpenThemeData(hWnd, L"ButtonStyle") : nullptr;
if (pContainer)
dat = (CTabBaseDlg*)GetWindowLongPtr(pContainer->m_hwndActive, GWLP_USERDATA);
@@ -731,11 +731,11 @@ LONG_PTR CALLBACK CTabBaseDlg::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM
GetClientRect(hWnd, &rcClient);
HBITMAP hbm, hbmOld;
- HANDLE hbp = 0;
+ HANDLE hbp = nullptr;
HDC hdcMem;
if (CMimAPI::m_haveBufferedPaint) {
hbp = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rcClient, BPBF_TOPDOWNDIB, nullptr, &hdcMem);
- hbm = hbmOld = 0;
+ hbm = hbmOld = nullptr;
}
else {
hdcMem = CreateCompatibleDC(hdc);
@@ -837,16 +837,16 @@ LONG_PTR CALLBACK CTabBaseDlg::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM
else {
if (hIcon) {
if (LOWORD(result) > 1) { // we have a text
- DrawIconEx(hdcMem, itemRect.left + 3, (height / 2 - 8) + itemRect.top, hIcon, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(hdcMem, itemRect.left + 3, (height / 2 - 8) + itemRect.top, hIcon, 16, 16, 0, nullptr, DI_NORMAL);
if (dat) {
if (dat->m_bShowTyping == 2)
- DrawIconEx(hdcMem, itemRect.left + 3, (height / 2 - 8) + itemRect.top, PluginConfig.g_iconOverlayEnabled, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(hdcMem, itemRect.left + 3, (height / 2 - 8) + itemRect.top, PluginConfig.g_iconOverlayEnabled, 16, 16, 0, nullptr, DI_NORMAL);
}
itemRect.left += 20;
CSkin::RenderText(hdcMem, hTheme, szText, &itemRect, DT_VCENTER | DT_END_ELLIPSIS | DT_SINGLELINE | DT_NOPREFIX,
CSkin::m_glowSize, clr);
}
- else DrawIconEx(hdcMem, itemRect.left + 3, (height / 2 - 8) + itemRect.top, hIcon, 16, 16, 0, 0, DI_NORMAL);
+ else DrawIconEx(hdcMem, itemRect.left + 3, (height / 2 - 8) + itemRect.top, hIcon, 16, 16, 0, nullptr, DI_NORMAL);
}
else {
itemRect.left += 2;
@@ -909,7 +909,7 @@ LONG_PTR CALLBACK CTabBaseDlg::StatusBarSubclassProc(HWND hWnd, UINT msg, WPARAM
tooltip_active = FALSE;
}
KillTimer(hWnd, TIMERID_HOVER);
- SetTimer(hWnd, TIMERID_HOVER, 450, 0);
+ SetTimer(hWnd, TIMERID_HOVER, 450, nullptr);
break;
case WM_LBUTTONDOWN:
diff --git a/plugins/TabSRMM/src/eventpopups.cpp b/plugins/TabSRMM/src/eventpopups.cpp
index b42a1792e3..205e5d5dac 100644
--- a/plugins/TabSRMM/src/eventpopups.cpp
+++ b/plugins/TabSRMM/src/eventpopups.cpp
@@ -68,7 +68,7 @@ static void PU_CleanUp()
static void CheckForRemoveMask()
{
if (!M.GetByte(MODULE, "firsttime", 0) && (nen_options.maskActL & MASK_REMOVE || nen_options.maskActR & MASK_REMOVE || nen_options.maskActTE & MASK_REMOVE)) {
- MessageBox(0, TranslateT("One of your popup actions is set to DISMISS EVENT.\nNote that this options may have unwanted side effects as it REMOVES the event from the unread queue.\nThis may lead to events not showing up as \"new\". If you don't want this behavior, please review the 'Event notifications' settings page."), TranslateT("TabSRMM warning message"), MB_OK | MB_ICONSTOP);
+ MessageBox(nullptr, TranslateT("One of your popup actions is set to DISMISS EVENT.\nNote that this options may have unwanted side effects as it REMOVES the event from the unread queue.\nThis may lead to events not showing up as \"new\". If you don't want this behavior, please review the 'Event notifications' settings page."), TranslateT("TabSRMM warning message"), MB_OK | MB_ICONSTOP);
db_set_b(0, MODULE, "firsttime", 1);
}
}
@@ -153,10 +153,10 @@ INT_PTR CALLBACK DlgProcPopupOpts(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lPa
TreeViewInit(GetDlgItem(hWnd, IDC_EVENTOPTIONS), CTranslator::TREE_NEN, 0, TRUE);
if (!PluginConfig.g_bPopupAvail) {
- HWND hwndChild = FindWindowEx(hWnd, 0, 0, 0);
+ HWND hwndChild = FindWindowEx(hWnd, nullptr, nullptr, nullptr);
while (hwndChild) {
ShowWindow(hwndChild, SW_HIDE);
- hwndChild = FindWindowEx(hWnd, hwndChild, 0, 0);
+ hwndChild = FindWindowEx(hWnd, hwndChild, nullptr, nullptr);
}
Utils::showDlgControl(hWnd, IDC_NOPOPUPAVAIL, SW_SHOW);
}
@@ -373,7 +373,7 @@ static LRESULT CALLBACK PopupDlgProc(HWND hWnd, UINT message, WPARAM wParam, LPA
break;
case UM_FREEPLUGINDATA:
pdata->hContact = 0; // mark as removeable
- pdata->hWnd = 0;
+ pdata->hWnd = nullptr;
return TRUE;
case UM_INITPOPUP:
pdata->hWnd = hWnd;
@@ -456,7 +456,7 @@ static wchar_t* GetPreviewT(WORD eventType, DBEVENTINFO* dbe)
if (dbe->cbBlob > 5) { // min valid size = (sizeof(DWORD) + 1 character file name + terminating 0)
char* szFileName = (char *)dbe->pBlob + sizeof(DWORD);
- char* szDescr = 0;
+ char* szDescr = nullptr;
size_t namelength = Utils::safe_strlen(szFileName, dbe->cbBlob - sizeof(DWORD));
if (dbe->cbBlob > (sizeof(DWORD) + namelength + 1))
@@ -655,7 +655,7 @@ static int TSAPI PopupPreview(NEN_OPTIONS *pluginOptions)
// bForced is used to only update the status, nickname etc. and does NOT update the unread count
void TSAPI UpdateTrayMenuState(CTabBaseDlg *dat, BOOL bForced)
{
- if (PluginConfig.g_hMenuTrayUnread == 0 || dat->m_hContact == 0)
+ if (PluginConfig.g_hMenuTrayUnread == nullptr || dat->m_hContact == 0)
return;
MENUITEMINFO mii = { 0 };
@@ -663,7 +663,7 @@ void TSAPI UpdateTrayMenuState(CTabBaseDlg *dat, BOOL bForced)
mii.fMask = MIIM_DATA | MIIM_BITMAP;
const wchar_t *tszProto = dat->m_cache->getRealAccount();
- assert(tszProto != 0);
+ assert(tszProto != nullptr);
GetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)dat->m_hContact, FALSE, &mii);
if (!bForced)
@@ -690,8 +690,8 @@ int TSAPI UpdateTrayMenu(const CTabBaseDlg *dat, WORD wStatus, const char *szPro
return 0;
PROTOACCOUNT *acc = Proto_GetAccount(szProto);
- wchar_t *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : 0);
- if (tszFinalProto == 0)
+ wchar_t *tszFinalProto = (acc && acc->tszAccountName ? acc->tszAccountName : nullptr);
+ if (tszFinalProto == nullptr)
return 0;
WORD wMyStatus = (wStatus == 0) ? db_get_w(hContact, szProto, "Status", ID_STATUS_OFFLINE) : wStatus;
@@ -705,7 +705,7 @@ int TSAPI UpdateTrayMenu(const CTabBaseDlg *dat, WORD wStatus, const char *szPro
wchar_t szMenuEntry[80];
const wchar_t *szNick = nullptr;
- if (dat != 0) {
+ if (dat != nullptr) {
szNick = dat->m_cache->getNick();
GetMenuItemInfo(PluginConfig.g_hMenuTrayUnread, (UINT_PTR)hContact, FALSE, &mii);
mii.dwItemData++;
@@ -773,7 +773,7 @@ int tabSRMM_ShowPopup(MCONTACT hContact, MEVENT hDbEvent, WORD eventType, int wi
if (nen_options.bNoRSS && szProto != nullptr && !strncmp(szProto, "RSS", 3))
return 0; // filter out RSS popups
- if (windowOpen && pContainer != 0) { // message window is open, need to check the container config if we want to see a popup nonetheless
+ if (windowOpen && pContainer != nullptr) { // message window is open, need to check the container config if we want to see a popup nonetheless
if (nen_options.bWindowCheck && windowOpen) // no popups at all for open windows... no exceptions
return 0;
if (pContainer->dwFlags & CNT_DONTREPORT && (IsIconic(pContainer->m_hwnd))) // in tray counts as "minimised"
@@ -798,9 +798,9 @@ passed:
if (PU_GetByContact(hContact) && nen_options.bMergePopup && eventType == EVENTTYPE_MESSAGE) {
if (PopupUpdateT(hContact, hDbEvent) != 0)
- PopupShowT(&nen_options, hContact, hDbEvent, eventType, pContainer ? pContainer->m_hwnd : 0);
+ PopupShowT(&nen_options, hContact, hDbEvent, eventType, pContainer ? pContainer->m_hwnd : nullptr);
}
- else PopupShowT(&nen_options, hContact, hDbEvent, eventType, pContainer ? pContainer->m_hwnd : 0);
+ else PopupShowT(&nen_options, hContact, hDbEvent, eventType, pContainer ? pContainer->m_hwnd : nullptr);
return 0;
}
@@ -811,10 +811,10 @@ void TSAPI DeletePopupsForContact(MCONTACT hContact, DWORD dwMask)
if (!(dwMask & nen_options.dwRemoveMask) || nen_options.iDisable || !PluginConfig.g_bPopupAvail)
return;
- PLUGIN_DATAT *_T = 0;
- while ((_T = PU_GetByContact(hContact)) != 0) {
+ PLUGIN_DATAT *_T = nullptr;
+ while ((_T = PU_GetByContact(hContact)) != nullptr) {
_T->hContact = 0; // make sure, it never "comes back"
- if (_T->hWnd != 0)
+ if (_T->hWnd != nullptr)
PUDeletePopup(_T->hWnd);
}
}
diff --git a/plugins/TabSRMM/src/generic_msghandlers.cpp b/plugins/TabSRMM/src/generic_msghandlers.cpp
index 45fc240a4a..939a92e906 100644
--- a/plugins/TabSRMM/src/generic_msghandlers.cpp
+++ b/plugins/TabSRMM/src/generic_msghandlers.cpp
@@ -35,7 +35,7 @@
void CTabBaseDlg::DM_SaveLogAsRTF() const
{
- if (m_hwndIEView != 0) {
+ if (m_hwndIEView != nullptr) {
IEVIEWEVENT event = { sizeof(event) };
event.hwnd = m_hwndIEView;
event.hContact = m_hContact;
@@ -130,7 +130,7 @@ bool CTabBaseDlg::DM_GenericHotkeysCheck(MSG *message)
return true;
case TABSRMM_HK_CONTAINEROPTIONS:
- if (m_pContainer->hWndOptions == 0)
+ if (m_pContainer->hWndOptions == nullptr)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), m_pContainer->m_hwnd, DlgProcContainerOptions, (LPARAM)m_pContainer);
return true;
@@ -385,7 +385,7 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar
break;
case ID_SENDMENU_SENDTOCONTAINER:
m_sendMode ^= SMODE_CONTAINER;
- RedrawWindow(m_hwnd, 0, 0, RDW_ERASENOW | RDW_UPDATENOW);
+ RedrawWindow(m_hwnd, nullptr, nullptr, RDW_ERASENOW | RDW_UPDATENOW);
break;
case ID_SENDMENU_SENDLATER:
if (sendLater->isAvail())
@@ -402,18 +402,18 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar
break;
}
db_set_b(m_hContact, SRMSGMOD_T, "no_ack", (BYTE)(m_sendMode & SMODE_NOACK ? 1 : 0));
- SetWindowPos(m_message.GetHwnd(), 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(m_message.GetHwnd(), nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
if (m_sendMode & SMODE_MULTIPLE || m_sendMode & SMODE_CONTAINER) {
- SetWindowPos(m_message.GetHwnd(), 0, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER |
+ SetWindowPos(m_message.GetHwnd(), nullptr, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER |
SWP_NOMOVE | SWP_NOSIZE | SWP_NOCOPYBITS);
- RedrawWindow(m_hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
else {
if (IsWindow(GetDlgItem(m_hwnd, IDC_CLIST)))
DestroyWindow(GetDlgItem(m_hwnd, IDC_CLIST));
- SetWindowPos(m_message.GetHwnd(), 0, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER |
+ SetWindowPos(m_message.GetHwnd(), nullptr, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER |
SWP_NOMOVE | SWP_NOSIZE | SWP_NOCOPYBITS);
- RedrawWindow(m_hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
SendMessage(m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
Resize();
@@ -459,9 +459,9 @@ LRESULT CTabBaseDlg::DM_MsgWindowCmdHandler(UINT cmd, WPARAM wParam, LPARAM lPar
DM_ScrollToBottom(0, 1);
}
}
- SetWindowPos(m_message.GetHwnd(), 0, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER |
+ SetWindowPos(m_message.GetHwnd(), nullptr, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER |
SWP_NOMOVE | SWP_NOSIZE | SWP_NOCOPYBITS);
- RedrawWindow(m_hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_FRAME | RDW_UPDATENOW | RDW_ALLCHILDREN);
if (m_bEditNotesActive)
CWarning::show(CWarning::WARN_EDITUSERNOTES, MB_OK | MB_ICONINFORMATION);
@@ -764,7 +764,7 @@ void CTabBaseDlg::DM_RecalcPictureSize()
void CTabBaseDlg::DM_UpdateLastMessage() const
{
- if (m_pContainer->hwndStatus == 0 || m_pContainer->m_hwndActive != m_hwnd)
+ if (m_pContainer->hwndStatus == nullptr || m_pContainer->m_hwndActive != m_hwnd)
return;
wchar_t szBuf[100];
@@ -822,7 +822,7 @@ HWND CTabBaseDlg::DM_CreateClist()
if (!sendLater->isAvail()) {
CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK | MB_ICONINFORMATION, TranslateT("Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart."));
m_sendMode &= ~SMODE_MULTIPLE;
- return 0;
+ return nullptr;
}
HWND hwndClist = CreateWindowExA(0, "CListControl", "", WS_TABSTOP | WS_VISIBLE | WS_CHILD | 0x248, 184, 0, 30, 30, m_hwnd, (HMENU)IDC_CLIST, g_hInst, nullptr);
@@ -843,7 +843,7 @@ HWND CTabBaseDlg::DM_CreateClist()
SendMessage(hwndClist, CLM_FIRST + 106, 0, 1);
SendMessage(hwndClist, CLM_AUTOREBUILD, 0, 0);
if (hwndClist)
- RedrawWindow(hwndClist, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
+ RedrawWindow(hwndClist, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
return hwndClist;
}
@@ -885,7 +885,7 @@ LRESULT CTabBaseDlg::DM_MouseWheelHandler(WPARAM wParam, LPARAM lParam)
HWND hwndLog = (m_hwndIEView || m_hwndHPP) ? m_hwndIWebBrowserControl : m_log.GetHwnd();
short wDirection = (short)HIWORD(wParam);
- if (hwndLog == 0)
+ if (hwndLog == nullptr)
hwndLog = WindowFromPoint(pt);
if (LOWORD(wParam) & MK_SHIFT || M.GetByte("fastscroll", 0)) {
@@ -910,15 +910,15 @@ void CTabBaseDlg::DM_FreeTheme()
{
if (m_hTheme) {
CloseThemeData(m_hTheme);
- m_hTheme = 0;
+ m_hTheme = nullptr;
}
if (m_hThemeIP) {
CloseThemeData(m_hThemeIP);
- m_hThemeIP = 0;
+ m_hThemeIP = nullptr;
}
if (m_hThemeToolbar) {
CloseThemeData(m_hThemeToolbar);
- m_hThemeToolbar = 0;
+ m_hThemeToolbar = nullptr;
}
}
@@ -929,17 +929,17 @@ void CTabBaseDlg::DM_ThemeChanged()
m_hTheme = OpenThemeData(m_hwnd, L"EDIT");
- if (m_hTheme != 0 || (CSkin::m_skinEnabled && !item_log->IGNORED)) {
+ if (m_hTheme != nullptr || (CSkin::m_skinEnabled && !item_log->IGNORED)) {
SetWindowLongPtr(m_log.GetHwnd(), GWL_EXSTYLE, GetWindowLongPtr(m_log.GetHwnd(), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
if (isChat())
SetWindowLongPtr(m_nickList.GetHwnd(), GWL_EXSTYLE, GetWindowLongPtr(m_nickList.GetHwnd(), GWL_EXSTYLE) & ~(WS_EX_CLIENTEDGE | WS_EX_STATICEDGE));
}
- if (m_hTheme != 0 || (CSkin::m_skinEnabled && !item_msg->IGNORED))
+ if (m_hTheme != nullptr || (CSkin::m_skinEnabled && !item_msg->IGNORED))
SetWindowLongPtr(m_message.GetHwnd(), GWL_EXSTYLE, GetWindowLongPtr(m_message.GetHwnd(), GWL_EXSTYLE) & ~WS_EX_STATICEDGE);
- m_hThemeIP = M.isAero() ? OpenThemeData(m_hwnd, L"ButtonStyle") : 0;
- m_hThemeToolbar = (M.isAero() || (!CSkin::m_skinEnabled && M.isVSThemed())) ? OpenThemeData(m_hwnd, L"REBAR") : 0;
+ m_hThemeIP = M.isAero() ? OpenThemeData(m_hwnd, L"ButtonStyle") : nullptr;
+ m_hThemeToolbar = (M.isAero() || (!CSkin::m_skinEnabled && M.isVSThemed())) ? OpenThemeData(m_hwnd, L"REBAR") : nullptr;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1004,7 +1004,7 @@ void CSrmmWindow::DM_OptionsApplied(WPARAM, LPARAM lParam)
}
LoadLocalFlags();
- m_hTimeZone = TimeZone_CreateByContact(m_hContact, 0, TZF_KNOWNONLY);
+ m_hTimeZone = TimeZone_CreateByContact(m_hContact, nullptr, TZF_KNOWNONLY);
m_bShowUIElements = (m_pContainer->dwFlags & CNT_HIDETOOLBAR) == 0;
@@ -1105,7 +1105,7 @@ void CTabBaseDlg::DM_Typing(bool fForceOff)
HandleIconFeedback(this, PluginConfig.g_IconTypingEvent);
}
}
- if ((GetForegroundWindow() != hwndContainer) || (m_pContainer->hwndStatus == 0) || (m_pContainer->m_hwndActive != m_hwnd))
+ if ((GetForegroundWindow() != hwndContainer) || (m_pContainer->hwndStatus == nullptr) || (m_pContainer->m_hwndActive != m_hwnd))
SendMessage(hwndContainer, DM_SETICON, (WPARAM)this, (LPARAM)PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING]);
m_bShowTyping = 1;
diff --git a/plugins/TabSRMM/src/globals.cpp b/plugins/TabSRMM/src/globals.cpp
index 298bee3138..a002a44042 100644
--- a/plugins/TabSRMM/src/globals.cpp
+++ b/plugins/TabSRMM/src/globals.cpp
@@ -78,10 +78,10 @@ void CGlobals::reloadSystemStartup()
hCurSplitNS = LoadCursor(nullptr, IDC_SIZENS);
hCurSplitWE = LoadCursor(nullptr, IDC_SIZEWE);
- HDC hScrnDC = GetDC(0);
+ HDC hScrnDC = GetDC(nullptr);
m_DPIscaleX = GetDeviceCaps(hScrnDC, LOGPIXELSX) / 96.0;
m_DPIscaleY = GetDeviceCaps(hScrnDC, LOGPIXELSY) / 96.0;
- ReleaseDC(0, hScrnDC);
+ ReleaseDC(nullptr, hScrnDC);
reloadSettings(false);
reloadAdv();
@@ -173,7 +173,7 @@ void CGlobals::reloadSettings(bool fReloadSkins)
m_visualMessageSizeIndicator = M.GetByte("msgsizebar", 0);
m_autoSplit = M.GetByte("autosplit", 0);
m_FlashOnMTN = M.GetByte(SRMSGMOD, SRMSGSET_SHOWTYPINGWINFLASH, SRMSGDEFSET_SHOWTYPINGWINFLASH);
- if (m_MenuBar == 0) {
+ if (m_MenuBar == nullptr) {
m_MenuBar = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENUBAR));
TranslateMenu(m_MenuBar);
}
@@ -191,7 +191,7 @@ void CGlobals::reloadSettings(bool fReloadSkins)
m_fillColor = M.GetDword(FONTMODULE, "fillColor", 0);
if (CSkin::m_BrushFill) {
::DeleteObject(CSkin::m_BrushFill);
- CSkin::m_BrushFill = 0;
+ CSkin::m_BrushFill = nullptr;
}
m_genericTxtColor = M.GetDword(FONTMODULE, "genericTxtClr", GetSysColor(COLOR_BTNTEXT));
m_cRichBorders = M.GetDword(FONTMODULE, "cRichBorders", 0);
@@ -220,7 +220,7 @@ void CGlobals::reloadAdv()
const HMENU CGlobals::getMenuBar()
{
- if (m_MenuBar == 0) {
+ if (m_MenuBar == nullptr) {
m_MenuBar = ::LoadMenu(g_hInst, MAKEINTRESOURCE(IDR_MENUBAR));
TranslateMenu(m_MenuBar);
}
@@ -248,7 +248,7 @@ void CGlobals::hookSystemEvents()
int CGlobals::TopToolbarLoaded(WPARAM, LPARAM)
{
- TTBButton ttb = { 0 };
+ TTBButton ttb = {};
ttb.dwFlags = TTBBF_SHOWTOOLTIP | TTBBF_VISIBLE;
ttb.pszService = MS_TABMSG_TRAYSUPPORT;
ttb.name = "TabSRMM session list";
@@ -276,7 +276,7 @@ int CGlobals::ModulesLoaded(WPARAM, LPARAM)
CSkin::initAeroEffect();
for (int i = 0; i < NR_BUTTONBARICONS; i++)
- PluginConfig.g_buttonBarIcons[i] = 0;
+ PluginConfig.g_buttonBarIcons[i] = nullptr;
::LoadIconTheme();
::CreateImageList(TRUE);
::CB_InitCustomButtons();
@@ -299,7 +299,7 @@ int CGlobals::ModulesLoaded(WPARAM, LPARAM)
if (M.GetByte("avatarmode", -1) == -1)
db_set_b(0, SRMSGMOD_T, "avatarmode", 2);
- PluginConfig.g_hwndHotkeyHandler = CreateWindowEx(0, L"TSHK", L"", WS_POPUP, 0, 0, 40, 40, 0, 0, g_hInst, nullptr);
+ PluginConfig.g_hwndHotkeyHandler = CreateWindowEx(0, L"TSHK", L"", WS_POPUP, 0, 0, 40, 40, nullptr, nullptr, g_hInst, nullptr);
::CreateTrayMenus(TRUE);
if (nen_options.bTraySupport)
@@ -316,7 +316,7 @@ int CGlobals::ModulesLoaded(WPARAM, LPARAM)
if (sendLater->isAvail()) {
SET_UID(mi, 0x8f32b04e, 0x314e, 0x42eb, 0x89, 0xc6, 0x56, 0x21, 0xf5, 0x1a, 0x2f, 0x22);
mi.position = -500050006;
- mi.hIcolibItem = 0;
+ mi.hIcolibItem = nullptr;
mi.name.a = LPGEN("&Send later job list...");
mi.pszService = MS_TABMSG_SLQMGR;
PluginConfig.m_UserMenuItem = Menu_AddMainMenuItem(&mi);
@@ -449,7 +449,7 @@ int CGlobals::MetaContactEvent(WPARAM hContact, LPARAM)
if (pDlg) {
pDlg->UpdateTitle();
::PostMessage(pDlg->GetHwnd(), DM_UPDATEPICLAYOUT, 0, 0);
- InvalidateRect(pDlg->GetHwnd(), 0, TRUE); // force redraw
+ InvalidateRect(pDlg->GetHwnd(), nullptr, TRUE); // force redraw
}
}
return 0;
@@ -544,7 +544,7 @@ void CGlobals::RestoreUnreadMessageAlerts(void)
void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
{
- if (c == 0)
+ if (c == nullptr)
return;
CSrmmWindow *dat = c->getDat();
@@ -566,7 +566,7 @@ void CGlobals::logStatusChange(WPARAM wParam, const CContactCache *c)
wchar_t *szOldStatus = pcli->pfnGetStatusModeDescription(wOldStatus, 0);
wchar_t *szNewStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
- if (szOldStatus == 0 || szNewStatus == 0)
+ if (szOldStatus == nullptr || szNewStatus == nullptr)
return;
CMStringW text;
diff --git a/plugins/TabSRMM/src/hotkeyhandler.cpp b/plugins/TabSRMM/src/hotkeyhandler.cpp
index 5e613b9f6a..844cf2adfd 100644
--- a/plugins/TabSRMM/src/hotkeyhandler.cpp
+++ b/plugins/TabSRMM/src/hotkeyhandler.cpp
@@ -37,35 +37,35 @@
#include "stdafx.h"
static UINT WM_TASKBARCREATED;
-static HANDLE hSvcHotkeyProcessor = 0;
+static HANDLE hSvcHotkeyProcessor = nullptr;
static HOTKEYDESC _hotkeydescs[] = {
{ "tabsrmm_mostrecent", LPGEN("Most recent unread session"), TABSRMM_HK_SECTION_IM, MS_TABMSG_HOTKEYPROCESS, HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'R'), TABSRMM_HK_LASTUNREAD },
- { "tabsrmm_paste_and_send", LPGEN("Paste and send"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'D'), TABSRMM_HK_PASTEANDSEND },
- { "tabsrmm_uprefs", LPGEN("Contact's messaging preferences"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'C'), TABSRMM_HK_SETUSERPREFS },
- { "tabsrmm_copts", LPGEN("Container options"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_CONTROL, 'O'), TABSRMM_HK_CONTAINEROPTIONS },
- { "tabsrmm_sendfile", LPGEN("Send a file"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT, 'F'), TABSRMM_HK_SENDFILE },
- { "tabsrmm_quote", LPGEN("Quote message"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT, 'Q'), TABSRMM_HK_QUOTEMSG },
- { "tabsrmm_sendlater", LPGEN("Toggle send later"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'S'), TABSRMM_HK_TOGGLESENDLATER },
-
- { "tabsrmm_send", LPGEN("Send message"), TABSRMM_HK_SECTION_GENERIC, 0, 0, TABSRMM_HK_SEND },
- { "tabsrmm_hist", LPGEN("Show message history"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT, 'H'), TABSRMM_HK_HISTORY },
- { "tabsrmm_sendmenu", LPGEN("Show send menu"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL, 'S'), TABSRMM_HK_SENDMENU },
- { "tabsrmm_protomenu", LPGEN("Show protocol menu"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_CONTROL, 'P'), TABSRMM_HK_PROTOMENU },
- { "tabsrmm_umenu", LPGEN("Show user menu"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT, 'D'), TABSRMM_HK_USERMENU },
- { "tabsrmm_udet", LPGEN("Show user details"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT, 'U'), TABSRMM_HK_USERDETAILS },
- { "tabsrmm_tbar", LPGEN("Toggle toolbar"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_SHIFT, 'T'), TABSRMM_HK_TOGGLETOOLBAR },
- { "tabsrmm_ipanel", LPGEN("Toggle info panel"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_CONTROL, 'I'), TABSRMM_HK_TOGGLEINFOPANEL },
- { "tabsrmm_rtl", LPGEN("Toggle text direction"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_CONTROL, 'B'), TABSRMM_HK_TOGGLERTL },
- { "tabsrmm_msend", LPGEN("Toggle multi send"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_CONTROL, 'M'), TABSRMM_HK_TOGGLEMULTISEND },
- { "tabsrmm_clearlog", LPGEN("Clear message log"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_CONTROL, 'L'), TABSRMM_HK_CLEARLOG },
- { "tabsrmm_notes", LPGEN("Edit user notes"), TABSRMM_HK_SECTION_IM, 0, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'N'), TABSRMM_HK_EDITNOTES },
- { "tabsrmm_sbar", LPGEN("Collapse side bar"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(0, VK_F9), TABSRMM_HK_TOGGLESIDEBAR },
- { "tabsrmm_muc_cmgr", LPGEN("Channel manager"), TABSRMM_HK_SECTION_GC, 0, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'C'), TABSRMM_HK_CHANNELMGR },
- { "tabsrmm_muc_filter", LPGEN("Toggle filter"), TABSRMM_HK_SECTION_GC, 0, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'F'), TABSRMM_HK_FILTERTOGGLE },
- { "tabsrmm_muc_nick", LPGEN("Toggle nick list"), TABSRMM_HK_SECTION_GC, 0, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'N'), TABSRMM_HK_LISTTOGGLE },
- { "tabsrmm_muc_server_show", LPGEN("Show server window"), TABSRMM_HK_SECTION_GC, 0, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, '1'), TABSRMM_HK_MUC_SHOWSERVER },
- { "tabsrmm_close_other", LPGEN("Close other tabs"), TABSRMM_HK_SECTION_GENERIC, 0, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_CONTROL, 'W'), TABSRMM_HK_CLOSE_OTHER },
+ { "tabsrmm_paste_and_send", LPGEN("Paste and send"), TABSRMM_HK_SECTION_GENERIC, nullptr, HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'D'), TABSRMM_HK_PASTEANDSEND },
+ { "tabsrmm_uprefs", LPGEN("Contact's messaging preferences"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'C'), TABSRMM_HK_SETUSERPREFS },
+ { "tabsrmm_copts", LPGEN("Container options"), TABSRMM_HK_SECTION_GENERIC, nullptr, HOTKEYCODE(HOTKEYF_CONTROL, 'O'), TABSRMM_HK_CONTAINEROPTIONS },
+ { "tabsrmm_sendfile", LPGEN("Send a file"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_ALT, 'F'), TABSRMM_HK_SENDFILE },
+ { "tabsrmm_quote", LPGEN("Quote message"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_ALT, 'Q'), TABSRMM_HK_QUOTEMSG },
+ { "tabsrmm_sendlater", LPGEN("Toggle send later"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_CONTROL | HOTKEYF_SHIFT, 'S'), TABSRMM_HK_TOGGLESENDLATER },
+
+ { "tabsrmm_send", LPGEN("Send message"), TABSRMM_HK_SECTION_GENERIC, nullptr, 0, TABSRMM_HK_SEND },
+ { "tabsrmm_hist", LPGEN("Show message history"), TABSRMM_HK_SECTION_GENERIC, nullptr, HOTKEYCODE(HOTKEYF_ALT, 'H'), TABSRMM_HK_HISTORY },
+ { "tabsrmm_sendmenu", LPGEN("Show send menu"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_CONTROL, 'S'), TABSRMM_HK_SENDMENU },
+ { "tabsrmm_protomenu", LPGEN("Show protocol menu"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_CONTROL, 'P'), TABSRMM_HK_PROTOMENU },
+ { "tabsrmm_umenu", LPGEN("Show user menu"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_ALT, 'D'), TABSRMM_HK_USERMENU },
+ { "tabsrmm_udet", LPGEN("Show user details"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_ALT, 'U'), TABSRMM_HK_USERDETAILS },
+ { "tabsrmm_tbar", LPGEN("Toggle toolbar"), TABSRMM_HK_SECTION_GENERIC, nullptr, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_SHIFT, 'T'), TABSRMM_HK_TOGGLETOOLBAR },
+ { "tabsrmm_ipanel", LPGEN("Toggle info panel"), TABSRMM_HK_SECTION_GENERIC, nullptr, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_CONTROL, 'I'), TABSRMM_HK_TOGGLEINFOPANEL },
+ { "tabsrmm_rtl", LPGEN("Toggle text direction"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_CONTROL, 'B'), TABSRMM_HK_TOGGLERTL },
+ { "tabsrmm_msend", LPGEN("Toggle multi send"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_CONTROL, 'M'), TABSRMM_HK_TOGGLEMULTISEND },
+ { "tabsrmm_clearlog", LPGEN("Clear message log"), TABSRMM_HK_SECTION_GENERIC, nullptr, HOTKEYCODE(HOTKEYF_CONTROL, 'L'), TABSRMM_HK_CLEARLOG },
+ { "tabsrmm_notes", LPGEN("Edit user notes"), TABSRMM_HK_SECTION_IM, nullptr, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'N'), TABSRMM_HK_EDITNOTES },
+ { "tabsrmm_sbar", LPGEN("Collapse side bar"), TABSRMM_HK_SECTION_GENERIC, nullptr, HOTKEYCODE(0, VK_F9), TABSRMM_HK_TOGGLESIDEBAR },
+ { "tabsrmm_muc_cmgr", LPGEN("Channel manager"), TABSRMM_HK_SECTION_GC, nullptr, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'C'), TABSRMM_HK_CHANNELMGR },
+ { "tabsrmm_muc_filter", LPGEN("Toggle filter"), TABSRMM_HK_SECTION_GC, nullptr, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'F'), TABSRMM_HK_FILTERTOGGLE },
+ { "tabsrmm_muc_nick", LPGEN("Toggle nick list"), TABSRMM_HK_SECTION_GC, nullptr, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, 'N'), TABSRMM_HK_LISTTOGGLE },
+ { "tabsrmm_muc_server_show", LPGEN("Show server window"), TABSRMM_HK_SECTION_GC, nullptr, HOTKEYCODE(HOTKEYF_SHIFT | HOTKEYF_CONTROL, '1'), TABSRMM_HK_MUC_SHOWSERVER },
+ { "tabsrmm_close_other", LPGEN("Close other tabs"), TABSRMM_HK_SECTION_GENERIC, nullptr, HOTKEYCODE(HOTKEYF_ALT | HOTKEYF_CONTROL, 'W'), TABSRMM_HK_CLOSE_OTHER },
};
LRESULT ProcessHotkeysByMsgFilter(const CCtrlBase &pCtrl, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -95,11 +95,11 @@ void TSAPI HandleMenuEntryFromhContact(MCONTACT hContact)
HWND hWnd = Srmm_FindWindow(hContact);
if (hWnd && IsWindow(hWnd)) {
- TContainerData *pContainer = 0;
+ TContainerData *pContainer = nullptr;
SendMessage(hWnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
if (pContainer) {
ActivateExistingTab(pContainer, hWnd);
- pContainer->hwndSaved = 0;
+ pContainer->hwndSaved = nullptr;
SetForegroundWindow(pContainer->m_hwnd);
}
else CallService(MS_MSG_SENDMESSAGE, hContact, 0);
@@ -115,7 +115,7 @@ void TSAPI DrawMenuItem(DRAWITEMSTRUCT *dis, HICON hIcon, DWORD dwIdle)
if (dwIdle)
CSkin::DrawDimmedIcon(dis->hDC, 2, (dis->rcItem.bottom + dis->rcItem.top - 16) / 2, 16, 16, hIcon, 180);
else
- DrawIconEx(dis->hDC, 2, (dis->rcItem.bottom + dis->rcItem.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT);
+ DrawIconEx(dis->hDC, 2, (dis->rcItem.bottom + dis->rcItem.top - 16) / 2, hIcon, 16, 16, 0, nullptr, DI_NORMAL | DI_COMPAT);
}
LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -183,7 +183,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
hWnd = si ? si->pDlg->GetHwnd() : nullptr;
}
- CSrmmWindow *dat = 0;
+ CSrmmWindow *dat = nullptr;
if (hWnd)
dat = (CSrmmWindow*)GetWindowLongPtr(hWnd, GWLP_USERDATA);
@@ -193,7 +193,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (dis->itemData > 0)
hIcon = (dis->itemData & 0x10000000) ? pci->hIcons[ICON_HIGHLIGHT] : PluginConfig.g_IconMsgEvent;
else if (dat != nullptr) {
- hIcon = dat->GetMyContactIcon(0);
+ hIcon = dat->GetMyContactIcon(nullptr);
idle = dat->m_idle;
}
else hIcon = PluginConfig.g_iconContainer;
@@ -353,7 +353,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
{
HWND hWnd = Srmm_FindWindow(lParam);
if (hWnd && IsWindow(hWnd)) {
- TContainerData *pContainer = 0;
+ TContainerData *pContainer = nullptr;
SendMessage(hWnd, DM_QUERYCONTAINER, 0, (LPARAM)&pContainer);
if (pContainer) {
int iTabs = TabCtrl_GetItemCount(GetDlgItem(pContainer->m_hwnd, IDC_MSGTABS));
@@ -475,7 +475,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (IsWindow(job->hOwnerWnd))
::SendMessage(job->hOwnerWnd, HM_EVENTSENT, (WPARAM)MAKELONG(wParam, 0), (LPARAM)&ack);
else
- sendQueue->ackMessage(0, (WPARAM)MAKELONG(wParam, 0), (LPARAM)&ack);
+ sendQueue->ackMessage(nullptr, (WPARAM)MAKELONG(wParam, 0), (LPARAM)&ack);
}
}
return 0;
@@ -512,7 +512,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SelectObject(pCont->cachedDC, pCont->oldHBM);
DeleteObject(pCont->cachedHBM);
DeleteDC(pCont->cachedDC);
- pCont->cachedDC = 0;
+ pCont->cachedDC = nullptr;
RedrawWindow(pCont->m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW | RDW_FRAME);
}
break;
@@ -533,8 +533,8 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
SendMessage(pCont->m_hwnd, WM_TIMER, TIMERID_HEARTBEAT, 0);
// process send later contacts and jobs, if enough time has elapsed
- if (sendLater->isAvail() && !sendLater->isInteractive() && (time(0) - sendLater->lastProcessed()) > CSendLater::SENDLATER_PROCESS_INTERVAL) {
- sendLater->setLastProcessed(time(0));
+ if (sendLater->isAvail() && !sendLater->isInteractive() && (time(nullptr) - sendLater->lastProcessed()) > CSendLater::SENDLATER_PROCESS_INTERVAL) {
+ sendLater->setLastProcessed(time(nullptr));
// check the list of contacts that may have new send later jobs
// (added on user's request)
@@ -544,7 +544,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
if (!sendLater->isJobListEmpty()) {
KillTimer(hwndDlg, wParam);
sendLater->startJobListProcess();
- SetTimer(hwndDlg, TIMERID_SENDLATER_TICK, TIMEOUT_SENDLATER_TICK, 0);
+ SetTimer(hwndDlg, TIMERID_SENDLATER_TICK, TIMEOUT_SENDLATER_TICK, nullptr);
}
}
}
@@ -555,7 +555,7 @@ LONG_PTR CALLBACK HotkeyHandlerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LP
else if (wParam == TIMERID_SENDLATER_TICK) {
if (!sendLater->haveJobs()) {
KillTimer(hwndDlg, wParam);
- SetTimer(hwndDlg, TIMERID_SENDLATER, TIMEOUT_SENDLATER, 0);
+ SetTimer(hwndDlg, TIMERID_SENDLATER, TIMEOUT_SENDLATER, nullptr);
sendLater->qMgrUpdate(true);
}
else sendLater->processCurrentJob();
diff --git a/plugins/TabSRMM/src/infopanel.cpp b/plugins/TabSRMM/src/infopanel.cpp
index 75448e5f9e..e891fcf5b9 100644
--- a/plugins/TabSRMM/src/infopanel.cpp
+++ b/plugins/TabSRMM/src/infopanel.cpp
@@ -38,7 +38,7 @@ wchar_t *xStatusDescr[] =
L"<undef>", L"<undef>"
};
-TInfoPanelConfig CInfoPanel::m_ipConfig = { 0 };
+TInfoPanelConfig CInfoPanel::m_ipConfig = {};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -50,9 +50,9 @@ CInfoPanel::CInfoPanel(CTabBaseDlg *dat)
}
m_defaultHeight = PluginConfig.m_panelHeight;
m_defaultMUCHeight = PluginConfig.m_MUCpanelHeight;
- m_hwndConfig = 0;
+ m_hwndConfig = nullptr;
m_hoverFlags = 0;
- m_tip = 0;
+ m_tip = nullptr;
}
CInfoPanel::~CInfoPanel()
@@ -288,7 +288,7 @@ void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool bAero,
rcBlack.top = rc.bottom;// + 1;
rcBlack.bottom = rcBlack.top + 2;
if (CSkin::m_pCurrentAeroEffect && CSkin::m_pCurrentAeroEffect->m_clrBack != 0)
- ::DrawAlpha(hdc, &rcBlack, CSkin::m_pCurrentAeroEffect->m_clrBack, 90, CSkin::m_pCurrentAeroEffect->m_clrBack, 0, 0, 0, 1, 0);
+ ::DrawAlpha(hdc, &rcBlack, CSkin::m_pCurrentAeroEffect->m_clrBack, 90, CSkin::m_pCurrentAeroEffect->m_clrBack, 0, 0, 0, 1, nullptr);
return;
}
@@ -305,7 +305,7 @@ void CInfoPanel::renderBG(const HDC hdc, RECT& rc, CSkinItem *item, bool bAero,
}
rc.bottom -= 2;
- ::DrawAlpha(hdc, &rc, PluginConfig.m_ipBackgroundGradient, 100, PluginConfig.m_ipBackgroundGradientHigh, 0, 17, 0, 0, 0);
+ ::DrawAlpha(hdc, &rc, PluginConfig.m_ipBackgroundGradient, 100, PluginConfig.m_ipBackgroundGradientHigh, 0, 17, 0, 0, nullptr);
if (fAutoCalc) {
rc.top = rc.bottom - 1;
rc.left--; rc.right++;
@@ -377,7 +377,7 @@ void CInfoPanel::renderContent(const HDC hdc)
void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem)
{
const wchar_t *szStatusMsg = nullptr;
- const wchar_t *szTextToShow = 0;
+ const wchar_t *szTextToShow = nullptr;
bool fShowUin = false;
COLORREF clr = 0;
@@ -395,7 +395,7 @@ void CInfoPanel::RenderIPNickname(const HDC hdc, RECT &rcItem)
if (szTextToShow[0]) {
HICON xIcon = m_dat->GetXStatusIcon();
if (xIcon) {
- ::DrawIconEx(hdc, rcItem.left, (rcItem.bottom + rcItem.top - PluginConfig.m_smcyicon) / 2, xIcon, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, 0, 0, DI_NORMAL | DI_COMPAT);
+ ::DrawIconEx(hdc, rcItem.left, (rcItem.bottom + rcItem.top - PluginConfig.m_smcyicon) / 2, xIcon, PluginConfig.m_smcxicon, PluginConfig.m_smcyicon, 0, nullptr, DI_NORMAL | DI_COMPAT);
::DestroyIcon(xIcon);
rcItem.left += 21;
}
@@ -553,7 +553,7 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem)
rc.right -= 3;
if (szResult[0]) {
- ::DrawIconEx(hdc, rcItem.left, (rcItem.bottom - rcItem.top) / 2 - 8 + rcItem.top, PluginConfig.g_iconClock, 16, 16, 0, 0, DI_NORMAL);
+ ::DrawIconEx(hdc, rcItem.left, (rcItem.bottom - rcItem.top) / 2 - 8 + rcItem.top, PluginConfig.g_iconClock, 16, 16, 0, nullptr, DI_NORMAL);
HFONT oldFont = (HFONT)SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_TIME]);
@@ -581,7 +581,7 @@ void CInfoPanel::RenderIPStatus(const HDC hdc, RECT& rcItem)
}
if (m_dat->m_hClientIcon)
- DrawIconEx(hdc, rc.right - 19, (rc.bottom + rc.top - 16) / 2, m_dat->m_hClientIcon, 16, 16, 0, 0, DI_NORMAL);
+ DrawIconEx(hdc, rc.right - 19, (rc.bottom + rc.top - 16) / 2, m_dat->m_hClientIcon, 16, 16, 0, nullptr, DI_NORMAL);
if (hOldFont)
SelectObject(hdc, hOldFont);
@@ -655,7 +655,7 @@ void CInfoPanel::Chat_RenderIPNickname(const HDC hdc, RECT& rcItem)
void CInfoPanel::Chat_RenderIPSecondLine(const HDC hdc, RECT& rcItem)
{
SESSION_INFO *si = reinterpret_cast<SESSION_INFO*>(m_dat->m_si);
- if (si == 0)
+ if (si == nullptr)
return;
HFONT hOldFont = reinterpret_cast<HFONT>(::SelectObject(hdc, m_ipConfig.hFonts[IPFONTID_UIN]));
@@ -707,7 +707,7 @@ HMENU CInfoPanel::constructContextualMenu() const
mii.hbmpItem = HBMMENU_CALLBACK;
if (!(m_hoverFlags & HOVER_NICK))
- return 0;
+ return nullptr;
HMENU m = ::CreatePopupMenu();
@@ -721,10 +721,10 @@ HMENU CInfoPanel::constructContextualMenu() const
if (GCW_SERVER & m_dat->m_si->iType)
::EnableMenuItem(m, IDC_SRMM_CHANMGR, MF_BYCOMMAND | MF_GRAYED);
}
- ::AppendMenu(m, MF_SEPARATOR, 1000, 0);
+ ::AppendMenu(m, MF_SEPARATOR, 1000, nullptr);
Utils::addMenuItem(m, mii, PluginConfig.g_buttonBarIcons[6], TranslateT("Close session"), IDC_CLOSE, 4);
}
- ::AppendMenu(m, MF_SEPARATOR, 1000, 0);
+ ::AppendMenu(m, MF_SEPARATOR, 1000, nullptr);
::AppendMenu(m, MF_STRING, CMD_IP_COPY, TranslateT("Copy to clipboard"));
return m;
@@ -830,23 +830,23 @@ void CInfoPanel::trackMouse(POINT &pt)
switch (result) {
case HTSTATUS:
m_hoverFlags |= HOVER_STATUS;
- ::SetCursor(LoadCursor(0, IDC_HAND));
+ ::SetCursor(LoadCursor(nullptr, IDC_HAND));
break;
case HTNICK:
m_hoverFlags |= HOVER_NICK;
- ::SetCursor(LoadCursor(0, IDC_HAND));
+ ::SetCursor(LoadCursor(nullptr, IDC_HAND));
break;
case HTUIN:
- ::SetCursor(LoadCursor(0, IDC_HAND));
+ ::SetCursor(LoadCursor(nullptr, IDC_HAND));
m_hoverFlags |= HOVER_UIN;
break;
}
if (m_hoverFlags) {
if (!(m_dat->m_dwFlagsEx & MWF_SHOW_AWAYMSGTIMER)) {
- ::SetTimer(m_dat->GetHwnd(), TIMERID_AWAYMSG, 1000, 0);
+ ::SetTimer(m_dat->GetHwnd(), TIMERID_AWAYMSG, 1000, nullptr);
m_dat->m_dwFlagsEx |= MWF_SHOW_AWAYMSGTIMER;
}
}
@@ -885,7 +885,7 @@ void CInfoPanel::showTip(UINT ctrlId, const LPARAM lParam)
DBVARIANT dbv = { 0 };
if (BYTE xStatus = m_dat->m_cache->getXStatusId()) {
- wchar_t *tszXStatusName = 0;
+ wchar_t *tszXStatusName = nullptr;
if (0 == db_get_ws(m_dat->m_cache->getContact(), m_dat->m_cache->getProto(), "XStatusName", &dbv))
tszXStatusName = dbv.ptszVal;
else if (xStatus > 0 && xStatus <= 31)
@@ -942,7 +942,7 @@ void CInfoPanel::hideTip(const HWND hwndNew)
return;
if (::IsWindow(m_tip->getHwnd()))
::DestroyWindow(m_tip->getHwnd());
- m_tip = 0;
+ m_tip = nullptr;
}
}
@@ -963,7 +963,7 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP
// parent window of the infopanel ACC control
RECT rc, rcItem;
CSrmmWindow *dat = (CSrmmWindow*)GetWindowLongPtr(GetParent(hwnd), GWLP_USERDATA);
- if (dat == 0)
+ if (dat == nullptr)
break;
GetClientRect(hwnd, &rcItem);
@@ -984,7 +984,7 @@ LRESULT CALLBACK CInfoPanel::avatarParentSubclass(HWND hwnd, UINT msg, WPARAM wP
HBITMAP hbm = CSkin::CreateAeroCompatibleBitmap(rc, dcWin);
HBITMAP hbmOld = (HBITMAP)SelectObject(hdc, hbm);
- if (CSkin::m_pCurrentAeroEffect == 0)
+ if (CSkin::m_pCurrentAeroEffect == nullptr)
FillRect(hdc, &rc, (HBRUSH)GetStockObject(BLACK_BRUSH));
else {
if (CSkin::m_pCurrentAeroEffect->m_finalAlpha == 0)
@@ -1097,7 +1097,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
HWND hwndChild = (HWND)lParam;
UINT id = ::GetDlgCtrlID(hwndChild);
- if (m_configDlgFont == 0) {
+ if (m_configDlgFont == nullptr) {
HFONT hFont = (HFONT)::SendDlgItemMessage(hwnd, IDC_IPCONFIG_TITLE, WM_GETFONT, 0, 0);
LOGFONT lf = { 0 };
@@ -1225,7 +1225,7 @@ INT_PTR CALLBACK CInfoPanel::ConfigDlgProc(HWND hwnd, UINT msg, WPARAM wParam, L
::DeleteObject(m_configDlgBoldFont);
::DeleteObject(m_configDlgFont);
- m_configDlgBoldFont = m_configDlgFont = 0;
+ m_configDlgBoldFont = m_configDlgFont = nullptr;
::SetWindowLongPtr(hwnd, GWLP_USERDATA, 0);
break;
}
@@ -1251,9 +1251,9 @@ int CInfoPanel::invokeConfigDialog(const POINT &pt)
if (!::PtInRect(&rc, ptTest))
return 0;
- if (m_hwndConfig == 0) {
- m_configDlgBoldFont = m_configDlgFont = 0;
- m_hwndConfig = ::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_INFOPANEL), 0 /*m_dat->m_pContainer->m_hwnd */,
+ if (m_hwndConfig == nullptr) {
+ m_configDlgBoldFont = m_configDlgFont = nullptr;
+ m_hwndConfig = ::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_INFOPANEL), nullptr /*m_dat->m_pContainer->m_hwnd */,
ConfigDlgProcStub, (LPARAM)this);
if (m_hwndConfig) {
TranslateDialogDefault(m_hwndConfig);
@@ -1278,7 +1278,7 @@ int CInfoPanel::invokeConfigDialog(const POINT &pt)
void CInfoPanel::dismissConfig(bool fForced)
{
- if (m_hwndConfig == 0)
+ if (m_hwndConfig == nullptr)
return;
if (!m_fDialogCreated) {
@@ -1289,7 +1289,7 @@ void CInfoPanel::dismissConfig(bool fForced)
::GetWindowRect(m_hwndConfig, &rc);
if (fForced || !PtInRect(&rc, pt)) {
SendMessage(m_hwndConfig, WM_CLOSE, 1, 1);
- m_hwndConfig = 0;
+ m_hwndConfig = nullptr;
}
}
m_fDialogCreated = false;
@@ -1306,7 +1306,7 @@ void CInfoPanel::dismissConfig(bool fForced)
CTip::CTip(const HWND hwndParent, const MCONTACT hContact, const wchar_t *pszText, const CInfoPanel* panel)
{
m_hwnd = ::CreateWindowEx(WS_EX_TOOLWINDOW, L"RichEditTipClass", L"", (M.isAero() ? WS_THICKFRAME : WS_BORDER) | WS_POPUPWINDOW | WS_TABSTOP | WS_CLIPCHILDREN | WS_CLIPSIBLINGS,
- 0, 0, 40, 40, 0, 0, g_hInst, this);
+ 0, 0, 40, 40, nullptr, nullptr, g_hInst, this);
m_hRich = ::CreateWindowEx(0, L"RICHEDIT50W", L"", WS_CHILD | ES_MULTILINE | ES_AUTOVSCROLL | ES_NOHIDESEL | ES_READONLY | WS_VSCROLL | WS_TABSTOP,
0, 0, 40, 40, m_hwnd, reinterpret_cast<HMENU>(1000), g_hInst, nullptr);
@@ -1379,7 +1379,7 @@ void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const wchar_t *szT
m_rcRich.right = m_rcRich.left + (twips * (m_rcRich.right - m_rcRich.left)) - 10 * twips;
m_rcRich.bottom = m_rcRich.top + (twips * (m_rcRich.bottom - m_rcRich.top));
- FORMATRANGE fr = { 0 };
+ FORMATRANGE fr = {};
fr.hdc = hdc;
fr.hdcTarget = hdc;
fr.rc = m_rcRich;
@@ -1397,7 +1397,7 @@ void CTip::show(const RECT& rc, POINT& pt, const HICON hIcon, const wchar_t *szT
::SetWindowPos(m_hwnd, HWND_TOP, pt.x - 5, pt.y - 5, m_szRich.cx + m_leftWidth + LEFT_BORDER + RIGHT_BORDER + 2 * xBorder,
m_szRich.cy + TOP_BORDER + BOTTOM_BORDER + 2 * yBorder, SWP_NOACTIVATE | SWP_SHOWWINDOW);
- ::SetWindowPos(m_hRich, 0, LEFT_BORDER + m_leftWidth, TOP_BORDER, m_szRich.cx, m_szRich.cy, SWP_SHOWWINDOW);
+ ::SetWindowPos(m_hRich, nullptr, LEFT_BORDER + m_leftWidth, TOP_BORDER, m_szRich.cx, m_szRich.cy, SWP_SHOWWINDOW);
::ReleaseDC(m_hwnd, hdc);
}
@@ -1473,7 +1473,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
case WM_ACTIVATE:
case WM_SETCURSOR:
::KillTimer(hwnd, 1000);
- ::SetTimer(hwnd, 1000, 200, 0);
+ ::SetTimer(hwnd, 1000, 200, nullptr);
if (msg == WM_ACTIVATE && LOWORD(wParam) == WA_INACTIVE)
::DestroyWindow(hwnd);
@@ -1494,7 +1494,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
RECT rcText = { 0, 0, rc.right, TOP_BORDER };
LONG cx = rc.right;
LONG cy = rc.bottom;
- HANDLE hTheme = 0;
+ HANDLE hTheme = nullptr;
mir_snwprintf(szTitle, m_szTitle ? L"%s (%s)" : L"%s%s", c->getNick(), m_szTitle ? m_szTitle : L"");
@@ -1524,7 +1524,7 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
else {
::FillRect(hdcMem, &rc, br);
::DrawAlpha(hdcMem, &rcText, PluginConfig.m_ipBackgroundGradientHigh, 100, PluginConfig.m_ipBackgroundGradient,
- 0, GRADIENT_TB + 1, 0, 2, 0);
+ 0, GRADIENT_TB + 1, 0, 2, nullptr);
}
::DeleteObject(br);
rcText.left = 20;
@@ -1532,15 +1532,15 @@ INT_PTR CALLBACK CTip::WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam
LONG dy = 4;
if (m_hIcon) {
- ::DrawIconEx(hdcMem, 2, dy, m_hIcon, 16, 16, 0, 0, DI_NORMAL);
+ ::DrawIconEx(hdcMem, 2, dy, m_hIcon, 16, 16, 0, nullptr, DI_NORMAL);
dy = TOP_BORDER + 4;
}
if (m_panel->getDat()->m_hXStatusIcon) {
- ::DrawIconEx(hdcMem, 2, dy, m_panel->getDat()->m_hXStatusIcon, 16, 16, 0, 0, DI_NORMAL);
+ ::DrawIconEx(hdcMem, 2, dy, m_panel->getDat()->m_hXStatusIcon, 16, 16, 0, nullptr, DI_NORMAL);
dy += 18;
}
if (m_panel->getDat()->m_hClientIcon)
- ::DrawIconEx(hdcMem, 2, dy, m_panel->getDat()->m_hClientIcon, 16, 16, 0, 0, DI_NORMAL);
+ ::DrawIconEx(hdcMem, 2, dy, m_panel->getDat()->m_hClientIcon, 16, 16, 0, nullptr, DI_NORMAL);
CSkin::RenderText(hdcMem, hTheme, szTitle, &rcText, DT_SINGLELINE | DT_END_ELLIPSIS | DT_VCENTER, CSkin::m_glowSize, clr);
if (hTheme)
diff --git a/plugins/TabSRMM/src/mim.cpp b/plugins/TabSRMM/src/mim.cpp
index d1af47ec4b..cace397ad3 100644
--- a/plugins/TabSRMM/src/mim.cpp
+++ b/plugins/TabSRMM/src/mim.cpp
@@ -29,23 +29,23 @@
#include "stdafx.h"
-PDTTE CMimAPI::m_pfnDrawThemeTextEx = 0;
-DEFICA CMimAPI::m_pfnDwmExtendFrameIntoClientArea = 0;
-DICE CMimAPI::m_pfnDwmIsCompositionEnabled = 0;
-DRT CMimAPI::m_pfnDwmRegisterThumbnail = 0;
-BPI CMimAPI::m_pfnBufferedPaintInit = 0;
-BPU CMimAPI::m_pfnBufferedPaintUninit = 0;
-BBP CMimAPI::m_pfnBeginBufferedPaint = 0;
-EBP CMimAPI::m_pfnEndBufferedPaint = 0;
-BBW CMimAPI::m_pfnDwmBlurBehindWindow = 0;
-DGC CMimAPI::m_pfnDwmGetColorizationColor = 0;
-BPSA CMimAPI::m_pfnBufferedPaintSetAlpha = 0;
-DWMIIB CMimAPI::m_pfnDwmInvalidateIconicBitmaps = 0;
-DWMSWA CMimAPI::m_pfnDwmSetWindowAttribute = 0;
-DWMUT CMimAPI::m_pfnDwmUpdateThumbnailProperties = 0;
-DURT CMimAPI::m_pfnDwmUnregisterThumbnail = 0;
-DSIT CMimAPI::m_pfnDwmSetIconicThumbnail = 0;
-DSILP CMimAPI::m_pfnDwmSetIconicLivePreviewBitmap = 0;
+PDTTE CMimAPI::m_pfnDrawThemeTextEx = nullptr;
+DEFICA CMimAPI::m_pfnDwmExtendFrameIntoClientArea = nullptr;
+DICE CMimAPI::m_pfnDwmIsCompositionEnabled = nullptr;
+DRT CMimAPI::m_pfnDwmRegisterThumbnail = nullptr;
+BPI CMimAPI::m_pfnBufferedPaintInit = nullptr;
+BPU CMimAPI::m_pfnBufferedPaintUninit = nullptr;
+BBP CMimAPI::m_pfnBeginBufferedPaint = nullptr;
+EBP CMimAPI::m_pfnEndBufferedPaint = nullptr;
+BBW CMimAPI::m_pfnDwmBlurBehindWindow = nullptr;
+DGC CMimAPI::m_pfnDwmGetColorizationColor = nullptr;
+BPSA CMimAPI::m_pfnBufferedPaintSetAlpha = nullptr;
+DWMIIB CMimAPI::m_pfnDwmInvalidateIconicBitmaps = nullptr;
+DWMSWA CMimAPI::m_pfnDwmSetWindowAttribute = nullptr;
+DWMUT CMimAPI::m_pfnDwmUpdateThumbnailProperties = nullptr;
+DURT CMimAPI::m_pfnDwmUnregisterThumbnail = nullptr;
+DSIT CMimAPI::m_pfnDwmSetIconicThumbnail = nullptr;
+DSILP CMimAPI::m_pfnDwmSetIconicLivePreviewBitmap = nullptr;
bool CMimAPI::m_shutDown = 0;
wchar_t CMimAPI::m_userDir[] = L"\0";
@@ -161,10 +161,10 @@ void CMimAPI::InitAPI()
DWORD dwVer = LOWORD(GetVersion());
m_winVer = MAKEWORD(HIBYTE(dwVer), LOBYTE(dwVer));
- m_hUxTheme = 0;
+ m_hUxTheme = nullptr;
// vista+ DWM API
- m_hDwmApi = 0;
+ m_hDwmApi = nullptr;
if (IsWinVerVistaPlus()) {
m_hDwmApi = Utils::loadSystemLibrary(L"\\dwmapi.dll");
if (m_hDwmApi) {
@@ -190,7 +190,7 @@ void CMimAPI::InitAPI()
m_pfnBufferedPaintInit = (BPI)GetProcAddress(m_hUxTheme, "BufferedPaintInit");
m_pfnBufferedPaintUninit = (BPU)GetProcAddress(m_hUxTheme, "BufferedPaintUnInit");
m_pfnBufferedPaintSetAlpha = (BPSA)GetProcAddress(m_hUxTheme, "BufferedPaintSetAlpha");
- m_haveBufferedPaint = (m_pfnBeginBufferedPaint != 0 && m_pfnEndBufferedPaint != 0) ? true : false;
+ m_haveBufferedPaint = (m_pfnBeginBufferedPaint != nullptr && m_pfnEndBufferedPaint != nullptr) ? true : false;
if (m_haveBufferedPaint)
m_pfnBufferedPaintInit();
}
@@ -253,11 +253,11 @@ int CMimAPI::TypingMessage(WPARAM hContact, LPARAM mode)
fShow = true;
break;
case 2:
- if (hwnd == 0)
+ if (hwnd == nullptr)
fShow = true;
else {
if (PluginConfig.m_bHideOnClose) {
- TContainerData *pCont = 0;
+ TContainerData *pCont = nullptr;
SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pCont);
if (pCont && pCont->fHidden)
fShow = true;
@@ -302,7 +302,7 @@ int CMimAPI::ProtoAck(WPARAM, LPARAM lParam)
{
ACKDATA *pAck = (ACKDATA*)lParam;
- if ((pAck != 0) && (pAck->type == ACKTYPE_MESSAGE)) {
+ if ((pAck != nullptr) && (pAck->type == ACKTYPE_MESSAGE)) {
int i = 0, iFound = SendQueue::NR_SENDJOBS;
SendJob *jobs = sendQueue->getJobByIndex(0);
MCONTACT hMeta = db_mc_getMeta(pAck->hContact);
@@ -399,7 +399,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
DWORD dwStatusMask = M.GetDword("autopopupmask", -1);
if (hwnd) {
- TContainerData *pTargetContainer = 0;
+ TContainerData *pTargetContainer = nullptr;
SendMessage(hwnd, DM_QUERYCONTAINER, 0, (LPARAM)&pTargetContainer);
if (pTargetContainer == nullptr || !PluginConfig.m_bHideOnClose || IsWindowVisible(pTargetContainer->m_hwnd))
return 0;
@@ -439,7 +439,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
return 0;
case EVENTTYPE_FILE:
- tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule);
+ tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, nullptr, nullptr, dbei.szModule);
return 0;
}
}
@@ -505,7 +505,7 @@ int CMimAPI::MessageEventAdded(WPARAM hContact, LPARAM hDbEvent)
// the contact list for flashing
nowindowcreate:
if (!(dbei.flags & DBEF_READ)) {
- UpdateTrayMenu(0, 0, dbei.szModule, nullptr, hContact, 1);
+ UpdateTrayMenu(nullptr, 0, dbei.szModule, nullptr, hContact, 1);
if (!nen_options.bTraySupport) {
wchar_t toolTip[256], *contactName;
@@ -520,10 +520,10 @@ nowindowcreate:
cle.szTooltip.w = toolTip;
pcli->pfnAddEvent(&cle);
}
- tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, 0, 0, dbei.szModule);
+ tabSRMM_ShowPopup(hContact, hDbEvent, dbei.eventType, 0, nullptr, nullptr, dbei.szModule);
}
return 0;
}
CMimAPI M;
-FI_INTERFACE *FIF = 0;
+FI_INTERFACE *FIF = nullptr;
diff --git a/plugins/TabSRMM/src/modplus.cpp b/plugins/TabSRMM/src/modplus.cpp
index 3bde72a450..eaa29d336b 100644
--- a/plugins/TabSRMM/src/modplus.cpp
+++ b/plugins/TabSRMM/src/modplus.cpp
@@ -111,8 +111,8 @@ static int CustomButtonPressed(WPARAM wParam, LPARAM lParam)
pwszFormatedText.Format(L"[img]%s[/img]", pszText);
- bbd.pwszTooltip = 0;
- bbd.hIcon = 0;
+ bbd.pwszTooltip = nullptr;
+ bbd.hIcon = nullptr;
bbd.bbbFlags = BBSF_RELEASED;
Srmm_SetButtonState(wParam, &bbd);
}
diff --git a/plugins/TabSRMM/src/msgdialog.cpp b/plugins/TabSRMM/src/msgdialog.cpp
index b2046d2473..5ede9f7a68 100644
--- a/plugins/TabSRMM/src/msgdialog.cpp
+++ b/plugins/TabSRMM/src/msgdialog.cpp
@@ -95,7 +95,7 @@ void CTabBaseDlg::ShowPopupMenu(const CCtrlBase &pCtrl, POINT pt)
}
if (pCtrl.GetCtrlId() == IDC_SRMM_LOG) {
- InsertMenuA(hSubMenu, 6, MF_BYPOSITION | MF_SEPARATOR, 0, 0);
+ InsertMenuA(hSubMenu, 6, MF_BYPOSITION | MF_SEPARATOR, 0, nullptr);
CheckMenuItem(hSubMenu, ID_LOG_FREEZELOG, MF_BYCOMMAND | (m_dwFlagsEx & MWF_SHOW_SCROLLINGDISABLED ? MF_CHECKED : MF_UNCHECKED));
}
@@ -152,7 +152,7 @@ void CTabBaseDlg::ShowPopupMenu(const CCtrlBase &pCtrl, POINT pt)
Srmm_Broadcast(DM_CONFIGURETOOLBAR, 0, 0);
Resize();
if (m_pContainer->hwndStatus)
- RedrawWindow(m_pContainer->hwndStatus, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW);
+ RedrawWindow(m_pContainer->hwndStatus, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
break;
case ID_EDITOR_PASTEANDSENDIMMEDIATELY:
HandlePasteAndSend();
@@ -291,13 +291,13 @@ void CSrmmWindow::MsgWindowUpdateState(UINT msg)
PostMessage(m_hwnd, DM_SAVESIZE, 0, 0);
if (PluginConfig.m_bAutoLocaleSupport) {
- if (m_hkl == 0)
+ if (m_hkl == nullptr)
DM_LoadLocale();
else
SendMessage(m_hwnd, DM_SETLOCALE, 0, 0);
}
- m_pContainer->hIconTaskbarOverlay = 0;
+ m_pContainer->hIconTaskbarOverlay = nullptr;
m_pContainer->UpdateTitle(m_hContact);
tabUpdateStatusBar();
@@ -312,7 +312,7 @@ void CSrmmWindow::MsgWindowUpdateState(UINT msg)
m_pPanel.Invalidate();
- if (m_dwFlags & MWF_DEFERREDSCROLL && m_hwndIEView == 0 && m_hwndHPP == 0) {
+ if (m_dwFlags & MWF_DEFERREDSCROLL && m_hwndIEView == nullptr && m_hwndHPP == nullptr) {
m_dwFlags &= ~MWF_DEFERREDSCROLL;
DM_ScrollToBottom(0, 1);
}
@@ -331,8 +331,8 @@ void CSrmmWindow::MsgWindowUpdateState(UINT msg)
if (m_hwndIEView) {
if (M.GetByte("subclassIEView", 0)) {
mir_subclassWindow(m_hwndIEView, IEViewSubclassProc);
- SetWindowPos(m_hwndIEView, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_DRAWFRAME);
- RedrawWindow(m_hwndIEView, 0, 0, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
+ SetWindowPos(m_hwndIEView, nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_DRAWFRAME);
+ RedrawWindow(m_hwndIEView, nullptr, nullptr, RDW_FRAME | RDW_INVALIDATE | RDW_UPDATENOW);
}
}
m_hwndIWebBrowserControl = WindowFromPoint(pt);
@@ -627,7 +627,7 @@ void CSrmmWindow::OnInitDialog()
DBEVENTINFO dbei = {};
m_bWantPopup = false;
db_event_get(m_hDbEventFirst, &dbei);
- tabSRMM_ShowPopup(m_hContact, m_hDbEventFirst, dbei.eventType, 0, 0, m_hwnd, m_cache->getActiveProto());
+ tabSRMM_ShowPopup(m_hContact, m_hDbEventFirst, dbei.eventType, 0, nullptr, m_hwnd, m_cache->getActiveProto());
}
m_hDbEventFirst = 0;
@@ -758,8 +758,8 @@ void CSrmmWindow::OnInitDialog()
m_log.SendMsg(EM_SETLANGOPTIONS, 0, m_log.SendMsg(EM_GETLANGOPTIONS, 0, 0) & ~IMF_AUTOFONTSIZEADJUST);
// add us to the tray list (if it exists)
- if (PluginConfig.g_hMenuTrayUnread != 0 && m_hContact != 0 && m_szProto != nullptr)
- UpdateTrayMenu(0, m_wStatus, m_szProto, m_wszStatus, m_hContact, FALSE);
+ if (PluginConfig.g_hMenuTrayUnread != nullptr && m_hContact != 0 && m_szProto != nullptr)
+ UpdateTrayMenu(nullptr, m_wStatus, m_szProto, m_wszStatus, m_hContact, FALSE);
m_log.SendMsg(EM_AUTOURLDETECT, TRUE, 0);
m_log.SendMsg(EM_EXLIMITTEXT, 0, 0x80000000);
@@ -812,7 +812,7 @@ void CSrmmWindow::OnInitDialog()
SendMessage(m_pContainer->m_hwnd, DM_QUERYCLIENTAREA, 0, (LPARAM)&rc);
- SetWindowPos(m_hwnd, 0, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), m_bActivate ? 0 : SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(m_hwnd, nullptr, rc.left, rc.top, (rc.right - rc.left), (rc.bottom - rc.top), m_bActivate ? 0 : SWP_NOZORDER | SWP_NOACTIVATE);
LoadSplitter();
ShowPicture(true);
@@ -821,7 +821,7 @@ void CSrmmWindow::OnInitDialog()
SetTimer(m_hwnd, TIMERID_FLASHWND, TIMEOUT_FLASHWND, nullptr);
m_bCanFlashTab = true;
- DBEVENTINFO dbei = { 0 };
+ DBEVENTINFO dbei = {};
dbei.eventType = EVENTTYPE_MESSAGE;
FlashOnClist(m_hDbEventFirst, &dbei);
@@ -916,7 +916,7 @@ void CSrmmWindow::OnDestroy()
// the hwndOwner is set to 0 because the window handle is now no longer valid.
// Response for such a job is still silently handled by AckMessage() (sendqueue.c)
if (jobs[i].iStatus == (unsigned)SendQueue::SQ_INPROGRESS)
- jobs[i].hOwnerWnd = 0;
+ jobs[i].hOwnerWnd = nullptr;
}
}
}
@@ -942,7 +942,7 @@ void CSrmmWindow::OnDestroy()
NotifyEvent(MSG_WINDOW_EVT_CLOSE);
// clean up IEView and H++ log windows
- if (m_hwndIEView != 0) {
+ if (m_hwndIEView != nullptr) {
IEVIEWWINDOW ieWindow;
ieWindow.cbSize = sizeof(IEVIEWWINDOW);
ieWindow.iType = IEW_DESTROY;
@@ -974,7 +974,7 @@ void CSrmmWindow::ReplayQueue()
void CSrmmWindow::UpdateTitle()
{
DWORD dwOldIdle = m_idle;
- const char *szActProto = 0;
+ const char *szActProto = nullptr;
m_wszStatus[0] = 0;
@@ -1172,7 +1172,7 @@ void CSrmmWindow::onClick_Add(CCtrlButton*)
ADDCONTACTSTRUCT acs = {};
acs.hContact = m_hContact;
acs.handleType = HANDLE_CONTACT;
- acs.szProto = 0;
+ acs.szProto = nullptr;
CallService(MS_ADDCONTACT_SHOW, (WPARAM)m_hwnd, (LPARAM)&acs);
if (!db_get_b(m_hContact, "CList", "NotOnList", 0)) {
m_bNotOnList = FALSE;
@@ -1193,7 +1193,7 @@ void CSrmmWindow::onClick_Color(CCtrlButton *pButton)
RECT rc;
GetWindowRect(pButton->GetHwnd(), &rc);
- int iSelection = TrackPopupMenu(GetSubMenu(PluginConfig.g_hMenuContext, 7), TPM_RETURNCMD, rc.left, rc.bottom, 0, m_hwnd, NULL);
+ int iSelection = TrackPopupMenu(GetSubMenu(PluginConfig.g_hMenuContext, 7), TPM_RETURNCMD, rc.left, rc.bottom, 0, m_hwnd, nullptr);
if (iSelection == ID_FONT_CLEARALLFORMATTING) {
cf.dwMask = CFM_BOLD | CFM_COLOR | CFM_ITALIC | CFM_UNDERLINE | CFM_STRIKEOUT;
cf.crTextColor = M.GetDword(FONTMODULE, "Font16Col", 0);
@@ -1572,9 +1572,9 @@ int CSrmmWindow::OnFilter(MSGFILTER *pFilter)
case TABSRMM_HK_TOGGLESENDLATER:
if (sendLater->isAvail()) {
m_sendMode ^= SMODE_SENDLATER;
- SetWindowPos(m_message.GetHwnd(), 0, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER |
+ SetWindowPos(m_message.GetHwnd(), nullptr, 0, 0, 0, 0, SWP_DRAWFRAME | SWP_FRAMECHANGED | SWP_NOZORDER |
SWP_NOMOVE | SWP_NOSIZE | SWP_NOCOPYBITS);
- RedrawWindow(m_hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
}
else
CWarning::show(CWarning::WARN_NO_SENDLATER, MB_OK | MB_ICONINFORMATION, TranslateT("Configuration issue|The unattended send feature is disabled. The \\b1 send later\\b0 and \\b1 send to multiple contacts\\b0 features depend on it.\n\nYou must enable it under \\b1Options -> Message sessions -> Advanced tweaks\\b0. Changing this option requires a restart."));
@@ -1615,7 +1615,7 @@ int CSrmmWindow::OnFilter(MSGFILTER *pFilter)
DestroyWindow(GetDlgItem(m_hwnd, IDC_CLIST));
HWND hwndEdit = m_message.GetHwnd();
- SetWindowPos(hwndEdit, 0, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
+ SetWindowPos(hwndEdit, nullptr, 0, 0, 0, 0, SWP_FRAMECHANGED | SWP_NOSIZE | SWP_NOMOVE);
Resize();
RedrawWindow(hwndEdit, nullptr, nullptr, RDW_INVALIDATE | RDW_FRAME | RDW_UPDATENOW | RDW_ERASE);
DM_ScrollToBottom(0, 0);
@@ -1625,7 +1625,7 @@ int CSrmmWindow::OnFilter(MSGFILTER *pFilter)
SetFocus(GetDlgItem(m_hwnd, IDC_CLIST));
else
SetFocus(m_message.GetHwnd());
- RedrawWindow(m_hwnd, 0, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
+ RedrawWindow(m_hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW | RDW_ALLCHILDREN);
return _dlgReturn(m_hwnd, 1);
}
if (DM_GenericHotkeysCheck(&message)) {
@@ -2119,7 +2119,7 @@ LRESULT CSrmmWindow::WndProc_Message(UINT msg, WPARAM wParam, LPARAM lParam)
else if (wParam == VK_DOWN)
wp = MAKEWPARAM(SB_LINEDOWN, 0);
- if (m_hwndIEView == 0 && m_hwndHPP == 0)
+ if (m_hwndIEView == nullptr && m_hwndHPP == nullptr)
m_log.SendMsg(WM_VSCROLL, wp, 0);
else
SendMessage(m_hwndIWebBrowserControl, WM_VSCROLL, wp, 0);
@@ -2212,17 +2212,17 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
RECT rcClient, rcWindow;
{
HDC hdc = (HDC)wParam;
- HDC hdcMem = 0;
+ HDC hdcMem = nullptr;
HBITMAP hbm, hbmOld;
- HANDLE hpb = 0;
+ HANDLE hpb = nullptr;
GetClientRect(m_hwnd, &rcClient);
DWORD cx = rcClient.right - rcClient.left;
DWORD cy = rcClient.bottom - rcClient.top;
if (CMimAPI::m_haveBufferedPaint) {
- hpb = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rcClient, BPBF_TOPDOWNDIB, 0, &hdcMem);
- hbm = hbmOld = 0;
+ hpb = CMimAPI::m_pfnBeginBufferedPaint(hdc, &rcClient, BPBF_TOPDOWNDIB, nullptr, &hdcMem);
+ hbm = hbmOld = nullptr;
}
else {
hdcMem = CreateCompatibleDC(hdc);
@@ -2323,7 +2323,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
}
HBITMAP hbm = ((m_pPanel.isActive()) && m_pContainer->avatarMode != 3) ? m_hOwnPic : (m_ace ? m_ace->hbmPic : PluginConfig.g_hbmUnknown);
- if (hbm != 0) {
+ if (hbm != nullptr) {
BITMAP bminfo;
GetObject(hbm, sizeof(bminfo), &bminfo);
CalcDynamicAvatarSize(&bminfo);
@@ -2382,7 +2382,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
m_pPanel.Invalidate();
}
- if (GetDlgItem(m_hwnd, IDC_CLIST) != 0) {
+ if (GetDlgItem(m_hwnd, IDC_CLIST) != nullptr) {
RECT rcLog;
GetClientRect(m_hwnd, &rcClient);
GetClientRect(m_log.GetHwnd(), &rcLog);
@@ -2407,7 +2407,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
break;
case WM_NOTIFY:
- if (this != 0 && ((NMHDR*)lParam)->hwndFrom == m_hwndTip) {
+ if (this != nullptr && ((NMHDR*)lParam)->hwndFrom == m_hwndTip) {
if (((NMHDR*)lParam)->code == NM_CLICK)
SendMessage(m_hwndTip, TTM_TRACKACTIVATE, FALSE, 0);
break;
@@ -2444,7 +2444,7 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
case DM_UPDATEWINICON:
if (m_hXStatusIcon) {
DestroyIcon(m_hXStatusIcon);
- m_hXStatusIcon = 0;
+ m_hXStatusIcon = nullptr;
}
if (LPCSTR szProto = m_cache->getProto()) {
@@ -2728,12 +2728,12 @@ INT_PTR CSrmmWindow::DlgProc(UINT uMsg, WPARAM wParam, LPARAM lParam)
Resize();
PostMessage(m_hwnd, DM_UPDATEPICLAYOUT, 0, 0);
if (PluginConfig.m_bAutoLocaleSupport) {
- if (m_hkl == 0)
+ if (m_hkl == nullptr)
DM_LoadLocale();
else
PostMessage(m_hwnd, DM_SETLOCALE, 0, 0);
}
- if (m_hwndIEView != 0)
+ if (m_hwndIEView != nullptr)
SetFocus(m_message.GetHwnd());
if (m_pContainer->dwFlags & CNT_SIDEBAR)
m_pContainer->SideBar->Layout();
diff --git a/plugins/TabSRMM/src/msgdlgutils.cpp b/plugins/TabSRMM/src/msgdlgutils.cpp
index 19593fa9e7..21924f7c9a 100644
--- a/plugins/TabSRMM/src/msgdlgutils.cpp
+++ b/plugins/TabSRMM/src/msgdlgutils.cpp
@@ -143,9 +143,9 @@ static void SaveAvatarToFile(CTabBaseDlg *dat, HBITMAP hbm, int isOwnPic)
mir_snwprintf(szFinalPath, L"%s\\%s", M.getSavedAvatarPath(), szProto);
mir_free(szProto);
- if (CreateDirectory(szFinalPath, 0) == 0) {
+ if (CreateDirectory(szFinalPath, nullptr) == 0) {
if (GetLastError() != ERROR_ALREADY_EXISTS) {
- MessageBox(0, TranslateT("Error creating destination directory"),
+ MessageBox(nullptr, TranslateT("Error creating destination directory"),
TranslateT("Save contact picture"), MB_OK | MB_ICONSTOP);
return;
}
@@ -178,7 +178,7 @@ static void SaveAvatarToFile(CTabBaseDlg *dat, HBITMAP hbm, int isOwnPic)
ofn.lCustData = (LPARAM)&setView;
if (GetSaveFileName(&ofn)) {
if (PathFileExists(szFinalFilename))
- if (MessageBox(0, TranslateT("The file exists. Do you want to overwrite it?"), TranslateT("Save contact picture"), MB_YESNO | MB_ICONQUESTION) == IDNO)
+ if (MessageBox(nullptr, TranslateT("The file exists. Do you want to overwrite it?"), TranslateT("Save contact picture"), MB_YESNO | MB_ICONQUESTION) == IDNO)
return;
IMGSRVC_INFO ii;
@@ -260,7 +260,7 @@ int CTabBaseDlg::MsgWindowUpdateMenu(HMENU submenu, int menuID)
wchar_t *szText = nullptr;
char avOverride = (char)M.GetByte(m_hContact, "hideavatar", -1);
HMENU visMenu = GetSubMenu(submenu, 0);
- BOOL picValid = bInfoPanel ? (m_hOwnPic != 0) : (m_ace && m_ace->hbmPic && m_ace->hbmPic != PluginConfig.g_hbmUnknown);
+ BOOL picValid = bInfoPanel ? (m_hOwnPic != nullptr) : (m_ace && m_ace->hbmPic && m_ace->hbmPic != PluginConfig.g_hbmUnknown);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -309,7 +309,7 @@ int CTabBaseDlg::MsgWindowMenuHandler(int selection, int menuId)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SELECTCONTAINER), m_hwnd, SelectContainerDlgProc, (LPARAM)m_hwnd);
return 1;
case ID_TABMENU_CONTAINEROPTIONS:
- if (m_pContainer->hWndOptions == 0)
+ if (m_pContainer->hWndOptions == nullptr)
CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_CONTAINEROPTIONS), m_hwnd, DlgProcContainerOptions, (LPARAM)m_pContainer);
return 1;
case ID_TABMENU_CLOSECONTAINER:
@@ -562,7 +562,7 @@ bool CTabBaseDlg::GetAvatarVisibility()
if (!bOwnAvatarMode) {
m_bShowAvatar = (m_hOwnPic && m_hOwnPic != PluginConfig.g_hbmUnknown);
if (!m_hwndContactPic)
- m_hwndContactPic = CreateWindowEx(WS_EX_TOPMOST, AVATAR_CONTROL_CLASS, L"", WS_VISIBLE | WS_CHILD, 1, 1, 1, 1, GetDlgItem(m_hwnd, IDC_CONTACTPIC), (HMENU)0, nullptr, nullptr);
+ m_hwndContactPic = CreateWindowEx(WS_EX_TOPMOST, AVATAR_CONTROL_CLASS, L"", WS_VISIBLE | WS_CHILD, 1, 1, 1, 1, GetDlgItem(m_hwnd, IDC_CONTACTPIC), (HMENU)nullptr, nullptr, nullptr);
}
switch (bAvatarMode) {
@@ -572,7 +572,7 @@ bool CTabBaseDlg::GetAvatarVisibility()
case 0:
m_bShowInfoAvatar = true;
case 1:
- HBITMAP hbm = ((m_ace && !(m_ace->dwFlags & AVS_HIDEONCLIST)) ? m_ace->hbmPic : 0);
+ HBITMAP hbm = ((m_ace && !(m_ace->dwFlags & AVS_HIDEONCLIST)) ? m_ace->hbmPic : nullptr);
if (hbm == nullptr && !bAvatarMode) {
m_bShowInfoAvatar = false;
break;
@@ -605,14 +605,14 @@ bool CTabBaseDlg::GetAvatarVisibility()
m_bShowAvatar = true;
LBL_Check:
if (!m_hwndContactPic)
- m_hwndContactPic = CreateWindowEx(WS_EX_TOPMOST, AVATAR_CONTROL_CLASS, L"", WS_VISIBLE | WS_CHILD, 1, 1, 1, 1, GetDlgItem(m_hwnd, IDC_CONTACTPIC), (HMENU)0, nullptr, nullptr);
+ m_hwndContactPic = CreateWindowEx(WS_EX_TOPMOST, AVATAR_CONTROL_CLASS, L"", WS_VISIBLE | WS_CHILD, 1, 1, 1, 1, GetDlgItem(m_hwnd, IDC_CONTACTPIC), (HMENU)nullptr, nullptr, nullptr);
break;
case 2: // globally OFF
m_bShowAvatar = false;
break;
case 3: // on, if present
case 1:
- HBITMAP hbm = (m_ace && !(m_ace->dwFlags & AVS_HIDEONCLIST)) ? m_ace->hbmPic : 0;
+ HBITMAP hbm = (m_ace && !(m_ace->dwFlags & AVS_HIDEONCLIST)) ? m_ace->hbmPic : nullptr;
m_bShowAvatar = (hbm && hbm != PluginConfig.g_hbmUnknown);
goto LBL_Check;
}
@@ -1223,18 +1223,18 @@ void CTabBaseDlg::GetLocaleID(const wchar_t *szKLName)
* Vista+: read ISO locale names from the registry
*/
if (PluginConfig.m_bIsVista) {
- HKEY hKey = 0;
+ HKEY hKey = nullptr;
wchar_t szKey[20];
DWORD dwLID = wcstoul(szKLName, &stopped, 16);
mir_snwprintf(szKey, L"%04.04x", LOWORD(dwLID));
if (ERROR_SUCCESS == RegOpenKeyEx(HKEY_CLASSES_ROOT, L"MIME\\Database\\Rfc1766", 0, KEY_READ, &hKey)) {
DWORD dwLength = 255;
- if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, 0, 0, (unsigned char *)szLI, &dwLength)) {
+ if (ERROR_SUCCESS == RegQueryValueEx(hKey, szKey, nullptr, nullptr, (unsigned char *)szLI, &dwLength)) {
wchar_t* p;
szLI[255] = 0;
- if ((p = wcschr(szLI, ';')) != 0)
+ if ((p = wcschr(szLI, ';')) != nullptr)
*p = 0;
}
RegCloseKey(hKey);
@@ -1419,7 +1419,7 @@ int CTabBaseDlg::MsgWindowDrawHandler(WPARAM, LPARAM lParam)
bool bAero = M.isAero();
- HRGN clipRgn = 0;
+ HRGN clipRgn = nullptr;
HBRUSH hOldBrush = (HBRUSH)SelectObject(hdcDraw, bAero ? (HBRUSH)GetStockObject(HOLLOW_BRUSH) : GetSysColorBrush(COLOR_3DFACE));
rcFrame = rcClient;
@@ -1518,7 +1518,7 @@ int CTabBaseDlg::MsgWindowDrawHandler(WPARAM, LPARAM lParam)
else
CSkin::FillBack(dis->hDC, &dis->rcItem);
DrawIconEx(dis->hDC, (dis->rcItem.right - dis->rcItem.left) / 2 - 8, (dis->rcItem.bottom - dis->rcItem.top) / 2 - 8,
- PluginConfig.g_iconErr, 16, 16, 0, 0, DI_NORMAL);
+ PluginConfig.g_iconErr, 16, 16, 0, nullptr, DI_NORMAL);
return TRUE;
}
diff --git a/plugins/TabSRMM/src/msglog.cpp b/plugins/TabSRMM/src/msglog.cpp
index d96e3ddcbf..11b1a1de13 100644
--- a/plugins/TabSRMM/src/msglog.cpp
+++ b/plugins/TabSRMM/src/msglog.cpp
@@ -204,7 +204,7 @@ TLogIcon::TLogIcon(HICON hIcon, COLORREF backgroundColor)
rc.right = bih.biWidth;
rc.bottom = bih.biHeight;
- m_hdc = GetDC(0);
+ m_hdc = GetDC(nullptr);
m_hBmp = CreateCompatibleBitmap(m_hdc, bih.biWidth, bih.biHeight);
m_hdcMem = CreateCompatibleDC(m_hdc);
@@ -435,8 +435,8 @@ static char* Template_CreateRTFFromDbEvent(CTabBaseDlg *dat, MCONTACT hContact,
struct tm event_time = { 0 };
BOOL isBold = FALSE, isItalic = FALSE, isUnderline = FALSE;
- DBEVENTINFO dbei = { 0 };
- if (streamData->dbei != 0)
+ DBEVENTINFO dbei = {};
+ if (streamData->dbei != nullptr)
dbei = *(streamData->dbei);
else {
dbei.cbBlob = db_event_getBlobSize(hDbEvent);
@@ -997,7 +997,7 @@ static char* Template_CreateRTFFromDbEvent(CTabBaseDlg *dat, MCONTACT hContact,
str.Append("\\par");
- if (streamData->dbei == 0)
+ if (streamData->dbei == nullptr)
mir_free(dbei.pBlob);
dat->m_iLastEventType = MAKELONG((dbei.flags & (DBEF_SENT | DBEF_READ | DBEF_RTL)), dbei.eventType);
@@ -1326,7 +1326,7 @@ void CTabBaseDlg::StreamInEvents(MEVENT hDbEventFirst, int count, int fAppend, D
}
BOOL isSent;
- if (streamData.dbei != 0)
+ if (streamData.dbei != nullptr)
isSent = (streamData.dbei->flags & DBEF_SENT) != 0;
else {
DBEVENTINFO dbei = {};
diff --git a/plugins/TabSRMM/src/msgoptions.cpp b/plugins/TabSRMM/src/msgoptions.cpp
index da130dc338..3a5d1e806d 100644
--- a/plugins/TabSRMM/src/msgoptions.cpp
+++ b/plugins/TabSRMM/src/msgoptions.cpp
@@ -82,7 +82,7 @@ void LoadLogfont(int section, int i, LOGFONTA * lf, COLORREF * colour, char *szM
HIMAGELIST g_himlOptions;
-static HWND hwndTabConfig = 0;
+static HWND hwndTabConfig = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
// scan a single skin directory and find the.TSK file.Fill the combobox and set the
@@ -227,7 +227,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
CheckDlgButton(hwndDlg, IDC_SKIN_LOADTEMPLATES, loadMode & THEME_READ_TEMPLATES ? BST_CHECKED : BST_UNCHECKED);
SendMessage(hwndDlg, WM_USER + 100, 0, 0);
- SetTimer(hwndDlg, 1000, 100, 0);
+ SetTimer(hwndDlg, 1000, 100, nullptr);
return TRUE;
case WM_CTLCOLORSTATIC:
@@ -242,7 +242,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
// windows must be closed.
case WM_USER + 100:
{
- bool fWindowsOpen = (pFirstContainer != 0 ? true : false);
+ bool fWindowsOpen = (pFirstContainer != nullptr ? true : false);
for (int i = 0; _ctrls[i]; i++)
Utils::enableDlgControl(hwndDlg, _ctrls[i], !fWindowsOpen);
@@ -294,7 +294,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
{
const wchar_t *szFilename = GetThemeFileName(1);
if (szFilename != nullptr)
- WriteThemeToINI(szFilename, 0);
+ WriteThemeToINI(szFilename, nullptr);
}
break;
@@ -313,13 +313,13 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
DWORD dwFlags = THEME_READ_FONTS;
if (szFilename != nullptr) {
- int result = MessageBox(0, TranslateT("Do you want to also read message templates from the theme?\nCaution: This will overwrite the stored template set which may affect the look of your message window significantly.\nSelect Cancel to not load anything at all."),
+ int result = MessageBox(nullptr, TranslateT("Do you want to also read message templates from the theme?\nCaution: This will overwrite the stored template set which may affect the look of your message window significantly.\nSelect Cancel to not load anything at all."),
TranslateT("Load theme"), MB_YESNOCANCEL);
if (result == IDCANCEL)
return 1;
if (result == IDYES)
dwFlags |= THEME_READ_TEMPLATES;
- ReadThemeFromINI(szFilename, 0, 0, dwFlags);
+ ReadThemeFromINI(szFilename, nullptr, 0, dwFlags);
CacheLogFonts();
CacheMsgLogIcons();
PluginConfig.reloadSettings();
@@ -386,7 +386,7 @@ static INT_PTR CALLBACK DlgProcSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, L
void TreeViewInit(HWND hwndTree, UINT id, DWORD dwFlags, BOOL bFromMem)
{
- TVINSERTSTRUCT tvi = { 0 };
+ TVINSERTSTRUCT tvi = {};
TOptionListGroup *lvGroups = CTranslator::getGroupTree(id);
TOptionListItem *lvItems = CTranslator::getTree(id);
@@ -396,7 +396,7 @@ void TreeViewInit(HWND hwndTree, UINT id, DWORD dwFlags, BOOL bFromMem)
// fill the list box, create groups first, then add items
for (int i = 0; lvGroups[i].szName != nullptr; i++) {
- tvi.hParent = 0;
+ tvi.hParent = nullptr;
tvi.hInsertAfter = TVI_LAST;
tvi.item.mask = TVIF_TEXT | TVIF_STATE | TVIF_IMAGE | TVIF_SELECTEDIMAGE;
tvi.item.pszText = TranslateW(lvGroups[i].szName);
@@ -505,7 +505,7 @@ BOOL TreeViewHandleClick(HWND hwndDlg, HWND hwndTree, WPARAM, LPARAM lParam)
hti.pt.x = (short)LOWORD(GetMessagePos());
hti.pt.y = (short)HIWORD(GetMessagePos());
ScreenToClient(((LPNMHDR)lParam)->hwndFrom, &hti.pt);
- if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti) == 0)
+ if (TreeView_HitTest(((LPNMHDR)lParam)->hwndFrom, &hti) == nullptr)
return FALSE;
if ((hti.flags & TVHT_ONITEMICON) == 0)
return FALSE;
@@ -1518,7 +1518,7 @@ INT_PTR CALLBACK DlgProcSetupStatusModes(HWND hwndDlg, UINT msg, WPARAM wParam,
{
DWORD dwStatusMask = GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
static DWORD dwNewStatusMask = 0;
- static HWND hwndParent = 0;
+ static HWND hwndParent = nullptr;
switch (msg) {
case WM_INITDIALOG:
diff --git a/plugins/TabSRMM/src/msgs.cpp b/plugins/TabSRMM/src/msgs.cpp
index fad83f4175..67598de9d6 100644
--- a/plugins/TabSRMM/src/msgs.cpp
+++ b/plugins/TabSRMM/src/msgs.cpp
@@ -32,8 +32,8 @@
#define IDI_CORE_LOAD 132 // icon id for the "connecting" icon
NEN_OPTIONS nen_options;
-static HANDLE hUserPrefsWindowLis = 0;
-HMODULE g_hIconDLL = 0, g_hMsftedit;
+static HANDLE hUserPrefsWindowLis = nullptr;
+HMODULE g_hIconDLL = nullptr, g_hMsftedit;
static void UnloadIcons();
@@ -270,7 +270,7 @@ void CTabBaseDlg::NotifyDeliveryFailure() const
ppd.PluginWindowProc = Utils::PopupDlgProcError;
ppd.lchIcon = PluginConfig.g_iconErr;
- ppd.PluginData = 0;
+ ppd.PluginData = nullptr;
ppd.iSeconds = (int)M.GetDword(MODULE, OPT_DELAY_ERR, (DWORD)DEFAULT_DELAY);
PUAddPopupT(&ppd);
}
@@ -304,7 +304,7 @@ static INT_PTR SetUserPrefs(WPARAM wParam, LPARAM)
SetForegroundWindow(hWnd); // already open, bring it to front
return 0;
}
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_USERPREFS_FRAME), 0, DlgProcUserPrefsFrame, (LPARAM)wParam);
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_USERPREFS_FRAME), nullptr, DlgProcUserPrefsFrame, (LPARAM)wParam);
return 0;
}
@@ -331,7 +331,7 @@ static INT_PTR Service_OpenTrayMenu(WPARAM, LPARAM lParam)
int TSAPI MessageWindowOpened(MCONTACT hContact, HWND _hwnd)
{
- HWND hwnd = 0;
+ HWND hwnd = nullptr;
TContainerData *pContainer = nullptr;
if (hContact)
@@ -374,7 +374,7 @@ static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam)
MCONTACT hContact = ((CLISTEVENT *)lParam)->hContact;
HWND hwndExisting = Srmm_FindWindow(hContact);
- if (hwndExisting != 0)
+ if (hwndExisting != nullptr)
SendMessage(hwndExisting, DM_ACTIVATEME, 0, 0);
else {
wchar_t szName[CONTAINER_NAMELEN + 1];
@@ -513,7 +513,7 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild)
if (!dat || !pContainer)
return FALSE;
- NMHDR nmhdr = { 0 };
+ NMHDR nmhdr = {};
nmhdr.code = TCN_SELCHANGE;
if (TabCtrl_GetItemCount(GetDlgItem(pContainer->m_hwnd, IDC_MSGTABS)) > 1 && !(pContainer->dwFlags & CNT_DEFERREDTABSELECT)) {
TabCtrl_SetCurSel(GetDlgItem(pContainer->m_hwnd, IDC_MSGTABS), GetTabIndexFromHWND(GetDlgItem(pContainer->m_hwnd, IDC_MSGTABS), hwndChild));
@@ -558,16 +558,16 @@ int TSAPI ActivateExistingTab(TContainerData *pContainer, HWND hwndChild)
HWND TSAPI CreateNewTabForContact(TContainerData *pContainer, MCONTACT hContact, bool bActivateTab, bool bPopupContainer, bool bWantPopup, MEVENT hdbEvent, bool bIsUnicode, const char *pszInitialText)
{
- if (Srmm_FindWindow(hContact) != 0) {
+ if (Srmm_FindWindow(hContact) != nullptr) {
_DebugPopup(hContact, L"Warning: trying to create duplicate window");
- return 0;
+ return nullptr;
}
// if we have a max # of tabs/container set and want to open something in the default container...
if (hContact != 0 && M.GetByte("limittabs", 0) && !wcsncmp(pContainer->m_wszName, L"default", 6))
if ((pContainer = FindMatchingContainer(L"default")) == nullptr)
if ((pContainer = CreateContainer(L"default", CNT_CREATEFLAG_CLONED, hContact)) == nullptr)
- return 0;
+ return nullptr;
char *szProto = GetContactProto(hContact);
@@ -743,10 +743,10 @@ void TSAPI CreateImageList(BOOL bInitial)
PluginConfig.g_IconMsgEvent = Skin_LoadIcon(SKINICON_EVENT_MESSAGE);
PluginConfig.g_IconMsgEventBig = Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true);
if ((HICON)CALLSERVICE_NOTFOUND == PluginConfig.g_IconMsgEventBig)
- PluginConfig.g_IconMsgEventBig = 0;
+ PluginConfig.g_IconMsgEventBig = nullptr;
PluginConfig.g_IconTypingEventBig = Skin_LoadIcon(SKINICON_OTHER_TYPING, true);
if ((HICON)CALLSERVICE_NOTFOUND == PluginConfig.g_IconTypingEventBig)
- PluginConfig.g_IconTypingEventBig = 0;
+ PluginConfig.g_IconTypingEventBig = nullptr;
PluginConfig.g_IconSend = PluginConfig.g_buttonBarIcons[9];
PluginConfig.g_IconTypingEvent = PluginConfig.g_buttonBarIcons[ICON_DEFAULT_TYPING];
}
@@ -859,7 +859,7 @@ static int TSAPI SetupIconLibConfig()
wchar_t szFilename[MAX_PATH];
wcsncpy(szFilename, L"icons\\tabsrmm_icons.dll", MAX_PATH);
g_hIconDLL = LoadLibrary(szFilename);
- if (g_hIconDLL == 0) {
+ if (g_hIconDLL == nullptr) {
CWarning::show(CWarning::WARN_ICONPACKMISSING, CWarning::CWF_NOALLOWHIDE | MB_ICONERROR | MB_OK);
return 0;
}
@@ -868,9 +868,9 @@ static int TSAPI SetupIconLibConfig()
Chat_AddIcons();
version = GetIconPackVersion(g_hIconDLL);
FreeLibrary(g_hIconDLL);
- g_hIconDLL = 0;
+ g_hIconDLL = nullptr;
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.defaultFile.w = szFilename;
sid.flags = SIDF_PATH_UNICODE;
@@ -967,9 +967,9 @@ static void UnloadIcons()
{
for (int n = 0; n < _countof(ICONBLOCKS); n++)
for (int i = 0; i < ICONBLOCKS[n].nItems; i++)
- if (*(ICONBLOCKS[n].idesc[i].phIcon) != 0) {
+ if (*(ICONBLOCKS[n].idesc[i].phIcon) != nullptr) {
DestroyIcon(*(ICONBLOCKS[n].idesc[i].phIcon));
- *(ICONBLOCKS[n].idesc[i].phIcon) = 0;
+ *(ICONBLOCKS[n].idesc[i].phIcon) = nullptr;
}
if (PluginConfig.g_hbmUnknown)
@@ -1036,8 +1036,8 @@ static void TSAPI InitAPI()
int LoadSendRecvMessageModule(void)
{
- if (FIF == 0) {
- MessageBox(0, TranslateT("The image service plugin (AdvaImg) is not properly installed.\n\nTabSRMM is disabled."), TranslateT("TabSRMM fatal error"), MB_OK | MB_ICONERROR);
+ if (FIF == nullptr) {
+ MessageBox(nullptr, TranslateT("The image service plugin (AdvaImg) is not properly installed.\n\nTabSRMM is disabled."), TranslateT("TabSRMM fatal error"), MB_OK | MB_ICONERROR);
return 1;
}
diff --git a/plugins/TabSRMM/src/muchighlight.cpp b/plugins/TabSRMM/src/muchighlight.cpp
index 11a3a46e4d..85b131ff3f 100644
--- a/plugins/TabSRMM/src/muchighlight.cpp
+++ b/plugins/TabSRMM/src/muchighlight.cpp
@@ -32,12 +32,12 @@ void CMUCHighlight::cleanup()
{
mir_free(m_NickPatternString);
mir_free(m_TextPatternString);
- m_TextPatternString = m_NickPatternString = 0;
+ m_TextPatternString = m_NickPatternString = nullptr;
mir_free(m_NickPatterns);
mir_free(m_TextPatterns);
m_iNickPatterns = m_iTextPatterns = 0;
- m_NickPatterns = m_TextPatterns = 0;
+ m_NickPatterns = m_TextPatterns = nullptr;
}
void CMUCHighlight::init()
@@ -67,7 +67,7 @@ void CMUCHighlight::init()
void CMUCHighlight::tokenize(wchar_t *tszString, wchar_t**& patterns, UINT& nr)
{
- if (tszString == 0)
+ if (tszString == nullptr)
return;
wchar_t *p = tszString;
@@ -114,17 +114,17 @@ bool CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dw
{
int result = 0, nResult = 0;
- if (pgce == 0 || m_Valid == false)
+ if (pgce == nullptr || m_Valid == false)
return false;
- if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != 0) {
+ if ((m_dwFlags & MATCH_TEXT) && (dwFlags & MATCH_TEXT) && (m_fHighlightMe || m_iTextPatterns > 0) && psi != nullptr) {
wchar_t *p = pci->RemoveFormatting(pgce->ptszText);
p = NEWWSTR_ALLOCA(p);
if (p == nullptr)
return false;
CharLower(p);
- wchar_t *tszMe = ((psi && psi->pMe) ? NEWWSTR_ALLOCA(psi->pMe->pszNick) : 0);
+ wchar_t *tszMe = ((psi && psi->pMe) ? NEWWSTR_ALLOCA(psi->pMe->pszNick) : nullptr);
if (tszMe)
CharLower(tszMe);
@@ -148,7 +148,7 @@ bool CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dw
if (*p1)
*p1 = 0;
else
- p1 = 0;
+ p1 = nullptr;
for (UINT i = 0; i < m_iTextPatterns && !result; i++)
result = wildcmpw(p, m_TextPatterns[i]) ? MATCH_TEXT : 0;
@@ -157,7 +157,7 @@ bool CMUCHighlight::match(const GCEVENT *pgce, const SESSION_INFO *psi, DWORD dw
*p1 = ' ';
p = p1 + 1;
}
- else p = 0;
+ else p = nullptr;
}
}
@@ -240,7 +240,7 @@ INT_PTR CALLBACK CMUCHighlight::dlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
switch (((LPNMHDR)lParam)->code) {
case PSN_APPLY:
{
- wchar_t* szBuf = 0;
+ wchar_t* szBuf = nullptr;
int iLen = ::GetWindowTextLength(::GetDlgItem(hwndDlg, IDC_HIGHLIGHTNICKPATTERN));
if (iLen) {
szBuf = reinterpret_cast<wchar_t *>(mir_alloc((iLen + 2) * sizeof(wchar_t)));
diff --git a/plugins/TabSRMM/src/selectcontainer.cpp b/plugins/TabSRMM/src/selectcontainer.cpp
index bbe61242b5..2f8e50f92d 100644
--- a/plugins/TabSRMM/src/selectcontainer.cpp
+++ b/plugins/TabSRMM/src/selectcontainer.cpp
@@ -30,7 +30,7 @@
INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam)
{
- HWND hwndMsgDlg = 0;
+ HWND hwndMsgDlg = nullptr;
hwndMsgDlg = (HWND)GetWindowLongPtr(hwndDlg, GWLP_USERDATA);
@@ -58,7 +58,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
GetWindowRect(hwndDlg, &rc);
GetWindowRect(GetParent(hwndDlg), &rcParent);
- SetWindowPos(hwndDlg, 0, (rcParent.left + rcParent.right - (rc.right - rc.left)) / 2, (rcParent.top + rcParent.bottom - (rc.bottom - rc.top)) / 2, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
+ SetWindowPos(hwndDlg, nullptr, (rcParent.left + rcParent.right - (rc.right - rc.left)) / 2, (rcParent.top + rcParent.bottom - (rc.bottom - rc.top)) / 2, 0, 0, SWP_NOSIZE | SWP_SHOWWINDOW);
return TRUE;
}
@@ -113,7 +113,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
wchar_t szOldName[CONTAINER_NAMELEN + 1];
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szOldName);
if (mir_wstrlen(szOldName) == mir_wstrlen(szNewName)) {
- MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINERNAME));
break;
}
@@ -149,7 +149,7 @@ INT_PTR CALLBACK SelectContainerDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, L
if (iItem != LB_ERR || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
SendDlgItemMessage(hwndDlg, IDC_CNTLIST, LB_GETTEXT, (WPARAM)iItem, (LPARAM)szName);
if (mir_wstrlen(szName) == mir_wstrlen(szNewName) || !wcsncmp(szNewName, CGlobals::m_default_container_name, CONTAINER_NAMELEN)) {
- MessageBox(0, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, TranslateT("This name is already in use"), TranslateT("Error"), MB_OK | MB_ICONERROR);
SetFocus(GetDlgItem(hwndDlg, IDC_NEWCONTAINER));
break;
}
diff --git a/plugins/TabSRMM/src/sendlater.cpp b/plugins/TabSRMM/src/sendlater.cpp
index eb2e1ecc19..2858ef040a 100644
--- a/plugins/TabSRMM/src/sendlater.cpp
+++ b/plugins/TabSRMM/src/sendlater.cpp
@@ -28,7 +28,7 @@
#include "stdafx.h"
-CSendLater *sendLater = 0;
+CSendLater *sendLater = nullptr;
// implementation of the CSendLaterJob class
CSendLaterJob::CSendLaterJob()
@@ -139,7 +139,7 @@ CSendLaterJob::~CSendLaterJob()
ppd.colorBack = fFailed ? RGB(191, 0, 0) : nen_options.colBackMsg;
ppd.PluginWindowProc = Utils::PopupDlgProcError;
ppd.lchIcon = fFailed ? PluginConfig.g_iconErr : PluginConfig.g_IconMsgEvent;
- ppd.PluginData = 0;
+ ppd.PluginData = nullptr;
ppd.iSeconds = fFailed ? -1 : nen_options.iDelayMsg;
PUAddPopupT(&ppd);
}
@@ -161,7 +161,7 @@ CSendLater::CSendLater() :
m_hFilter(0)
{
m_fAvail = M.GetByte("sendLaterAvail", 0) != 0;
- m_last_sendlater_processed = time(0);
+ m_last_sendlater_processed = time(nullptr);
m_fIsInteractive = false;
m_fErrorPopups = M.GetByte("qmgrErrorPopups", 0) != 0;
m_fSuccessPopups = M.GetByte("qmgrSuccessPopups", 0) != 0;
@@ -276,7 +276,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
{
MCONTACT hContact = lParam;
DBVARIANT dbv = { 0 };
- char *szOrig_Utf = 0;
+ char *szOrig_Utf = nullptr;
if (!m_fAvail || !szSetting || !mir_strcmp(szSetting, "count") || mir_strlen(szSetting) < 8)
return 0;
@@ -319,7 +319,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
job->sendBuffer[iLen] = 0;
// construct conventional send buffer
- wchar_t *szWchar = 0;
+ wchar_t *szWchar = nullptr;
char *szAnsi = mir_utf8decodecp(szOrig_Utf, CP_ACP, &szWchar);
iLen = mir_strlen(szAnsi);
size_t required = iLen + 1;
@@ -347,7 +347,7 @@ int CSendLater::addJob(const char *szSetting, LPARAM lParam)
// this is ONLY called from the WM_TIMER handler and should never be executed directly.
int CSendLater::sendIt(CSendLaterJob *job)
{
- time_t now = time(0);
+ time_t now = time(nullptr);
if (job->bCode == CSendLaterJob::JOB_HOLD || job->bCode == CSendLaterJob::JOB_DEFERRED || job->fSuccess || job->fFailed || job->lastSent > now)
return 0; // this one is frozen or done (will be removed soon), don't process it now.
@@ -376,7 +376,7 @@ int CSendLater::sendIt(CSendLaterJob *job)
MCONTACT hContact = c->getActiveContact();
const char *szProto = c->getActiveProto();
- if (!hContact || szProto == 0)
+ if (!hContact || szProto == nullptr)
return 0;
WORD wMyStatus = (WORD)CallProtoService(szProto, PS_GETSTATUS, 0, 0);
@@ -434,7 +434,7 @@ void CSendLater::addContact(const MCONTACT hContact)
HANDLE CSendLater::processAck(const ACKDATA *ack)
{
if (m_sendLaterJobList.getCount() == 0 || !m_fAvail)
- return 0;
+ return nullptr;
for (int i = 0; i < m_sendLaterJobList.getCount(); i++) {
CSendLaterJob *p = m_sendLaterJobList[i];
@@ -456,10 +456,10 @@ HANDLE CSendLater::processAck(const ACKDATA *ack)
p->hProcess = (HANDLE)-1;
p->bCode = '-';
qMgrUpdate();
- return 0;
+ return nullptr;
}
}
- return 0;
+ return nullptr;
}
// UI stuff (dialog procedures for the queue manager dialog
@@ -541,7 +541,7 @@ void CSendLater::qMgrFillList(bool fClear)
mir_free(preview);
mir_free(msg);
- const wchar_t *tszStatusText = 0;
+ const wchar_t *tszStatusText = nullptr;
if (p->fFailed) {
tszStatusText = p->bCode == CSendLaterJob::JOB_REMOVABLE ?
TranslateT("Removed") : TranslateT("Failed");
@@ -773,7 +773,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
item.stateMask = LVIS_SELECTED;
if (HIWORD(wParam) != ID_QUEUEMANAGER_COPYMESSAGETOCLIPBOARD) {
- if (MessageBox(0, TranslateT("You are about to modify the state of one or more items in the\nunattended send queue. The requested action(s) will be executed at the next scheduled queue processing.\n\nThis action cannot be made undone."), TranslateT("Queue manager"),
+ if (MessageBox(nullptr, TranslateT("You are about to modify the state of one or more items in the\nunattended send queue. The requested action(s) will be executed at the next scheduled queue processing.\n\nThis action cannot be made undone."), TranslateT("Queue manager"),
MB_ICONQUESTION | MB_OKCANCEL) == IDCANCEL)
break;
}
@@ -809,7 +809,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
else if (job->bCode == CSendLaterJob::JOB_AGE) {
job->fFailed = false;
job->bCode = '-';
- job->created = time(0);
+ job->created = time(nullptr);
}
break;
}
@@ -825,7 +825,7 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
break;
case WM_NCDESTROY:
- m_hwndDlg = 0;
+ m_hwndDlg = nullptr;
db_set_dw(0, SRMSGMOD_T, "qmgrFilterContact", m_hFilter);
break;
}
@@ -835,8 +835,8 @@ INT_PTR CALLBACK CSendLater::DlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
// invoke queue manager dialog - do nothing if this dialog is already open
void CSendLater::invokeQueueMgrDlg()
{
- if (m_hwndDlg == 0)
- m_hwndDlg = ::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SENDLATER_QMGR), 0, CSendLater::DlgProcStub, LPARAM(this));
+ if (m_hwndDlg == nullptr)
+ m_hwndDlg = ::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_SENDLATER_QMGR), nullptr, CSendLater::DlgProcStub, LPARAM(this));
}
// service function to invoke the queue manager
diff --git a/plugins/TabSRMM/src/sendqueue.cpp b/plugins/TabSRMM/src/sendqueue.cpp
index cae1d654e7..60dc9eb154 100644
--- a/plugins/TabSRMM/src/sendqueue.cpp
+++ b/plugins/TabSRMM/src/sendqueue.cpp
@@ -28,7 +28,7 @@
#include "stdafx.h"
-SendQueue *sendQueue = 0;
+SendQueue *sendQueue = nullptr;
/////////////////////////////////////////////////////////////////////////////////////////
// searches the queue for a message belonging to the given contact which has been marked
@@ -224,7 +224,7 @@ int SendQueue::sendQueued(CTabBaseDlg *dat, const int iEntry)
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
HANDLE hItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_FINDCONTACT, hContact, 0);
if (hItem && SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_GETCHECKMARK, (WPARAM)hItem, 0)) {
- doSendLater(iEntry, 0, hContact, false);
+ doSendLater(iEntry, nullptr, hContact, false);
iJobs++;
}
}
@@ -342,7 +342,7 @@ void SendQueue::checkQueue(const CTabBaseDlg *dat) const
void SendQueue::logError(CTabBaseDlg *dat, int iSendJobIndex, const wchar_t *szErrMsg) const
{
- if (dat == 0)
+ if (dat == nullptr)
return;
size_t iMsgLen;
@@ -416,7 +416,7 @@ int SendQueue::ackMessage(CTabBaseDlg *dat, WPARAM wParam, LPARAM lParam)
{
ACKDATA *ack = (ACKDATA *)lParam;
- TContainerData *m_pContainer = 0;
+ TContainerData *m_pContainer = nullptr;
if (dat)
m_pContainer = dat->m_pContainer;
@@ -520,7 +520,7 @@ int SendQueue::ackMessage(CTabBaseDlg *dat, WPARAM wParam, LPARAM lParam)
LRESULT SendQueue::WarnPendingJobs(unsigned int)
{
- return MessageBox(0,
+ return MessageBox(nullptr,
TranslateT("There are unsent messages waiting for confirmation.\nIf you close the window now, Miranda will try to send them but may be unable to inform you about possible delivery errors.\nDo you really want to close the window(s)?"),
TranslateT("Message window warning"), MB_YESNO | MB_ICONHAND);
}
@@ -540,7 +540,7 @@ int SendQueue::doSendLater(int iJobIndex, CTabBaseDlg *dat, MCONTACT hContact, b
{
bool fAvail = sendLater->isAvail();
- const wchar_t *szNote = 0;
+ const wchar_t *szNote = nullptr;
if (fIsSendLater && dat) {
if (fAvail)
@@ -579,13 +579,13 @@ int SendQueue::doSendLater(int iJobIndex, CTabBaseDlg *dat, MCONTACT hContact, b
wchar_t tszHeader[150];
if (fIsSendLater) {
- time_t now = time(0);
+ time_t now = time(nullptr);
wchar_t tszTimestamp[30];
wcsftime(tszTimestamp, _countof(tszTimestamp), L"%Y.%m.%d - %H:%M", _localtime32((__time32_t *)&now));
mir_snprintf(szKeyName, "S%d", now);
mir_snwprintf(tszHeader, TranslateT("\n(Sent delayed. Original timestamp %s)"), tszTimestamp);
}
- else mir_snwprintf(tszHeader, L"M%d|", time(0));
+ else mir_snwprintf(tszHeader, L"M%d|", time(nullptr));
T2Utf utf_header(tszHeader);
size_t required = mir_strlen(utf_header) + mir_strlen(job->szSendBuffer) + 10;
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp
index dc99331396..9edf862b52 100644
--- a/plugins/TabSRMM/src/sidebar.cpp
+++ b/plugins/TabSRMM/src/sidebar.cpp
@@ -81,7 +81,7 @@ CSideBarButton::CSideBarButton(CTabBaseDlg *dat, CSideBar *sideBar)
CSideBarButton::CSideBarButton(const UINT id, CSideBar *sideBar)
{
- m_dat = 0;
+ m_dat = nullptr;
m_id = id;
m_sideBar = sideBar;
_create();
@@ -90,7 +90,7 @@ CSideBarButton::CSideBarButton(const UINT id, CSideBar *sideBar)
// Internal method to create the button item and configure the associated button control
void CSideBarButton::_create()
{
- m_hwnd = 0;
+ m_hwnd = nullptr;
m_isTopAligned = true;
m_sz.cx = m_sz.cy = 0;
@@ -342,7 +342,7 @@ void CSideBarButton::invokeContextMenu()
const TContainerData *pContainer = m_sideBar->getContainer();
if (pContainer) {
- TSideBarNotify tsn = { 0 };
+ TSideBarNotify tsn = {};
tsn.nmHdr.code = NM_RCLICK;
tsn.nmHdr.idFrom = 5000;
tsn.nmHdr.hwndFrom = ::GetDlgItem(pContainer->m_hwnd, 5000);
@@ -355,9 +355,9 @@ CSideBar::CSideBar(TContainerData *pContainer) :
m_buttonlist(1, PtrKeySortT)
{
m_pContainer = pContainer;
- m_up = m_down = 0;
- m_hwndScrollWnd = 0;
- m_activeItem = 0;
+ m_up = m_down = nullptr;
+ m_hwndScrollWnd = nullptr;
+ m_activeItem = nullptr;
m_isVisible = true;
Init();
@@ -389,7 +389,7 @@ void CSideBar::Init()
m_dwFlags = (m_pContainer->dwFlagsEx & TCF_SBARRIGHT ? m_dwFlags | SIDEBARORIENTATION_RIGHT : m_dwFlags & ~SIDEBARORIENTATION_RIGHT);
if (m_pContainer->dwFlags & CNT_SIDEBAR) {
- if (m_hwndScrollWnd == 0)
+ if (m_hwndScrollWnd == nullptr)
m_hwndScrollWnd = ::CreateWindowEx(0, L"TS_SideBarClass", L"", WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | WS_CHILD,
0, 0, m_width, 40, m_pContainer->m_hwnd, reinterpret_cast<HMENU>(5000), g_hInst, this);
@@ -407,12 +407,12 @@ void CSideBar::Init()
destroyScroller();
m_width = 0;
m_isActive = m_isVisible = false;
- m_activeItem = 0;
+ m_activeItem = nullptr;
removeAll();
if (m_hwndScrollWnd)
::DestroyWindow(m_hwndScrollWnd);
- m_hwndScrollWnd = 0;
+ m_hwndScrollWnd = nullptr;
}
}
@@ -445,9 +445,9 @@ void CSideBar::setVisible(bool fNewVisible)
*/
void CSideBar::createScroller()
{
- if (m_up == 0)
+ if (m_up == nullptr)
m_up = new CSideBarButton(IDC_SIDEBARUP, this);
- if (m_down == 0)
+ if (m_down == nullptr)
m_down = new CSideBarButton(IDC_SIDEBARDOWN, this);
m_up->setLayout(m_currentLayout);
@@ -461,11 +461,11 @@ void CSideBar::destroyScroller()
{
if (m_up) {
delete m_up;
- m_up = 0;
+ m_up = nullptr;
}
if (m_down) {
delete m_down;
- m_down = 0;
+ m_down = nullptr;
}
}
@@ -597,7 +597,7 @@ void CSideBar::scrollIntoView(const CSideBarButton *item)
if (!m_isActive)
return;
- if (item == 0)
+ if (item == nullptr)
item = m_activeItem;
int i;
@@ -687,7 +687,7 @@ const CSideBarButton* CSideBar::setActiveItem(const CTabBaseDlg *dat)
if (item != nullptr)
return setActiveItem(item);
- return 0;
+ return nullptr;
}
/**
@@ -747,14 +747,14 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc)
if (p.isTopAligned()) {
if (m_totalItemHeight <= m_firstVisibleOffset) { // partially visible
if (!fOnlyCalc && nullptr != hwnd) /* Wine fix. */
- hdwp = ::DeferWindowPos(hdwp, hwnd, 0, 2, -(m_firstVisibleOffset - m_totalItemHeight),
+ hdwp = ::DeferWindowPos(hdwp, hwnd, nullptr, 2, -(m_firstVisibleOffset - m_totalItemHeight),
m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
spaceUsed += ((height + 1) - (m_firstVisibleOffset - m_totalItemHeight));
m_totalItemHeight += (height + 1);
}
else {
if (!fOnlyCalc && nullptr != hwnd) /* Wine fix. */
- hdwp = ::DeferWindowPos(hdwp, hwnd, 0, 2, spaceUsed, m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
+ hdwp = ::DeferWindowPos(hdwp, hwnd, nullptr, 2, spaceUsed, m_elementWidth, height, SWP_SHOWWINDOW | dwFlags);
spaceUsed += (height + 1);
m_totalItemHeight += (height + 1);
}
@@ -771,9 +771,9 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc)
LONG dx = m_dwFlags & SIDEBARORIENTATION_LEFT ? m_pContainer->tBorder_outer_left :
rcContainer.right - m_pContainer->tBorder_outer_right - (m_elementWidth + 4);
- ::SetWindowPos(m_up->getHwnd(), 0, dx, m_pContainer->tBorder_outer_top + m_pContainer->MenuBar->getHeight(),
+ ::SetWindowPos(m_up->getHwnd(), nullptr, dx, m_pContainer->tBorder_outer_top + m_pContainer->MenuBar->getHeight(),
m_elementWidth + 4, 14, dwFlags | SWP_SHOWWINDOW);
- ::SetWindowPos(m_down->getHwnd(), 0, dx, (rcContainer.bottom - 14 - m_pContainer->statusBarHeight - 1),
+ ::SetWindowPos(m_down->getHwnd(), nullptr, dx, (rcContainer.bottom - 14 - m_pContainer->statusBarHeight - 1),
m_elementWidth + 4, 14, dwFlags | SWP_SHOWWINDOW);
::EnableWindow(m_up->getHwnd(), topEnabled);
::EnableWindow(m_down->getHwnd(), bottomEnabled);
@@ -784,7 +784,7 @@ void CSideBar::Layout(const RECT *rc, bool fOnlyCalc)
inline void CSideBar::Invalidate()
{
- Layout(0);
+ Layout(nullptr);
}
void CSideBar::showAll(int showCmd)
@@ -844,7 +844,7 @@ CSideBarButton* CSideBar::findSession(const MCONTACT hContact)
void CSideBar::processScrollerButtons(UINT commandID)
{
- if (!m_isActive || m_down == 0)
+ if (!m_isActive || m_down == nullptr)
return;
if (commandID == IDC_SIDEBARDOWN && ::IsWindowEnabled(m_down->getHwnd()))
@@ -852,7 +852,7 @@ void CSideBar::processScrollerButtons(UINT commandID)
else if (commandID == IDC_SIDEBARUP && ::IsWindowEnabled(m_up->getHwnd()))
m_firstVisibleOffset = max(0, m_firstVisibleOffset - 10);
- Layout(0);
+ Layout(nullptr);
}
void CSideBar::resizeScrollWnd(LONG x, LONG y, LONG, LONG height) const
@@ -861,7 +861,7 @@ void CSideBar::resizeScrollWnd(LONG x, LONG y, LONG, LONG height) const
::ShowWindow(m_hwndScrollWnd, SW_HIDE);
return;
}
- ::SetWindowPos(m_hwndScrollWnd, 0, x, y + 15, m_width, height - 30,
+ ::SetWindowPos(m_hwndScrollWnd, nullptr, x, y + 15, m_width, height - 30,
SWP_NOCOPYBITS | SWP_NOZORDER | SWP_SHOWWINDOW | SWP_NOSENDCHANGING | SWP_DEFERERASE | SWP_ASYNCWINDOWPOS);
}
@@ -870,7 +870,7 @@ void CSideBar::invalidateButton(CTabBaseDlg *dat)
if (m_isActive && m_isVisible) {
CSideBarButton *item = findSession(dat);
if (item != nullptr)
- RedrawWindow(item->m_buttonControl->hwnd, 0, 0, RDW_INVALIDATE | RDW_UPDATENOW);
+ RedrawWindow(item->m_buttonControl->hwnd, nullptr, nullptr, RDW_INVALIDATE | RDW_UPDATENOW);
}
}
@@ -899,12 +899,12 @@ LRESULT CALLBACK CSideBar::wndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
}
else if (M.isAero() || M.isVSThemed()) {
HDC hdcMem;
- HANDLE hbp = 0;
+ HANDLE hbp = nullptr;
HBITMAP hbm, hbmOld;
if (CMimAPI::m_haveBufferedPaint) {
hbp = CSkin::InitiateBufferedPaint(hdc, rc, hdcMem);
- hbm = hbmOld = 0;
+ hbm = hbmOld = nullptr;
}
else {
hdcMem = ::CreateCompatibleDC(hdc);
@@ -979,10 +979,10 @@ void __fastcall CSideBar::m_DefaultBackgroundRenderer(const HDC hdc, const RECT
if (stateId == PBS_HOT || stateId == PBS_PRESSED)
DrawAlpha(hdc, const_cast<RECT *>(rc), 0xf0f0f0, 70, 0x000000, 0, 9,
- 31, 4, 0);
+ 31, 4, nullptr);
else
DrawAlpha(hdc, const_cast<RECT *>(rc), 0xf0f0f0, 30, 0x707070, 0, 9,
- 31, 4, 0);
+ 31, 4, nullptr);
}
else {
if (PluginConfig.m_fillColor)
@@ -1046,7 +1046,7 @@ void __fastcall CSideBar::m_DefaultContentRenderer(const HDC hdc, const RECT *rc
if (id == IDC_SIDEBARUP || id == IDC_SIDEBARDOWN) {
::DrawIconEx(hdc, (rcBox->left + rcBox->right) / 2 - 8, (rcBox->top + rcBox->bottom) / 2 - 8, id == IDC_SIDEBARUP ? PluginConfig.g_buttonBarIcons[26] : PluginConfig.g_buttonBarIcons[16],
- 16, 16, 0, 0, DI_NORMAL);
+ 16, 16, 0, nullptr, DI_NORMAL);
if (!M.isAero() && stateID == PBS_HOT)
::DrawEdge(hdc, const_cast<RECT *>(rcBox), BDR_INNER, BF_RECT | BF_SOFT | BF_FLAT);
}
@@ -1122,7 +1122,7 @@ void __fastcall CSideBar::m_AdvancedContentRenderer(const HDC hdc, const RECT *r
// TODO support larger icons at a later time. This side bar button
// could use 32x32 icons as well.
rc.top = rc.bottom - szSecondLine.cy - 2;
- ::DrawIconEx(hdc, rc.left, rc.top + (rc.bottom - rc.top) / 2 - 8, hIcon, 16, 16, 0, 0, DI_NORMAL);
+ ::DrawIconEx(hdc, rc.left, rc.top + (rc.bottom - rc.top) / 2 - 8, hIcon, 16, 16, 0, nullptr, DI_NORMAL);
rc.left += 18;
::SelectObject(hdc, CInfoPanel::m_ipConfig.hFonts[IPFONTID_STATUS]);
CSkin::RenderText(hdc, dat->m_hThemeIP, dat->m_wszStatus, &rc,
diff --git a/plugins/TabSRMM/src/srmm.cpp b/plugins/TabSRMM/src/srmm.cpp
index 9c2de2c656..9e4de29270 100644
--- a/plugins/TabSRMM/src/srmm.cpp
+++ b/plugins/TabSRMM/src/srmm.cpp
@@ -68,7 +68,7 @@ extern "C" __declspec(dllexport) const MUUID MirandaInterfaces[] = { MIID_SRMM,
extern "C" int __declspec(dllexport) Load(void)
{
if (WinVerMajor() < 5) {
- MessageBox(0, TranslateT("This version of TabSRMM requires Windows 2000 or later."), L"tabSRMM", MB_OK | MB_ICONERROR);
+ MessageBox(nullptr, TranslateT("This version of TabSRMM requires Windows 2000 or later."), L"tabSRMM", MB_OK | MB_ICONERROR);
return 1;
}
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp
index 41348286a6..f02a185743 100644
--- a/plugins/TabSRMM/src/tabctrl.cpp
+++ b/plugins/TabSRMM/src/tabctrl.cpp
@@ -116,7 +116,7 @@ static tabcolors[] =
{ COLOR_3DFACE, "tab_bg_active", "tab_bg_active" },
{ COLOR_3DFACE, "tab_bg_hottrack", "tab_bg_hottrack" },
{ COLOR_3DFACE, "tab_bg_unread", "tab_bg_unread" },
- { 0, 0, nullptr }
+ { 0, nullptr, nullptr }
};
/////////////////////////////////////////////////////////////////////////////////////////
@@ -418,7 +418,7 @@ static HRESULT DrawThemesPartWithAero(const TabControlData *tabdat, HDC hDC, int
if (iStateId != PBS_NORMAL)
tabdat->helperGlowItem->Render(hDC, prcBox, true);
}
- else if (tabdat->hTheme != 0) {
+ else if (tabdat->hTheme != nullptr) {
hResult = DrawThemeBackground(tabdat->hTheme, hDC, iPartId, iStateId, prcBox, nullptr);
}
@@ -432,7 +432,7 @@ static HRESULT DrawThemesPart(const TabControlData *tabdat, HDC hDC, int iPartId
{
HRESULT hResult = 0;
- if (tabdat->hTheme != 0)
+ if (tabdat->hTheme != nullptr)
hResult = DrawThemeBackground(tabdat->hTheme, hDC, iPartId, iStateId, prcBox, nullptr);
return hResult;
@@ -548,7 +548,7 @@ static void DrawThemesXpTabItem(HDC pDC, RECT *rcItem, UINT uiFlag, TabControlDa
SetDIBits(hdcTemp, hbmTemp, nStart, 50 - nLenSub, pcImg, &biOut, DIB_RGB_COLORS);
mir_free(pcImg);
}
- CImageItem tempItem(10, 10, 10, 10, hdcTemp, 0, IMAGE_FLAG_DIVIDED | IMAGE_FILLSOLID,
+ CImageItem tempItem(10, 10, 10, 10, hdcTemp, nullptr, IMAGE_FLAG_DIVIDED | IMAGE_FILLSOLID,
GetSysColorBrush(COLOR_3DFACE), 255, 30, 80, 50, 100);
if (PluginConfig.m_bIsVista) // hide right tab sheet shadow (only draw the actual border line)
@@ -616,7 +616,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat)
tabdat->fAeroTabs = (CSkin::m_fAeroSkinsValid && (isAero || PluginConfig.m_fillColor)) ? TRUE : FALSE;
tabdat->fCloseButton = (tabdat->pContainer->dwFlagsEx & TCF_CLOSEBUTTON ? TRUE : FALSE);
- tabdat->helperDat = 0;
+ tabdat->helperDat = nullptr;
if (tabdat->fAeroTabs) {
CSrmmWindow *dat = (CSrmmWindow*)GetWindowLongPtr(tabdat->pContainer->m_hwndActive, GWLP_USERDATA);
@@ -656,7 +656,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat)
HBITMAP bmpMem, bmpOld;
if (CMimAPI::m_haveBufferedPaint) {
hpb = tabdat->hbp = CSkin::InitiateBufferedPaint(hdcreal, rctPage, hdc);
- bmpMem = bmpOld = 0;
+ bmpMem = bmpOld = nullptr;
}
else {
hpb = nullptr;
@@ -724,7 +724,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat)
if (PluginConfig.m_fillColor)
DrawCustomTabPage(hdc, rcClient);
else
- DrawThemesXpTabItem(hdc, &rcClient, uiFlags, tabdat, 0); // TABP_PANE=9,0,'TAB'
+ DrawThemesXpTabItem(hdc, &rcClient, uiFlags, tabdat, nullptr); // TABP_PANE=9,0,'TAB'
if (tabdat->bRefreshWithoutClip)
goto skip_tabs;
}
@@ -847,7 +847,7 @@ page_done:
continue;
TabCtrl_GetItem(hwnd, i, &tci);
- CSrmmWindow *dat = 0;
+ CSrmmWindow *dat = nullptr;
if (tci.lParam)
dat = (CSrmmWindow*)GetWindowLongPtr((HWND)tci.lParam, GWLP_USERDATA);
TabCtrl_GetItemRect(hwnd, i, &rcItem);
@@ -877,7 +877,7 @@ page_done:
rctActive.bottom -= PluginConfig.tabConfig.m_bottomAdjust;
}
if (rctActive.left >= 0) {
- CSrmmWindow *dat = 0;
+ CSrmmWindow *dat = nullptr;
int nHint = 0;
rcItem = rctActive;
@@ -964,11 +964,11 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
tabdat->m_VisualStyles = FALSE;
if (IsThemeActive()) {
tabdat->m_VisualStyles = TRUE;
- if (tabdat->hTheme != 0) {
+ if (tabdat->hTheme != nullptr) {
CloseThemeData(tabdat->hTheme);
CloseThemeData(tabdat->hThemeButton);
}
- if ((tabdat->hTheme = OpenThemeData(hwnd, L"TAB")) == 0 || (tabdat->hThemeButton = OpenThemeData(hwnd, L"BUTTON")) == 0)
+ if ((tabdat->hTheme = OpenThemeData(hwnd, L"TAB")) == nullptr || (tabdat->hThemeButton = OpenThemeData(hwnd, L"BUTTON")) == nullptr)
tabdat->m_VisualStyles = FALSE;
}
return 0;
@@ -980,7 +980,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
// it is sufficient to search it once. So this message is called, whenever
// a new tab is inserted
HWND hwndChild;
- if ((hwndChild = FindWindowEx(hwnd, 0, L"msctls_updown32", nullptr)) != 0)
+ if ((hwndChild = FindWindowEx(hwnd, nullptr, L"msctls_updown32", nullptr)) != nullptr)
DestroyWindow(hwndChild);
return 0;
@@ -1018,7 +1018,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
case WM_DESTROY:
if (tabdat) {
- if (tabdat->hTheme != 0) {
+ if (tabdat->hTheme != nullptr) {
CloseThemeData(tabdat->hTheme);
CloseThemeData(tabdat->hThemeButton);
}
@@ -1051,7 +1051,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
}
KillTimer(hwnd, TIMERID_HOVER_T);
if (tabdat->pContainer && (!tabdat->pContainer->SideBar->isActive() && (TabCtrl_GetItemCount(hwnd) > 1 || !(tabdat->pContainer->dwFlags & CNT_HIDETABS))))
- SetTimer(hwnd, TIMERID_HOVER_T, 750, 0);
+ SetTimer(hwnd, TIMERID_HOVER_T, 750, nullptr);
break;
case WM_SIZE:
@@ -1173,7 +1173,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
if (tabdat->himlDrag) {
ImageList_RemoveAll(tabdat->himlDrag);
ImageList_Destroy(tabdat->himlDrag);
- tabdat->himlDrag = 0;
+ tabdat->himlDrag = nullptr;
}
break;
@@ -1226,7 +1226,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
if (tabdat->himlDrag) {
ImageList_RemoveAll(tabdat->himlDrag);
ImageList_Destroy(tabdat->himlDrag);
- tabdat->himlDrag = 0;
+ tabdat->himlDrag = nullptr;
}
}
if (tabdat->fCloseButton) {
@@ -1266,7 +1266,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara
/*
* get the message window data for the session to which this tab item belongs
*/
- CSrmmWindow *dat = 0;
+ CSrmmWindow *dat = nullptr;
if (IsWindow((HWND)item.lParam) && item.lParam != 0)
dat = (CSrmmWindow*)GetWindowLongPtr((HWND)item.lParam, GWLP_USERDATA);
if (dat) {
diff --git a/plugins/TabSRMM/src/taskbar.cpp b/plugins/TabSRMM/src/taskbar.cpp
index 6f802725a8..18d2087273 100644
--- a/plugins/TabSRMM/src/taskbar.cpp
+++ b/plugins/TabSRMM/src/taskbar.cpp
@@ -59,7 +59,7 @@
* used by getMUCBigICon()
*/
-CTaskbarInteract* Win7Taskbar = 0;
+CTaskbarInteract* Win7Taskbar = nullptr;
/**
* set the overlay icon for a task bar button. Used for typing notifications and incoming
@@ -98,13 +98,13 @@ bool CTaskbarInteract::haveLargeIcons()
* also, figure out the button grouping mode.
*/
if (::RegOpenKey(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced", &hKey) == ERROR_SUCCESS) {
- ::RegQueryValueEx(hKey, L"TaskbarSmallIcons", 0, &dwType, (LPBYTE)&val, &size);
+ ::RegQueryValueEx(hKey, L"TaskbarSmallIcons", nullptr, &dwType, (LPBYTE)&val, &size);
size = 4;
dwType = REG_DWORD;
/*
* this is the "grouping mode" setting for the task bar. 0 = always combine, no labels
*/
- ::RegQueryValueEx(hKey, L"TaskbarGlomLevel", 0, &dwType, (LPBYTE)&valGrouping, &size);
+ ::RegQueryValueEx(hKey, L"TaskbarGlomLevel", nullptr, &dwType, (LPBYTE)&valGrouping, &size);
::RegCloseKey(hKey);
}
m_fHaveLargeicons = (val ? false : true); // small icons in use, revert to default icon feedback
@@ -140,7 +140,7 @@ void CTaskbarInteract::registerTab(const HWND hwndTab, const HWND hwndContainer)
{
if (m_isEnabled) {
m_pTaskbarInterface->RegisterTab(hwndTab, hwndContainer);
- m_pTaskbarInterface->SetTabOrder(hwndTab, 0);
+ m_pTaskbarInterface->SetTabOrder(hwndTab, nullptr);
}
}
@@ -210,8 +210,8 @@ void CTabBaseDlg::VerifyProxy()
CProxyWindow::CProxyWindow(CTabBaseDlg *dat)
{
m_dat = dat;
- m_hBigIcon = 0;
- m_thumb = 0;
+ m_hBigIcon = nullptr;
+ m_thumb = nullptr;
m_hwndProxy = ::CreateWindowEx(/*WS_EX_TOOLWINDOW | */WS_EX_NOACTIVATE, PROXYCLASSNAME, L"",
WS_POPUP | WS_BORDER | WS_SYSMENU | WS_CAPTION, -32000, -32000, 10, 10, nullptr, nullptr, g_hInst, (LPVOID)this);
@@ -239,7 +239,7 @@ CProxyWindow::~CProxyWindow()
#endif
if (m_thumb) {
delete m_thumb;
- m_thumb = 0;
+ m_thumb = nullptr;
}
}
@@ -252,7 +252,7 @@ void CProxyWindow::verifyDwmState()
if (!M.isDwmActive()) {
if (m_thumb) {
delete m_thumb;
- m_thumb = 0;
+ m_thumb = nullptr;
}
}
else {
@@ -273,7 +273,7 @@ void CProxyWindow::verifyDwmState()
*/
void CProxyWindow::sendThumb(LONG width, LONG height)
{
- if (0 == m_thumb) {
+ if (nullptr == m_thumb) {
m_width = width;
m_height = height;
m_thumb = m_dat->tabCreateThumb(this);
@@ -304,7 +304,7 @@ void CProxyWindow::sendPreview()
if (!m_thumb || !dat_active)
return;
- FORMATRANGE fr = { 0 };
+ FORMATRANGE fr = {};
POINT pt = { 0 };
RECT rcContainer, rcTemp, rcRich, rcLog;
HDC hdc, dc;
@@ -580,7 +580,7 @@ CThumbBase::CThumbBase(const CProxyWindow* _p) :
m_isValid(false)
{
m_pWnd = _p;
- m_hbmThumb = 0;
+ m_hbmThumb = nullptr;
renderBase();
}
@@ -591,7 +591,7 @@ CThumbBase::CThumbBase(const CProxyWindow* _p) :
*/
void CThumbBase::renderBase()
{
- HICON hIcon = 0;
+ HICON hIcon = nullptr;
HBRUSH brBack;
LONG lIconSize = 32;
@@ -599,7 +599,7 @@ void CThumbBase::renderBase()
m_height = m_pWnd->getHeight();
m_dat = m_pWnd->getDat();
m_dtFlags = 0;
- m_hOldFont = 0;
+ m_hOldFont = nullptr;
#if defined(__LOGDEBUG_)
_DebugTraceW(L"refresh base (background) with %d, %d", m_width, m_height);
@@ -611,7 +611,7 @@ void CThumbBase::renderBase()
if (m_hbmThumb) {
::DeleteObject(m_hbmThumb);
- m_hbmThumb = 0;
+ m_hbmThumb = nullptr;
}
HDC dc = ::GetDC(m_pWnd->getHwnd());
@@ -639,7 +639,7 @@ void CThumbBase::renderBase()
setupRect();
hIcon = m_pWnd->getBigIcon();
- if (0 == hIcon) {
+ if (nullptr == hIcon) {
if (m_dat->m_dwUnread) {
if (PluginConfig.g_IconMsgEventBig)
hIcon = PluginConfig.g_IconMsgEventBig;
@@ -650,16 +650,16 @@ void CThumbBase::renderBase()
}
else {
hIcon = reinterpret_cast<HICON>(Skin_LoadProtoIcon(m_dat->m_cache->getActiveProto(), m_dat->m_cache->getActiveStatus(), true));
- if (0 == hIcon || reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) == hIcon) {
+ if (nullptr == hIcon || reinterpret_cast<HICON>(CALLSERVICE_NOTFOUND) == hIcon) {
hIcon = reinterpret_cast<HICON>(Skin_LoadProtoIcon(m_dat->m_cache->getActiveProto(), m_dat->m_cache->getActiveStatus()));
lIconSize = 16;
}
}
}
- ::DrawIconEx(m_hdc, m_rcIcon.right / 2 - lIconSize / 2, m_rcIcon.top, hIcon, lIconSize, lIconSize, 0, 0, DI_NORMAL);
+ ::DrawIconEx(m_hdc, m_rcIcon.right / 2 - lIconSize / 2, m_rcIcon.top, hIcon, lIconSize, lIconSize, 0, nullptr, DI_NORMAL);
hIcon = m_pWnd->getOverlayIcon();
if (hIcon)
- ::DrawIconEx(m_hdc, m_rcIcon.right - 16, m_rcIcon.top + 16, hIcon, 16, 16, 0, 0, DI_NORMAL);
+ ::DrawIconEx(m_hdc, m_rcIcon.right - 16, m_rcIcon.top + 16, hIcon, 16, 16, 0, nullptr, DI_NORMAL);
m_rcIcon.top += (lIconSize + 3);
CSkin::RenderText(m_hdc, m_dat->m_hTheme, m_dat->m_wszStatus, &m_rcIcon, m_dtFlags | DT_CENTER | DT_WORD_ELLIPSIS, 10, 0, true);
@@ -710,7 +710,7 @@ CThumbBase::~CThumbBase()
{
if (m_hbmThumb) {
::DeleteObject(m_hbmThumb);
- m_hbmThumb = 0;
+ m_hbmThumb = nullptr;
m_isValid = false;
}
#if defined(__LOGDEBUG_)
@@ -786,7 +786,7 @@ void CThumbIM::renderContent()
m_rcBottom.bottom -= ((m_rcBottom.bottom - m_rcBottom.top) % m_sz.cy); // adjust to a multiple of line height
const wchar_t *tszStatusMsg = m_dat->m_cache->getStatusMsg();
- if (tszStatusMsg == 0)
+ if (tszStatusMsg == nullptr)
tszStatusMsg = TranslateT("No status message");
CSkin::RenderText(m_hdc, m_dat->m_hTheme, tszStatusMsg, &m_rcBottom, DT_WORD_ELLIPSIS | DT_END_ELLIPSIS | m_dtFlags, 10, 0, true);
@@ -882,9 +882,9 @@ void CThumbMUC::renderContent()
m_rcBottom.bottom -= ((m_rcBottom.bottom - m_rcBottom.top) % m_sz.cy); // adjust to a multiple of line height
- const wchar_t *szStatusMsg = 0;
+ const wchar_t *szStatusMsg = nullptr;
if (si->iType != GCW_SERVER) {
- if (0 == (szStatusMsg = si->ptszTopic))
+ if (nullptr == (szStatusMsg = si->ptszTopic))
szStatusMsg = TranslateT("no topic set.");
}
else if (mi) {
diff --git a/plugins/TabSRMM/src/templates.cpp b/plugins/TabSRMM/src/templates.cpp
index 114186c985..0ab41c7c6e 100644
--- a/plugins/TabSRMM/src/templates.cpp
+++ b/plugins/TabSRMM/src/templates.cpp
@@ -155,7 +155,7 @@ void CTemplateEditDlg::OnInitDialog()
m_hContact = db_find_first();
m_szProto = GetContactProto(m_hContact);
- while (m_szProto == 0 && m_hContact != 0) {
+ while (m_szProto == nullptr && m_hContact != 0) {
m_hContact = db_find_next(m_hContact);
m_szProto = GetContactProto(m_hContact);
}
diff --git a/plugins/TabSRMM/src/themeio.cpp b/plugins/TabSRMM/src/themeio.cpp
index c0ffbdb78c..5f7d4fb866 100644
--- a/plugins/TabSRMM/src/themeio.cpp
+++ b/plugins/TabSRMM/src/themeio.cpp
@@ -225,15 +225,15 @@ void TSAPI WriteThemeToINI(const wchar_t *szIniFilenameT, CSrmmWindow *dat)
WritePrivateProfileStringA("Message Log", "ExtraMicroLF", _itoa(M.GetByte("extramicrolf", 0), szBuf, 10), szIniFilename);
for (i = 0; i <= TMPL_ERRMSG; i++) {
- T2Utf szLTR((dat == 0) ? LTR_Active.szTemplates[i] : dat->m_pContainer->ltr_templates->szTemplates[i]);
+ T2Utf szLTR((dat == nullptr) ? LTR_Active.szTemplates[i] : dat->m_pContainer->ltr_templates->szTemplates[i]);
WritePrivateProfileStringA("Templates", TemplateNames[i], szLTR, szIniFilename);
- T2Utf szRTL((dat == 0) ? RTL_Active.szTemplates[i] : dat->m_pContainer->rtl_templates->szTemplates[i]);
+ T2Utf szRTL((dat == nullptr) ? RTL_Active.szTemplates[i] : dat->m_pContainer->rtl_templates->szTemplates[i]);
WritePrivateProfileStringA("RTLTemplates", TemplateNames[i], szRTL, szIniFilename);
}
for (i = 0; i < CUSTOM_COLORS; i++) {
mir_snprintf(szTemp, "cc%d", i + 1);
- if (dat == 0)
+ if (dat == nullptr)
WritePrivateProfileStringA("Custom Colors", szTemp, _itoa(M.GetDword(szTemp, 0), szBuf, 10), szIniFilename);
else
WritePrivateProfileStringA("Custom Colors", szTemp, _itoa(dat->m_pContainer->theme.custom_colors[i], szBuf, 10), szIniFilename);
@@ -259,7 +259,7 @@ void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat,
version = 1;
HDC hdc = GetDC(nullptr);
- if (dat == 0) {
+ if (dat == nullptr) {
while (fontBlocks[n].szModule && (dwFlags & THEME_READ_FONTS)) {
char *szModule = fontBlocks[n].szModule;
int firstIndex = fontBlocks[n].iFirst;
@@ -376,15 +376,15 @@ void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat,
if (version >= 3) {
if (!noAdvanced && dwFlags & THEME_READ_TEMPLATES) {
for (i = 0; i <= TMPL_ERRMSG; i++) {
- wchar_t *decoded = 0;
+ wchar_t *decoded = nullptr;
GetPrivateProfileStringA("Templates", TemplateNames[i], "[undef]", szTemplateBuffer, TEMPLATE_LENGTH * 3, szIniFilename);
if (mir_strcmp(szTemplateBuffer, "[undef]")) {
- if (dat == 0)
+ if (dat == nullptr)
db_set_utf(0, TEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
- if (dat == 0)
+ if (dat == nullptr)
wcsncpy_s(LTR_Active.szTemplates[i], decoded, _TRUNCATE);
else
wcsncpy_s(dat->ltr_templates->szTemplates[i], decoded, _TRUNCATE);
@@ -394,10 +394,10 @@ void TSAPI ReadThemeFromINI(const wchar_t *szIniFilenameT, TContainerData *dat,
GetPrivateProfileStringA("RTLTemplates", TemplateNames[i], "[undef]", szTemplateBuffer, TEMPLATE_LENGTH * 3, szIniFilename);
if (mir_strcmp(szTemplateBuffer, "[undef]")) {
- if (dat == 0)
+ if (dat == nullptr)
db_set_utf(0, RTLTEMPLATES_MODULE, TemplateNames[i], szTemplateBuffer);
decoded = mir_utf8decodeW(szTemplateBuffer);
- if (dat == 0)
+ if (dat == nullptr)
wcsncpy_s(RTL_Active.szTemplates[i], decoded, _TRUNCATE);
else
wcsncpy_s(dat->rtl_templates->szTemplates[i], decoded, _TRUNCATE);
@@ -428,7 +428,7 @@ const wchar_t* TSAPI GetThemeFileName(int iMode)
mir_snwprintf(filter, L"%s%c*.tabsrmm%c%c", TranslateT("TabSRMM themes"), 0, 0, 0);
ofn.lpstrFilter = filter;
ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400;
- ofn.hwndOwner = 0;
+ ofn.hwndOwner = nullptr;
ofn.lpstrFile = szFilename;
ofn.lpstrInitialDir = szInitialDir;
ofn.nMaxFile = MAX_PATH;
diff --git a/plugins/TabSRMM/src/themes.cpp b/plugins/TabSRMM/src/themes.cpp
index 884f952efa..5ed85aab29 100644
--- a/plugins/TabSRMM/src/themes.cpp
+++ b/plugins/TabSRMM/src/themes.cpp
@@ -36,7 +36,7 @@ static SKINDESC my_default_skin[] = {
IDR_SKIN_LOGO, L"unknown.png"
};
-CSkin* Skin = 0;
+CSkin* Skin = nullptr;
static void __inline gradientVertical(UCHAR *ubRedFinal, UCHAR *ubGreenFinal, UCHAR *ubBlueFinal,
@@ -49,7 +49,7 @@ static void __inline gradientHorizontal(UCHAR *ubRedFinal, UCHAR *ubGreenFinal,
UINT nextButtonID;
-ButtonSet g_ButtonSet = { 0 };
+ButtonSet g_ButtonSet = {};
#define NR_MAXSKINICONS 100
@@ -81,34 +81,34 @@ char CSkin::m_realSkinnedFrame_caption = 0;
int CSkin::m_titleBarLeftOff = 0, CSkin::m_titleButtonTopOff = 0, CSkin::m_captionOffset = 0, CSkin::m_captionPadding = 0,
CSkin::m_titleBarRightOff = 0, CSkin::m_sidebarTopOffset = 0, CSkin::m_sidebarBottomOffset = 0, CSkin::m_bRoundedCorner = 0;
-CImageItem *CSkin::m_switchBarItem = 0, *CSkin::m_tabTop = 0, *CSkin::m_tabBottom = 0, *CSkin::m_tabGlowTop = 0, *CSkin::m_tabGlowBottom = 0;
+CImageItem *CSkin::m_switchBarItem = nullptr, *CSkin::m_tabTop = nullptr, *CSkin::m_tabBottom = nullptr, *CSkin::m_tabGlowTop = nullptr, *CSkin::m_tabGlowBottom = nullptr;
bool CSkin::m_fAeroSkinsValid = false;
SIZE CSkin::m_titleBarButtonSize = { 0 };
COLORREF CSkin::m_ContainerColorKey = 0, CSkin::m_dwmColorRGB = 0, CSkin::m_DefaultFontColor = 0;
-HBRUSH CSkin::m_ContainerColorKeyBrush = 0, CSkin::m_MenuBGBrush = 0;
+HBRUSH CSkin::m_ContainerColorKeyBrush = nullptr, CSkin::m_MenuBGBrush = nullptr;
-HPEN CSkin::m_SkinLightShadowPen = 0, CSkin::m_SkinDarkShadowPen = 0;
+HPEN CSkin::m_SkinLightShadowPen = nullptr, CSkin::m_SkinDarkShadowPen = nullptr;
-HICON CSkin::m_closeIcon = 0, CSkin::m_maxIcon = 0, CSkin::m_minIcon = 0;
+HICON CSkin::m_closeIcon = nullptr, CSkin::m_maxIcon = nullptr, CSkin::m_minIcon = nullptr;
UINT CSkin::m_aeroEffect = 0;
DWORD CSkin::m_glowSize = 0;
-HBRUSH CSkin::m_BrushBack = 0, CSkin::m_BrushFill = 0;
+HBRUSH CSkin::m_BrushBack = nullptr, CSkin::m_BrushFill = nullptr;
-HBITMAP CSkin::m_tabCloseBitmap = 0, CSkin::m_tabCloseOldBitmap = 0;
-HDC CSkin::m_tabCloseHDC = 0;
+HBITMAP CSkin::m_tabCloseBitmap = nullptr, CSkin::m_tabCloseOldBitmap = nullptr;
+HDC CSkin::m_tabCloseHDC = nullptr;
// aero effects
AeroEffect CSkin::m_currentAeroEffect;
-AeroEffect *CSkin::m_pCurrentAeroEffect = 0;
+AeroEffect *CSkin::m_pCurrentAeroEffect = nullptr;
AeroEffect CSkin::m_aeroEffects[AERO_EFFECT_LAST] = {
{
- LPGENW("No effect"), 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, 0
+ LPGENW("No effect"), 0, 0, 0, 0, 0, 0, 0, 10, 0, 0, 0, nullptr
},
{
LPGENW("Milky Glass"),
@@ -285,11 +285,11 @@ CSkinItem SkinItems[] = {
}, { L"InfoPanelBackground", "TSKIN_INFOPANELBG", ID_EXTBKINFOPANELBG,
8, CLCDEFAULT_CORNER,
0xf0f0f0, 0x42b1ff, 1, CLCDEFAULT_TEXTCOLOR, 40, CLCDEFAULT_MRGN_LEFT,
- CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT, CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE, 0, 0
+ CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT, CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE, 0, nullptr
}, { L"Sidebar Background", "TSKIN_SIDEBARBG", ID_EXTBKSIDEBARBG,
CLCDEFAULT_GRADIENT, CLCDEFAULT_CORNER,
0xb2e1ff, 0xb2e1ff, 1, CLCDEFAULT_TEXTCOLOR, 40, CLCDEFAULT_MRGN_LEFT,
- CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT, CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE, 0, 0
+ CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT, CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE, 0, nullptr
}
};
@@ -297,7 +297,7 @@ static CSkinItem _defInfoPanel = {
L"InfoPanelBackground", "TSKIN_INFOPANELBG", ID_EXTBKINFOPANELBG,
8, CLCDEFAULT_CORNER,
0xf0f0f0, 0x62caff, 0, CLCDEFAULT_TEXTCOLOR, 255, CLCDEFAULT_MRGN_LEFT,
- CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT, CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE, 0, 0
+ CLCDEFAULT_MRGN_TOP, CLCDEFAULT_MRGN_RIGHT, CLCDEFAULT_MRGN_BOTTOM, CLCDEFAULT_IGNORE, 0, nullptr
};
static BYTE __inline percent_to_byte(UINT32 percent)
@@ -474,7 +474,7 @@ void TSAPI DrawAlpha(HDC hDC, PRECT rc, DWORD clr_base, int alpha, DWORD clr_de
// TL+BL CORNER
hbitmap = CreateDIBSection(hdc, &bmi, DIB_RGB_COLORS, &pvBits, nullptr, 0x0);
- if (hbitmap == 0 || pvBits == nullptr) {
+ if (hbitmap == nullptr || pvBits == nullptr) {
DeleteObject(BrMask);
DeleteDC(hdc);
return;
@@ -627,12 +627,12 @@ void __fastcall CImageItem::Render(const HDC hdc, const RECT *rc, bool fIgnoreGl
LONG height = rc->bottom - rc->top;
BOOL isGlyph = ((m_dwFlags & IMAGE_GLYPH) && Skin->haveGlyphItem());
BOOL fCleanUp = TRUE;
- HDC hdcSrc = 0;
- HBITMAP hbmOld = 0;
+ HDC hdcSrc = nullptr;
+ HBITMAP hbmOld = nullptr;
LONG srcOrigX = isGlyph ? m_glyphMetrics[0] : 0;
LONG srcOrigY = isGlyph ? m_glyphMetrics[1] : 0;
- if (m_hdc == 0) {
+ if (m_hdc == nullptr) {
hdcSrc = CreateCompatibleDC(hdc);
hbmOld = (HBITMAP)SelectObject(hdcSrc, isGlyph ? Skin->getGlyphItem()->getHbm() : m_hbm);
}
@@ -755,9 +755,9 @@ void CImageItem::Create(const wchar_t *szImageFile)
HBITMAP hbm = LoadPNG(szImageFile);
BITMAP bm;
- m_hdc = 0;
- m_hbmOld = 0;
- m_hbm = 0;
+ m_hdc = nullptr;
+ m_hbmOld = nullptr;
+ m_hbm = nullptr;
if (hbm) {
m_hbm = hbm;
@@ -778,7 +778,7 @@ void CImageItem::Create(const wchar_t *szImageFile)
m_dwFlags |= IMAGE_FLAG_DIVIDED;
if (m_inner_height <= 0 || m_inner_width <= 0) {
DeleteObject(hbm);
- m_hbm = 0;
+ m_hbm = nullptr;
return;
}
}
@@ -799,7 +799,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
{
wchar_t buffer[501];
wchar_t szDrive[MAX_PATH], szPath[MAX_PATH];
- wchar_t *szFinalName = 0;
+ wchar_t *szFinalName = nullptr;
GetPrivateProfileString(m_szName, L"Glyph", L"None", buffer, 500, szFilename);
if (mir_wstrcmp(buffer, L"None")) {
@@ -821,7 +821,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
mir_snwprintf(szFinalName, MAX_PATH, L"%s\\%s%s", szDrive, szPath, buffer);
if (!PathFileExists(szFinalName)) {
delete[] szFinalName;
- szFinalName = 0;
+ szFinalName = nullptr;
}
m_alpha = GetPrivateProfileInt(m_szName, L"Alpha", 100, szFilename);
m_alpha = min(m_alpha, 100);
@@ -846,7 +846,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
if (m_inner_height <= 0 || m_inner_width <= 0) {
if (szFinalName) {
delete[] szFinalName;
- szFinalName = 0;
+ szFinalName = nullptr;
}
return(szFinalName);
}
@@ -858,7 +858,7 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
m_dwFlags |= IMAGE_FILLSOLID;
}
else
- m_fillBrush = 0;
+ m_fillBrush = nullptr;
GetPrivateProfileString(m_szName, L"Colorkey", L"None", buffer, 500, szFilename);
if (mir_wstrcmp(buffer, L"None")) {
CSkin::m_ContainerColorKey = CSkin::HexStringToLong(buffer);
@@ -873,13 +873,13 @@ wchar_t* CImageItem::Read(const wchar_t *szFilename)
m_bStretch = IMAGE_STRETCH_V;
else if (buffer[0] == 'w' || buffer[0] == 'W')
m_bStretch = IMAGE_STRETCH_H;
- m_hbm = 0;
+ m_hbm = nullptr;
if (GetPrivateProfileInt(m_szName, L"Perpixel", 0, szFilename))
m_dwFlags |= IMAGE_PERPIXEL_ALPHA;
return(szFinalName);
}
- return 0;
+ return nullptr;
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -1001,7 +1001,7 @@ void CImageItem::Colorize(HBITMAP hBitmap, BYTE dr, BYTE dg, BYTE db, BYTE alpha
HBITMAP TSAPI CImageItem::LoadPNG(const wchar_t *szFilename)
{
- HBITMAP hBitmap = 0;
+ HBITMAP hBitmap = nullptr;
hBitmap = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)szFilename, IMGL_WCHAR);
return hBitmap;
}
@@ -1030,7 +1030,7 @@ void CSkin::setFileName()
void CSkin::Init(bool fStartup)
{
- m_ImageItems = 0;
+ m_ImageItems = nullptr;
m_SkinItems = ::SkinItems;
m_fLoadOnStartup = false;
m_skinEnabled = m_frameSkins = false;
@@ -1059,7 +1059,7 @@ bool CSkin::warnToClose() const
if (::pFirstContainer == nullptr)
return true;
- if (MessageBox(0,
+ if (MessageBox(nullptr,
TranslateT("All message containers need to close before the skin can be changed\nProceed?"),
TranslateT("Change skin"), MB_YESNO | MB_ICONQUESTION) != IDYES)
return false;
@@ -1123,7 +1123,7 @@ void CSkin::Unload()
tmp = nextItem;
}
- m_ImageItems = 0;
+ m_ImageItems = nullptr;
m_glyphItem.Free();
if (m_ContainerColorKeyBrush)
@@ -1133,20 +1133,20 @@ void CSkin::Unload()
if (m_BrushBack)
::DeleteObject(m_BrushBack);
- m_ContainerColorKeyBrush = m_MenuBGBrush = 0;
+ m_ContainerColorKeyBrush = m_MenuBGBrush = nullptr;
if (m_SkinLightShadowPen)
::DeleteObject(m_SkinLightShadowPen);
- m_SkinLightShadowPen = 0;
+ m_SkinLightShadowPen = nullptr;
if (m_SkinDarkShadowPen)
::DeleteObject(m_SkinDarkShadowPen);
- m_SkinDarkShadowPen = 0;
+ m_SkinDarkShadowPen = nullptr;
if (m_SkinItems) {
for (int i = 0; i < ID_EXTBK_LAST; i++) {
m_SkinItems[i].IGNORED = 1;
- m_SkinItems[i].imageItem = 0;
+ m_SkinItems[i].imageItem = nullptr;
}
m_SkinItems[ID_EXTBKINFOPANELBG] = _defInfoPanel;
}
@@ -1165,7 +1165,7 @@ void CSkin::Unload()
m_titleBarButtonSize.cx = m_titleBarButtonSize.cy = 0;
m_ContainerColorKey = 0;
- m_ContainerColorKeyBrush = m_MenuBGBrush = 0;
+ m_ContainerColorKeyBrush = m_MenuBGBrush = nullptr;
m_skinEnabled = m_frameSkins = false;
if (m_closeIcon)
@@ -1175,7 +1175,7 @@ void CSkin::Unload()
if (m_minIcon)
::DestroyIcon(m_minIcon);
- m_closeIcon = m_maxIcon = m_minIcon = 0;
+ m_closeIcon = m_maxIcon = m_minIcon = nullptr;
for (int i = 0; i < m_nrSkinIcons; i++)
if (m_skinIcons[i].phIcon)
@@ -1197,7 +1197,7 @@ void CSkin::Unload()
void CSkin::LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon)
{
- if (hIcon != 0)
+ if (hIcon != nullptr)
DestroyIcon(hIcon);
wchar_t buffer[512];
@@ -1209,7 +1209,7 @@ void CSkin::LoadIcon(const wchar_t *szSection, const wchar_t *name, HICON &hIcon
_wsplitpath(m_tszFileName, szDrive, szDir, nullptr, nullptr);
mir_snwprintf(szImagePath, L"%s\\%s\\%s", szDrive, szDir, buffer);
- hIcon = (HICON)LoadImage(0, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
+ hIcon = (HICON)LoadImage(nullptr, szImagePath, IMAGE_ICON, 16, 16, LR_LOADFROMFILE);
}
else hIcon = nullptr;
}
@@ -1299,7 +1299,7 @@ void CSkin::ReadImageItem(const wchar_t *itemname)
wchar_t *szImageFileName = tmpItem.Read(m_tszFileName);
- if (!mir_wstrcmpi(itemname, L"$glyphs") && szImageFileName != 0) { // the glyph item MUST have a valid image
+ if (!mir_wstrcmpi(itemname, L"$glyphs") && szImageFileName != nullptr) { // the glyph item MUST have a valid image
tmpItem.Create(szImageFileName);
if (tmpItem.getHbm()) {
m_glyphItem = tmpItem;
@@ -1334,7 +1334,7 @@ void CSkin::ReadImageItem(const wchar_t *itemname)
else {
CImageItem *pItem = m_ImageItems;
- while (pItem->getNextItem() != 0)
+ while (pItem->getNextItem() != nullptr)
pItem = pItem->getNextItem();
pItem->setNextItem(newItem);
}
@@ -1478,7 +1478,7 @@ void CSkin::Load(void)
_wsplitpath(m_tszFileName, szDrive, szPath, nullptr, nullptr);
mir_snwprintf(szFinalName, L"%s\\%s\\%s", szDrive, szPath, buffer);
if (PathFileExists(szFinalName)) {
- ReadThemeFromINI(szFinalName, 0, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
+ ReadThemeFromINI(szFinalName, nullptr, FALSE, m_fLoadOnStartup ? 0 : M.GetByte("skin_loadmode", 0));
CacheLogFonts();
CacheMsgLogIcons();
}
@@ -1487,7 +1487,7 @@ void CSkin::Load(void)
data = HexStringToLong(buffer);
if (m_MenuBGBrush) {
DeleteObject(m_MenuBGBrush);
- m_MenuBGBrush = 0;
+ m_MenuBGBrush = nullptr;
}
if (mir_wstrcmp(buffer, L"None"))
m_MenuBGBrush = CreateSolidBrush(data);
@@ -1524,7 +1524,7 @@ void CSkin::LoadItems()
{
wchar_t *szSections = nullptr;
wchar_t *p, *p1;
- TIconDesc tmpIconDesc = { 0 };
+ TIconDesc tmpIconDesc = {};
if (m_skinIcons == nullptr)
m_skinIcons = (TIconDescW *)mir_calloc(sizeof(TIconDescW) * NR_MAXSKINICONS);
@@ -1628,7 +1628,7 @@ void CSkin::setupTabCloseBitmap(bool fDeleteOnly)
::FillRect(m_tabCloseHDC, &rc, ::GetSysColorBrush(COLOR_3DFACE));
::DrawFrameControl(m_tabCloseHDC, &rc, DFC_BUTTON, DFCS_BUTTONPUSH | DFCS_MONO);
}
- ::DrawIconEx(m_tabCloseHDC, 2, 2, PluginConfig.g_buttonBarIcons[ICON_BUTTON_CANCEL], 16, 16, 0, 0, DI_NORMAL);
+ ::DrawIconEx(m_tabCloseHDC, 2, 2, PluginConfig.g_buttonBarIcons[ICON_BUTTON_CANCEL], 16, 16, 0, nullptr, DI_NORMAL);
::SelectObject(m_tabCloseHDC, m_tabCloseOldBitmap);
HBITMAP hbmTemp = ResizeBitmap(m_tabCloseBitmap, 16, 16, fFree);
@@ -1671,15 +1671,15 @@ void CSkin::setupAeroSkins()
mir_wstrcat(tszBasePath, L"\\");
// load unknown avatar..
- if (0 == PluginConfig.g_hbmUnknown) {
+ if (nullptr == PluginConfig.g_hbmUnknown) {
mir_snwprintf(tszFilename, L"%scustom_unknown.png", tszBasePath);
if (!PathFileExists(tszFilename))
mir_snwprintf(tszFilename, L"%sunknown.png", tszBasePath);
PluginConfig.g_hbmUnknown = (HBITMAP)CallService(MS_IMG_LOAD, (WPARAM)tszFilename, IMGL_WCHAR);
- if (PluginConfig.g_hbmUnknown == 0) {
- HDC dc = GetDC(0);
+ if (PluginConfig.g_hbmUnknown == nullptr) {
+ HDC dc = GetDC(nullptr);
PluginConfig.g_hbmUnknown = CreateCompatibleBitmap(dc, 20, 20);
- ReleaseDC(0, dc);
+ ReleaseDC(nullptr, dc);
}
}
@@ -1744,8 +1744,8 @@ void CSkin::setupAeroSkins()
BITMAP bm;
GetObject(hbm, sizeof(bm), &bm);
- m_tabTop = new CImageItem(4, 4, 4, 4, 0, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
- 0, 255, 30, 80, 50, 100);
+ m_tabTop = new CImageItem(4, 4, 4, 4, nullptr, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
+ nullptr, 255, 30, 80, 50, 100);
m_tabTop->setAlphaFormat(AC_SRC_ALPHA, 255);
m_tabTop->setMetrics(bm.bmWidth, bm.bmHeight);
@@ -1763,8 +1763,8 @@ void CSkin::setupAeroSkins()
FIF->FI_Unload(fib);
GetObject(hbm, sizeof(bm), &bm);
- m_tabBottom = new CImageItem(4, 4, 4, 4, 0, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
- 0, 255, 30, 80, 50, 100);
+ m_tabBottom = new CImageItem(4, 4, 4, 4, nullptr, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
+ nullptr, 255, 30, 80, 50, 100);
m_tabBottom->setAlphaFormat(AC_SRC_ALPHA, 255);
m_tabBottom->setMetrics(bm.bmWidth, bm.bmHeight);
@@ -1782,8 +1782,8 @@ void CSkin::setupAeroSkins()
CImageItem::PreMultiply(hbm, 1);
GetObject(hbm, sizeof(bm), &bm);
- m_tabGlowTop = new CImageItem(4, 4, 4, 4, 0, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
- 0, 255, 30, 80, 50, 100);
+ m_tabGlowTop = new CImageItem(4, 4, 4, 4, nullptr, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
+ nullptr, 255, 30, 80, 50, 100);
m_tabGlowTop->setAlphaFormat(AC_SRC_ALPHA, 255);
m_tabGlowTop->setMetrics(bm.bmWidth, bm.bmHeight);
@@ -1796,8 +1796,8 @@ void CSkin::setupAeroSkins()
FIF->FI_Unload(fib);
GetObject(hbm, sizeof(bm), &bm);
- m_tabGlowBottom = new CImageItem(4, 4, 4, 4, 0, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
- 0, 255, 30, 80, 50, 100);
+ m_tabGlowBottom = new CImageItem(4, 4, 4, 4, nullptr, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
+ nullptr, 255, 30, 80, 50, 100);
m_tabGlowBottom->setAlphaFormat(AC_SRC_ALPHA, 255);
m_tabGlowBottom->setMetrics(bm.bmWidth, bm.bmHeight);
@@ -1817,8 +1817,8 @@ void CSkin::setupAeroSkins()
GetObject(hbm, sizeof(bm), &bm);
- m_switchBarItem = new CImageItem(4, 4, 4, 4, 0, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
- 0, 255, 2, 12, 10, 20);
+ m_switchBarItem = new CImageItem(4, 4, 4, 4, nullptr, hbm, IMAGE_FLAG_DIVIDED | IMAGE_PERPIXEL_ALPHA,
+ nullptr, 255, 2, 12, 10, 20);
m_switchBarItem->setAlphaFormat(AC_SRC_ALPHA, 255);
m_switchBarItem->setMetrics(bm.bmWidth, bm.bmHeight);
@@ -1904,10 +1904,10 @@ void CSkin::SkinDrawBGFromDC(HWND hwndClient, HWND hwnd, RECT *rcClient, HDC hdc
void CSkin::DrawDimmedIcon(HDC hdc, LONG left, LONG top, LONG dx, LONG dy, HICON hIcon, BYTE alpha)
{
HDC dcMem = ::CreateCompatibleDC(hdc);
- HBITMAP hbm = ::CreateCompatibleBitmap(hdc, dx, dy), hbmOld = 0;
+ HBITMAP hbm = ::CreateCompatibleBitmap(hdc, dx, dy), hbmOld = nullptr;
hbmOld = reinterpret_cast<HBITMAP>(::SelectObject(dcMem, hbm));
- ::DrawIconEx(dcMem, 0, 0, hIcon, dx, dy, 0, 0, DI_NORMAL);
+ ::DrawIconEx(dcMem, 0, 0, hIcon, dx, dy, 0, nullptr, DI_NORMAL);
m_default_bf.SourceConstantAlpha = alpha;
hbm = (HBITMAP)SelectObject(dcMem, hbmOld);
CImageItem::PreMultiply(hbm, 1); // for AlphaBlend()...
@@ -2241,7 +2241,7 @@ void CTabBaseDlg::RenderToolbarBG(HDC hdc, const RECT &rcWindow) const
rcCachedToolbar.right = cx;
rcCachedToolbar.bottom = cy;
- if (m_pContainer->cachedToolbarDC == 0)
+ if (m_pContainer->cachedToolbarDC == nullptr)
m_pContainer->cachedToolbarDC = ::CreateCompatibleDC(hdc);
if (m_pContainer->szOldToolbarSize.cx != cx || m_pContainer->szOldToolbarSize.cy != cy) {
@@ -2267,7 +2267,7 @@ void CTabBaseDlg::RenderToolbarBG(HDC hdc, const RECT &rcWindow) const
((bAero && CSkin::m_pCurrentAeroEffect) ? CSkin::m_pCurrentAeroEffect->m_clrToolbar2 : ::GetSysColor(COLOR_3DFACE));
bAlphaOffset = PluginConfig.m_tbBackgroundHigh ? 40 : 0;
- ::DrawAlpha(m_pContainer->cachedToolbarDC, &rcCachedToolbar, CSkin::m_tmp_tb_high, 55 + bAlphaOffset, CSkin::m_tmp_tb_low, 0, 9, 0, 0, 0);
+ ::DrawAlpha(m_pContainer->cachedToolbarDC, &rcCachedToolbar, CSkin::m_tmp_tb_high, 55 + bAlphaOffset, CSkin::m_tmp_tb_low, 0, 9, 0, 0, nullptr);
}
::BitBlt(hdc, rcToolbar.left, rcToolbar.top, cx, cy, m_pContainer->cachedToolbarDC, 0, 0, SRCCOPY);
@@ -2314,7 +2314,7 @@ void CSkin::FinalizeBufferedPaint(HANDLE hbp, RECT *rc)
void CSkin::ApplyAeroEffect(const HDC hdc, const RECT *rc, int iEffectArea)
{
- if (m_pCurrentAeroEffect == 0 || m_aeroEffect == AERO_EFFECT_NONE)
+ if (m_pCurrentAeroEffect == nullptr || m_aeroEffect == AERO_EFFECT_NONE)
return;
if (m_pCurrentAeroEffect->pfnEffectRenderer)
@@ -2334,7 +2334,7 @@ void CSkin::AeroEffectCallback_Milk(const HDC hdc, const RECT *rc, int iEffectAr
DWORD corner = (iEffectArea == AERO_EFFECT_AREA_INFOPANEL) ? m_pCurrentAeroEffect->m_cornerRadius : 6;
DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, alpha, m_pCurrentAeroEffect->m_gradientColor,
- color2_trans, m_pCurrentAeroEffect->m_gradientType, m_pCurrentAeroEffect->m_cornerType, corner, 0);
+ color2_trans, m_pCurrentAeroEffect->m_gradientType, m_pCurrentAeroEffect->m_cornerType, corner, nullptr);
}
}
@@ -2343,7 +2343,7 @@ void CSkin::AeroEffectCallback_Carbon(const HDC hdc, const RECT *rc, int iEffect
if (iEffectArea < 0x1000)
DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, m_pCurrentAeroEffect->m_baseAlpha,
m_pCurrentAeroEffect->m_gradientColor, 0, m_pCurrentAeroEffect->m_gradientType,
- m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, 0);
+ m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, nullptr);
}
void CSkin::AeroEffectCallback_Solid(const HDC hdc, const RECT *rc, int iEffectArea)
@@ -2352,17 +2352,17 @@ void CSkin::AeroEffectCallback_Solid(const HDC hdc, const RECT *rc, int iEffectA
if (iEffectArea == AERO_EFFECT_AREA_SIDEBAR_LEFT)
::DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, m_pCurrentAeroEffect->m_baseAlpha,
m_pCurrentAeroEffect->m_gradientColor, 0, GRADIENT_TB + 1,
- 0, 2, 0);
+ 0, 2, nullptr);
else
::DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, m_pCurrentAeroEffect->m_baseAlpha,
m_pCurrentAeroEffect->m_gradientColor, 0, m_pCurrentAeroEffect->m_gradientType,
- m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, 0);
+ m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, nullptr);
}
else {
BYTE bGradient = (iEffectArea & AERO_EFFECT_AREA_TAB_BOTTOM ? GRADIENT_BT : GRADIENT_TB) + 1;
::DrawAlpha(hdc, const_cast<RECT *>(rc), m_pCurrentAeroEffect->m_baseColor, 70,
m_pCurrentAeroEffect->m_gradientColor, 1, bGradient,
- m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, 0);
+ m_pCurrentAeroEffect->m_cornerType, m_pCurrentAeroEffect->m_cornerRadius, nullptr);
}
}
@@ -2370,7 +2370,7 @@ void CSkin::initAeroEffect()
{
if (m_BrushBack) {
::DeleteObject(m_BrushBack);
- m_BrushBack = 0;
+ m_BrushBack = nullptr;
}
if (PluginConfig.m_bIsVista && m_aeroEffect > AERO_EFFECT_NONE && m_aeroEffect < AERO_EFFECT_LAST) {
m_currentAeroEffect = m_aeroEffects[m_aeroEffect];
@@ -2395,7 +2395,7 @@ void CSkin::initAeroEffect()
m_BrushBack = ::CreateSolidBrush(m_pCurrentAeroEffect->m_clrBack);
}
else {
- m_pCurrentAeroEffect = 0;
+ m_pCurrentAeroEffect = nullptr;
m_glowSize = 10;
m_BrushBack = ::CreateSolidBrush(0);
}
@@ -2465,7 +2465,7 @@ void CTabBaseDlg::UpdateToolbarBG()
if (M.isAero() || M.isDwmActive())
m_fLimitedUpdate = true; // skip unrelevant window updates when we have buffered paint avail
- ::RedrawWindow(m_hwnd, &rcUpdate, 0, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
+ ::RedrawWindow(m_hwnd, &rcUpdate, nullptr, RDW_INVALIDATE | RDW_ERASE | RDW_UPDATENOW);
BB_RedrawButtons();
m_fLimitedUpdate = false;
}
@@ -2479,7 +2479,7 @@ void CTabBaseDlg::UpdateToolbarBG()
void CSkin::FillBack(const HDC hdc, RECT* rc)
{
- if (0 == CSkin::m_BrushFill) {
+ if (nullptr == CSkin::m_BrushFill) {
if (PluginConfig.m_fillColor)
CSkin::m_BrushFill = ::CreateSolidBrush(PluginConfig.m_fillColor);
}
diff --git a/plugins/TabSRMM/src/translator.cpp b/plugins/TabSRMM/src/translator.cpp
index b4aa5d29f9..6c89f3b3c6 100644
--- a/plugins/TabSRMM/src/translator.cpp
+++ b/plugins/TabSRMM/src/translator.cpp
@@ -184,7 +184,7 @@ TOptionListItem* CTranslator::getTree(UINT id)
case TREE_LOG: return m_lvItemsLog;
case TREE_TAB: return m_lvItemsTab;
}
- return 0;
+ return nullptr;
}
TOptionListGroup* CTranslator::getGroupTree(UINT id)
@@ -196,5 +196,5 @@ TOptionListGroup* CTranslator::getGroupTree(UINT id)
case TREE_LOG: return m_lvGroupsLog;
case TREE_TAB: return m_lvGroupsTab;
}
- return 0;
+ return nullptr;
}
diff --git a/plugins/TabSRMM/src/trayicon.cpp b/plugins/TabSRMM/src/trayicon.cpp
index c538f898c1..1fcaff527c 100644
--- a/plugins/TabSRMM/src/trayicon.cpp
+++ b/plugins/TabSRMM/src/trayicon.cpp
@@ -29,9 +29,9 @@
#include "stdafx.h"
static BOOL isAnimThreadRunning = TRUE;
-static HANDLE hTrayAnimThread = 0;
-static HICON hIconTrayCurrent = 0;
-HANDLE g_hEvent = 0;
+static HANDLE hTrayAnimThread = nullptr;
+static HICON hIconTrayCurrent = nullptr;
+HANDLE g_hEvent = nullptr;
static wchar_t g_eventName[100];
@@ -75,7 +75,7 @@ static void TrayAnimThread(LPVOID)
if (dwElapsed >= 600) {
PluginConfig.m_TrayFlashState = !PluginConfig.m_TrayFlashState;
dwElapsed = 0;
- FlashTrayIcon(PluginConfig.m_TrayFlashState ? 0 : hIconDefault); // restore default icon
+ FlashTrayIcon(PluginConfig.m_TrayFlashState ? nullptr : hIconDefault); // restore default icon
}
}
Sleep(200);
@@ -109,19 +109,19 @@ void TSAPI CreateTrayMenus(int mode)
SetEvent(g_hEvent);
WaitForSingleObject(hTrayAnimThread, 5000);
CloseHandle(g_hEvent);
- g_hEvent = 0;
- hTrayAnimThread = 0;
- if (PluginConfig.g_hMenuTrayUnread != 0) {
+ g_hEvent = nullptr;
+ hTrayAnimThread = nullptr;
+ if (PluginConfig.g_hMenuTrayUnread != nullptr) {
DestroyMenu(PluginConfig.g_hMenuTrayUnread);
- PluginConfig.g_hMenuTrayUnread = 0;
+ PluginConfig.g_hMenuTrayUnread = nullptr;
}
- if (PluginConfig.g_hMenuFavorites != 0) {
+ if (PluginConfig.g_hMenuFavorites != nullptr) {
DestroyMenu(PluginConfig.g_hMenuFavorites);
- PluginConfig.g_hMenuFavorites = 0;
+ PluginConfig.g_hMenuFavorites = nullptr;
}
- if (PluginConfig.g_hMenuRecent != 0) {
+ if (PluginConfig.g_hMenuRecent != nullptr) {
DestroyMenu(PluginConfig.g_hMenuRecent);
- PluginConfig.g_hMenuRecent = 0;
+ PluginConfig.g_hMenuRecent = nullptr;
}
}
}
@@ -142,7 +142,7 @@ void TSAPI CreateSystrayIcon(int create)
if (create && !nen_options.bTrayExist) {
Shell_NotifyIcon(NIM_ADD, &nim);
nen_options.bTrayExist = TRUE;
- hIconTrayCurrent = 0;
+ hIconTrayCurrent = nullptr;
SetEvent(g_hEvent);
}
else if (create == FALSE && nen_options.bTrayExist) {
@@ -206,7 +206,7 @@ void TSAPI AddContactToFavorites(MCONTACT hContact, const wchar_t *szNickname, c
if (szStatus == nullptr)
szStatus = pcli->pfnGetStatusModeDescription(wStatus, 0);
- if (hIcon == 0)
+ if (hIcon == nullptr)
hIcon = Skin_LoadProtoIcon(szProto, wStatus);
PROTOACCOUNT *acc = Proto_GetAccount(szProto);
@@ -289,7 +289,7 @@ void TSAPI LoadFavoritesAndRecent()
for (MCONTACT hContact = db_find_first(); hContact; hContact = db_find_next(hContact)) {
if (M.GetByte(hContact, "isFavorite", 0))
- AddContactToFavorites(hContact, nullptr, nullptr, nullptr, 0, 0, 1, PluginConfig.g_hMenuFavorites);
+ AddContactToFavorites(hContact, nullptr, nullptr, nullptr, 0, nullptr, 1, PluginConfig.g_hMenuFavorites);
if ((dwRecent = M.GetDword(hContact, "isRecent", 0)) != 0 && iIndex < nen_options.wMaxRecent) {
recentEntries[iIndex].dwTimestamp = dwRecent;
recentEntries[iIndex++].hContact = hContact;
@@ -311,7 +311,7 @@ void TSAPI LoadFavoritesAndRecent()
}
}
for (i = 0; i < iIndex; i++)
- AddContactToFavorites(recentEntries[i].hContact, nullptr, nullptr, nullptr, 0, 0, 1, PluginConfig.g_hMenuRecent);
+ AddContactToFavorites(recentEntries[i].hContact, nullptr, nullptr, nullptr, 0, nullptr, 1, PluginConfig.g_hMenuRecent);
delete[] recentEntries;
}
diff --git a/plugins/TabSRMM/src/typingnotify.cpp b/plugins/TabSRMM/src/typingnotify.cpp
index 48da8a6311..fcef66e691 100644
--- a/plugins/TabSRMM/src/typingnotify.cpp
+++ b/plugins/TabSRMM/src/typingnotify.cpp
@@ -22,8 +22,8 @@ static BYTE newColorMode;
static wchar_t szStart[128];
static wchar_t szStop[128];
-static HANDLE hntfStarted = 0;
-static HANDLE hntfStopped = 0;
+static HANDLE hntfStarted = nullptr;
+static HANDLE hntfStopped = nullptr;
struct
{
diff --git a/plugins/TabSRMM/src/userprefs.cpp b/plugins/TabSRMM/src/userprefs.cpp
index 752d5d7c2d..72e81f3af3 100644
--- a/plugins/TabSRMM/src/userprefs.cpp
+++ b/plugins/TabSRMM/src/userprefs.cpp
@@ -132,7 +132,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
break;
case WM_USER + 100:
- CSrmmWindow *dat = 0;
+ CSrmmWindow *dat = nullptr;
DWORD *pdwActionToTake = (DWORD *)lParam;
unsigned int iOldIEView = 0;
HWND hWnd = Srmm_FindWindow(hContact);
@@ -182,7 +182,7 @@ static INT_PTR CALLBACK DlgProcUserPrefs(HWND hwndDlg, UINT msg, WPARAM wParam,
if (IsDlgButtonChecked(hwndDlg, IDC_ISFAVORITE)) {
if (!M.GetByte(hContact, "isFavorite", 0))
- AddContactToFavorites(hContact, nullptr, nullptr, nullptr, 0, 0, 1, PluginConfig.g_hMenuFavorites);
+ AddContactToFavorites(hContact, nullptr, nullptr, nullptr, 0, nullptr, 1, PluginConfig.g_hMenuFavorites);
}
else DeleteMenu(PluginConfig.g_hMenuFavorites, hContact, MF_BYCOMMAND);
diff --git a/plugins/TabSRMM/src/utils.cpp b/plugins/TabSRMM/src/utils.cpp
index 8faf8bbce5..aa4110c804 100644
--- a/plugins/TabSRMM/src/utils.cpp
+++ b/plugins/TabSRMM/src/utils.cpp
@@ -34,7 +34,7 @@
OBJLIST<TRTFColorTable> Utils::rtf_clrs(10);
-MWindowList CWarning::hWindowList = 0;
+MWindowList CWarning::hWindowList = nullptr;
static wchar_t *w_bbcodes_begin[] = { L"[b]", L"[i]", L"[u]", L"[s]", L"[color=" };
static wchar_t *w_bbcodes_end[] = { L"[/b]", L"[/i]", L"[/u]", L"[/s]", L"[/color]" };
@@ -355,7 +355,7 @@ void Utils::DoubleAmpersands(wchar_t *pszText, size_t len)
wchar_t* Utils::GetPreviewWithEllipsis(wchar_t *szText, size_t iMaxLen)
{
size_t uRequired;
- wchar_t *p = 0, cSaved;
+ wchar_t *p = nullptr, cSaved;
bool fEllipsis = false;
if (mir_wstrlen(szText) <= iMaxLen) {
@@ -663,7 +663,7 @@ void Utils::scaleAvatarHeightLimited(const HBITMAP hBm, double& dNewWidth, doubl
HICON CTabBaseDlg::IconFromAvatar() const
{
if (!ServiceExists(MS_AV_GETAVATARBITMAP))
- return 0;
+ return nullptr;
AVATARCACHEENTRY *ace = (AVATARCACHEENTRY *)CallService(MS_AV_GETAVATARBITMAP, m_hContact, 0);
if (ace == nullptr || ace->hbmPic == nullptr)
@@ -698,7 +698,7 @@ HICON CTabBaseDlg::IconFromAvatar() const
CSkin::m_default_bf.SourceConstantAlpha = 255;
::SelectObject(dc, hbmOld);
- ::ImageList_Add(hIml_c, hbmNew, 0);
+ ::ImageList_Add(hIml_c, hbmNew, nullptr);
::DeleteObject(hbmNew);
::DeleteDC(dc);
@@ -715,7 +715,7 @@ HICON CTabBaseDlg::IconFromAvatar() const
AVATARCACHEENTRY* Utils::loadAvatarFromAVS(const MCONTACT hContact)
{
if (!ServiceExists(MS_AV_GETAVATARBITMAP))
- return 0;
+ return nullptr;
return (AVATARCACHEENTRY*)CallService(MS_AV_GETAVATARBITMAP, hContact, 0);
}
@@ -841,7 +841,7 @@ bool Utils::extractResource(const HMODULE h, const UINT uID, const wchar_t *tszN
if (PathFileExists(szFilename))
return true;
- HANDLE hFile = CreateFile(szFilename, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, 0);
+ HANDLE hFile = CreateFile(szFilename, GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, nullptr);
if (hFile == INVALID_HANDLE_VALUE)
return false;
@@ -863,7 +863,7 @@ wchar_t* Utils::extractURLFromRichEdit(const ENLINK* _e, const HWND hwndRich)
CHARRANGE sel = { 0 };
::SendMessage(hwndRich, EM_EXGETSEL, 0, (LPARAM)&sel);
if (sel.cpMin != sel.cpMax)
- return 0;
+ return nullptr;
TEXTRANGE tr;
tr.chrg = _e->chrg;
@@ -888,7 +888,7 @@ void Utils::sanitizeFilename(wchar_t* tszFilename)
static size_t forbiddenCharactersLen = mir_wstrlen(forbiddenCharacters);
for (size_t i = 0; i < forbiddenCharactersLen; i++) {
- wchar_t* szFound = 0;
+ wchar_t* szFound = nullptr;
while ((szFound = wcschr(tszFilename, (int)forbiddenCharacters[i])) != nullptr)
*szFound = ' ';
@@ -915,16 +915,16 @@ HMODULE Utils::loadSystemLibrary(const wchar_t* szFilename)
{
wchar_t sysPathName[MAX_PATH + 2];
if (0 == ::GetSystemDirectoryW(sysPathName, MAX_PATH))
- return 0;
+ return nullptr;
sysPathName[MAX_PATH - 1] = 0;
if (mir_wstrlen(sysPathName) + mir_wstrlen(szFilename) >= MAX_PATH)
- return 0;
+ return nullptr;
mir_wstrcat(sysPathName, szFilename);
HMODULE _h = LoadLibraryW(sysPathName);
- if (0 == _h)
- return 0;
+ if (nullptr == _h)
+ return nullptr;
return _h;
}
@@ -943,7 +943,7 @@ void Utils::setAvatarContact(HWND hWnd, MCONTACT hContact)
size_t Utils::CopyToClipBoard(const wchar_t *str, const HWND hwndOwner)
{
- if (!OpenClipboard(hwndOwner) || str == 0)
+ if (!OpenClipboard(hwndOwner) || str == nullptr)
return 0;
size_t i = sizeof(wchar_t) * (mir_wstrlen(str) + 1);
@@ -1025,7 +1025,7 @@ CWarning::CWarning(const wchar_t *tszTitle, const wchar_t *tszText, const UINT u
m_szText(mir_wstrdup(tszText))
{
m_uId = uId;
- m_hFontCaption = 0;
+ m_hFontCaption = nullptr;
m_dwFlags = dwFlags;
m_fIsModal = ((m_dwFlags & MB_YESNO || m_dwFlags & MB_YESNOCANCEL) ? true : false);
@@ -1040,11 +1040,11 @@ CWarning::~CWarning()
LRESULT CWarning::ShowDialog() const
{
if (!m_fIsModal) {
- ::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_WARNING), 0, stubDlgProc, LPARAM(this));
+ ::CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_WARNING), nullptr, stubDlgProc, LPARAM(this));
return 0;
}
- return ::DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_WARNING), 0, stubDlgProc, LPARAM(this));
+ return ::DialogBoxParam(g_hInst, MAKEINTRESOURCE(IDD_WARNING), nullptr, stubDlgProc, LPARAM(this));
}
__int64 CWarning::getMask()
@@ -1077,10 +1077,10 @@ void CWarning::destroyAll()
LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt)
{
- wchar_t* separator_pos = 0;
+ wchar_t* separator_pos = nullptr;
__int64 mask = 0, val = 0;
- if (0 == hWindowList)
+ if (nullptr == hWindowList)
hWindowList = WindowList_Create();
// don't open new warnings when shutdown was initiated (modal ones will otherwise
@@ -1102,12 +1102,12 @@ LRESULT CWarning::show(const int uId, DWORD dwFlags, const wchar_t* tszTxt)
// is not well-formatted.
_s = TranslateW(warnings[uId]);
- if (mir_wstrlen(_s) < 3 || 0 == wcschr(_s, '|'))
+ if (mir_wstrlen(_s) < 3 || nullptr == wcschr(_s, '|'))
_s = TranslateW(warnings[uId]);
}
}
- if ((mir_wstrlen(_s) > 3) && ((separator_pos = wcschr(_s, '|')) != 0)) {
+ if ((mir_wstrlen(_s) > 3) && ((separator_pos = wcschr(_s, '|')) != nullptr)) {
if (uId >= 0) {
mask = getMask();
val = ((__int64)1L) << uId;
@@ -1162,7 +1162,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
case WM_INITDIALOG:
{
UINT uResId = 0;
- HICON hIcon = 0;
+ HICON hIcon = nullptr;
m_hwnd = hwnd;
@@ -1204,7 +1204,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
uResId = 32514;
if (uResId)
- hIcon = reinterpret_cast<HICON>(::LoadImage(0, MAKEINTRESOURCE(uResId), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
+ hIcon = reinterpret_cast<HICON>(::LoadImage(nullptr, MAKEINTRESOURCE(uResId), IMAGE_ICON, 0, 0, LR_SHARED | LR_DEFAULTSIZE));
else
hIcon = ::Skin_LoadIcon(SKINICON_EVENT_MESSAGE, true);
@@ -1220,7 +1220,7 @@ INT_PTR CALLBACK CWarning::dlgProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
{
HWND hwndChild = reinterpret_cast<HWND>(lParam);
UINT id = ::GetDlgCtrlID(hwndChild);
- if (0 == m_hFontCaption) {
+ if (nullptr == m_hFontCaption) {
HFONT hFont = reinterpret_cast<HFONT>(::SendDlgItemMessage(hwnd, IDC_CAPTION, WM_GETFONT, 0, 0));
LOGFONT lf = { 0 };