ControlSetText and monitor refresh rate windows 10

3 posts in this topic

#1 ·  Posted (edited)



I have windows 10 64 bit pro with the latest versions of scite and 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]
            $line1 = StringLen($line) - StringLen($aRetArray[$i - 1])
            $line2 = StringRight($line, $line1)
            $line3 = $aRetArray[$i - 1];
            $line4 = $aRetArray[$i + 1]; 
        $aArray[$a] = $i & "| " & $line3 & "| " & $line2 & "| " & $line4
        $a = $a + 1
    ControlSetText("Percent Complete", "", "Static1", Round((($i / $bb) * 100), 2))

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


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




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

    • RC86
      By RC86
      Afternoon, I could very well be doing this wrong so feel free to totally advise otherwise - I'm wanting to use a GUI to first display a key from within an INI file, then secondly change the INI file by using a FileSelectFolder command but then I want to see the GUI change to reflect the change I've just made.
      #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 615, 437, 192, 124) $Input1 = GUICtrlCreateInput(Iniread(@WorkingDir & "\test.ini","Path","FilePath",""), 64, 80, 121, 21) $Button1 = GUICtrlCreateButton("Change", 200, 80, 75, 25) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 $selectedFolder = FileSelectFolder("Select Log Path Directory",@WorkingDir,0) If NOT $selectedFolder = "" Then $newLogPath = IniWrite(@WorkingDir & "\test.ini","Path","FilePath",$selectedFolder) EndIf EndSwitch WEnd So 2 part question really: (1) Should I be using GUICtrlCreateInput to display my INI read from within the GUI? (2) How can I refresh the GUI to update that to read the new information I've just written to the GUI?

    • ur
      By ur
      I need to set value to a text box to a desktop application.
      I am trying to do that with 
      ControlSetText($MartConfigWindow, "", "", $dbserver)  
      where $MartConfigWindow has the window ID.
      And the text box field is having class as
      THis code is working on one machine but on some machines, the last part of ID, means 378734a6
      is changing.
      Is there anyway to handle this?
    • 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.
      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
          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?