SPONSORS:






User Tag List

Thanks Thanks:  0
Likes Likes:  0
Dislikes Dislikes:  0
Results 1 to 6 of 6
  1. #1
    Member
    Join Date
    Oct 2005
    Posts
    352
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    How can I get the Screen resolution value?

    Hi
    Can anyone let me know how can I get the screen resolution value~?

    MAny Thanks

  2. #2
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can I get the Screen resolution value?

    Here you go:

    Systemutil.run "control.exe","desk.cpl"
    Wait(2)
    With Dialog("regexpwndtitle:=Display Properties")
    Wait(1)
    .WinTab("regexpwndclass:=SysTabControl32").Select "Settings "
    Wait(2)
    scRes=.Static("regexpwndtitle:=.* by .*").GetROProperty("text")
    Wait(1)
    .WinButton("regexpwndtitle:=OK").Click
    End With

    MsgBox scRes

    Mark Smith.

  3. #3
    Member
    Join Date
    Oct 2007
    Location
    Ukraine
    Posts
    76
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can I get the Screen resolution value?

    Wow, your code is good example of using QTP capability [img]/images/graemlins/smile.gif[/img]

    Try this code:
    <font class="small">Code:</font><hr /><pre>
    Set objWMIService = GetObject("Winmgmts:\\.\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select * From Win32_DesktopMonitor where DeviceID = 'DesktopMonitor1'",,0)
    For Each objItem in colItems
    intHorizontal = objItem.ScreenWidth
    intVertical = objItem.ScreenHeight
    Next
    </pre><hr />

  4. #4
    Senior Member
    Join Date
    Dec 2006
    Location
    Germany, Dresden
    Posts
    1,536
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can I get the Screen resolution value?

    width = Window("regexpwndtitle:=Program Manager").GetROProperty ("width")
    height = Window("regexpwndtitle:=Program Manager").GetROProperty ("height")
    MsgBox width &amp; "*" &amp; height
    http://qcmt.pc-polis.de

    de omnibus dubitandum

    For all Questions: Please be sure to take a look at the QTP Manual before posting any Questions, thanks for doing this

  5. #5
    Member
    Join Date
    Oct 2005
    Posts
    352
    Post Thanks / Like
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can I get the Screen resolution value?

    Thanks Very much for all your help. Its very nice to see how this can be acheived. MAny Thanks to mwsrosso, gralex, rscholz660.

  6. #6
    Moderator
    Join Date
    Sep 2001
    Location
    Doncaster, UK
    Posts
    5,788
    Post Thanks / Like
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Total Downloaded
    0

    Re: How can I get the Screen resolution value?

    Gralex, Roland thanks for the alternative methods to get the resoulution.

    Mark Smith.

 

 

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Search Engine Optimisation provided by DragonByte SEO v2.0.36 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 10.71%
vBulletin Optimisation provided by vB Optimise v2.6.4 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
User Alert System provided by Advanced User Tagging v3.2.8 (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
vBNominate (Lite) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Feedback Buttons provided by Advanced Post Thanks / Like (Pro) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
Username Changing provided by Username Change (Free) - vBulletin Mods & Addons Copyright © 2016 DragonByte Technologies Ltd.
BetaSoft Inc.
Digital Point modules: Sphinx-based search
All times are GMT -8. The time now is 02:21 PM.

Copyright BetaSoft Inc.