Announcement

Collapse
No announcement yet.

Screen resolution

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Screen resolution

    How does one capture what screen resolution the Computer is set to?

    This does not appear to return a valid size...

    Local wndclass As WndClassEx

    GetWindowRect %HWND_DESKTOP, WndRect

    Thanks,

    -------------
    Scott Turchin


    Scott Turchin
    MCSE, MCP+I
    http://www.tngbbs.com
    ----------------------
    True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

    #2
    How does one capture what screen resolution the Computer is set to?
    Code:
    nScreenWidth = GetSystemMetrics( SM_CXSCREEN )
    nScreenHeight = GetSystemMetrics( SM_CYSCREEN)
    If you try to make something idiot-proof, someone will invent a better idiot.

    Comment


      #3
      Beautiful, thank you!


      Working on a setup program, needed the "Normal" setup look for the gradient blue screen..


      Scott

      -------------
      Scott Turchin


      Scott Turchin
      MCSE, MCP+I
      http://www.tngbbs.com
      ----------------------
      True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

      Comment


        #4
        To get the usable desktop area, use SystemParametersInfo()...
        Code:
        ' hDlg, dx & dy are the DDT dialog metric's.... psuedo code follows:
        DIM Rct as RECT
        SystemParametersInfo %SPI_GETWORKAREA, 0, BYVAL VARPTR(Rct), 0
        ' Now convert the values into DDT units...
        DIALOG PIXELS hDlg, Rct.nLeft,  Rct.nTop    TO UNITS Rct.nLeft,  Rct.nTop
        DIALOG PIXELS hDlg, Rct.nRight, Rct.nBottom TO UNITS Rct.nRight, Rct.nBottom
        ' Now centre the dialog in the true desktop area...
        DIALOG SET LOC hDlg, Rct.nLeft + (Rct.nRight - Rct.nLeft - dx) / 2, Rct.nTop + (Rct.nBottom - Rct.nTop - dy) / 2
        By using all 4 RECT parameters, it's possible to center your window in the usable desktop space, instead of the center of whole screen. ie, try making your taskbar very large and see how your program reacts without taking the taskbar into effect... some app's look positively horrible is the taskbar is ignored (ie, the taskbar may be displayed over the top of your dialog).



        -------------
        Lance
        PowerBASIC Support
        ( mailto:[email protected][email protected]</A> )
        Lance
        mailto:[email protected]

        Comment


          #5
          -

          [This message has been edited by Semen Matusovski (edited February 27, 2000).]

          Comment

          Working...
          X
          😀
          🥰
          🤢
          😎
          😡
          👍
          👎