Search the Community
Showing results for tags 'refresh'.
-
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
-
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!
-
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
-
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)) NextThanks in advance
- 2 replies
-
- windows10
- controlsettext
-
(and 1 more)
Tagged with:
-
How can I do to, when I click on on a specific column in a listview control, instead to get clicked/sorted other column. Is this possible ? I already know how to sort a column when I click on it : after the listview control was created, I add this code : _GUICtrlListView_RegisterSortCallBack(-1) I know that a gui can wait for a window event to happen, like a click on a control, but how can this be done to look if I clicked on a specific column and if so then, to sort (a clasic sort ) other column instead o.O ?
-
Hello everybody, this is my first post and I'm quite new to the world of AutoIt. I already manage to change programmatically my desktop background via this one-liner: DllCall("user32.dll", "int", "SystemParametersInfo", "int", 20, "int", 0, "str", $CmdLine[1], "int", 0) (via drag 'n' drop of the desired wallpaper onto the compiled script). However, this code does even too much for my needs. In fact I have another software that changes the desktop but, for some unknown-to-me reasons, fails to send the WM_SETTINGCHANGE message (I can see the key HKCU\Control Panel\Desktop\Wallpaper getting updated in fact, by the way). So I ask you: how can I write a simple script that sends this message and thus triggers the wallpaper refresh? And will it work or the first script is the only "real"/"correct" way to proceed programmatically? I tried this but it doesn't work: #include-once Global $MAX_VALUE_NAME = 1024 Global $HWND_BROADCAST = 0xffff Global $WM_SETTINGCHANGE = 0x001A Global $SMTO_ABORTIFHUNG = 0x0002 Global $SMTO_NORMAL = 0x0000 Global $MSG_TIMEOUT = 5000 DllCall("user32.dll", "lresult", "SendMessageTimeoutW", _ "hwnd", $HWND_BROADCAST, _ "dword", $WM_SETTINGCHANGE, _ "ptr", 0, _ "wstr", "Environment", _ "dword", $SMTO_ABORTIFHUNG, _ "dword", $MSG_TIMEOUT, _ "dword_ptr*", 0) Many thanks in advance to whomever will help me!
- 8 replies
-
- WM_SETTINGCHANGE
- refresh
-
(and 1 more)
Tagged with: