diff options
author | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:03:31 +0100 |
---|---|---|
committer | Goraf <22941576+Goraf@users.noreply.github.com> | 2017-11-13 15:07:33 +0100 |
commit | a7c24ca48995cf2bf436156302f96b91bf135409 (patch) | |
tree | 953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/Clist_modern | |
parent | 591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff) |
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/Clist_modern')
24 files changed, 122 insertions, 122 deletions
diff --git a/plugins/Clist_modern/src/cluiframes.cpp b/plugins/Clist_modern/src/cluiframes.cpp index e4d223dc9f..f5e130c5e7 100644 --- a/plugins/Clist_modern/src/cluiframes.cpp +++ b/plugins/Clist_modern/src/cluiframes.cpp @@ -68,7 +68,7 @@ static int _iNextFrameId = 100; static HFONT _hTitleBarFont = nullptr;
// menus
-static FrameMenuHandles cont = { nullptr };
+static FrameMenuHandles cont = {};
static LIST<HGENMENU__> g_frameMenus(10);
// others
@@ -163,7 +163,7 @@ int CLUIFrames_RepaintSubContainers() {
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
- if (!F.floating && F.OwnerWindow != (HWND)0 && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide)
+ if (!F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide)
RedrawWindow(F.hWnd, nullptr, nullptr, RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_INVALIDATE | RDW_FRAME);
}
@@ -174,7 +174,7 @@ int CLUIFrames_ActivateSubContainers(BOOL active) {
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
- if (active && !F.floating && F.OwnerWindow != (HWND)0 && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
+ if (active && !F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
if (db_get_b(0, "CList", "OnDesktop", SETTING_ONDESKTOP_DEFAULT)) {
SetWindowPos(F.OwnerWindow, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
SetWindowPos(F.OwnerWindow, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
@@ -191,7 +191,7 @@ int CLUIFrames_SetParentForContainers(HWND parent) for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
- if (!F.floating && F.OwnerWindow != (HWND)0 && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
+ if (!F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2 && F.visible && !F.needhide) {
HWND hwnd = F.OwnerWindow;
SetParent(hwnd, parent);
}
@@ -204,7 +204,7 @@ int CLUIFrames_OnShowHide(int mode) int prevFrameCount;
for (int i = 0; i < g_nFramesCount; i++) {
FRAMEWND &F = g_pfwFrames[i];
- if (!F.floating && F.OwnerWindow != (HWND)0 && F.OwnerWindow != (HWND)-2) {
+ if (!F.floating && F.OwnerWindow != (HWND)nullptr && F.OwnerWindow != (HWND)-2) {
// Try to avoid crash on exit due to unlock.
HWND owner = F.OwnerWindow;
HWND Frmhwnd = F.hWnd;
@@ -289,7 +289,7 @@ int QueueAllFramesUpdating(bool queue) if (F.UpdateRgn) {
DeleteObject(F.UpdateRgn);
}
- F.UpdateRgn = 0;
+ F.UpdateRgn = nullptr;
}
}
return queue;
@@ -846,7 +846,7 @@ static HMENU CLUIFramesCreateMenuForFrame(int frameid, HGENMENU root, int popupp mi.name.a = LPGEN("&Down");
mi.pszService = CLUIFRAMESMOVEDOWN;
addFrameMenuItem(&mi, frameid, bMain);
- return 0;
+ return nullptr;
}
static int CLUIFramesModifyContextMenuForFrame(WPARAM wParam, LPARAM)
@@ -1029,7 +1029,7 @@ static int _us_DoSetFrameOptions(WPARAM wParam, LPARAM lParam) }
CLUIFramesOnClistResize((WPARAM)pcli->hwndContactList, 0);
- SetWindowPos(fw.TitleBar.hwnd, 0, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE);
+ SetWindowPos(fw.TitleBar.hwnd, nullptr, 0, 0, 0, 0, SWP_NOZORDER | SWP_NOMOVE | SWP_NOSIZE | SWP_FRAMECHANGED | SWP_NOACTIVATE);
return 0;
case FO_NAME:
@@ -1348,7 +1348,7 @@ static int _us_DoSetFrameBorder(WPARAM wParam, LPARAM lParam) GetWindowRect(hw, &rc);
CallService(MS_CLIST_FRAMES_SETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, wParam), oldflags);
- SetWindowPos(hw, 0, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_DRAWFRAME);
+ SetWindowPos(hw, nullptr, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOMOVE | SWP_NOACTIVATE | SWP_DRAWFRAME);
return 0;
}
@@ -1494,7 +1494,7 @@ static int CLUIFramesLoadMainMenu() mi.flags = CMIF_SYSTEM | CMIF_UNICODE;
mi.position = separator++;
mi.name.w = F.TitleBar.tbname ? F.TitleBar.tbname : F.name;
- mi.pszService = 0;
+ mi.pszService = nullptr;
g_frameMenus.insert(F.MenuHandles.MainMenuItem = Menu_AddMainMenuItem(&mi));
CLUIFramesCreateMenuForFrame(F.id, F.MenuHandles.MainMenuItem, separator, true);
CLUIFramesModifyMainMenuItems(F.id, 0);
@@ -1526,7 +1526,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) //char * CustomName = nullptr;
CLISTFrame *clfrm = (CLISTFrame *)wParam;
- if (pcli->hwndContactList == 0) return -1;
+ if (pcli->hwndContactList == nullptr) return -1;
if (_fCluiFramesModuleNotStarted) return -1;
if (clfrm->cbSize != sizeof(CLISTFrame)) return -1;
if (!(_hTitleBarFont)) _hTitleBarFont = CLUILoadTitleBarFont();
@@ -1544,7 +1544,7 @@ static int _us_DoAddFrame(WPARAM wParam, LPARAM) if (clfrm->Flags & F_NO_SUBCONTAINER || !g_CluiData.fLayered)
F.OwnerWindow = (HWND)-2;
else
- F.OwnerWindow = 0;
+ F.OwnerWindow = nullptr;
if (db_get_b(0, CLUIFrameModule, "RemoveAllBorders", 0) == 1)
clfrm->Flags |= F_NOBORDER;
@@ -1694,7 +1694,7 @@ static int _us_DoRemoveFrame(WPARAM wParam, LPARAM) static int CLUIFramesForceUpdateTB(const FRAMEWND *Frame)
{
- if (Frame->TitleBar.hwnd != 0)
+ if (Frame->TitleBar.hwnd != nullptr)
RedrawWindow(Frame->TitleBar.hwnd, nullptr, nullptr, RDW_ALLCHILDREN | RDW_UPDATENOW | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME);
//UpdateWindow(Frame->TitleBar.hwnd);
return 0;
@@ -1702,12 +1702,12 @@ static int CLUIFramesForceUpdateTB(const FRAMEWND *Frame) static int CLUIFramesForceUpdateFrame(const FRAMEWND *Frame)
{
- if (Frame->hWnd != 0) {
+ if (Frame->hWnd != nullptr) {
RedrawWindow(Frame->hWnd, nullptr, nullptr, RDW_UPDATENOW | RDW_FRAME | RDW_ERASE | RDW_INVALIDATE);
UpdateWindow(Frame->hWnd);
}
- if (Frame->floating && Frame->ContainerWnd != 0)
+ if (Frame->floating && Frame->ContainerWnd != nullptr)
RedrawWindow(Frame->ContainerWnd, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME);
return 0;
}
@@ -2055,7 +2055,7 @@ int CLUIFrames_ApplyNewSizes(int mode) };
}
if (IsWindowVisible(pcli->hwndContactList)) {
- ske_DrawNonFramedObjects(1, 0);
+ ske_DrawNonFramedObjects(1, nullptr);
CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, 0, 0);
}
g_CluiData.mutexPreventDockMoving = 1;
@@ -2288,8 +2288,8 @@ int CLUIFramesOnClistResize(WPARAM wParam, LPARAM lParam) tick = GetTickCount() - tick;
- if (pcli->hwndContactList != 0) cliInvalidateRect(pcli->hwndContactList, nullptr, TRUE);
- if (pcli->hwndContactList != 0) UpdateWindow(pcli->hwndContactList);
+ if (pcli->hwndContactList != nullptr) cliInvalidateRect(pcli->hwndContactList, nullptr, TRUE);
+ if (pcli->hwndContactList != nullptr) UpdateWindow(pcli->hwndContactList);
if (lParam == 2) RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
@@ -2328,7 +2328,7 @@ int OnFrameTitleBarBackgroundChange(WPARAM, LPARAM) sttBackgroundBmpUse = db_get_w(0, "FrameTitleBar", "BkBmpUse", CLCDEFAULT_BKBMPUSE);
}
- cliInvalidateRect(pcli->hwndContactList, 0, 0);
+ cliInvalidateRect(pcli->hwndContactList, nullptr, 0);
RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_UPDATENOW | RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE);
return 0;
@@ -2340,7 +2340,7 @@ void DrawBackGround(HWND hwnd, HDC mhdc, HBITMAP hBmpBackground, COLORREF bkColo RECT clRect, *rcPaint;
int yScroll = 0;
- PAINTSTRUCT paintst = { 0 };
+ PAINTSTRUCT paintst = {};
HFONT hFont = (HFONT)SendMessage(hwnd, WM_GETFONT, 0, 0);
@@ -2559,7 +2559,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam return 1;
case WM_ENABLE:
- if (hwnd != 0)
+ if (hwnd != nullptr)
cliInvalidateRect(hwnd, nullptr, FALSE);
return 0;
@@ -2615,7 +2615,7 @@ static LRESULT CALLBACK CLUIFrameTitleBarProc(HWND hwnd, UINT msg, WPARAM wParam AppendMenu(hmenu, g_pfwFrames[framepos].floating ? (MF_STRING | MF_CHECKED) : MF_STRING, frame_menu_floating, TranslateT("Floating"));
}
- TrackPopupMenu(hmenu, TPM_LEFTALIGN, pt.x, pt.y, 0, hwnd, 0);
+ TrackPopupMenu(hmenu, TPM_LEFTALIGN, pt.x, pt.y, 0, hwnd, nullptr);
DestroyMenu(hmenu);
}
break;
@@ -2927,7 +2927,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos) RECT rect;
if (!g_pfwFrames[framepos].floating) { return 0; };
- if (g_pfwFrames[framepos].ContainerWnd == 0) { return 0; };
+ if (g_pfwFrames[framepos].ContainerWnd == nullptr) { return 0; };
GetClientRect(g_pfwFrames[framepos].ContainerWnd, &rect);
int width = rect.right - rect.left;
@@ -2951,7 +2951,7 @@ static int CLUIFrameResizeFloatingFrame(int framepos) SetWindowPos(g_pfwFrames[framepos].hWnd, HWND_TOP, 0, 0, width, height, SWP_SHOWWINDOW | SWP_NOACTIVATE);
};
- if (g_pfwFrames[framepos].ContainerWnd != 0) UpdateWindow(g_pfwFrames[framepos].ContainerWnd);
+ if (g_pfwFrames[framepos].ContainerWnd != nullptr) UpdateWindow(g_pfwFrames[framepos].ContainerWnd);
GetWindowRect(g_pfwFrames[framepos].hWnd, &g_pfwFrames[framepos].wndSize);
return 0;
};
@@ -2971,7 +2971,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP if (g_bTransparentFlag) {
BYTE alpha;
if ((wParam != WA_INACTIVE || ((HWND)lParam == hwnd) || GetParent((HWND)lParam) == hwnd)) {
- HWND hw = lParam ? GetParent((HWND)lParam) : 0;
+ HWND hw = lParam ? GetParent((HWND)lParam) : nullptr;
alpha = db_get_b(0, "CList", "Alpha", SETTING_ALPHA_DEFAULT);
if (hw) SetWindowPos(hw, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE | SWP_NOACTIVATE);
CLUI_SmoothAlphaTransition(hwnd, alpha, 1);
@@ -3017,7 +3017,7 @@ static LRESULT CALLBACK CLUIFrameSubContainerProc(HWND hwnd, UINT msg, WPARAM wP static HWND CreateSubContainerWindow(HWND parent, int x, int y, int width, int height)
{
- HWND hwnd = CreateWindowEx(WS_EX_LAYERED, CLUIFrameSubContainerClassName, L"SubContainerWindow", WS_POPUP | (!g_CluiData.fLayered ? WS_BORDER : 0), x, y, width, height, parent, 0, g_hInst, 0);
+ HWND hwnd = CreateWindowEx(WS_EX_LAYERED, CLUIFrameSubContainerClassName, L"SubContainerWindow", WS_POPUP | (!g_CluiData.fLayered ? WS_BORDER : 0), x, y, width, height, parent, nullptr, g_hInst, nullptr);
SetWindowLongPtr(hwnd, GWL_STYLE, GetWindowLongPtr(hwnd, GWL_STYLE) & ~(WS_CAPTION | WS_BORDER));
if (g_CluiData.fOnDesktop) {
HWND hProgMan = FindWindow(L"Progman", nullptr);
@@ -3045,7 +3045,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP framepos = id2pos(Frameid);
if (framepos < 0 || framepos >= g_nFramesCount) { break; };
if (!g_pfwFrames[framepos].minmaxenabled) { break; };
- if (g_pfwFrames[framepos].ContainerWnd == 0) { break; };
+ if (g_pfwFrames[framepos].ContainerWnd == nullptr) { break; };
if (g_pfwFrames[framepos].Locked) {
RECT rct;
@@ -3078,7 +3078,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP framepos = id2pos(Frameid);
if (framepos < 0 || framepos >= g_nFramesCount)
break;
- if (g_pfwFrames[framepos].ContainerWnd == 0)
+ if (g_pfwFrames[framepos].ContainerWnd == nullptr)
return 0;
GetWindowRect(g_pfwFrames[framepos].ContainerWnd, &rect);
@@ -3138,7 +3138,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP framepos = id2pos(Frameid);
if (framepos < 0 || framepos >= g_nFramesCount) { break; };
- if (g_pfwFrames[framepos].ContainerWnd == 0) { return 0; };
+ if (g_pfwFrames[framepos].ContainerWnd == nullptr) { return 0; };
CLUIFrameResizeFloatingFrame(framepos);
GetWindowRect(g_pfwFrames[framepos].ContainerWnd, &rect);
@@ -3170,7 +3170,7 @@ static LRESULT CALLBACK CLUIFrameContainerWndProc(HWND hwnd, UINT msg, WPARAM wP static HWND CreateContainerWindow(HWND parent, int x, int y, int width, int height)
{
- return CreateWindow(L"FramesContainer", L"FramesContainer", WS_POPUP | WS_THICKFRAME, x, y, width, height, parent, 0, g_hInst, 0);
+ return CreateWindow(L"FramesContainer", L"FramesContainer", WS_POPUP | WS_THICKFRAME, x, y, width, height, parent, nullptr, g_hInst, nullptr);
}
static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam)
@@ -3183,7 +3183,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) if (g_pfwFrames[pos].floating || (lParam & 2)) {
if (g_pfwFrames[pos].OwnerWindow != (HWND)-2 && g_pfwFrames[pos].visible) {
- if (g_pfwFrames[pos].OwnerWindow == 0) g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
+ if (g_pfwFrames[pos].OwnerWindow == nullptr) g_pfwFrames[pos].OwnerWindow = CreateSubContainerWindow(pcli->hwndContactList, g_pfwFrames[pos].FloatingPos.x, g_pfwFrames[pos].FloatingPos.y, 10, 10);
CLUI_ShowWindowMod(g_pfwFrames[pos].OwnerWindow, (g_pfwFrames[pos].visible && g_pfwFrames[pos].collapsed && IsWindowVisible(pcli->hwndContactList)) ? SW_SHOW/*NOACTIVATE*/ : SW_HIDE);
SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].OwnerWindow);
SetParent(g_pfwFrames[pos].TitleBar.hwnd, pcli->hwndContactList);
@@ -3191,7 +3191,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) g_pfwFrames[pos].floating = FALSE;
if (!(lParam & 2)) {
DestroyWindow(g_pfwFrames[pos].ContainerWnd);
- g_pfwFrames[pos].ContainerWnd = 0;
+ g_pfwFrames[pos].ContainerWnd = nullptr;
}
}
else {
@@ -3199,7 +3199,7 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) SetParent(g_pfwFrames[pos].TitleBar.hwnd, pcli->hwndContactList);
g_pfwFrames[pos].floating = FALSE;
if (g_pfwFrames[pos].ContainerWnd) DestroyWindow(g_pfwFrames[pos].ContainerWnd);
- g_pfwFrames[pos].ContainerWnd = 0;
+ g_pfwFrames[pos].ContainerWnd = nullptr;
}
}
else {
@@ -3222,9 +3222,9 @@ static int _us_DoSetFrameFloat(WPARAM wParam, LPARAM lParam) SetParent(g_pfwFrames[pos].hWnd, g_pfwFrames[pos].ContainerWnd);
SetParent(g_pfwFrames[pos].TitleBar.hwnd, g_pfwFrames[pos].ContainerWnd);
- if (g_pfwFrames[pos].OwnerWindow != (HWND)-2 && g_pfwFrames[pos].OwnerWindow != 0) {
+ if (g_pfwFrames[pos].OwnerWindow != (HWND)-2 && g_pfwFrames[pos].OwnerWindow != nullptr) {
DestroyWindow(g_pfwFrames[pos].OwnerWindow);
- g_pfwFrames[pos].OwnerWindow = 0;
+ g_pfwFrames[pos].OwnerWindow = nullptr;
}
GetBorderSize(g_pfwFrames[pos].ContainerWnd, &border);
@@ -3368,7 +3368,7 @@ int LoadCLUIFramesModule(void) CreateCluiFramesServices();
- hWndExplorerToolBar = FindWindowEx(0, 0, L"Shell_TrayWnd", nullptr);
+ hWndExplorerToolBar = FindWindowEx(nullptr, nullptr, L"Shell_TrayWnd", nullptr);
OnFrameTitleBarBackgroundChange(0, 0);
_fCluiFramesModuleNotStarted = FALSE;
return 0;
diff --git a/plugins/Clist_modern/src/init.cpp b/plugins/Clist_modern/src/init.cpp index 381136d9d7..1143005d11 100644 --- a/plugins/Clist_modern/src/init.cpp +++ b/plugins/Clist_modern/src/init.cpp @@ -32,10 +32,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define CHECKRES(sub) if (sub != S_OK) return S_FALSE;
-HINSTANCE g_hInst = 0, g_hMirApp = 0;
+HINSTANCE g_hInst = nullptr, g_hMirApp = nullptr;
CLIST_INTERFACE *pcli = nullptr;
CLIST_INTERFACE corecli = { 0 };
-CLUIDATA g_CluiData = { 0 };
+CLUIDATA g_CluiData = {};
int hLangpack;
static HRESULT SubclassClistInterface();
diff --git a/plugins/Clist_modern/src/modern_aniavatars.cpp b/plugins/Clist_modern/src/modern_aniavatars.cpp index 8e374b19eb..1cc510b4b5 100644 --- a/plugins/Clist_modern/src/modern_aniavatars.cpp +++ b/plugins/Clist_modern/src/modern_aniavatars.cpp @@ -179,7 +179,7 @@ static void _AniAva_AnimationTreadProc(void*) Netlib_Logf(nullptr, "AnimationTreadProc thread start");
// wait forever till hExitEvent signalled
- HANDLE hThread = 0;
+ HANDLE hThread = nullptr;
s_AnimationThreadID = GetCurrentThreadId();
DuplicateHandle(GetCurrentProcess(), GetCurrentThread(), GetCurrentProcess(), &hThread, 0, FALSE, DUPLICATE_SAME_ACCESS);
s_AnimationThreadHandle = hThread;
@@ -235,7 +235,7 @@ static INT_PTR _AniAva_CreateAvatarWindowSync_Worker(WPARAM tszName, LPARAM) static HWND _AniAva_CreateAvatarWindowSync(wchar_t *szFileName)
{
- if (s_AnimationThreadHandle == 0 || s_AnimationThreadID == 0)
+ if (s_AnimationThreadHandle == nullptr || s_AnimationThreadID == 0)
return nullptr;
ANIAVA_SYNCCALLITEM item = { 0 };
diff --git a/plugins/Clist_modern/src/modern_awaymsg.cpp b/plugins/Clist_modern/src/modern_awaymsg.cpp index 7ece765d67..3bb07bcdda 100644 --- a/plugins/Clist_modern/src/modern_awaymsg.cpp +++ b/plugins/Clist_modern/src/modern_awaymsg.cpp @@ -90,7 +90,7 @@ static void amThreadProc(void *) ClcCacheEntry *pdnce = pcli->pfnGetCacheEntry(hContact);
- HANDLE ACK = 0;
+ HANDLE ACK = nullptr;
if (pdnce->ApparentMode != ID_STATUS_OFFLINE) //don't ask if contact is always invisible (should be done with protocol)
ACK = (HANDLE)ProtoChainSend(hContact, PSS_GETAWAYMSG, 0, 0);
if (!ACK) {
@@ -152,7 +152,7 @@ void amRequestAwayMsg(MCONTACT hContact) void InitAwayMsgModule()
{
hamProcessEvent = CreateEvent(nullptr, FALSE, FALSE, nullptr);
- g_hAwayMsgThread = mir_forkthread(amThreadProc, 0);
+ g_hAwayMsgThread = mir_forkthread(amThreadProc, nullptr);
}
void UninitAwayMsgModule()
diff --git a/plugins/Clist_modern/src/modern_cachefuncs.cpp b/plugins/Clist_modern/src/modern_cachefuncs.cpp index 102aed2c9b..3e785d8f18 100644 --- a/plugins/Clist_modern/src/modern_cachefuncs.cpp +++ b/plugins/Clist_modern/src/modern_cachefuncs.cpp @@ -52,7 +52,7 @@ void Cache_GetTimezone(ClcData *dat, MCONTACT hContact) if (dat && dat->hWnd == pcli->hwndContactTree) { DWORD flags = dat->contact_time_show_only_if_different ? TZF_DIFONLY : 0; - pdnce->hTimeZone = TimeZone_CreateByContact(hContact, 0, flags); + pdnce->hTimeZone = TimeZone_CreateByContact(hContact, nullptr, flags); } } diff --git a/plugins/Clist_modern/src/modern_clc.cpp b/plugins/Clist_modern/src/modern_clc.cpp index 14aa6ef3be..53e6712c9e 100644 --- a/plugins/Clist_modern/src/modern_clc.cpp +++ b/plugins/Clist_modern/src/modern_clc.cpp @@ -1198,9 +1198,9 @@ static LRESULT clcOnLButtonUp(ClcData *dat, HWND hwnd, UINT msg, WPARAM wParam, pcli->pfnGetRowByIndex(dat, dat->iDragItem, &contact, &group);
int i = pcli->pfnGetRowByIndex(dat, dat->iInsertionMark, &destcontact, &destgroup);
if (i != -1 && group->groupId != destgroup->groupId) {
- wchar_t *groupName = mir_wstrdup(Clist_GroupGetName(contact->groupId, 0));
+ wchar_t *groupName = mir_wstrdup(Clist_GroupGetName(contact->groupId, nullptr));
wchar_t *shortGroup = nullptr;
- wchar_t *sourceGrName = mir_wstrdup(Clist_GroupGetName(destgroup->groupId, 0));
+ wchar_t *sourceGrName = mir_wstrdup(Clist_GroupGetName(destgroup->groupId, nullptr));
if (groupName) {
int len = (int)mir_wstrlen(groupName);
do { len--; } while (len >= 0 && groupName[len] != '\\');
@@ -1553,7 +1553,7 @@ static int clcHookModulesLoaded(WPARAM, LPARAM) wchar_t szMyPath[MAX_PATH];
GetModuleFileName(g_hInst, szMyPath, _countof(szMyPath));
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.defaultFile.w = szMyPath;
sid.flags = SIDF_PATH_UNICODE;
diff --git a/plugins/Clist_modern/src/modern_clcidents.cpp b/plugins/Clist_modern/src/modern_clcidents.cpp index dde2266bc4..d071c407f0 100644 --- a/plugins/Clist_modern/src/modern_clcidents.cpp +++ b/plugins/Clist_modern/src/modern_clcidents.cpp @@ -87,7 +87,7 @@ ClcContact* cliFindItem(DWORD dwItem, ClcContact *cc) if (cc->subcontacts[i].hContact == dwItem)
return &cc->subcontacts[i];
- return 0;
+ return nullptr;
}
int cliGetRowByIndex(ClcData *dat, int testindex, ClcContact **contact, ClcGroup **subgroup)
diff --git a/plugins/Clist_modern/src/modern_clcpaint.cpp b/plugins/Clist_modern/src/modern_clcpaint.cpp index 1537729272..48ace78fcf 100644 --- a/plugins/Clist_modern/src/modern_clcpaint.cpp +++ b/plugins/Clist_modern/src/modern_clcpaint.cpp @@ -254,7 +254,7 @@ tPaintCallbackProc CLCPaint::PaintCallbackProc(HWND hWnd, HDC hDC, RECT *rcPaint ClcData *dat = (ClcData*)GetWindowLongPtr(hWnd, 0);
if (dat)
cliPaintClc(hWnd, dat, hDC, rcPaint);
- return 0;
+ return nullptr;
}
void CLCPaint::_FillQuickHash()
@@ -530,7 +530,7 @@ void CLCPaint::_AddParamShort(MODERNMASK *mpModernMask, DWORD dwParamIndex, DWOR MODERNMASK* CLCPaint::_GetCLCContactRowBackModernMask(ClcGroup *group, ClcContact *Drawing, int indent, int index, BOOL selected, BOOL hottrack, ClcData *dat)
{
if (Drawing == nullptr)
- return 0;
+ return nullptr;
char buf[BUF2SIZE] = { 0 };
MODERNMASK *mpModernMask = (MODERNMASK*)mir_calloc(sizeof(MODERNMASK));
@@ -1697,7 +1697,7 @@ void CLCPaint::_DrawLines(HWND hWnd, ClcData *dat, int paintMode, RECT *rcPaint, mpRequest = _GetCLCContactRowBackModernMask(group, Drawing, indent, line_num, selected, hottrack, dat);
RECT mrc = row_rc;
- if (group->parent == 0
+ if (group->parent == nullptr
&& group->scanIndex != 0
&& group->scanIndex < group->cl.getCount()
&& group->cl[group->scanIndex]->type == CLCIT_GROUP) {
diff --git a/plugins/Clist_modern/src/modern_clistevents.cpp b/plugins/Clist_modern/src/modern_clistevents.cpp index d7f95d0bfa..382590e0fd 100644 --- a/plugins/Clist_modern/src/modern_clistevents.cpp +++ b/plugins/Clist_modern/src/modern_clistevents.cpp @@ -103,7 +103,7 @@ CListEvent* cli_AddEvent(CLISTEVENT *cle) for (int j = 0; j < GetMenuItemCount(g_CluiData.hMenuNotify); j++) {
if (GetMenuItemInfo(g_CluiData.hMenuNotify, j, TRUE, &mii) != 0) {
NotifyMenuItemExData *nmi = (struct NotifyMenuItemExData *) mii.dwItemData;
- if (nmi != 0 && (HANDLE)nmi->hContact == (HANDLE)p->hContact && nmi->iIcon == p->imlIconIndex)
+ if (nmi != nullptr && (HANDLE)nmi->hContact == (HANDLE)p->hContact && nmi->iIcon == p->imlIconIndex)
return p;
}
}
@@ -322,7 +322,7 @@ static int EventArea_DrawWorker(HWND hWnd, HDC hDC) HICON hIcon = (HICON)LoadImage(g_hMirApp, MAKEINTRESOURCE(IDI_BLANK), IMAGE_ICON, 16, 16, 0);
wchar_t *ptszEvents = TranslateT("No events");
ske_DrawText(hDC, ptszEvents, (int)mir_wstrlen(ptszEvents), &rc, DT_VCENTER | DT_SINGLELINE);
- ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, 0, DI_NORMAL | DI_COMPAT);
+ ske_DrawIconEx(hDC, 4, (rc.bottom + rc.top - 16) / 2, hIcon, 16, 16, 0, nullptr, DI_NORMAL | DI_COMPAT);
DestroyIcon(hIcon);
}
diff --git a/plugins/Clist_modern/src/modern_clistmod.cpp b/plugins/Clist_modern/src/modern_clistmod.cpp index c3197d3810..4725dac959 100644 --- a/plugins/Clist_modern/src/modern_clistmod.cpp +++ b/plugins/Clist_modern/src/modern_clistmod.cpp @@ -220,7 +220,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) int wx = 0;
BYTE *ptr = nullptr;
HRGN rgn = nullptr;
- HBITMAP WindowImage = g_CluiData.fLayered ? ske_GetCurrentWindowImage() : 0;
+ HBITMAP WindowImage = g_CluiData.fLayered ? ske_GetCurrentWindowImage() : nullptr;
if (WindowImage && g_CluiData.fLayered) {
BITMAP bmp;
GetObject(WindowImage, sizeof(BITMAP), &bmp);
@@ -275,7 +275,7 @@ int GetWindowVisibleState(HWND hWnd, int iStepX, int iStepY) po = (a > 16);
}
- if (po || (!rgn && ptr == 0)) {
+ if (po || (!rgn && ptr == nullptr)) {
BOOL hWndFound = FALSE;
HWND hAuxOld = nullptr;
HWND hAux = WindowFromPoint(pt);
diff --git a/plugins/Clist_modern/src/modern_clisttray.cpp b/plugins/Clist_modern/src/modern_clisttray.cpp index 53c1edb5b4..fcb72f86dd 100644 --- a/plugins/Clist_modern/src/modern_clisttray.cpp +++ b/plugins/Clist_modern/src/modern_clisttray.cpp @@ -368,7 +368,7 @@ int cliTrayIconInit(HWND hwnd) case TRAY_ICON_MODE_CYCLE:
pcli->pfnTrayIconAdd(hwnd, nullptr, nullptr, CListTray_GetGlobalStatus(0, 0));
pcli->cycleStep = 0;
- cliTrayCycleTimerProc(0, 0, 0, 0); // force icon update
+ cliTrayCycleTimerProc(nullptr, 0, 0, 0); // force icon update
// Не сохраняем ID таймера в pcli, чтобы fnTrayIconUpdateBase не убивала его.
TimerID = CLUI_SafeSetTimer(nullptr, 0, db_get_w(0, "CList", "CycleTime", SETTING_CYCLETIME_DEFAULT) * 1000, cliTrayCycleTimerProc);
break;
diff --git a/plugins/Clist_modern/src/modern_clui.cpp b/plugins/Clist_modern/src/modern_clui.cpp index d9ea40e650..521f49d15d 100644 --- a/plugins/Clist_modern/src/modern_clui.cpp +++ b/plugins/Clist_modern/src/modern_clui.cpp @@ -58,7 +58,7 @@ BOOL CALLBACK ProcessCLUIFrameInternalMsg(HWND hwnd, UINT msg, WPARAM wParam, LP /* Global variables */
UINT g_dwMainThreadID = 0;
-HANDLE g_hAwayMsgThread = 0, g_hGetTextAsyncThread = 0, g_hSmoothAnimationThread = 0;
+HANDLE g_hAwayMsgThread = nullptr, g_hGetTextAsyncThread = nullptr, g_hSmoothAnimationThread = nullptr;
HMENU g_hMenuMain;
BOOL g_bTransparentFlag = FALSE;
@@ -157,7 +157,7 @@ void CLUI::cliOnCreateClc(void) int CLUI::OnEvent_ModulesLoaded(WPARAM, LPARAM)
{
- cliCluiProtocolStatusChanged(0, 0);
+ cliCluiProtocolStatusChanged(0, nullptr);
SleepEx(0, TRUE);
g_flag_bOnModulesLoadedCalled = TRUE;
@@ -174,7 +174,7 @@ int CLUI::OnEvent_FontReload(WPARAM wParam, LPARAM lParam) g_CluiData.dwKeyColor = db_get_dw(0, "ModernSettings", "KeyColor", (DWORD)SETTING_KEYCOLOR_DEFAULT);
- cliInvalidateRect(pcli->hwndContactList, 0, 0);
+ cliInvalidateRect(pcli->hwndContactList, nullptr, 0);
return 0;
}
@@ -580,7 +580,7 @@ void CLUI_UpdateAeroGlass() if (g_proc_DWMEnableBlurBehindWindow && (tAeroGlass != g_CluiData.fAeroGlass)) {
if (g_CluiData.hAeroGlassRgn) {
DeleteObject(g_CluiData.hAeroGlassRgn);
- g_CluiData.hAeroGlassRgn = 0;
+ g_CluiData.hAeroGlassRgn = nullptr;
}
DWM_BLURBEHIND bb = { 0 };
@@ -974,7 +974,7 @@ static bool StartTicksTimer(PROTOTICKS *pt) DestroyIcon(ic);
}
}
- CLUI_SafeSetTimer(pcli->hwndContactList, TM_STATUSBARUPDATE + pt->nIndex, nAnimatedIconStep, 0);
+ CLUI_SafeSetTimer(pcli->hwndContactList, TM_STATUSBARUPDATE + pt->nIndex, nAnimatedIconStep, nullptr);
pt->bTimerCreated = 1;
pt->nCycleStartTick = GetTickCount();
return true;
@@ -1009,7 +1009,7 @@ static BOOL CALLBACK BroadcastEnumChildProc(HWND hwndChild, LPARAM lParam) static LRESULT BroadCastMessageToChild(HWND hwnd, int message, WPARAM wParam, LPARAM lParam)
{
- MSG msg = { 0 };
+ MSG msg = {};
msg.hwnd = hwnd;
msg.lParam = lParam;
msg.wParam = wParam;
@@ -1498,7 +1498,7 @@ HANDLE RegisterIcolibIconHandle(char *szIcoID, char *szSectionName, char *szDesc wchar_t fileFull[MAX_PATH] = { 0 };
- SKINICONDESC sid = { 0 };
+ SKINICONDESC sid = {};
sid.section.a = szSectionName;
sid.pszName = szIcoID;
sid.flags |= SIDF_PATH_UNICODE;
@@ -1805,7 +1805,7 @@ LRESULT CLUI::OnPaint(UINT msg, WPARAM wParam, LPARAM lParam) if (!g_CluiData.fLayered && IsWindowVisible(m_hWnd)) {
RECT w = { 0 };
RECT w2 = { 0 };
- PAINTSTRUCT ps = { 0 };
+ PAINTSTRUCT ps = {};
GetClientRect(m_hWnd, &w);
if (!(w.right > 0 && w.bottom > 0))
@@ -1841,7 +1841,7 @@ LRESULT CLUI::OnPaint(UINT msg, WPARAM wParam, LPARAM lParam) else {
RECT w = { 0 };
RECT w2 = { 0 };
- PAINTSTRUCT ps = { 0 };
+ PAINTSTRUCT ps = {};
GetWindowRect(m_hWnd, &w);
OffsetRect(&w, -w.left, -w.top);
BeginPaint(m_hWnd, &ps);
@@ -1862,7 +1862,7 @@ LRESULT CLUI::OnCreate(UINT, WPARAM, LPARAM) {
TranslateMenu(GetMenu(m_hWnd));
DrawMenuBar(m_hWnd);
- cliCluiProtocolStatusChanged(0, 0);
+ cliCluiProtocolStatusChanged(0, nullptr);
MENUITEMINFO mii = { 0 };
mii.cbSize = sizeof(mii);
@@ -2270,7 +2270,7 @@ LRESULT CLUI::OnListSizeChangeNotify(NMCLISTCONTROL * pnmc) rcWindow = rcSizingRect;
else
GetWindowRect(m_hWnd, &rcWindow);
- if (!g_CluiData.fAutoSize || pcli->hwndContactTree == 0 || Clist_IsDocked())
+ if (!g_CluiData.fAutoSize || pcli->hwndContactTree == nullptr || Clist_IsDocked())
return FALSE;
maxHeight = db_get_b(0, "CLUI", "MaxSizeHeight", SETTING_MAXSIZEHEIGHT_DEFAULT);
@@ -2325,7 +2325,7 @@ LRESULT CLUI::OnListSizeChangeNotify(NMCLISTCONTROL * pnmc) }
else bNeedFixSizingRect = 0;
- SetWindowPos(m_hWnd, 0, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(m_hWnd, nullptr, rcWindow.left, rcWindow.top, rcWindow.right - rcWindow.left, rcWindow.bottom - rcWindow.top, SWP_NOZORDER | SWP_NOACTIVATE);
nRequiredHeight = 0;
diff --git a/plugins/Clist_modern/src/modern_docking.cpp b/plugins/Clist_modern/src/modern_docking.cpp index df8ef4b4a4..2661747e72 100644 --- a/plugins/Clist_modern/src/modern_docking.cpp +++ b/plugins/Clist_modern/src/modern_docking.cpp @@ -213,7 +213,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) Docking_AdjustPosition(msg->hwnd, &rcMonitor, &rcWindow);
*((LRESULT*)lParam) = TRUE;
g_CluiData.mutexPreventDockMoving = 0;
- SetWindowPos(msg->hwnd, 0, rcWindow.left, rcWindow.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOSENDCHANGING);
+ SetWindowPos(msg->hwnd, nullptr, rcWindow.left, rcWindow.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOREDRAW | SWP_NOSENDCHANGING);
Sync(CLUIFrames_OnMoving, msg->hwnd, &rcWindow);
ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);// -= -= -=
g_CluiData.mutexPreventDockMoving = 1;
@@ -293,7 +293,7 @@ int Docking_ProcessWindowMessage(WPARAM wParam, LPARAM lParam) g_CluiData.fDocked = 0;
GetCursorPos(&pt);
PostMessage(msg->hwnd, WM_NCLBUTTONDOWN, HTCAPTION, MAKELPARAM(pt.x, pt.y));
- SetWindowPos(msg->hwnd, 0, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, db_get_dw(0, "CList", "Width", 0), db_get_dw(0, "CList", "Height", 0), SWP_NOZORDER);
+ SetWindowPos(msg->hwnd, nullptr, pt.x - rc.right / 2, pt.y - GetSystemMetrics(SM_CYFRAME) - GetSystemMetrics(SM_CYSMCAPTION) / 2, db_get_dw(0, "CList", "Width", 0), db_get_dw(0, "CList", "Height", 0), SWP_NOZORDER);
db_set_b(0, "CList", "Docked", (BYTE)g_CluiData.fDocked);
// ModernSkinButton_ReposButtons(msg->hwnd, SBRF_DO_NOT_DRAW, nullptr);
}
diff --git a/plugins/Clist_modern/src/modern_global.cpp b/plugins/Clist_modern/src/modern_global.cpp index 073f4e948b..43bc2ff63f 100644 --- a/plugins/Clist_modern/src/modern_global.cpp +++ b/plugins/Clist_modern/src/modern_global.cpp @@ -31,4 +31,4 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. //ClcProtoStatus *clcProto = nullptr;
HIMAGELIST g_himlCListClc = nullptr;
HICON g_hListeningToIcon = nullptr;
-char* g_szMetaModuleName = 0;
+char* g_szMetaModuleName = nullptr;
diff --git a/plugins/Clist_modern/src/modern_newrowopts.cpp b/plugins/Clist_modern/src/modern_newrowopts.cpp index 191619fe4a..6d0d574b6f 100644 --- a/plugins/Clist_modern/src/modern_newrowopts.cpp +++ b/plugins/Clist_modern/src/modern_newrowopts.cpp @@ -167,7 +167,7 @@ BOOL CALLBACK DlgProcItemNewRowOpts(HWND hwndDlg, UINT msg, WPARAM, LPARAM lPara res3->pData = i++;
TRACE("*********** Nodes DUMP 1 ***********\n");
TraceTreeLevel(RootNode);
- if (RemoveNode(res1)) res1 = 0;
+ if (RemoveNode(res1)) res1 = nullptr;
TRACE("*********** Nodes DUMP 2 ***********\n");
TraceTreeLevel(RootNode);
//CheckDlgButton(hwndDlg, IDC_HIDE_ICON_ON_AVATAR, db_get_b(0,"CList","IconHideOnAvatar",SETTING_HIDEICONONAVATAR_DEFAULT) == 1 ? BST_CHECKED : BST_UNCHECKED );
diff --git a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp index e69b80025a..3cecdbbdf5 100644 --- a/plugins/Clist_modern/src/modern_rowheight_funcs.cpp +++ b/plugins/Clist_modern/src/modern_rowheight_funcs.cpp @@ -27,7 +27,7 @@ Created by Pescuma, modified by Artem Shpynov #include "stdafx.h"
#include "modern_clcpaint.h"
-ROWCELL *gl_RowTabAccess[TC_ELEMENTSCOUNT + 1] = { 0 }; // Массив, через который осуществляется доступ к элементам контакта.
+ROWCELL *gl_RowTabAccess[TC_ELEMENTSCOUNT + 1] = {}; // Массив, через который осуществляется доступ к элементам контакта.
ROWCELL *gl_RowRoot;
void FreeRowCell()
diff --git a/plugins/Clist_modern/src/modern_skinbutton.cpp b/plugins/Clist_modern/src/modern_skinbutton.cpp index 31c8dcfa01..b957d3f89b 100644 --- a/plugins/Clist_modern/src/modern_skinbutton.cpp +++ b/plugins/Clist_modern/src/modern_skinbutton.cpp @@ -75,7 +75,7 @@ int ModernSkinButtonLoadModule() wc.lpfnWndProc = ModernSkinButtonWndProc; wc.hCursor = LoadCursor(nullptr, IDC_ARROW); wc.cbWndExtra = sizeof(ModernSkinButtonCtrl*); - wc.hbrBackground = 0; + wc.hbrBackground = nullptr; wc.style = CS_GLOBALCLASS; RegisterClassEx(&wc); ModernSkinButtonModuleIsLoaded = TRUE; @@ -107,7 +107,7 @@ static int ModernSkinButtonPaintWorker(HWND hwnd, HDC whdc) if (!g_CluiData.fLayered) ske_BltBackImage(bct->hwnd, hdc, nullptr); { - MODERNMASK Request = { 0 }; + MODERNMASK Request = {}; // int res; //HBRUSH br = CreateSolidBrush(RGB(255,255,255)); char * Value = nullptr; @@ -322,12 +322,12 @@ static int _CallServiceStrParams(IN char * toParce, OUT int *Return) static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { - ModernSkinButtonCtrl* bct = (msg != WM_NCCREATE) ? (ModernSkinButtonCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA) : 0; + ModernSkinButtonCtrl* bct = (msg != WM_NCCREATE) ? (ModernSkinButtonCtrl *)GetWindowLongPtr(hwndDlg, GWLP_USERDATA) : nullptr; if (bct) { if (bct->HandleService && IsBadStringPtrA(bct->HandleService, 255)) bct->HandleService = nullptr; else if (bct->HandleService && ServiceExists(bct->HandleService)) { - HandleServiceParams MSG = { 0 }; + HandleServiceParams MSG = {}; MSG.hwnd = hwndDlg; MSG.msg = msg; MSG.wParam = wParam; @@ -389,7 +389,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w case WM_PAINT: if (IsWindowVisible(hwndDlg) && !g_CluiData.fLayered) { - PAINTSTRUCT ps = { 0 }; + PAINTSTRUCT ps = {}; BeginPaint(hwndDlg, &ps); ModernSkinButtonPaintWorker(hwndDlg, (HDC)ps.hdc); EndPaint(hwndDlg, &ps); @@ -400,7 +400,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w if (bct) { bct->hover = 0; bct->down = 0; - ModernSkinButtonPaintWorker(bct->hwnd, 0); + ModernSkinButtonPaintWorker(bct->hwnd, nullptr); } break; @@ -409,7 +409,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w if (!bct->hover) { SetCapture(bct->hwnd); bct->hover = 1; - ModernSkinButtonPaintWorker(bct->hwnd, 0); + ModernSkinButtonPaintWorker(bct->hwnd, nullptr); } else { POINT t = UNPACK_POINT(lParam); @@ -424,7 +424,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w if (bct) { bct->down = 1; SetForegroundWindow(GetParent(bct->hwnd)); - ModernSkinButtonPaintWorker(bct->hwnd, 0); + ModernSkinButtonPaintWorker(bct->hwnd, nullptr); if (bct->CommandService && IsBadStringPtrA(bct->CommandService, 255)) bct->CommandService = nullptr; if (bct->fCallOnPress) { @@ -434,7 +434,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w } bct->down = 0; - ModernSkinButtonPaintWorker(bct->hwnd, 0); + ModernSkinButtonPaintWorker(bct->hwnd, nullptr); } } return 0; @@ -444,7 +444,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w ReleaseCapture(); bct->hover = 0; bct->down = 0; - ModernSkinButtonPaintWorker(bct->hwnd, 0); + ModernSkinButtonPaintWorker(bct->hwnd, nullptr); if (bct->CommandService && IsBadStringPtrA(bct->CommandService, 255)) bct->CommandService = nullptr; if (bct->CommandService) @@ -460,7 +460,7 @@ static LRESULT CALLBACK ModernSkinButtonWndProc(HWND hwndDlg, UINT msg, WPARAM w HWND SetToolTip(HWND hwnd, wchar_t * tip) { TOOLINFO ti; - if (!tip) return 0; + if (!tip) return nullptr; mir_cslock lck(csTips); if (!hwndToolTips) { hwndToolTips = CreateWindowEx(0, TOOLTIPS_CLASS, nullptr, @@ -625,7 +625,7 @@ int ModernSkinButtonRedrawAll() for (DWORD i = 0; i < ButtonsCount; i++) { if (pcli->hwndContactList && Buttons[i].hwnd == nullptr) Buttons[i].hwnd = ModernSkinButtonCreateWindow(Buttons[i].bct, pcli->hwndContactList); - ModernSkinButtonPaintWorker(Buttons[i].hwnd, 0); + ModernSkinButtonPaintWorker(Buttons[i].hwnd, nullptr); } g_mutex_bLockUpdating--; return 0; diff --git a/plugins/Clist_modern/src/modern_skinengine.cpp b/plugins/Clist_modern/src/modern_skinengine.cpp index 109bd8abf7..eaf30819f7 100644 --- a/plugins/Clist_modern/src/modern_skinengine.cpp +++ b/plugins/Clist_modern/src/modern_skinengine.cpp @@ -985,7 +985,7 @@ static int ske_DrawSkinObject(SKINDRAWREQUEST * preq, GLYPHOBJECT * pobj) HDC memdc = nullptr, glyphdc = nullptr; int k = 0; //BITMAP bmp = {0}; - HBITMAP membmp = 0, oldbmp = 0, oldglyph = 0; + HBITMAP membmp = nullptr, oldbmp = nullptr, oldglyph = nullptr; BYTE Is32Bit = 0; RECT PRect; POINT mode2offset = { 0 }; @@ -2467,7 +2467,7 @@ BOOL ske_DrawText(HDC hdc, LPCTSTR lpString, int nCount, RECT *lpRect, UINT form HICON ske_ImageList_GetIcon(HIMAGELIST himl, int i) { - IMAGEINFO imi = { 0 }; + IMAGEINFO imi = {}; BITMAP bm = { 0 }; if (i != -1) { ImageList_GetImageInfo(himl, i, &imi); @@ -2712,7 +2712,7 @@ int ske_PrepareImageButDontUpdateIt(RECT *r) int ske_RedrawCompleteWindow() { if (g_CluiData.fLayered) { - ske_DrawNonFramedObjects(TRUE, 0); + ske_DrawNonFramedObjects(TRUE, nullptr); CallService(MS_SKINENG_INVALIDATEFRAMEIMAGE, 0, 0); } else RedrawWindow(pcli->hwndContactList, nullptr, nullptr, RDW_ALLCHILDREN | RDW_ERASE | RDW_INVALIDATE | RDW_FRAME); @@ -2755,7 +2755,7 @@ static INT_PTR ske_Service_UpdateFrameImage(WPARAM wParam, LPARAM) // else { if (frm->UpdateRgn) { DeleteObject(frm->UpdateRgn); - frm->UpdateRgn = 0; + frm->UpdateRgn = nullptr; } ske_ValidateSingleFrameImage(frm, 0); ske_UpdateWindowImage(); @@ -2810,7 +2810,7 @@ static INT_PTR ske_Service_InvalidateFrameImage(WPARAM wParam, LPARAM lParam) if (!frm->UpdateRgn) { frm->UpdateRgn = CreateRectRgn(0, 0, 1, 1); - CombineRgn(frm->UpdateRgn, r2, 0, RGN_COPY); + CombineRgn(frm->UpdateRgn, r2, nullptr, RGN_COPY); } else CombineRgn(frm->UpdateRgn, frm->UpdateRgn, r2, RGN_OR); DeleteObject(r2); @@ -2919,7 +2919,7 @@ static int ske_ValidateSingleFrameImage(FRAMEWND * Frame, BOOL SkipBkgBlitting) DeleteObject(rgnUpdate); } DeleteObject(Frame->UpdateRgn); - Frame->UpdateRgn = 0; + Frame->UpdateRgn = nullptr; if (!IsRectEmpty(&ru)) { x1 = ru.left; @@ -3060,7 +3060,7 @@ int ske_DrawNonFramedObjects(BOOL Erase, RECT *r) RECT w, wnd; if (r) w = *r; else CLUI_SizingGetWindowRect(pcli->hwndContactList, &w); - if (!g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE, 0); + if (!g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE, nullptr); if (g_pCachedWindow == nullptr) return ske_ValidateFrameImageProc(&w); @@ -3173,7 +3173,7 @@ int ske_UpdateWindowImage() GetWindowRect(pcli->hwndContactList, &r); return ske_UpdateWindowImageRect(&r); } - else ske_ReCreateBackImage(FALSE, 0); + else ske_ReCreateBackImage(FALSE, nullptr); ske_ApplyTranslucency(); return 0; } @@ -3184,7 +3184,7 @@ int ske_UpdateWindowImageRect(RECT *r) // Up //else Update using current alpha RECT wnd = *r; - if (!g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE, 0); + if (!g_CluiData.fLayered) return ske_ReCreateBackImage(FALSE, nullptr); if (g_pCachedWindow == nullptr) return ske_ValidateFrameImageProc(&wnd); if (g_pCachedWindow->Width != wnd.right - wnd.left || g_pCachedWindow->Height != wnd.bottom - wnd.top) return ske_ValidateFrameImageProc(&wnd); if (g_flag_bFullRepaint) { diff --git a/plugins/Clist_modern/src/modern_skinopt.cpp b/plugins/Clist_modern/src/modern_skinopt.cpp index 58b137f97e..386b268fa1 100644 --- a/plugins/Clist_modern/src/modern_skinopt.cpp +++ b/plugins/Clist_modern/src/modern_skinopt.cpp @@ -90,7 +90,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case IDC_BUTTON_INFO: { HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1)); - if (hti == 0) + if (hti == nullptr) return 0; TVITEM tvi = { 0 }; @@ -126,7 +126,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara case IDC_BUTTON_APPLY_SKIN: if (HIWORD(wParam) == BN_CLICKED) { HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1)); - if (hti == 0) + if (hti == nullptr) return 0; TVITEM tvi = { 0 }; @@ -255,7 +255,7 @@ INT_PTR CALLBACK DlgSkinOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lPara InvalidateRect(GetDlgItem(hwndDlg, IDC_PREVIEW), nullptr, TRUE); else { // prepare text HTREEITEM hti = TreeView_GetSelection(GetDlgItem(hwndDlg, IDC_TREE1)); - if (hti == 0) + if (hti == nullptr) return 0; TVITEM tvi = { 0 }; @@ -380,7 +380,7 @@ HTREEITEM AddSkinToList(HWND hwndDlg, wchar_t *path, wchar_t *file) wchar_t fullName[MAX_PATH], defskinname[MAX_PATH]; SkinListData *sd = (SkinListData*)mir_alloc(sizeof(SkinListData)); if (!sd) - return 0; + return nullptr; if (!file || wcschr(file, '%')) { mir_snwprintf(sd->File, L"%%Default Skin%%"); @@ -435,9 +435,9 @@ HTREEITEM AddItemToTree(HWND hTree, wchar_t *itemName, void *data) { HTREEITEM cItem = nullptr; // Insert item node - cItem = FindChild(hTree, 0, itemName, data); + cItem = FindChild(hTree, nullptr, itemName, data); if (!cItem) { - TVINSERTSTRUCT tvis = { 0 }; + TVINSERTSTRUCT tvis = {}; tvis.hInsertAfter = TVI_SORT; tvis.item.mask = TVIF_PARAM | TVIF_TEXT | TVIF_PARAM; tvis.item.pszText = itemName; diff --git a/plugins/Clist_modern/src/modern_skinselector.cpp b/plugins/Clist_modern/src/modern_skinselector.cpp index 01b73ea92d..214faf17b9 100644 --- a/plugins/Clist_modern/src/modern_skinselector.cpp +++ b/plugins/Clist_modern/src/modern_skinselector.cpp @@ -313,7 +313,7 @@ static BOOL CompareModernMask(MODERNMASK *mmValue, MODERNMASK *mmTemplate) BOOL CompareStrWithModernMask(char *szValue, MODERNMASK *mmTemplate)
{
- MODERNMASK mmValue = { 0 };
+ MODERNMASK mmValue = {};
if (!ParseToModernMask(&mmValue, szValue)) {
BOOL res = CompareModernMask(&mmValue, mmTemplate);
SkinSelector_DeleteMask(&mmValue);
@@ -328,7 +328,7 @@ int AddStrModernMaskToList(DWORD maskID, char *szStr, char *objectName, LISTMODE if (!szStr || !mmTemplateList)
return -1;
- MODERNMASK mm = { 0 };
+ MODERNMASK mm = {};
if (ParseToModernMask(&mm, szStr))
return -1;
@@ -356,7 +356,7 @@ SKINOBJECTDESCRIPTOR* skin_FindObjectByRequest(char *szValue, LISTMODERNMASK *mm if (!mmTemplateList)
return nullptr;
- MODERNMASK mm = { 0 };
+ MODERNMASK mm = {};
ParseToModernMask(&mm, szValue);
SKINOBJECTDESCRIPTOR *res = skin_FindObjectByMask(&mm, mmTemplateList);
SkinSelector_DeleteMask(&mm);
diff --git a/plugins/Clist_modern/src/modern_statusbar.cpp b/plugins/Clist_modern/src/modern_statusbar.cpp index ee88bafa9a..8308345840 100644 --- a/plugins/Clist_modern/src/modern_statusbar.cpp +++ b/plugins/Clist_modern/src/modern_statusbar.cpp @@ -689,7 +689,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa rc = ProtosData[i].protoRect;
if (PtInRect(&rc, pt)) {
NotifyEventHooks(g_CluiData.hEventStatusBarShowToolTip, (WPARAM)ProtosData[i].szAccountName, 0);
- CLUI_SafeSetTimer(hwnd, TM_STATUSBARHIDE, db_get_w(0, "CLUIFrames", "HideToolTipTime", SETTING_HIDETOOLTIPTIME_DEFAULT), 0);
+ CLUI_SafeSetTimer(hwnd, TM_STATUSBARHIDE, db_get_w(0, "CLUIFrames", "HideToolTipTime", SETTING_HIDETOOLTIPTIME_DEFAULT), nullptr);
tooltipshoing = TRUE;
ClientToScreen(hwnd, &pt);
ptToolTipShow = pt;
@@ -733,7 +733,7 @@ LRESULT CALLBACK ModernStatusProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPa ReleaseCapture();
}
KillTimer(hwnd, TM_STATUSBAR);
- CLUI_SafeSetTimer(hwnd, TM_STATUSBAR, db_get_w(0, "CLC", "InfoTipHoverTime", CLCDEFAULT_INFOTIPTIME), 0);
+ CLUI_SafeSetTimer(hwnd, TM_STATUSBAR, db_get_w(0, "CLC", "InfoTipHoverTime", CLCDEFAULT_INFOTIPTIME), nullptr);
}
return CLUI_TestCursorOnBorders();
@@ -893,7 +893,7 @@ HWND StatusBar_Create(HWND parent) CallService(MS_SKINENG_REGISTERPAINTSUB, (WPARAM)Frame.hWnd, (LPARAM)NewStatusPaintCallbackProc); //$$$$$ register sub for frame
LoadStatusBarData();
- cliCluiProtocolStatusChanged(0, 0);
+ cliCluiProtocolStatusChanged(0, nullptr);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, -1, 0);
return hModernStatusBar;
}
diff --git a/plugins/Clist_modern/src/modern_statusbar_options.cpp b/plugins/Clist_modern/src/modern_statusbar_options.cpp index 76c8b73eb8..43c942c6af 100644 --- a/plugins/Clist_modern/src/modern_statusbar_options.cpp +++ b/plugins/Clist_modern/src/modern_statusbar_options.cpp @@ -38,7 +38,7 @@ typedef struct _StatusBarProtocolOptions int PaddingRight;
} StatusBarProtocolOptions;
-static StatusBarProtocolOptions _GlobalOptions = { 0 };
+static StatusBarProtocolOptions _GlobalOptions = {};
static void UpdateXStatusIconOptions(HWND hwndDlg, StatusBarProtocolOptions &dat)
{
@@ -442,7 +442,7 @@ INT_PTR CALLBACK DlgProcSBarOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM l db_set_b(0, "CLUI", "ShowSBar", (BYTE)IsDlgButtonChecked(hwndDlg, IDC_SHOWSBAR));
LoadStatusBarData();
- cliCluiProtocolStatusChanged(0, 0);
+ cliCluiProtocolStatusChanged(0, nullptr);
return TRUE;
}
break;
diff --git a/plugins/Clist_modern/src/modern_toolbar.cpp b/plugins/Clist_modern/src/modern_toolbar.cpp index 6cc33a1ecd..35457afc55 100644 --- a/plugins/Clist_modern/src/modern_toolbar.cpp +++ b/plugins/Clist_modern/src/modern_toolbar.cpp @@ -58,7 +58,7 @@ static void SetButtonPressed(int i, int state) void Modern_InitButtons()
{
for (int i = 0; i < _countof(BTNS); i++) {
- TTBButton tbb = { 0 };
+ TTBButton tbb = {};
if (BTNS[i].pszButtonID) {
tbb.name = LPGEN(BTNS[i].pszButtonName);
diff --git a/plugins/Clist_modern/src/modern_viewmodebar.cpp b/plugins/Clist_modern/src/modern_viewmodebar.cpp index 7252400df4..aed452623f 100644 --- a/plugins/Clist_modern/src/modern_viewmodebar.cpp +++ b/plugins/Clist_modern/src/modern_viewmodebar.cpp @@ -34,13 +34,13 @@ $Id: viewmodes.c 2998 2006-06-01 07:11:52Z nightwish2004 $ #define TIMERID_VIEWMODEEXPIRE 100
typedef int(__cdecl *pfnEnumCallback)(char *szName);
-static HWND clvmHwnd = 0;
+static HWND clvmHwnd = nullptr;
static int clvm_curItem = 0;
-HMENU hViewModeMenu = 0;
+HMENU hViewModeMenu = nullptr;
-static HWND hwndSelector = 0;
-static HIMAGELIST himlViewModes = 0;
-static HANDLE hInfoItem = 0;
+static HWND hwndSelector = nullptr;
+static HIMAGELIST himlViewModes = nullptr;
+static HANDLE hInfoItem = nullptr;
static int nullImage;
static DWORD stickyStatusMask = 0;
static char g_szModename[2048];
@@ -676,7 +676,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETEXTRACOLUMNS, ID_STATUS_OUTTOLUNCH - ID_STATUS_OFFLINE, 0);
CLCINFOITEM cii = { sizeof(cii) };
- cii.hParentGroup = 0;
+ cii.hParentGroup = nullptr;
cii.pszText = TranslateT("*** All contacts ***");
hInfoItem = (HANDLE)SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_ADDINFOITEM, 0, (LPARAM)&cii);
SendDlgItemMessage(hwndDlg, IDC_CLIST, CLM_SETHIDEEMPTYGROUPS, 1, 0);
@@ -745,7 +745,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP break;
case IDC_DELETEVIEWMODE:
- if (MessageBox(0, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
+ if (MessageBox(nullptr, TranslateT("Really delete this view mode? This cannot be undone"), TranslateT("Delete a view mode"), MB_YESNO | MB_ICONQUESTION) == IDYES) {
int iLen = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETTEXTLEN, SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_GETCURSEL, 0, 0), 0);
if (iLen) {
wchar_t *szTempBuf = (wchar_t*)_alloca((iLen + 1)*sizeof(wchar_t));
@@ -773,7 +773,7 @@ INT_PTR CALLBACK DlgProcViewModesSetup(HWND hwndDlg, UINT msg, WPARAM wParam, LP T2Utf szUTF8Buf(szBuf);
if (db_get_dw(0, CLVM_MODULE, szUTF8Buf, -1) != -1)
- MessageBox(0, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK);
+ MessageBox(nullptr, TranslateT("A view mode with this name does already exist"), TranslateT("Duplicate name"), MB_OK);
else {
int iNewItem = SendDlgItemMessage(hwndDlg, IDC_VIEWMODES, LB_INSERTSTRING, -1, (LPARAM)szBuf);
if (iNewItem != LB_ERR) {
@@ -957,11 +957,11 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM RECT rcCLVMFrame;
HDWP PosBatch = BeginDeferWindowPos(3);
GetClientRect(hwnd, &rcCLVMFrame);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), 0,
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_RESETMODES), nullptr,
rcCLVMFrame.right - 23, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), 0,
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_CONFIGUREMODES), nullptr,
rcCLVMFrame.right - 45, 1, 22, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
- PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), 0,
+ PosBatch = DeferWindowPos(PosBatch, GetDlgItem(hwnd, IDC_SELECTMODE), nullptr,
1, 1, rcCLVMFrame.right - 46, 18, SWP_NOZORDER | SWP_NOACTIVATE | SWP_NOREDRAW | SWP_NOCOPYBITS);
EndDeferWindowPos(PosBatch);
}
@@ -1102,7 +1102,7 @@ LRESULT CALLBACK ViewModeFrameWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_CONFIGUREMODES:
clvm_config_command :
if (!g_ViewModeOptDlg)
- CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), 0, DlgProcViewModesSetup, 0);
+ CreateDialogParam(g_hInst, MAKEINTRESOURCE(IDD_OPT_VIEWMODES), nullptr, DlgProcViewModesSetup, 0);
break;
}
@@ -1187,7 +1187,7 @@ void CreateViewModeFrame() wndclass.hInstance = g_hInst;
wndclass.hCursor = LoadCursor(nullptr, IDC_ARROW);
wndclass.hbrBackground = (HBRUSH)GetSysColorBrush(COLOR_3DFACE);
- wndclass.lpszMenuName = 0;
+ wndclass.lpszMenuName = nullptr;
wndclass.lpszClassName = L"CLVMFrameWindow";
RegisterClass(&wndclass);
@@ -1199,7 +1199,7 @@ void CreateViewModeFrame() frame.TBtname = TranslateT("View modes");
frame.Flags = F_VISIBLE | F_SHOWTBTIP | F_NOBORDER | F_NO_SUBCONTAINER | F_UNICODE;
frame.align = alBottom;
- frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", _A2W(CLVM_MODULE), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)0, g_hInst, nullptr);
+ frame.hWnd = CreateWindowEx(0, L"CLVMFrameWindow", _A2W(CLVM_MODULE), WS_VISIBLE | WS_CHILD | WS_TABSTOP | WS_CLIPCHILDREN, 0, 0, 20, 20, pcli->hwndContactList, (HMENU)nullptr, g_hInst, nullptr);
g_hwndViewModeFrame = frame.hWnd;
hCLVMFrame = (HWND)CallService(MS_CLIST_FRAMES_ADDFRAME, (WPARAM)&frame, 0);
CallService(MS_CLIST_FRAMES_UPDATEFRAME, (WPARAM)hCLVMFrame, FU_FMPOS);
|