Rex Posted June 7, 2005 Share Posted June 7, 2005 Is there a way to do a gui refresh, like when you hit F5 in explorer. When i start my gui it read some settings from file/reg and adds then into a treeview, and some input/checkboxe's. What i now is trying to do is simulate / do a fake guiclose or somthing like that to get the gui to clear all info current in the gui and then re read the info, is there a way to do that. All my items in the treeview is added by reading a filen and then pased into arrayers. eg. $i = 0 $Lines = _FileCountLines("C:\Test.ini") If Not $lines = 0 Then ReDim $ahsLines[$Lines][2] $file = FileOpen("C:\Test.ini", 0) Do $i = $i + 1 $line = FileReadLine($file, $i) $ahsLines[$i-1][0] = $line $ahsLines[$i-1][1] = GuiCtrlCreateTreeViewItem($line, $treeview) Until $i = $lines FileClose($file) Link to comment Share on other sites More sharing options...
GaryFrost Posted June 8, 2005 Share Posted June 8, 2005 Far as I know, no such thing as a Gui refresh at this time Can delete the gui and rebuild or if it's just the treeview data can clear it with the following Global Const $TVM_DELETEITEM = 0x1101 Global Const $TVI_ROOT = -0x10000 Func _GUICtrlTreeViewDeleteAllItems($h_treeview) Return GUICtrlSendMsg($h_treeview, $TVM_DELETEITEM, 0, $TVI_ROOT) EndFunc then reload the data. SciTE for AutoItDirections for Submitting Standard UDFs Don't argue with an idiot; people watching may not be able to tell the difference. Link to comment Share on other sites More sharing options...
yawoo Posted July 23, 2005 Share Posted July 23, 2005 Far as I know, no such thing as a Gui refresh at this timeCan delete the gui and rebuildor if it's just the treeview datacan clear it with the followingGlobal Const $TVM_DELETEITEM = 0x1101 Global Const $TVI_ROOT = -0x10000 Func _GUICtrlTreeViewDeleteAllItems($h_treeview) Return GUICtrlSendMsg($h_treeview, $TVM_DELETEITEM, 0, $TVI_ROOT) EndFuncthen reload the data.<{POST_SNAPBACK}>How to delete GUI and rebuild it?I try to GUIDelete() and GUICreate(), but it seems to be failed.I would like to write a program, choose language setting from Combobox,and then the GUI will change to another language interface. Link to comment Share on other sites More sharing options...
Rex Posted July 23, 2005 Author Share Posted July 23, 2005 How to delete GUI and rebuild it?I try to GUIDelete() and GUICreate(), but it seems to be failed.I would like to write a program, choose language setting from Combobox,and then the GUI will change to another language interface.<{POST_SNAPBACK}>Just do it like this, i did :"> Run(@ScriptFullPath) ExitOf course you need to compile the script, for this to work Else try this_GuiCreate() GUIDelete($MyGui) Func _GuiCreate(); This is the main gui, for the "loop" to use, it's not a real loop ; but more a do before we do somthing else :blink: $MyGui = GuiCreate("My Gui") Link to comment Share on other sites More sharing options...
quaizywabbit Posted July 23, 2005 Share Posted July 23, 2005 Const $SWP_NOMOVE = 0x0002, $SWP_NOSIZE = 0x0001, $SWP_NOZORDER = 0x0004, $SWP_FRAMECHANGED = 0x0020;from Winuser.h DllCall("user32.dll", "long", "SetWindowPos", "hwnd", $yourwindowHWND_here, "hwnd", $yourwindowHWND_here, "int", 0, "int", 0, "int", 0, "int", 0, _ "long", BitOR($SWP_NOMOVE, $SWP_NOSIZE, $SWP_NOZORDER, $SWP_FRAMECHANGED)) I use this to update a window after altering its Style/ExStyle settings.... [u]Do more with pre-existing apps![/u]ANYGUIv2.8 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