Announcement

Collapse
No announcement yet.

screen resolution ist not correct with PBwin 8.04

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

  • 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.

  • #2
    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
    Michael Mattias
    Tal Systems (retired)
    Port Washington WI USA
    [email protected]
    http://www.talsystems.com

    Comment


    • #3
      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.
      kgpsoftware.com | Slam DBMS | PrpT Control | Other Downloads | Contact Me

      Comment


      • #4
        EXCELLLENT point Kev, cause apps do not normally take into account what you see vs, what it is displaying
        Engineer's Motto: If it aint broke take it apart and fix it

        "If at 1st you don't succeed... call it version 1.0"

        "Half of Programming is coding"....."The other 90% is DEBUGGING"

        "Document my code????" .... "WHYYY??? do you think they call it CODE? "

        Comment


        • #5
          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
          Barry

          Comment


          • #6
            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.
            Michael Mattias
            Tal Systems (retired)
            Port Washington WI USA
            [email protected]
            http://www.talsystems.com

            Comment


            • #7
              Michael,

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

              Regards
              Patrice Terrier
              www.zapsolution.com
              www.objreader.com
              Addons: GDImage.DLL 32/64-bit (Graphic library), WinLIFT.DLL 32/64-bit (Skin Engine).

              Comment


              • #8
                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.
                Michael Mattias
                Tal Systems (retired)
                Port Washington WI USA
                [email protected]
                http://www.talsystems.com

                Comment


                • #9
                  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

                  Comment


                  • #10
                    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.
                    Michael Mattias
                    Tal Systems (retired)
                    Port Washington WI USA
                    [email protected]
                    http://www.talsystems.com

                    Comment


                    • #11
                      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

                      Comment


                      • #12
                        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.

                        Comment


                        • #13
                          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" )
                          Engineer's Motto: If it aint broke take it apart and fix it

                          "If at 1st you don't succeed... call it version 1.0"

                          "Half of Programming is coding"....."The other 90% is DEBUGGING"

                          "Document my code????" .... "WHYYY??? do you think they call it CODE? "

                          Comment

                          Working...
                          X