summaryrefslogtreecommitdiff
path: root/plugins/AutoShutdown/src/frame.cpp
diff options
context:
space:
mode:
authorGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:03:31 +0100
committerGoraf <22941576+Goraf@users.noreply.github.com>2017-11-13 15:07:33 +0100
commita7c24ca48995cf2bf436156302f96b91bf135409 (patch)
tree953835509ff1b778833e78fd7b74b05e05e77c84 /plugins/AutoShutdown/src/frame.cpp
parent591ec17b1c99db7f120c22ca9fb20ae05fe78325 (diff)
Code modernize ...
* replace 0/NULL with nullptr [using clang-tidy]
Diffstat (limited to 'plugins/AutoShutdown/src/frame.cpp')
-rw-r--r--plugins/AutoShutdown/src/frame.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/plugins/AutoShutdown/src/frame.cpp b/plugins/AutoShutdown/src/frame.cpp
index a450355f22..5908be544f 100644
--- a/plugins/AutoShutdown/src/frame.cpp
+++ b/plugins/AutoShutdown/src/frame.cpp
@@ -56,7 +56,7 @@ static LOGFONT* GetDefaultFont(LOGFONT *lf)
*lf = ncm.lfStatusFont;
return lf;
}
- return (LOGFONT*)NULL;
+ return nullptr;
}
static LRESULT CALLBACK ProgressBarSubclassProc(HWND hwndProgress, UINT msg, WPARAM wParam, LPARAM lParam)
@@ -116,7 +116,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
case WM_NCCREATE: /* init window data */
dat = (struct CountdownFrameWndData*)mir_calloc(sizeof(*dat));
SetWindowLongPtr(hwndFrame, GWLP_USERDATA, (LONG_PTR)dat);
- if (dat == NULL) return FALSE; /* creation failed */
+ if (dat == nullptr) return FALSE; /* creation failed */
dat->fTimeFlags = *(WORD*)((CREATESTRUCT*)lParam)->lpCreateParams;
dat->flags = FWPDF_COUNTDOWNINVALID;
break;
@@ -124,26 +124,26 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
case WM_CREATE: /* create childs */
{
CREATESTRUCT *params = (CREATESTRUCT*)lParam;
- dat->hwndIcon = CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", NULL, WS_CHILD | WS_VISIBLE | SS_ICON | SS_CENTERIMAGE | SS_NOTIFY,
- 3, 0, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), hwndFrame, NULL, params->hInstance, NULL);
+ dat->hwndIcon = CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", nullptr, WS_CHILD | WS_VISIBLE | SS_ICON | SS_CENTERIMAGE | SS_NOTIFY,
+ 3, 0, GetSystemMetrics(SM_CXICON), GetSystemMetrics(SM_CYICON), hwndFrame, nullptr, params->hInstance, nullptr);
dat->hwndProgress = CreateWindowEx(WS_EX_NOPARENTNOTIFY, PROGRESS_CLASS, (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"),
- WS_CHILD | WS_VISIBLE | PBS_SMOOTH, GetSystemMetrics(SM_CXICON) + 5, 5, 90, (GetSystemMetrics(SM_CXICON) / 2) - 5, hwndFrame, NULL, params->hInstance, NULL);
- if (dat->hwndProgress == NULL) return -1; /* creation failed, calls WM_DESTROY */
+ WS_CHILD | WS_VISIBLE | PBS_SMOOTH, GetSystemMetrics(SM_CXICON) + 5, 5, 90, (GetSystemMetrics(SM_CXICON) / 2) - 5, hwndFrame, nullptr, params->hInstance, nullptr);
+ if (dat->hwndProgress == nullptr) return -1; /* creation failed, calls WM_DESTROY */
SendMessage(dat->hwndProgress, PBM_SETSTEP, 1, 0);
mir_subclassWindow(dat->hwndProgress, ProgressBarSubclassProc);
dat->hwndDesc = CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", (dat->fTimeFlags&SDWTF_ST_TIME) ? TranslateT("Shutdown at:") : TranslateT("Time left:"),
WS_CHILD | WS_VISIBLE | SS_LEFTNOWORDWRAP | SS_NOTIFY, GetSystemMetrics(SM_CXICON) + 5, (GetSystemMetrics(SM_CXICON) / 2), 75,
- (GetSystemMetrics(SM_CXICON) / 2), hwndFrame, NULL, params->hInstance, NULL);
- dat->hwndTime = CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", NULL, WS_CHILD | WS_VISIBLE | SS_RIGHT | SS_NOTIFY | SS_ENDELLIPSIS,
- (GetSystemMetrics(SM_CXICON) + 80), (GetSystemMetrics(SM_CXICON) / 2), 35, (GetSystemMetrics(SM_CXICON) / 2), hwndFrame, NULL, params->hInstance, NULL);
- if (dat->hwndTime == NULL)
+ (GetSystemMetrics(SM_CXICON) / 2), hwndFrame, nullptr, params->hInstance, nullptr);
+ dat->hwndTime = CreateWindowEx(WS_EX_NOPARENTNOTIFY, L"Static", nullptr, WS_CHILD | WS_VISIBLE | SS_RIGHT | SS_NOTIFY | SS_ENDELLIPSIS,
+ (GetSystemMetrics(SM_CXICON) + 80), (GetSystemMetrics(SM_CXICON) / 2), 35, (GetSystemMetrics(SM_CXICON) / 2), hwndFrame, nullptr, params->hInstance, nullptr);
+ if (dat->hwndTime == nullptr)
return -1; /* creation failed, calls WM_DESTROY */
// create tooltips
TTTOOLINFO ti;
- dat->hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, NULL, WS_POPUP | TTS_ALWAYSTIP | TTS_NOPREFIX,
- CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwndFrame, NULL, params->hInstance, NULL);
- if (dat->hwndToolTip != NULL) {
+ dat->hwndToolTip = CreateWindowEx(WS_EX_TOPMOST, TOOLTIPS_CLASS, nullptr, WS_POPUP | TTS_ALWAYSTIP | TTS_NOPREFIX,
+ CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, hwndFrame, nullptr, params->hInstance, nullptr);
+ if (dat->hwndToolTip != nullptr) {
SetWindowPos(dat->hwndToolTip, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOACTIVATE);
memset(&ti, 0, sizeof(ti));
ti.cbSize = sizeof(ti);
@@ -155,11 +155,11 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
ti.uFlags &= ~TTF_TRANSPARENT;
ti.uId = (UINT_PTR)dat->hwndProgress;
SendMessage(dat->hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
- if (dat->hwndDesc != NULL) {
+ if (dat->hwndDesc != nullptr) {
ti.uId = (UINT_PTR)dat->hwndDesc;
SendMessage(dat->hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
}
- if (dat->hwndIcon != NULL) {
+ if (dat->hwndIcon != nullptr) {
ti.uId = (UINT_PTR)dat->hwndIcon;
SendMessage(dat->hwndToolTip, TTM_ADDTOOL, 0, (LPARAM)&ti);
}
@@ -173,26 +173,26 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
SendMessage(hwndFrame, M_REFRESH_ICONS, 0, 0);
SendMessage(hwndFrame, M_SET_COUNTDOWN, 0, 0);
SendMessage(hwndFrame, M_UPDATE_COUNTDOWN, 0, 0);
- if (!SetTimer(hwndFrame, 1, 1000, NULL))
+ if (!SetTimer(hwndFrame, 1, 1000, nullptr))
return -1; /* creation failed, calls WM_DESTROY */
}
return 0;
case WM_DESTROY:
- if (dat == NULL) return 0;
+ if (dat == nullptr) return 0;
UnhookEvent(dat->hHookColorsChanged);
UnhookEvent(dat->hHookFontsChanged);
UnhookEvent(dat->hHookIconsChanged);
/* other childs are destroyed automatically */
- if (dat->hwndToolTip != NULL)
+ if (dat->hwndToolTip != nullptr)
DestroyWindow(dat->hwndToolTip);
break;
case WM_NCDESTROY:
- if (dat == NULL) return 0;
- if (dat->hFont != NULL) DeleteObject(dat->hFont);
- if (dat->hbrBackground != NULL) DeleteObject(dat->hbrBackground);
+ if (dat == nullptr) return 0;
+ if (dat->hFont != nullptr) DeleteObject(dat->hFont);
+ if (dat->hbrBackground != nullptr) DeleteObject(dat->hbrBackground);
mir_free(dat);
SetWindowLongPtr(hwndFrame, GWLP_USERDATA, 0);
break;
@@ -208,14 +208,14 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
/* progress */
LONG width = rc.right - GetSystemMetrics(SM_CXICON) - 10;
LONG height = rc.bottom - (GetSystemMetrics(SM_CYICON) / 2) - 5;
- if (NULL != dat->hwndProgress) /* Wine fix. */
- hdwp = DeferWindowPos(hdwp, dat->hwndProgress, NULL, 0, 0, width, height, SWP_NOMOVE | defflg);
+ if (nullptr != dat->hwndProgress) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->hwndProgress, nullptr, 0, 0, width, height, SWP_NOMOVE | defflg);
/* desc */
- if (dat->hwndDesc != NULL) /* Wine fix. */
- hdwp = DeferWindowPos(hdwp, dat->hwndDesc, NULL, GetSystemMetrics(SM_CXICON) + 5, 5 + height, 0, 0, SWP_NOSIZE | defflg);
+ if (dat->hwndDesc != nullptr) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->hwndDesc, nullptr, GetSystemMetrics(SM_CXICON) + 5, 5 + height, 0, 0, SWP_NOSIZE | defflg);
/* time */
- if (NULL != dat->hwndTime) /* Wine fix. */
- hdwp = DeferWindowPos(hdwp, dat->hwndTime, NULL, GetSystemMetrics(SM_CXICON) + 85, 5 + height, width - 80, (GetSystemMetrics(SM_CXICON) / 2), defflg);
+ if (nullptr != dat->hwndTime) /* Wine fix. */
+ hdwp = DeferWindowPos(hdwp, dat->hwndTime, nullptr, GetSystemMetrics(SM_CXICON) + 85, 5 + height, width - 80, (GetSystemMetrics(SM_CXICON) / 2), defflg);
EndDeferWindowPos(hdwp);
}
PostMessage(hwndFrame, M_CHECK_CLIPPED, 0, 0);
@@ -231,13 +231,13 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
if (dat->clrBackground == -1)
dat->clrBackground = GetDefaultColor(FRAMEELEMENT_BKGRND);
- if (dat->hbrBackground != NULL)
+ if (dat->hbrBackground != nullptr)
DeleteObject(dat->hbrBackground);
dat->hbrBackground = CreateSolidBrush(dat->clrBackground);
SendMessage(dat->hwndProgress, PBM_SETBARCOLOR, 0, (LPARAM)clrBar);
SendMessage(dat->hwndProgress, PBM_SETBKCOLOR, 0, (LPARAM)dat->clrBackground);
- InvalidateRect(hwndFrame, NULL, TRUE);
+ InvalidateRect(hwndFrame, nullptr, TRUE);
return 0;
case M_REFRESH_ICONS:
@@ -247,13 +247,13 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
{
LOGFONT lf;
dat->clrText = Font_GetW(L"Automatic shutdown", L"Countdown on frame", &lf);
- if (dat->hFont != NULL) DeleteObject(dat->hFont);
+ if (dat->hFont != nullptr) DeleteObject(dat->hFont);
dat->hFont = CreateFontIndirect(&lf);
}
- if (dat->hwndDesc != NULL)
+ if (dat->hwndDesc != nullptr)
SendMessage(dat->hwndDesc, WM_SETFONT, (WPARAM)dat->hFont, FALSE);
SendMessage(dat->hwndTime, WM_SETFONT, (WPARAM)dat->hFont, FALSE);
- InvalidateRect(hwndFrame, NULL, FALSE);
+ InvalidateRect(hwndFrame, nullptr, FALSE);
return 0;
case WM_SYSCOLORCHANGE:
@@ -264,7 +264,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
SendMessage(hwndFrame, M_REFRESH_COLORS, 0, 0);
SendMessage(hwndFrame, M_REFRESH_FONTS, 0, 0);
SendMessage(hwndFrame, M_UPDATE_COUNTDOWN, 0, 0);
- RedrawWindow(hwndFrame, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE);
+ RedrawWindow(hwndFrame, nullptr, nullptr, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE);
break;
case WM_TIMECHANGE: /* windows system clock changed */
@@ -281,7 +281,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
case WM_ERASEBKGND:
{
RECT rc;
- if (dat->hbrBackground != NULL && GetClientRect(hwndFrame, &rc)) {
+ if (dat->hbrBackground != nullptr && GetClientRect(hwndFrame, &rc)) {
FillRect((HDC)wParam, &rc, dat->hbrBackground);
return TRUE;
}
@@ -290,7 +290,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
case M_SET_COUNTDOWN:
if (dat->fTimeFlags&SDWTF_ST_TIME) {
dat->settingLastTime = (time_t)db_get_dw(NULL, "AutoShutdown", "TimeStamp", SETTING_TIMESTAMP_DEFAULT);
- dat->countdown = time(NULL);
+ dat->countdown = time(nullptr);
if (dat->settingLastTime > dat->countdown) dat->countdown = dat->settingLastTime - dat->countdown;
else dat->countdown = 0;
}
@@ -303,7 +303,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
SendMessage(dat->hwndProgress, PBM_SETRANGE32, 0, (LPARAM)dat->countdown);
return 0;
case WM_TIMER:
- if (dat == NULL) return 0;
+ if (dat == nullptr) return 0;
if (dat->countdown != 0 && !(dat->flags&FWPDF_COUNTDOWNINVALID) && !(dat->flags&FWPDF_PAUSED)) {
dat->countdown--;
PostMessage(dat->hwndProgress, PBM_STEPIT, 0, 0);
@@ -332,7 +332,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
SetWindowText(dat->hwndTime, szOutput);
PostMessage(hwndFrame, M_CHECK_CLIPPED, 0, 0);
/* update tooltip text (if shown) */
- if (dat->hwndToolTip != NULL && !(dat->flags&FWPDF_PAUSED)) {
+ if (dat->hwndToolTip != nullptr && !(dat->flags&FWPDF_PAUSED)) {
TTTOOLINFO ti;
ti.cbSize = sizeof(ti);
if (SendMessage(dat->hwndToolTip, TTM_GETCURRENTTOOL, 0, (LPARAM)&ti) && (HWND)ti.uId != dat->hwndIcon)
@@ -380,11 +380,11 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
pt.y = rc.top + ((int)(rc.bottom - rc.top) / 2);
}
HMENU hContextMenu = CreatePopupMenu();
- if (hContextMenu != NULL) {
+ if (hContextMenu != nullptr) {
AppendMenu(hContextMenu, MF_STRING, MENUITEM_PAUSECOUNTDOWN, (dat->flags&FWPDF_PAUSED) ? TranslateT("&Unpause countdown") : TranslateT("&Pause countdown"));
SetMenuDefaultItem(hContextMenu, MENUITEM_PAUSECOUNTDOWN, FALSE);
AppendMenu(hContextMenu, MF_STRING, MENUITEM_STOPCOUNTDOWN, TranslateT("&Cancel countdown"));
- TrackPopupMenuEx(hContextMenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_HORPOSANIMATION | TPM_VERPOSANIMATION | TPM_RIGHTBUTTON, pt.x, pt.y, hwndFrame, NULL);
+ TrackPopupMenuEx(hContextMenu, TPM_LEFTALIGN | TPM_TOPALIGN | TPM_HORPOSANIMATION | TPM_VERPOSANIMATION | TPM_RIGHTBUTTON, pt.x, pt.y, hwndFrame, nullptr);
DestroyMenu(hContextMenu);
}
}
@@ -411,19 +411,19 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
RECT rc;
HDC hdc;
SIZE size;
- HFONT hFontPrev = NULL;
+ HFONT hFontPrev = nullptr;
wchar_t szOutput[256];
dat->flags &= ~FWPDF_TIMEISCLIPPED;
if (GetWindowText(dat->hwndTime, szOutput, _countof(szOutput)))
if (GetClientRect(dat->hwndTime, &rc)) {
hdc = GetDC(dat->hwndTime);
- if (hdc != NULL) {
- if (dat->hFont != NULL)
+ if (hdc != nullptr) {
+ if (dat->hFont != nullptr)
hFontPrev = (HFONT)SelectObject(hdc, dat->hFont);
if (GetTextExtentPoint32(hdc, szOutput, (int)mir_wstrlen(szOutput), &size))
if (size.cx >= (rc.right - rc.left))
dat->flags &= FWPDF_TIMEISCLIPPED;
- if (dat->hFont != NULL)
+ if (dat->hFont != nullptr)
SelectObject(hdc, hFontPrev);
ReleaseDC(dat->hwndTime, hdc);
}
@@ -440,7 +440,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
SetWindowLongPtr(dat->hwndToolTip, GWL_STYLE, GetWindowLongPtr(dat->hwndToolTip, GWL_STYLE) | TTS_NOANIMATE);
SetWindowLongPtr(dat->hwndToolTip, GWL_EXSTYLE, GetWindowLongPtr(dat->hwndToolTip, GWL_EXSTYLE) | WS_EX_TRANSPARENT);
SendMessage(dat->hwndToolTip, TTM_ADJUSTRECT, TRUE, (LPARAM)&rc);
- SetWindowPos(dat->hwndToolTip, NULL, rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
+ SetWindowPos(dat->hwndToolTip, nullptr, rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE);
return TRUE; /* self-defined position */
}
}
@@ -450,7 +450,7 @@ static LRESULT CALLBACK FrameWndProc(HWND hwndFrame, UINT msg, WPARAM wParam, LP
case TTN_POP:
/* workaround #5: frame does not get redrawn after
* in-place tooltip hidden on dat->hwndTime */
- RedrawWindow(hwndCountdownFrame, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE);
+ RedrawWindow(hwndCountdownFrame, nullptr, nullptr, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE);
return 0;
case TTN_NEEDTEXT:
{
@@ -483,16 +483,16 @@ void ShowCountdownFrame(WORD fTimeFlags)
{
hwndCountdownFrame = CreateWindowEx(WS_EX_CONTROLPARENT | WS_EX_NOPARENTNOTIFY | WS_EX_TRANSPARENT,
COUNTDOWNFRAME_CLASS,
- NULL,
+ nullptr,
WS_CHILD | WS_TABSTOP,
0, 0,
GetSystemMetrics(SM_CXICON) + 103,
GetSystemMetrics(SM_CYICON) + 2,
pcli->hwndContactList,
- NULL,
+ nullptr,
hInst,
&fTimeFlags);
- if (hwndCountdownFrame == NULL) return;
+ if (hwndCountdownFrame == nullptr) return;
if (ServiceExists(MS_CLIST_FRAMES_ADDFRAME)) {
CLISTFrame clf = { sizeof(clf) };
@@ -517,7 +517,7 @@ void ShowCountdownFrame(WORD fTimeFlags)
if (!(CallService(MS_CLIST_FRAMES_GETFRAMEOPTIONS, MAKEWPARAM(FO_FLAGS, hFrame), 0)&F_VISIBLE))
CallService(MS_CLIST_FRAMES_SHFRAME, hFrame, 0);
/* workaround #4: MS_CLIST_FRAMES_SHFRAME does cause redrawing problems when frame was hidden */
- RedrawWindow(hwndCountdownFrame, NULL, NULL, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE);
+ RedrawWindow(hwndCountdownFrame, nullptr, nullptr, RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_ERASE);
/* workaround #5: for in-place tooltip TTN_POP
* workaround #6 and #7: see CloseCountdownFrame() */
}
@@ -526,7 +526,7 @@ void ShowCountdownFrame(WORD fTimeFlags)
void CloseCountdownFrame(void)
{
- if (hwndCountdownFrame != NULL) {
+ if (hwndCountdownFrame != nullptr) {
SendMessage(hwndCountdownFrame, M_CLOSE_COUNTDOWN, 0, 0);
if (hFrame) {
/* HACKS TO FIX CLUIFrames:
@@ -540,7 +540,7 @@ void CloseCountdownFrame(void)
#endif
}
else DestroyWindow(hwndCountdownFrame);
- hwndCountdownFrame = NULL;
+ hwndCountdownFrame = nullptr;
hFrame = 0;
}
@@ -573,12 +573,12 @@ int InitFrame(void)
wcx.style = CS_DBLCLKS | CS_PARENTDC;
wcx.lpfnWndProc = FrameWndProc;
wcx.hInstance = hInst;
- wcx.hCursor = (HCURSOR)LoadImage(NULL, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_SHARED);
+ wcx.hCursor = (HCURSOR)LoadImage(nullptr, IDC_ARROW, IMAGE_CURSOR, 0, 0, LR_SHARED);
wcx.lpszClassName = COUNTDOWNFRAME_CLASS;
if (!RegisterClassEx(&wcx))
return 1;
- hwndCountdownFrame = NULL;
+ hwndCountdownFrame = nullptr;
hHookModulesLoaded = HookEvent(ME_SYSTEM_MODULESLOADED, FrameModulesLoaded);
return 0;
}