Announcement

Collapse
No announcement yet.

Screen resolution

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

  • Semen Matusovski
    replied
    -

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

    Leave a comment:


  • Lance Edmonds
    replied
    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> )

    Leave a comment:


  • Scott Turchin
    replied
    Beautiful, thank you!


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


    Scott

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


    Leave a comment:


  • Matthew Berg
    replied
    How does one capture what screen resolution the Computer is set to?
    Code:
    nScreenWidth = GetSystemMetrics( SM_CXSCREEN )
    nScreenHeight = GetSystemMetrics( SM_CYSCREEN)

    Leave a comment:


  • Scott Turchin
    started a topic Screen resolution

    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


Working...
X