Jump to content
Carm01

ControlSetText and monitor refresh rate windows 10

Recommended Posts

Carm01

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
BrewManNH

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
Carm01

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

    • XinYoung
      By XinYoung
      For fun, I'm building an app that opens a webpage and refreshes it every 30 seconds.
      But once the script performs _IEAction($oIE, "refresh"), the GUI closes.
      Any help is appreciated.
       

      #include <ButtonConstants.au3>
      #include <EditConstants.au3>
      #include <GUIConstantsEx.au3>
      #include <StaticConstants.au3>
      #include <WindowsConstants.au3>
      #include <WinAPIFiles.au3>
      #include <Array.au3>
      #include <File.au3>
      #include <Excel.au3>
      #include <DateTimeConstants.au3>
      #include <MsgBoxConstants.au3>
      #include <WinAPIShellEx.au3>
      #include <MsgBoxConstants.au3>
      #include <Date.au3>
      #include <ComboConstants.au3>
      #include <guimenu.au3>
      #include <IE.au3>
      HotKeySet("{F4}", "_Exit")
      ;Open the file(s) in the selected folder
      $extension = ".txt"
      $app2openWith = @SystemDir & "\notepad.exe"
      Func Begin()
          Global $loopTrick = 0
          #Region ### START Koda GUI section ### Form=c:\users\mchu\downloads\autoit\my code\form1.kxf
          Global $UI = GUICreate("Hit Em Up!", 256, 113, -1, -1)
          GUISetBkColor(0x000000)
          $menu = _GUICtrlMenu_GetSystemMenu($UI)
          _GUICtrlMenu_EnableMenuItem($menu, $SC_CLOSE, 1, False)
          Global $url = GUICtrlCreateInput("https://www.youtube.com/watch?v=dQw4w9WgXcQ", 81, 8, 160, 21)
          $Label1 = GUICtrlCreateLabel("Target:", 16, 8, 55, 17)
          GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
          GUICtrlSetColor(-1, 0x00FF00)
          Global $StartBut = GUICtrlCreateButton("Start", 16, 40, 67, 25)
          GUICtrlSetFont(-1, 13, 800, 0, "MS Sans Serif")
          GUICtrlSetBkColor(-1, 0x008000)
          $Label2 = GUICtrlCreateLabel("(Press F4 to Exit)", 96, 40, 8000, 17)
          GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif")
          GUICtrlSetColor(-1, 0x00FF00)
          GUISetState(@SW_SHOW)
          #EndRegion ### END Koda GUI section ###
          While 1
              $UIfunc = GUIGetMsg()
              Select
                  Case $UIfunc = $GUI_EVENT_CLOSE
                      _Exit()
                  Case $UIfunc = $StartBut
                      If GUICtrlRead($url) = "" Then
                          MsgBox(48, "Um...", "Give me a target you idiot.")
                      Else
                          GUICtrlSetState($url, $GUI_DISABLE)
                          GUICtrlSetState($StartBut, $GUI_DISABLE)
                          Start()
                      EndIf
              EndSelect
          WEnd
      EndFunc   ;==>Begin
      Func Start()
          If $loopTrick = 0 Then
              Global $oIE = _IECreate(GUICtrlRead($url))
              _IELoadWait($oIE)
              Again()
          ElseIf $loopTrick = 1 Then
              Sleep(3000)
              _IEAction($oIE, "refresh")
              Sleep(3000)
              Start()
          EndIf
      EndFunc   ;==>Start
      Func Again()
          $loopTrick = 1
          Start()
      EndFunc   ;==>Again
      Func _Exit()
          Exit
      EndFunc   ;==>_Exit
    • Rskm
      By Rskm
      i have a code where the ControlSetText was working perfectly. now its not working. please see the video and snap attached. The snap show the way i have used window info. In the video,  when the dialogue box opens, it used to key in 'sea.runx' , but now its not working so... what could be the reason. the script used is as shown below - thanks
       
      WinActivate("SACS 5.3 V8i")
       winwaitactive("SACS 5.3 V8i")
      send("^r")
      winwaitactive("SACS Run Files")
      ControlSetText ("SACS Run Files","",1148,"sea.runx")
      SEND("{ENTER}")2018-03-22 at 00-02-47.mp4
       

    • 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?
      Thanks!

    • 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, "", "WindowsForms10.EDIT.app.0.378734a6", $dbserver)  
      where $MartConfigWindow has the window ID.
      And the text box field is having class as WindowsForms10.EDIT.app.0.378734a6
       
      THis code is working on one machine but on some machines, the last part of ID WindowsForms10.EDIT.app.0.378734a6, 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.
      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.
×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.