Biatu Posted September 6, 2015 Share Posted September 6, 2015 I have come across an issue that affects the performance of a few of my scripts over a period of a few years now. I notice it on Windows 7, 8, and 10.It happens when I have script run a function that calls other functions, and an adlib is running gui updates. After a few seconds the gui stops responding, or slowsdown immediately when my cursor stops moving. If i move the cursor around the screen the script speeds up, weather or not its moving within the gui. Anyone else noticing this? What is what? What is what. Link to comment Share on other sites More sharing options...
kylomas Posted September 7, 2015 Share Posted September 7, 2015 Can you post an example or reproducer? Forum Rules Procedure for posting code "I like pigs. Dogs look up to us. Cats look down on us. Pigs treat us as equals." - Sir Winston Churchill Link to comment Share on other sites More sharing options...
Biatu Posted September 12, 2015 Author Share Posted September 12, 2015 (edited) expandcollapse popup;I found that this issue had to do with the adlib loop and GuiGetMsg. $iProgress=0 $iStop=0 $hGUI=GUiCreate("",512+64,32) $idProgress=GUICtrlCreateProgress(0,0,512,32) $idStart=GUICtrlCreateButton("Start",512,0,64,32) GuiSetState() While 1 $iMsg=GuiGetMsg() Switch $iMsg Case -3 Exit Case $idStart AdlibRegister("Update",10) GUICtrlSetData($idStart,"Stop") Start() AdlibUnRegister("Update") GUICtrlSetData($idStart,"Start") GUICtrlSetData($idProgress,100) $iStop=0 EndSwitch WEnd Func Update() GUICtrlSetData($idProgress,$iProgress) $iMsg=GuiGetMsg() Switch $iMsg Case -3 Exit Case $idStart $iStop=1 EndSwitch EndFunc Func Start() For $i=0 to 1000000 If $iStop Then ExitLoop $iProgress=($i/1000000)*100 Next EndFunc Edited September 12, 2015 by Biatu What is what? What is what. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now