mirror of
https://github.com/Blinue/Magpie.git
synced 2026-06-24 02:04:10 +00:00
perf: 直接调用窗口过程而不是发送消息
This commit is contained in:
parent
a6f86d0849
commit
2db1444374
2 changed files with 7 additions and 7 deletions
|
|
@ -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)) {
|
||||
|
|
|
|||
|
|
@ -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,否则将消息传递给主窗口
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue