Home > Back-end >  Delphi form how to acquire the external program size (width is high, and the screen coordinates)
Delphi form how to acquire the external program size (width is high, and the screen coordinates)

Time:10-07

As title,,

Have an external program FORM1, for example, how to obtain wide high dimensions of FORM1, and FORM1 on location information of the screen?

CodePudding user response:

 var 
R: TRect;
The begin
GetWindowRect (Form1 handle, R);
ShowMessageFmt (' wide: % d, high: % d, abscissa: % d, ordinate: % d ', [R.R d.light - R.L eft,
R. b ottom - R.T op, R.L eft, R.T op]);
end;

CodePudding user response:

Handle to Form1:=FindWindow (Form1 class name and the title of Form1);

Which Form1 class name, title in the Form1 to use Spy++ get! After get you can write to death in the code!

CodePudding user response:

The same floor use GetWindowRect function

CodePudding user response:

GetWindowRect

CodePudding user response:

GetWindowRect useful function, earned a window on the screen coordinates

CodePudding user response:

Thank you, educated,

CodePudding user response:

Upstairs all positive solutions,,,,,,,

CodePudding user response:

Learning how to learn, you said yes

CodePudding user response:

Pass by, is the truth,

CodePudding user response:

Peek in the

CodePudding user response:

The upstairs is a great god, consult with an open mind,

CodePudding user response:

How to get a mobile phone screen size, getObjectProperty ()??

CodePudding user response:

reference 1st floor s11ss response:
 var 
R: TRect;
The begin
GetWindowRect (Form1 handle, R);
ShowMessageFmt (' wide: % d, high: % d, abscissa: % d, ordinate: % d ', [R.R d.light - R.L eft,
R. b ottom - R.T op, R.L eft, R.T op]);
end;



Positive solution ~ ~
  • Related