locked
Rate of play with Windows Media Player in Vista RRS feed

  • Question

  •  

    Ok, ive had a ton of problems with using windows media player and installing on a vista machine, ive finally worked out most of them except for this one.

     

    Right now I have a slider that controls the rate of play of the video.  1/4, 1/2, 3/4, full speed etc.  I use mediaPlayer.rate to set the speed.  It works fine on Windows XP and 2000.  But on Vista the play speed doesnt change at all.  What am I doing wrong?

     

    Also.  Is there a way to tell what font DPI the user is using via VB code?  I am having trouble with my forms displaying improperly because I need to set the size programmatically so it would be helpful if I could tell if they are in 96 dpi or the large 120 DPI in vista.

     

    Thanks.

    Wednesday, August 22, 2007 7:53 PM

Answers

  • JulianRidley,

     

    1. According to your first question on Windows Media playing rate in Vista, I found your thread Windows media player behavior on Vista in Visual Basic General forum. You can take a look at the article How are ratings used in Windows Media Player that can provide you some idea on the documents. Since there is no better answer in this forum, you can consider to post the question in Media Foundation Development forum. There are more exports on Media development issues.

     

    2. According to your second question on font DPI in Vista, please take a look at the following article and thread:

     

    UI Automation and Screen Scaling

     

    Windows Vista enables users to change the dots per inch (dpi) setting so that most user interface (UI) elements on the screen appear larger. Although this feature has long been available in Microsoft Windows, in previous versions the scaling had to be implemented by applications. In Windows Vista, the Desktop Window Manager performs default scaling for all applications that do not handle their own scaling. UI Automation client applications must take this feature into account.

     

    Code Snippet

        Structure CursorPoint

            Public X As Integer

            Public Y As Integer

        End Structure

     

        <System.Runtime.InteropServices.DllImport("user32.dll")> _

        Friend Shared Function GetPhysicalCursorPos(ByRef lpPoint As CursorPoint) As Boolean

        End Function

     

        Private Function ShowUsage() As Boolean

     

            Dim cursorPos As New CursorPoint()

            Try

                Return GetPhysicalCursorPos(cursorPos)

            Catch e As EntryPointNotFoundException ' Not Windows Vista

                Return False

            End Try

     

        End Function

     

     

     

    Display resolution and font size

     

    If a program has been careful to design and test for a range of DPIs, it can tell Vista that it's "DPI-aware" to stop the lies and the scaling.  Instead, you can call SetProcessDPIAware before you create any UI.

    SetProcessDPIAware is a new API for Vista.  If your program needs to be backward compatible to pre-Vista versions of Windows, you can use LoadLibrary and GetProcAddress to see if SetProcessDPIAware is available before calling it.

     

    Hope that can help you.

    Monday, August 27, 2007 5:36 AM