diff --git a/src/Magpie/AutoStartHelper.cpp b/src/Magpie/AutoStartHelper.cpp index a9323bef7..88011d25c 100644 --- a/src/Magpie/AutoStartHelper.cpp +++ b/src/Magpie/AutoStartHelper.cpp @@ -238,9 +238,9 @@ static bool CreateAutoStartTask(bool runElevated, const wchar_t* arguments) noex principal->put_LogonType(TASK_LOGON_INTERACTIVE_TOKEN); if (runElevated) { - hr = principal->put_RunLevel(_TASK_RUNLEVEL::TASK_RUNLEVEL_HIGHEST); + hr = principal->put_RunLevel(TASK_RUNLEVEL_HIGHEST); } else { - hr = principal->put_RunLevel(_TASK_RUNLEVEL::TASK_RUNLEVEL_LUA); + hr = principal->put_RunLevel(TASK_RUNLEVEL_LUA); } if (FAILED(hr)) { diff --git a/src/Magpie/MainWindow.cpp b/src/Magpie/MainWindow.cpp index 2762fe1fa..047756e25 100644 --- a/src/Magpie/MainWindow.cpp +++ b/src/Magpie/MainWindow.cpp @@ -456,9 +456,9 @@ LRESULT MainWindow::_TitleBarMessageHandler(UINT msg, WPARAM wParam, LPARAM lPar { POINT cursorPos{ GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam) }; ClientToScreen(_hwndTitleBar.get(), &cursorPos); - wParam = SendMessage(_hwndTitleBar.get(), WM_NCHITTEST, 0, MAKELPARAM(cursorPos.x, cursorPos.y)); + wParam = _TitleBarMessageHandler(WM_NCHITTEST, 0, MAKELPARAM(cursorPos.x, cursorPos.y)); + [[fallthrough]]; } - [[fallthrough]]; case WM_NCMOUSEMOVE: { CaptionButtonsControl& captionButtons = Content()->TitleBar().CaptionButtons(); @@ -513,7 +513,7 @@ LRESULT MainWindow::_TitleBarMessageHandler(UINT msg, WPARAM wParam, LPARAM lPar Content()->TitleBar().CaptionButtons().LeaveButtons(); } else { // 然后检查鼠标在标题栏上的位置 - LRESULT hit = SendMessage(_hwndTitleBar.get(), WM_NCHITTEST, 0, MAKELPARAM(cursorPos.x, cursorPos.y)); + LRESULT hit = _TitleBarMessageHandler(WM_NCHITTEST, 0, MAKELPARAM(cursorPos.x, cursorPos.y)); if (hit != HTMINBUTTON && hit != HTMAXBUTTON && hit != HTCLOSE) { Content()->TitleBar().CaptionButtons().LeaveButtons(); } @@ -553,9 +553,9 @@ LRESULT MainWindow::_TitleBarMessageHandler(UINT msg, WPARAM wParam, LPARAM lPar POINT cursorPos{ GET_X_LPARAM(lParam),GET_Y_LPARAM(lParam) }; ClientToScreen(_hwndTitleBar.get(), &cursorPos); - wParam = SendMessage(_hwndTitleBar.get(), WM_NCHITTEST, 0, MAKELPARAM(cursorPos.x, cursorPos.y)); + wParam = _TitleBarMessageHandler(WM_NCHITTEST, 0, MAKELPARAM(cursorPos.x, cursorPos.y)); + [[fallthrough]]; } - [[fallthrough]]; case WM_NCLBUTTONUP: { // 处理鼠标在标题栏上释放。如果在标题栏按钮上,则通知 CaptionButtons,否则将消息传递给主窗口