VicTT 0 Posted May 12, 2005 (edited) K..so what's wrong with this piece of code???It starts the GUI for a second and then it closes just like that..what am I missing? #include <GUIConstants.au3> $child=GuiCreate("Parinte",400,400) $button=GUICtrlCreateButton ("OK", 10, 30, 50) GuiSetState(@SW_SHOW) While 1 $msg=GuiGetMsg(1) if ($msg[1]=$child)&&($msg[0]=$GUI_EVENT_CLOSE) then GuiDelete($child) EndIf if $msg[0] = $GUI_EVENT_CLOSE then ExitLoop if $msg[0] = $button then $child=GuiCreate("Copil",100,200,-1,-1,-1,-1,$child) GuiSetState(@SW_SHOW,$child) EndIf WEnd Edited : My bad..it doesn't even compile.. Edited May 12, 2005 by VicTT [quote]Together we might liveDivided we must fall[/quote] Share this post Link to post Share on other sites
DaleHohm 65 Posted May 12, 2005 You're having a 60's moment switching between too many programming languages. Try using AND instead of && Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better?IE.au3 issues with Vista - WorkaroundsSciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble Share this post Link to post Share on other sites
datskat 0 Posted May 12, 2005 hope the below helps... #include <GUIConstants.au3> $child = "x" $parent = GUICreate("Parinte",400,400) $button = GUICtrlCreateButton ("OK", 10, 30, 50) GUISetState(@SW_SHOW) While 1 $msg = GUIGetMsg(1) If $msg[0] = 0 Then ContinueLoop ElseIf $msg[1] = $child And $msg[0] = $GUI_EVENT_CLOSE Then GUIDelete($child) ElseIf $msg[1] == $parent And $msg[0] = $GUI_EVENT_CLOSE Then ExitLoop ElseIf $msg[0] == $button Then $child = GUICreate("Copil",200,200,-1,-1,-1,-1,$parent) GUISetState(@SW_SHOW,$child) Else ContinueLoop EndIf Wend Exit Share this post Link to post Share on other sites
VicTT 0 Posted May 12, 2005 LOL! DaleHohm is right )..lols..yea..I'm used to&like PASCAL, HAVE to know C, and WANT to get to know AutoIt..thus, the above code piece appeared.. Thanks alot, everyone [quote]Together we might liveDivided we must fall[/quote] Share this post Link to post Share on other sites
VicTT 0 Posted May 12, 2005 Hmmm..one lil problem..if you spawn 2 windows using the OK button, the 2nd one closes just fine by the almighty "X" button, but the 1st seems to resist every attempt to be closed.. [quote]Together we might liveDivided we must fall[/quote] Share this post Link to post Share on other sites
datskat 0 Posted May 12, 2005 Are using the example that i posted? Share this post Link to post Share on other sites
VicTT 0 Posted May 12, 2005 Sure am [quote]Together we might liveDivided we must fall[/quote] Share this post Link to post Share on other sites
datskat 0 Posted May 12, 2005 when i run the script the $parent window closes when using the x. This line of code handles that event. ElseIf $msg[1] == $parent And $msg[0] = $GUI_EVENT_CLOSE Then ExitLoop Share this post Link to post Share on other sites
VicTT 0 Posted May 13, 2005 Well..Start the proggie..open up 2 windows by pressing OK TWICE!!!Close the 1st one and..surprise..the 2nd doesn't close .. [quote]Together we might liveDivided we must fall[/quote] Share this post Link to post Share on other sites