mirror of
https://github.com/microsoft/PowerToys.git
synced 2024-12-03 03:19:08 +08:00
Fix regression: Open PowerRename on current monitor (#18311)
Add missing reference to Version proj Minor cleanup
This commit is contained in:
parent
88e79ac669
commit
871b456be3
@ -47,6 +47,29 @@ namespace winrt::PowerRenameUI::implementation
|
|||||||
Microsoft::UI::WindowId windowId =
|
Microsoft::UI::WindowId windowId =
|
||||||
Microsoft::UI::GetWindowIdFromWindow(m_window);
|
Microsoft::UI::GetWindowIdFromWindow(m_window);
|
||||||
|
|
||||||
|
POINT cursorPosition{};
|
||||||
|
if (GetCursorPos(&cursorPosition))
|
||||||
|
{
|
||||||
|
HMONITOR hMonitor = MonitorFromPoint(cursorPosition, MONITOR_DEFAULTTOPRIMARY);
|
||||||
|
MONITORINFOEX monitorInfo;
|
||||||
|
monitorInfo.cbSize = sizeof(MONITORINFOEX);
|
||||||
|
GetMonitorInfo(hMonitor, &monitorInfo);
|
||||||
|
RECT rect;
|
||||||
|
if (GetWindowRect(m_window, &rect))
|
||||||
|
{
|
||||||
|
int width = rect.right - rect.left;
|
||||||
|
int height = rect.bottom - rect.top;
|
||||||
|
|
||||||
|
MoveWindow(m_window,
|
||||||
|
monitorInfo.rcWork.left + (monitorInfo.rcWork.right - monitorInfo.rcWork.left - width) / 2,
|
||||||
|
monitorInfo.rcWork.top + (monitorInfo.rcWork.bottom - monitorInfo.rcWork.top - height) / 2,
|
||||||
|
width,
|
||||||
|
height,
|
||||||
|
true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Microsoft::UI::Windowing::AppWindow appWindow =
|
Microsoft::UI::Windowing::AppWindow appWindow =
|
||||||
Microsoft::UI::Windowing::AppWindow::GetFromWindowId(windowId);
|
Microsoft::UI::Windowing::AppWindow::GetFromWindowId(windowId);
|
||||||
appWindow.SetIcon(PowerRenameUIIco);
|
appWindow.SetIcon(PowerRenameUIIco);
|
||||||
@ -107,7 +130,7 @@ namespace winrt::PowerRenameUI::implementation
|
|||||||
CComPtr<IShellItemArray> shellItemArray;
|
CComPtr<IShellItemArray> shellItemArray;
|
||||||
// To test PowerRename uncomment this line and update the path to
|
// To test PowerRename uncomment this line and update the path to
|
||||||
// your local (absolute or relative) path which you want to see in PowerRename
|
// your local (absolute or relative) path which you want to see in PowerRename
|
||||||
// files.push_back(<path>);
|
// g_files.push_back(<path>);
|
||||||
|
|
||||||
if (!g_files.empty())
|
if (!g_files.empty())
|
||||||
{
|
{
|
||||||
|
@ -153,7 +153,6 @@
|
|||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
</Image>
|
</Image>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<_WildCardPRIResource Include="Strings\*\Resources.resw" />
|
<_WildCardPRIResource Include="Strings\*\Resources.resw" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
@ -161,6 +160,9 @@
|
|||||||
<ProjectReference Include="..\..\..\common\logger\logger.vcxproj">
|
<ProjectReference Include="..\..\..\common\logger\logger.vcxproj">
|
||||||
<Project>{d9b8fc84-322a-4f9f-bbb9-20915c47ddfd}</Project>
|
<Project>{d9b8fc84-322a-4f9f-bbb9-20915c47ddfd}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
<ProjectReference Include="..\..\..\common\version\version.vcxproj">
|
||||||
|
<Project>{cc6e41ac-8174-4e8a-8d22-85dd7f4851df}</Project>
|
||||||
|
</ProjectReference>
|
||||||
<ProjectReference Include="..\lib\PowerRenameLib.vcxproj">
|
<ProjectReference Include="..\lib\PowerRenameLib.vcxproj">
|
||||||
<Project>{51920f1f-c28c-4adf-8660-4238766796c2}</Project>
|
<Project>{51920f1f-c28c-4adf-8660-4238766796c2}</Project>
|
||||||
</ProjectReference>
|
</ProjectReference>
|
||||||
|
@ -44,7 +44,4 @@
|
|||||||
</Image>
|
</Image>
|
||||||
<Image Include="PowerRenameUI.ico" />
|
<Image Include="PowerRenameUI.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
|
||||||
<PRIResource Include="Resources.resw" />
|
|
||||||
</ItemGroup>
|
|
||||||
</Project>
|
</Project>
|
Loading…
Reference in New Issue
Block a user