SRL Archive - SRL Archives

GetScreenDimensions


Diddy Kong

2010-03-22 21:31:57

procedure GetResolution(var Width, Height : Integer);
var
previousClient, clientX, clientY : Integer;
begin
previousClient := GetClientWindowHandle;
SetDesktopAsClient;
GetClientDimensions(clientX, clientY);
Width := clientX;
Height := clientY;
SetClientWindowHandle(previousClient);
end;

Used as so:
program GetResolutionExample;

var
resX, resY : Integer;

begin
GetResolution(resX, resY);
Writeln(Format('Screen Dimensions : (%d, %d)', [resX, resY]));
end.

I know it's crappy and I can do better than this, but it can be useful. :stirthepot:

Wanted

2010-03-22 21:37:38

GetResolution is the name you're looking for.

Diddy Kong

2010-03-22 21:49:33

There is no such procedure or function by that name.

Wanted

2010-03-22 21:52:23

From: Diddy Kong
There is no such procedure or function by that name.


Yea I know. What I meant was, that's would it should be named

Screen dimensions are in inches/centimeters. Resolution is pixels ;)

Diddy Kong

2010-03-22 21:55:15

From: IceFire908
Yea I know. What I meant was, that's would it should be named

Screen dimensions are in inches/centimeters. Resolution is pixels ;)


Okay then. :duh:

i luffs yeww

2010-03-22 21:58:48

What could this be used for?

Diddy Kong

2010-03-22 22:01:57

Forms, centering client windows. :bart: Or maybe just no use at all for SRL in mind.

Wanted

2010-03-22 22:07:29

This belongs in simba/SCAR suggestions IMO

Sex

2010-03-22 22:19:58

From: Diddy Kong
Forms, centering client windows. :bart: Or maybe just no use at all for SRL in mind.

If you can find no use then there is no reason for it to clog up the include.
Also, you don't need to use this for forms and you can do Form.Position := poScreenCenter; and others.

g0tp0t

2010-03-22 22:39:03

This could be used for full screen runescape applets. It's not big so it really wouldn't clog includes.

i luffs yeww

2010-03-22 22:41:54

Well SRL doesn't work in full screen, nor does it work in re-sizable mode, so I still don't see any use at all. Sorry.

Diddy Kong

2010-03-22 22:44:17

From: i luffs yeww
Well SRL doesn't work in full screen, nor does it work in re-sizable mode, so I still don't see any use at all. Sorry.


It's alright. I just have a SCAR high and it will settle down in a few days. :spongebob:

Sex

2010-03-22 22:46:11

From: g0tp0t
This could be used for full screen runescape applets. It's not big so it really wouldn't clog includes.

Clogging the include in the sense of filling it with useless procedures.

Wanted

2010-03-22 23:02:48

I would find this useful, in simba or SCAR. not the include.

Diddy Kong

2010-03-22 23:29:55

From: IceFire908
I would find this useful, in simba or SCAR. not the include.


I would, too. It doesn't really fit SRL include. It really needs to be cleaned.

i luffs yeww

2010-03-22 23:36:10

SRL needs to be cleaned or your function? >_>

Diddy Kong

2010-03-22 23:41:56

From: i luffs yeww
SRL needs to be cleaned or your function? >_>


SRL needs to be cleaned.

i luffs yeww

2010-03-22 23:44:51

Then clean it if you think it needs cleaned. It's open for a reason.

Boreas

2010-03-22 23:47:49

That will become easier with SRL5 and git.

Diddy Kong

2010-03-22 23:56:36

From: Boreas
That will become easier with SRL5 and git.


Aw, yes, thank you Boreas. ;)