Announcement

Collapse
No announcement yet.

screen resolution ist not correct with PBwin 8.04

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

  • Cliff Nichols
    replied
    Support of any computer company is "Not Enough" (Grin)

    Unfortunately these days, beyond the basic tech suppt questions, it is like finding an "elusive Unicorn"....

    You have to find a tech in a good mood (not likely after the amount of calls they get a day), and is knowledgeable (again not likely since most troubleshoot from a book, and if you ask a question not in the book, the answer is "Is the computer plugged in and turned on?" )

    MCM has the right idea (unfortunately I have to wait till next week to give a trial), but I have a sneaky suspicion that VISTA and XP with the same monitors, may report 2 different resolutions

    (But hey thats just me, and users use VISTA (or do they?) since M$ is even acknowledging that "Stick with XP or Wait for the new OS" )

    Leave a comment:


  • Walt Thompson
    replied
    You mean all I had to...

    "You mean all I had to change was lprect?

    instead of this...

    Code:
        GETWindowRect     GetDesktopWindow(), R
        lpRect          = VARPTR(R)use this?
    Code:
        lpRect          = %NULL
    can someone with two monitors try that? Works great here, but so did the first effort. "

    Hi Michael;
    With lpRect = %NULL your code correctly reports the number of displays attached to the computer.

    Leave a comment:


  • Matthias Kuhn
    replied
    result

    Hello Michael,

    thanks for the test code: the result ist 1024x640 with API and DDT.

    So I think ist is the best to resell this crasy Notebook and buy another because the support of samsung is not helpful
    enough.

    To Barry: I need to carry and to have a long runingtime
    over 4 hours.

    Best Regards

    Matthias Kuhn

    Leave a comment:


  • Michael Mattias
    replied
    You mean all I had to change was lprect?

    instead of this...
    Code:
        GETWindowRect     GetDesktopWindow(), R
        lpRect          = VARPTR(R)
    use this?
    Code:
        lpRect          = %NULL
    can someone with two monitors try that? Works great here, but so did the first effort.

    Leave a comment:


  • Walt Thompson
    replied
    Multiple Displays

    Hi;

    Bill Eppler posted the short program attached below. The program returns the number of displays installed and their assigned resolutions.

    code:
    Code:
    #COMPILE EXE
    #DIM ALL
    
    
    %USEMACROS = 1
    #INCLUDE "WIN32API.INC"
    
    
    DECLARE FUNCTION MonInfoEnumProc(BYVAL hmon AS DWORD, BYVAL hdc AS DWORD, _
     BYREF prect AS RECT, BYVAL pdat AS DWORD) AS LONG
    
    
    FUNCTION PBMAIN()
        EnumDisplayMonitors(BYVAL %NULL, BYVAL %NULL, BYVAL CODEPTR(MonInfoEnumProc), 0)
    END FUNCTION
    
    
    FUNCTION MonInfoEnumProc(BYVAL hmon AS DWORD, BYVAL hdc AS DWORD, _
     BYREF xy AS RECT, BYVAL pdat AS DWORD) AS LONG
        MSGBOX  FORMAT$(xy.nLeft) + "," + FORMAT$(xy.nTop) + ";  " + _
         FORMAT$(xy.nRight) + "," + FORMAT$(xy.nBottom)
        FUNCTION = %TRUE
    END FUNCTION
    Last edited by Walt Thompson; 23 May 2008, 04:12 PM. Reason: Lost Link

    Leave a comment:


  • Michael Mattias
    replied
    Well, I can't debug it since I have but one monitor.

    Ideas...

    - See how many times it enters the callback. If it's only entering once, then maybe the use of GetWindowRect for GetDesktopWindow() is wrong, and I should be getting separate RECTs for each monitor?

    If it's entering once per monitor, then I screwed up the string-building in the callback.

    - Maybe, the original hDC in the enum call should be GetDc (BYVAL %NULL) to get a handle to a DC for the desktop Window?
    Last edited by Michael Mattias; 23 May 2008, 10:00 AM.

    Leave a comment:


  • Patrice Terrier
    replied
    Michael,

    Tested on dual display, this code reports only the size of the first monitor.

    Regards

    Leave a comment:


  • Michael Mattias
    replied
    Updated for multiple-monitor support... I think.

    This works but I only have one monitor... so maybe someone with more than one monitor can test?

    (Note the error in the DECLARE in Win32API.INC I found). (I'll report that).

    Code:
    ' checkDesktopvideo.bas
    #COMPILE EXE
    #DIM ALL
    
    #INCLUDE "Win32API.INC"   ' 21 Feb 2005 
    
    FUNCTION GetDesktopVideoResolution ( cx AS LONG, cy AS LONG) AS LONG
        LOCAL hDC AS LONG, iret AS LONG
    
        hDc  = GetWindowDc (BYVAL %NULL)
        cx   = GetDeviceCaps (hDc, %HORZRES)
        cy   = getDeviceCaps (hDc, %VERTRES)
        iRet = ReleaseDc (BYVAL %NULL, hDc)
    
    END FUNCTION
    
    FUNCTION PBMAIN() AS LONG
    
     LOCAL cxAPI AS LONG, cyAPI AS LONG
     LOCAL cxDDT AS LONG, cyDDT AS LONG
     LOCAL s AS STRING, W AS STRING
    
     CALL GetDesktopVideoResolution ( cxAPI, cyAPI)
     DESKTOP GET SIZE TO cxDDT, cyDDT
    
       S = USING$ ("API SIZE  # x #" & $CRLF & " DDT SIZE # x #", cxAPI, cyAPI, cxDDT,cyDDT)
       
       CALL GetMonitorInfoString() TO W
       
       S = S & $CRLF & "---ENUM MONITOR INFO---"
       S = S & $CRLF & W
    
       MSGBOX  S, %MB_ICONINFORMATION, "Desktop Size Check"
    
    
    END FUNCTION
    
    ' ------------------------------------------------
    ' Enumerate all the monitors on the system and
    ' create a display line for each
    ' ------------------------------------------------
    
    FUNCTION GetMOnitorInfoString () AS STRING
        
        LOCAL hDC AS LONG,lpRect AS LONG, dwCallBack AS DWORD,dwUser AS LONG, iRet AS LONG
        LOCAL nMonitor AS LONG, MI() AS MonitorInfo
        LOCAL I AS LONG, W AS STRING, W2 AS STRING, S AS STRING
        LOCAL R AS RECT
        
        W              =  ""        ' reset the work string
        hDC            = %NULL       '   we want an enumeration of all monitors
        ' ***CHANGES 5/24/08 ************************
       ' Per debugging notes below:
       ' Delete:
        '   GETWindowRect     GetDesktopWindow(), R
        '   lpRect          = VARPTR(R)
        ' Add:
        lpRect              = %NULL
       ' **** END CHANGES 5/24/08 ********************
        dwCallBack      = CODEPTR (GetMonitorInfoCallBackProc)
        dwUser          = VARPTR (W)  ' pass string BYREF to callback
        REDIM             MI(0)       ' make it exist. Not necessary but I do it anyway.
        ' ******************************************************************
        ' NOTE: Win32API.Inc 21 Feb 2005  forgot the required "BYVAL" for
        '  parameter three 'lpfnEnum' of DECLARE so we override it here
        ' ******************************************************************
        iRet = EnumDisplayMonitors (hDC, BYVAL lpRect, BYVAL dwCallBack, dwUser)
        
        IF ISTRUE iRet THEN
            nMonitor = LEN(W) \ SIZEOF(MI (0))
        
          ' rebuild the display string
            REDIM MI(nMonitor- 1 )AT STRPTR (W)  ' overlay an array
            FOR I = LBOUND(MI, 1) TO UBOUND (MI,1)
               W2 = USING$ ("Monitor _# #  # x #", _
                      I, _
                      MI(I).RcMonitor.nRight - MI(I).rcMonitor.nLeft,_
                      MI(I).RcMonitor.nBottom - MI(I).rcMonitor.nTop) _
                  & $CRLF
               S = S & W2
             
           NEXT
        ELSE
             S = "EnumDisplayMonitors Failed"
        END IF
        
        FUNCTION = S
        
    END FUNCTION
        
    FUNCTION GetMonitorInfoCallbackProc (BYVAL hMonitor AS LONG, BYVAL Hdc AS LONG, r AS RECT, S AS STRING) AS LONG
        
        LOCAL MI AS MonitorInfo, iret AS LONG, W AS STRING
            
        MI.cbSize = SIZEOF(MI)
        iRet = GetMonitorInfo(hMonitor, BYVAL VARPTR(MI))  ' success==> true
        IF ISTRUE iRet THEN
            W        = PEEK$ (VARPTR (MI), SIZEOF(MI))  ' get the MI as a strring
            S        = S  &  W              ' add it to our total display string
        ELSE
            S        = S & "GetMonitorInfo Failed"
        END IF
            
        FUNCTION = %TRUE  ' continue
    
    END FUNCTION
    MCM
    Last edited by Michael Mattias; 24 May 2008, 08:26 AM. Reason: Update per debugging notes in subsequent postings.

    Leave a comment:


  • Barry Erick
    replied
    Originally posted by Matthias Kuhn View Post
    Hello,

    I'm using Win Vista and a 12 ' Screen with 1280x800 pixel
    (Samsung Notebook Q45). And an
    That must be one heck of a notebook to carry

    Leave a comment:


  • Cliff Nichols
    replied
    EXCELLLENT point Kev, cause apps do not normally take into account what you see vs, what it is displaying

    Leave a comment:


  • Kev Peel
    replied
    Is this a multi-monitor system? If so, you may want to use GetMonitorInfo to return the correct information. It's important to note that "desktop resolution" <> "screen resolution" as more than one screen can make up the desktop.

    Leave a comment:


  • Michael Mattias
    replied
    You might want to make sure you are comparing apples with apples first.

    DESKTOP GET SIZE reports the same as does Windows on my machine (Win/XP Pro) when compiled with PB/Win 8.03

    Code:
    ' checkDesktopvideo.bas
    #COMPILE EXE
    #DIM ALL
    
    #INCLUDE "Win32API.INC"
    
    
    FUNCTION GetDesktopVideoResolution ( cx AS LONG, cy AS LONG) AS LONG
        LOCAL hDC AS LONG, iret AS LONG
        hDc  = GetWindowDc (BYVAL %NULL)
        cx   = GetDeviceCaps (hDc, %HORZRES)
        cy   = getDeviceCaps (hDc, %VERTRES)
        iRet = ReleaseDc (BYVAL %NULL, hDc)
    END FUNCTION
    
    FUNCTION PBMAIN() AS LONG
    
     LOCAL cxAPI AS LONG, cyAPI AS LONG
     LOCAL cxDDT AS LONG, cyDDT AS LONG
     LOCAL s AS STRING
    
     CALL GetDesktopVideoResolution ( cxAPI, cyAPI)
     DESKTOP GET SIZE TO cxDDT, cyDDT
     
       S = USING$ ("API SIZE  # x #" & $CRLF & " DDT SIZE # x #", cxAPI, cyAPI, cxDDT,cyDDT)
       
       MSGBOX  S, %MB_ICONINFORMATION, "Desktop Size Check"
    
    
    END FUNCTION
    MCM

    Leave a comment:


  • screen resolution ist not correct with PBwin 8.04

    Hello,

    I'm using Win Vista and a 12 ' Screen with 1280x800 pixel
    (Samsung Notebook Q45). And an Intel Graphic driver ( Mobile Intel (R) 965 Express Chipset Family) not
    an ATI. And it looks like 1280x800 !

    PB - Win 8.04 tells me that the screen resolution is only (DESKTOP GET SIZE )1024x640 !!!!!

    How to get the right resolution form PB-win ?????

    And the right screen size in programs ??????


    Driver update are done.

    Thanks for help

    Regards

    Matthias Kuhn
    Last edited by Matthias Kuhn; 22 May 2008, 06:21 PM.
Working...
X