| Приложение с различным разрешением монитора? | Previous Home Next |
| Windows, Messages, SysUtils, Classes, Graphics, |
| Controls, Forms, Dialogs, StdCtrls; |
| |
| Button1: TButton; |
| Edit1: TEdit; |
| procedure Button1Click(Sender: TObject); |
| procedure FormCreate(Sender: TObject); |
| private |
| {Отлавливаем, сообщение о изменении разрешения экрана} |
| procedure WMDisplayChange(var message: TMessage); message WM_DISPLAYCHANGE; |
| public |
| W, H: integer; |
| Width := Round(Width * 1.5); |
| Height := Round(Height |
| * 1.5); |
| ScaleBy(150, 100) |
| inherited; |
| Width := Round(Width * LOWORD(message.LParam) / W); |
| Height := Round(Height * HIWORD(message.LParam) / H); |
| ScaleBy(LOWORD(message.LParam), W); |
| W := Screen.Width; |
| H := Screen.Height; |
| W := Screen.Width; |
| H := Screen.Height; |