问题
The question is simple. How to detect screen resolution change in Delphi ?
回答1:
You only need to detect the WM_DISPLAYCHANGE message.
For instance,
TForm1 = class(TForm)
private
protected
procedure WMDisplayChange(var Message: TWMDisplayChange);
message WM_DISPLAYCHANGE;
{ Private declarations }
public
{ Public declarations }
end;
...
procedure TForm1.WMDisplayChange(var Message: TWMDisplayChange);
begin
ShowMessageFmt('The screen resolution has changed to %d×%d×%d.',
[Message.Width, Message.Height, Message.BitsPerPixel]);
end;

来源:https://stackoverflow.com/questions/14772588/how-to-detect-screen-resolution-change-in-delphi