Skip to content

Commit

Permalink
update to 1.2.6
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCGDF committed Nov 11, 2022
1 parent f389581 commit 50aa626
Showing 1 changed file with 23 additions and 8 deletions.
31 changes: 23 additions & 8 deletions NetSpeed/Timer_Refresh.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,14 +111,29 @@ class Timer_Refresh {

RECT Rect;
GetWindowRect(Dialog_Main::Handle_Get(), &Rect);
if (Rect.right - Rect.left < GetSystemMetrics(SM_CXSCREEN) &&
Rect.bottom - Rect.top < GetSystemMetrics(SM_CYSCREEN) &&
(Rect.left < 0 || GetSystemMetrics(SM_CXSCREEN) < Rect.right ||
Rect.right < 0 || GetSystemMetrics(SM_CYSCREEN) < Rect.bottom)) {
Dialog_Main::Position_Set(POINT{
.x = (GetSystemMetrics(SM_CXSCREEN) - Rect.right + Rect.left) / 2 ,
.y = (GetSystemMetrics(SM_CYSCREEN) - Rect.bottom + Rect.top) / 2 }
);
POINT Position{
.x = Rect.left,
.y = Rect.top,
};
if (Rect.right - Rect.left < GetSystemMetrics(SM_CXSCREEN)) {
if (Rect.left < 0) {
Position.x = 0;
}
if (GetSystemMetrics(SM_CXSCREEN) < Rect.right) {
Position.x = GetSystemMetrics(SM_CXSCREEN) - Rect.right + Rect.left;
}
}
if (Rect.bottom - Rect.top < GetSystemMetrics(SM_CYSCREEN)) {
if (Rect.top < 0) {
Position.y = 0;
}
if (GetSystemMetrics(SM_CYSCREEN) < Rect.bottom) {
Position.y = GetSystemMetrics(SM_CYSCREEN) - Rect.bottom + Rect.top;
}
}
if (Position.x != Rect.left || Position.y != Rect.top) {
Dialog_Main::Position_Set(Position);
Registry::Position_Set(Position);
}
}
};

0 comments on commit 50aa626

Please sign in to comment.