MantisBT

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000128SoldatJohnpublic2011-11-01 00:312015-04-18 19:19
ReporterMr 
Assigned To 
PrioritynormalSeverityminorReproducibilityalways
StatusacknowledgedResolutionopen 
Platformx64OSWindowsOS Version7
Product Version1.6.2 
Target VersionFixed in Version 
Summary0000128: Config.exe always starts up on the primary screen
DescriptionSee summary
Additional InformationSuggested fix:

Use the cursor position or last active window to determine the active screen. This is a commonly used technique.

POINT point = { 0 };
MONITORINFO mi = { sizeof(MONITORINFO), 0 };
HMONITOR hMonitor = 0;
RECT rcArea = { 0 };

GetCursorPos(&point);
hMonitor = MonitorFromPoint(point, MONITOR_DEFAULTTONEAREST);
// hMonitor = MonitorFromWindow(GetForegroundWindow(), MONITOR_DEFAULTTONEAREST);

if(GetMonitorInfo(hMonitor, &mi))
{
    rcArea.left = (mi.rcMonitor.right + mi.rcMonitor.left - current_form_width) /2;
    rcArea.top = (mi.rcMonitor.top + mi.rcMonitor.bottom - current_form_height) /2;
}
else
{
    SystemParametersInfo(SPI_GETWORKAREA, NULL, &rcArea, NULL);
    rcArea.left = (rcArea.right + rcArea.left - current_form_width) / 2;
    rcArea.top = (rcArea.top + rcArea.bottom - current_form_height) / 2;
}

rcArea.left and rcArea.top will now contain the optimal startup position of your window.
TagsNo tags attached.
Attached Files

- Relationships
related to 0000523confirmed Start screen not centered, error and config.exe not saving fullscreen setting 

-  Notes
(0002418)
homerofgods (updater)
2015-04-15 23:00

<@Shoozza> is this still a thing?
<@Shoozza> i remember fixing that some time ago

Mr is it fixed?

- Issue History
Date Modified Username Field Change
2011-11-01 00:31 Mr New Issue
2012-03-01 02:06 Shoozza Status new => acknowledged
2015-04-15 23:00 homerofgods Note Added: 0002418
2015-04-18 19:19 homerofgods Relationship added related to 0000523
2020-08-27 11:23 MM Category GUI => John


Copyright © 2000 - 2024 MantisBT Team
Powered by Mantis Bugtracker