crypto2011 / IDR

Interactive Delphi Reconstructor
MIT License
951 stars 225 forks source link

The controls position will CHANGE when each execut #45

Closed csitGenny closed 5 years ago

csitGenny commented 5 years ago

After Windows 7, each execut the IDR, we find the controls position will changed.

Reason:

After Windows 7, has a display setting under the Desktop popup menu -> Display Settings: "Change the size of text, apps and other items" This can select: Smaller (100%), Medium (125%), Larger (150%), and so on.

Solve:

Modify the ScaleForm function in Misc.cpp

void __fastcall ScaleForm(TForm* AForm) { HDC _hdc = GetDC(0); if (_hdc) { //Modified by ZGL int LogicalScreenHeight = GetDeviceCaps(_hdc, VERTRES); int PhysicalScreenHeight = GetDeviceCaps(_hdc, DESKTOPVERTRES); AForm->ScaleBy(PhysicalScreenHeight, LogicalScreenHeight); //Modified end ReleaseDC(0, _hdc); } }

crypto2011 commented 5 years ago

Modified. Thanks.