Jikoo Posted November 19, 2008 Share Posted November 19, 2008 (edited) Hello,Today, I will be critical ! I would like to talk about the time to refresh a window is too long when I resize it (using mouse on bottom right corner). Why ?I tested MSpaint and Notepad on XP SP2, it's the same thing !... but not with Wordpad, Internet Explorer, VLC, Mozilla Firefox and most of programs.Why AutoIt use an "old" method to refresh GUI when I resize it ? Why AutoIt redraw all controls after each resizing ? Is it the same thing on VISTA ?A basic script. Use mouse on bottom right corner to resize the GUI and play with the resizing GUI.#include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt('MustDeclareVars', 1) Local $msg GUICreate("My GUI", 200, 200, -1, -1, $WS_OVERLAPPEDWINDOW) GUICtrlCreateListView("Demo", 10, 10, 180, 160) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() Edited November 19, 2008 by Jikoo My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). Link to comment Share on other sites More sharing options...
Airwolf Posted November 19, 2008 Share Posted November 19, 2008 I just tested your script on my XP SP3 box, and resizing was instantaneous. Certifications: A+, Network+, Security+, Linux+, LPIC-1, MCSA | Languages: AutoIt, C, SQL, .NETBooks: AutoIt v3: Your Quick Guide - $7.99 - O'Reilly Media - September 2007-------->[u]AutoIt v3 Development - newbie to g33k[/u] - Coming Soon - Fate Publishing - Spring 2013UDF Libraries: SkypeCOM UDF Library | ADUC Computers OU Cleanup | Find PixelChecksumExamples: Skype COM Examples - Skype4COMLib Examples converted from VBS to AutoIt Link to comment Share on other sites More sharing options...
Jikoo Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) Thanks Airwolf, Not for me. For example, I see a difference between Notepad and Worpad resizing on XP SP2 ! Same difference between AutoIt compiled script and VLC ! It's not instantaneous for Notepad and AutoIt compiled script because all controls are redraw, not on Wordpad and VLC. Sure, methods of resizing are different. Edited November 19, 2008 by Jikoo My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). Link to comment Share on other sites More sharing options...
youknowwho4eva Posted November 19, 2008 Share Posted November 19, 2008 I notice slightly more flicker with notepad then wordpad, and I have SP3. I'm wondering if there's a pause redraw function? Giggity Link to comment Share on other sites More sharing options...
Jikoo Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) Yes youknowwho4eva, That's what I am talking about : the flickering. Add Sleep(100) in the main loop is not the best solution ! ...And using of @SW_LOCK/@SW_UNLOCK is not easy for GUI resizing. Edited November 19, 2008 by Jikoo My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). Link to comment Share on other sites More sharing options...
youknowwho4eva Posted November 19, 2008 Share Posted November 19, 2008 What about checking to see if the window size is changing, locking the gui, then when the changes stop unlock it. Giggity Link to comment Share on other sites More sharing options...
Jikoo Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) The problem is known long time ago. Look at hereA good example of this problem Edited November 19, 2008 by Jikoo My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). Link to comment Share on other sites More sharing options...
Jikoo Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) youknowwho4eva,It could be a solution. Do you think it's possible to use this method with Opt("GUIOnEventMode", 0) ;0=disabled, 1=OnEvent mode enabled because my program have more than 2000 lines !!! Edited November 19, 2008 by Jikoo My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). Link to comment Share on other sites More sharing options...
Jikoo Posted November 19, 2008 Author Share Posted November 19, 2008 I found the solution here.Use the extended window style $WS_EX_COMPOSITED and the flickering will go away.Const $WS_EX_COMPOSITED = 0x2000000 My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). Link to comment Share on other sites More sharing options...
Jikoo Posted November 19, 2008 Author Share Posted November 19, 2008 (edited) A simple example done by myself : (No disco-club flickering ! ) #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> Opt('MustDeclareVars', 1) Global Const $WS_EX_COMPOSITED = 0x2000000 Global $msg Global $GUI = GUICreate("My GUI", 200, 200, -1, -1, $WS_OVERLAPPEDWINDOW, $WS_EX_COMPOSITED) Global $lv = GUICtrlCreateListView("Demo", 10, 10, 180, 160, BitOR($GUI_SS_DEFAULT_LISTVIEW, $LVS_NOCOLUMNHEADER)) Global $hLV = ControlGetHandle($GUI, "", $lv) For $y = 0 to 10 _GUICtrlListView_AddItem($hLV, "Item : " & $y) Next _GUICtrlListView_SetColumnWidth($hLV, 0, $LVSCW_AUTOSIZE) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg() If $msg = $GUI_EVENT_CLOSE Then ExitLoop WEnd GUIDelete() Edited November 19, 2008 by Jikoo My projects : GCS Search 1.07 (GUI Control Styles Search)* Multilingual tool to help about the old scripts, with a dynamic menu.* Easy way to find missing Include files in old scripts downloaded from forums !* Famous Monoceres script added and improved (visual, drag and drop, automatic)* There is an interactive color converter with palettes too, for fun !The best way to start Autoit3 development (for newbies). 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