Carm01

ControlSetText and monitor refresh rate windows 10

3 posts in this topic

#1 ·  Posted (edited)

All,

 

I have windows 10 64 bit pro with the latest versions of scite and 3.3.14.2 installed. Not that it matters for this instance.

My monitor resolution is 1920 x 1080 progressive with a refresh rate of 64 HZ ( more in a min on that )

I have a Nvida gtx 960 card and an HP monitor

Since moving to Windows 10 and this configuration ( latest drivers of course ) I am unable to see the " ControlSetText " being displayed under the standard 60HZ refresh rate in WIndows 10. On Windows 7 machines this is flawless and always had been. The ControlSetText is updated at an extremely fast rate. IF I change the resolution one notch lower in windows 10 the display displays the text like in Windows 7 60HZ refresh. IF I user the max resolution 1920 x 1080 @ 60 HZ nothing is displayed in Windows 10. IF I create a custom resolution profile and just change the refresh rate to 64HZ it displays normally in Windows 10.

If I enable " GUIGetMsg() " it displays fine but processes very slow fyi

I will place the relevant code below. I am wondering:

1) what is the max refresh/update rate for ControlSetText ( fasted it can be updated )

2) Could this be adjusted either in code without hampering processing speed

3) Does this need to be addressed in AutoIT program itself as a bug ?

 

 

 

#include <Array.au3>
#include <File.au3>
Local $aRetArray, $aArray
local $sFilePath = @ScriptDir & "\info.txt"
_FileReadToArray($sFilePath, $aRetArray)
Local $aArray[UBound($aRetArray)]
SplashTextOn("Percent Complete", "", 130, 40, -1, -1, 16, "")
Local $a = 0
Local $hTimer = TimerInit()
$bb = UBound($aRetArray) - 1
For $i = 1 To UBound($aRetArray) - 1 ;
    ;GUIGetMsg();prevent high cpu usage
    $line = $aRetArray[$i]
    If StringRight($line, 2) = " X" Then
        If $i = 1 Then
            $line1 = StringLen($line) - StringLen($aRetArray[$i])
            $line2 = StringRight($line, $line1)
            $line3 = $aRetArray[$i]
            $line4 = $aRetArray[$i + 1]
        Else
            $line1 = StringLen($line) - StringLen($aRetArray[$i - 1])
            $line2 = StringRight($line, $line1)
            $line3 = $aRetArray[$i - 1];
            $line4 = $aRetArray[$i + 1]; 
        EndIf
        $aArray[$a] = $i & "| " & $line3 & "| " & $line2 & "| " & $line4
        $a = $a + 1
    EndIf
    ControlSetText("Percent Complete", "", "Static1", Round((($i / $bb) * 100), 2))
Next

Thanks in advance

Edited by Carm01
there is a script you can run

Share this post


Link to post
Share on other sites



Please post a script we can run so that we can see the same issues you say you're seeing.


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

Please post a script we can run so that we can see the same issues you say you're seeing.

Posted

I wanted report at work on a windows 10 machine, a laptop at that, I had zero issues, but it was not at that high of a resolution but 60HZ.

Also turning off clear type text on the problematic machine allowed the progress to show barely though.

I also added a quick video of what I am experiencing. First with 60HZ 1920 X 1080 and second with 64HZ 1920 x 1080

 

 

ControlSetText.mp4

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now

  • Similar Content

    • DLS
      By DLS
      I have a working script that changes the core affinity and process priority of multiples of a specific application I have running.  
      I have that part figured out.

      I would like to make a little modification to it.

      Windows10 introduced virtual desktops.  I am trying to have different core affinity and priority of processes on the visible and non-visible desktops.  
      What I need is a bool function that could be described as IsWindowOnCurrentDesktop($hWnd).  I have searched the winAPI.au3 but I do not believe anything like that exists built it.
      I have searched multiple places before asking for help. I found a Microsoft supplied example of the function I need using C#, but I am unfamiliar with C# to a degree that I cannot port the system call over.
      https://blogs.msdn.microsoft.com/winsdk/2015/09/10/virtual-desktop-switching-in-windows-10/
      Help is appreciated but not expected.  Thanks in advanced.   In the meantime I will be learning C# syntax and class structure.
    • ces1a
      By ces1a
      I recently upgraded my laptop to one with Windows 10 and higher screen resolution.  In the process I found that some of my scripts did not work right when using Autoit's @DesktopWidth and @DesktopHeight macros.  Insteat of 1920 x 1080 resolution Autoit detects 1536 x 864.  Thus, GUIs designed to appear near the right edge of the screen  displayed closer to the horizontal middle of the screen.  I assume others may have the same problem.
      A search on this forum and Microsoft Script Center helped me to write the following script that gets the true screen width and height from WMI.
      MsgBox(0, '', _GetMonitorInfo())
      Func _GetMonitorInfo()
          Local $oWMI, $Listing, $sWidth = 0, $sHeight = 0
          $oWMI = ObjGet("winmgmts:\\" & @ComputerName & "\root\CIMV2")
          If IsObj($oWMI) Then
              $Listing = $oWMI.ExecQuery("SELECT * FROM Win32_DesktopMonitor")
              If IsObj($Listing) Then
                  For $oItem In $Listing
                      $sHeight = $oItem.ScreenHeight
                      $sWidth = $oItem.ScreenWidth
                  Next
              EndIf
          EndIf
          Return "Width: " & $sWidth & @CRLF & "Height: " & $sHeight
      EndFunc ;_GetMonitorInfo

      Hopefully it will benefit others.  I for sure am very happy with all the samples I been able to find here in the past.
    • Edie
      By Edie
      I'm using this method to draw a transparent image inside my window. It works, but not as expected. With that example - without minimize button or anything else and the _GDIPlus_GraphicsDrawImageRect inside the main loop -, it works, but when you need to refresh the window, like restoring it after minimized or when you drag some window above your autoit window, the draw just gone. How can I refresh the image, for example, when I display one MsgBox and minimize and restore the window with the MsgBox opened?
      Try the example below. Run the script and the image will show, then minimize and restore. Then click on the button, keep the MsgBox opened, minimize and restore... The image just disappears. How can I keep it?
      teste.au3
    • ces1a
      By ces1a
      I was looking for a way to find out how long my PC had been running a few weeks ago and had trouble finding something that satisfied my needs,  I found a Visual Basic Script that worked but found it too long. But searching trough AutoIt WINAPI help found that it really was as simple as the following little script.
      #include <WinAPISys.au3>
      #include <WinAPIMisc.au3>
      Local $Uptime = _WinAPI_StrFromTimeInterval(_WinAPI_GetTickCount())
      MsgBox(0, '', "PC Uptime ==> " & $UpTime)
      Hope it helps...
    • zerothesavior
      By zerothesavior
      I can't get this to work.
      ControlSetText("[CLASS:#32770]", "", "[CLASS:Edit; INSTANCE:3]", $sString) Am I doing something wrong? The string is not blank, I checked it with a message box.
      Here is the information from the window:
      >>>> Control <<<< Class: Edit Instance: 3 ClassnameNN: Edit3 Name: Advanced (Class): [CLASS:Edit; INSTANCE:3] ID: 1001 Text: Position: 47, 78 Size: 187, 14 ControlClick Coords: 112, 9 Style: 0x50000380 ExStyle: 0x00000000 Handle: 0x000000000021064A