mirror of
https://github.com/microsoft/PowerToys.git
synced 2025-12-16 11:48:06 +01:00
Modifying the startup behaviour of the FancyZones Layout Editor
Add setting to allow to choose if the FZ editor opens in the screen where mouse cursor is or where the active windows is.
This commit is contained in:
@@ -14,6 +14,18 @@ HRESULT DPIAware::GetScreenDPIForWindow(HWND hwnd, UINT &dpi_x, UINT &dpi_y) {
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT DPIAware::GetScreenDPIForPoint(POINT p, UINT& dpi_x, UINT& dpi_y) {
|
||||
auto monitor_handle = MonitorFromPoint(p, MONITOR_DEFAULTTONEAREST);
|
||||
dpi_x = 0;
|
||||
dpi_y = 0;
|
||||
if (monitor_handle != nullptr) {
|
||||
return GetDpiForMonitor(monitor_handle, MDT_EFFECTIVE_DPI, &dpi_x, &dpi_y);
|
||||
}
|
||||
else {
|
||||
return E_FAIL;
|
||||
}
|
||||
}
|
||||
|
||||
void DPIAware::Convert(HMONITOR monitor_handle, int &width, int &height) {
|
||||
if (monitor_handle == NULL) {
|
||||
const POINT ptZero = { 0, 0 };
|
||||
|
||||
Reference in New Issue
Block a user