Results 1 to 20 of 20

Thread: GetScreenDimensions

  1. #1
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default GetResolution

    Code:
    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:
    Code:
    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.
    Last edited by Diddy Kong; 03-23-2010 at 01:54 AM.

  2. #2
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    GetResolution is the name you're looking for.

  3. #3
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    There is no such procedure or function by that name.

  4. #4
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Diddy Kong View Post
    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

  5. #5
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    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.

  6. #6
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    What could this be used for?

  7. #7
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

  8. #8
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    This belongs in simba/SCAR suggestions IMO

  9. #9
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by Diddy Kong View Post
    Forms, centering client windows. 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.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  10. #10
    Join Date
    Mar 2010
    Location
    New Hampshire, U.S.A
    Posts
    586
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

  11. #11
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    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.

  12. #12
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    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.

  13. #13
    Join Date
    Oct 2009
    Location
    Stockton, CA
    Posts
    2,040
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    Quote Originally Posted by g0tp0t View Post
    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.
    Join the IRC! irc.rizon.net:6667/srl | SQLite (0.99rc3+) | SRL Doc | Simba Doc | Extra Simba Libraries (openSSL & sqlite3)
    Quote Originally Posted by #srl
    10:45 < Toter> daphil when can get sex anyday I want
    10:45 < Toter> he is always on #SRL
    "A programmer is just a tool which converts caffeine into code"

  14. #14
    Join Date
    Dec 2006
    Location
    Houston, TX USA
    Posts
    4,791
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

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

  15. #15
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by IceFire908 View Post
    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.

  16. #16
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

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

  17. #17
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by i luffs yeww View Post
    SRL needs to be cleaned or your function? >_>
    SRL needs to be cleaned.

  18. #18
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

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

  19. #19
    Join Date
    Sep 2006
    Posts
    5,219
    Mentioned
    4 Post(s)
    Quoted
    1 Post(s)

    Default

    That will become easier with SRL5 and git.

  20. #20
    Join Date
    Feb 2010
    Location
    On the edge of space
    Posts
    160
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Boreas View Post
    That will become easier with SRL5 and git.
    Aw, yes, thank you Boreas.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •