dansxmods Posted January 11, 2009 Share Posted January 11, 2009 Hi all, Is anybody else having problems with guidelete in the latest version of autoit, or am i using it in the wrong way. Func _close_about() DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 200, "long", 0x00050004) GUISetState(@SW_HIDE, $Form1) GUIDelete() GUISetState(@SW_SHOW, $input_gui) _WinAPI_RedrawWindow($input_gui) EndFunc;==> _close_about() Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted January 11, 2009 Moderators Share Posted January 11, 2009 @dansxmods, I have no problems at all with GUIDelete in 3.3.0.0. Have you tried the code without hiding the window first and deliberately specifying the ID? That has worked for me in the past, and still does:Func _close_about() DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 200, "long", 0x00050004) GUIDelete($Form1) GUISetState(@SW_SHOW, $input_gui) _WinAPI_RedrawWindow($input_gui) EndFunc;==> _close_about() M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 11, 2009 Share Posted January 11, 2009 also why do you need to use guidelete unless your doing something other than making it invisible... @SW_HIDE does that and if im correct onautoitexit delets the gui on exit so yeah idk [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
dansxmods Posted January 12, 2009 Author Share Posted January 12, 2009 (edited) I think it is how I am using it I tried @sw_hide but it doesn't hide the title in the taskbar. I also tried not using the @sw_hide and specifying the id but it still crashes my script. It still doesn't work with the previous version of autoit either. Thanks for your advice but the problem still remains. It still works if I put it within the function that create the gui. Then I tried putting an if then else in there but that then causes it to crash. Edited January 12, 2009 by dansxmods Link to comment Share on other sites More sharing options...
CodyBarrett Posted January 12, 2009 Share Posted January 12, 2009 ok then maybe you should try and make your gui a toolwindow and always ontop, then have it minimize\maximise by a hotkey then try @SW_HIDE thats what i would do [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] Link to comment Share on other sites More sharing options...
rasim Posted January 12, 2009 Share Posted January 12, 2009 Hi all, Is anybody else having problems with guidelete in the latest version of autoit, or am i using it in the wrong way. Func _close_about() DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $Form1, "int", 200, "long", 0x00050004) GUISetState(@SW_HIDE, $Form1) GUIDelete() GUISetState(@SW_SHOW, $input_gui) _WinAPI_RedrawWindow($input_gui) EndFunc;==> _close_about()Works fine for me: #include <GuiConstantsEx.au3> Global $hGUI = GUICreate("Test", 300, 200) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE DllCall("user32.dll", "int", "AnimateWindow", "hwnd", $hGUI, "int", 200, "long", 0x00050004) GUISetState(@SW_HIDE, $hGUI) GUIDelete($hGUI) Maybe GUIDelete($Form1)? Or make a small example to represent your problem. Link to comment Share on other sites More sharing options...
dansxmods Posted January 12, 2009 Author Share Posted January 12, 2009 (edited) Can somebody give this a try and see if it crashes on them. expandcollapse popup#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> Global $sample, $label GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") Func _open_gui() $sample = GUICreate("Hello", -1, -1, -1, -1) $label = GUICtrlCreateLabel("Click on me", 20, 40, -1, -1, $SS_CENTER) $button = GUICtrlCreateButton("Or click here", 20, 80) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $gui_event_close Exit Case $msg = $button _delete_gui() Exit EndSelect WEnd EndFunc Func _delete_gui() GUIDelete($sample) EndFunc Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Switch $iwParam case $label _delete_gui() ;~ MsgBox(0,"test","test") ;~ Exit EndSwitch Return $GUI_RUNDEFMSG EndFunc _open_gui() Am I using the GUIRegisterMsg incorrectly. EDIT: Made a better example. Clicking on the label causes it to crash. Edited January 12, 2009 by dansxmods Link to comment Share on other sites More sharing options...
rasim Posted January 12, 2009 Share Posted January 12, 2009 @dansxmods Clicking on the label causes it to crashCrash? Clicking on the label causes the GUI deleting: expandcollapse popup#include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> Global $sample, $label GUIRegisterMsg($WM_COMMAND, "WM_COMMAND") _open_gui() Func _open_gui() $sample = GUICreate("Hello", -1, -1, -1, -1) $label = GUICtrlCreateLabel("Click on me", 20, 40, -1, -1, $SS_CENTER) $button = GUICtrlCreateButton("Or click here", 20, 80) GUISetState() While 1 $msg = GUIGetMsg() Select Case $msg = $gui_event_close Exit Case $msg = $button _delete_gui() Exit EndSelect WEnd EndFunc ;==>_open_gui Func _delete_gui() GUIDelete($sample) EndFunc ;==>_delete_gui Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Switch $iwParam Case $label _delete_gui() Exit EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND Link to comment Share on other sites More sharing options...
dansxmods Posted January 12, 2009 Author Share Posted January 12, 2009 Hmmm, Strange. On my PC it crashes and cause Dr. Watson Post Mortem Debugger to crash also. 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