Jump to content
Sign in to follow this  
Miguel

GUI stops responding - what am i doing wrong ?

Recommended Posts

Miguel

Hello Everybody

I Wonder if somenone could help me solving this problem.

After some hours trying to understand what have i done wrong and after searching the forum i´ve gived up.

This is my problem:

I have a Gui with 2 child gui´s that intend to work like a tab.

In one child i have a IE browser.

After clicking Button1, when i click in any of the website links the Gui stops responding!

This is a sample of code that reproduces the problem.

#include <IE.au3>
#include <EditConstants.au3>
#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>

Global $child1, $child2

Opt("GUIOnEventMode", 1)
#Region ### START Koda GUI section ### 
$Main = GUICreate("Main", 633, 447, -1, -1)
$Button1 = GUICtrlCreateButton("Child 1", 49, 8, 50, 25, $WS_GROUP)
GUICtrlSetOnEvent($Button1, "Button1Click")
$Button2 = GUICtrlCreateButton("Child 2", 137, 8, 50, 25, $WS_GROUP)
GUICtrlSetOnEvent($Button2, "Button2Click")
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###


#Region ### START Koda GUI section ### 
$child2 = GUICreate("child2", 633, 417, 0, 30, $WS_CHILD, 0, $Main)
$Edit1 = GUICtrlCreateEdit("", 32, 40, 185, 353)
GUICtrlSetData($Edit1, "bla bla bla...")
#EndRegion ### END Koda GUI section ###


#Region ### START Koda GUI section ### 
$child1 = GUICreate("child1", 641, 451, 0, 0, $WS_CHILD, 0, $Main)
$Obj1 = ObjCreate("Shell.Explorer.2")
$Obj1_ctrl = GUICtrlCreateObj($Obj1, 32, 64, 570, 356)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

_IENavigate($Obj1, "http://www.autoitscript.com")



While 1
    Sleep(100)
WEnd

Func Button1Click()
    GUISetState(@SW_SHOW,$child1)
    GUISetState(@SW_HIDE,$child2)
EndFunc

Func Button2Click()
    GUISetState(@SW_SHOW,$child2)
    GUISetState(@SW_HIDE,$child1)
EndFunc
Edited by Miguel

Share this post


Link to post
Share on other sites
dantay9

All I can tell you is that it has something to do with the internet control. The cpu usage goes up to 100% on my pc. Try constructing an error handler for the shell.explorer.2 object. This might show what the error is.


[font="Verdana"] [size="2"]"[/size][/font]Failure is not an option -- it comes packaged with Windows"[font="Verdana"][size="2"] Gecko Web Browser[/size][/font][font="Verdana"][size="2"], [/size][/font][font="Verdana"][size="2"]Yahtzee![/size][/font][font="Verdana"][size="2"], Toolbar Launcher (like RocketDock)[/size][/font][font="Verdana"][size="2"]Internet Blocker, Simple Calculator, Local Weather, Easy GDI+ GUI [/size][/font][font="Verdana"][size="2"]Triangle Solver, TCP File Transfer, [/size][/font][font="Verdana"][size="2"]Valuater's Autoit Wrappers[/size][/font][font="Verdana"][size="3"][size="2"][size="2"]OOP In AutoIt[/size][/size][/size][/font][font="Verdana"][size="2"][size="1"]Using Windows XP SP3, 1GB RAM, AMD Athlon Processor @ 2.1 GHzCheck me out at gadgets.freehostrocket.com[/size][/size][/font]

Share this post


Link to post
Share on other sites
trung0407

Well. Don't try to hide obj control, that fixed -.-

Share this post


Link to post
Share on other sites
Miguel

Well. Don't try to hide obj control, that fixed -.-

What do you mean by not hiding the obj control?

could you change my code and post it.

Share this post


Link to post
Share on other sites
trung0407

There's probably a bug with object browser. If you try to hide that object, show it, and click it again, your script stop responding. Hiding a GUI that contains an object browser is the same...

Best way is to using Tab :)

Edited by trung0407

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.