batuoc931323 Posted August 30, 2011 Posted August 30, 2011 (edited) Hello everybody, I'm newbie. I'm trying to create a GUI to open a website when I insert address into it, this is my code: #include <GUIConstantsEx.au3> #include <IE.au3> GUICreate("5sUP", 360, 250) $url = GUICtrlCreateInput("", 100, 10, 250, 23) $time = GUICtrlCreateInput("", 100, 50, 50, 23) $username = GUICtrlCreateInput("", 100, 90, 150, 23) $password = GUICtrlCreateInput("", 100, 130, 150, 23, $ES_PASSWORD) $start = GUICtrlCreateButton("Bắt Đầu", 140, 200, 80, 30) GUICtrlCreateLabel("Nhập Liên Kết:", 15, 15, 100, 23) GUICtrlCreateLabel("Cập Nhật Sau:", 15, 55, 100, 23) GUICtrlCreateLabel("Tên Đăng Nhập:", 15, 95, 100, 23) GUICtrlCreateLabel("Mật Khẩu ĐN:", 16, 135, 100, 23) GUISetState(@SW_SHOW) $dataurl = GUICtrlRead($url) $datatime = GUICtrlRead($time) $datausername = GUICtrlRead($username) $datapassword = GUICtrlRead($password) While 1 = 1 $msg = GUIGetMsg() Switch $msg Case $GUI_EVENT_CLOSE Exit Case $start xuat() EndSwitch WEnd Func xuat() _IECreate(GUICtrlRead($url)) EndFunc But I have a problem, when I insert address of website into Input "Nhập Liên Kết:" and click Button, website I wish is appear, But then, I insert another website into Input and click Button again, nothing appear, and I can't close this window when I click "X", anyone can help me to fix this problem, thank you so much!. (I'm vietnamese, sorry for grammar). Edited August 30, 2011 by batuoc931323
BrewManNH Posted August 30, 2011 Posted August 30, 2011 Your code is working for me, as you have it written above. If your actual script is using _IEcreate($dataurl) instead of _IECreate(GUICtrlRead($url)) then it won't work, because $dataurl is only being read once before the script goes into the While...Wend loop and not getting updated. You should also be aware that the $datatime/password/username variables are not going to get updated correctly either if they're changed because they also are only being read before the While loop. If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag GudeHow to ask questions the smart way! I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from. Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays. - ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script. - Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label. - _FileGetProperty - Retrieve the properties of a file - SciTE Toolbar - A toolbar demo for use with the SciTE editor - GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI. - Latin Square password generator
batuoc931323 Posted August 30, 2011 Author Posted August 30, 2011 I understand, I'll try it again, thank you for your helping. I'll reply you if I have a result.
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