anhchangtk Posted April 20, 2009 Share Posted April 20, 2009 Now, me use _IECreateEmbedded () to create IE in from and me use code $s=GUICtrlRead($sock) regwrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","ProxyEnable","REG_DWORD","1") regwrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","ProxyServer","REG_SZ","socks="&$s) To change sock Project only active with first sock enter but all sock after don't active This my code: #include <GUIConstants.au3> #include <IE.au3> $oIE = _IECreateEmbedded () #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Test change sock with IE", 390, 304, 287, 249) $sock = GUICtrlCreateInput("194.33.184.66:59790", 67, 10, 177, 21) $Label1 = GUICtrlCreateLabel("Sock:", 11, 12, 32, 17) $GUIActiveX = GUICtrlCreateObj($oIE, 6, 73, 372, 220) $link = GUICtrlCreateInput("", 67, 39, 129, 21) $Label17 = GUICtrlCreateLabel("http://", 11, 41, 35, 17) $go = GUICtrlCreateButton("GO", 201, 38, 43, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $Msg = GUIGetMsg() if $Msg = $GUI_EVENT_CLOSE then Exit If $msg = $go Then $s=GUICtrlRead($sock) If $s="" Then regwrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","ProxyEnable","REG_DWORD","0") else regwrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","ProxyEnable","REG_DWORD","1") regwrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","ProxyServer","REG_SZ","socks="&$s) endif $l = GUICtrlRead($link) _IENavigate ($oIE,$l) endif WEnd Link to comment Share on other sites More sharing options...
anhchangtk Posted April 21, 2009 Author Share Posted April 21, 2009 Please help me Link to comment Share on other sites More sharing options...
DaleHohm Posted April 22, 2009 Share Posted April 22, 2009 I really don't follow what you are trying to do, but perhaps this code to force immediate setting changes will help: DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0) Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe 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 Link to comment Share on other sites More sharing options...
anhchangtk Posted April 22, 2009 Author Share Posted April 22, 2009 Thanks you But how me to use this code ???? :-s Link to comment Share on other sites More sharing options...
DaleHohm Posted April 22, 2009 Share Posted April 22, 2009 Put it in your script. Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe 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 Link to comment Share on other sites More sharing options...
anhchangtk Posted April 25, 2009 Author Share Posted April 25, 2009 me had maked with code #include <GUIConstants.au3> #include <IE.au3> $oIE = _IECreateEmbedded () #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Test change sock with IE", 390, 304, 287, 249) $sock = GUICtrlCreateInput("194.33.184.66:59790", 67, 10, 177, 21) $Label1 = GUICtrlCreateLabel("Sock:", 11, 12, 32, 17) $GUIActiveX = GUICtrlCreateObj($oIE, 6, 73, 372, 220) $link = GUICtrlCreateInput("", 67, 39, 129, 21) $Label17 = GUICtrlCreateLabel("http://", 11, 41, 35, 17) $go = GUICtrlCreateButton("GO", 201, 38, 43, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $Msg = GUIGetMsg() if $Msg = $GUI_EVENT_CLOSE then Exit If $msg = $go Then DllCall('WININET.DLL', 'long', 'InternetSetOption', 'int', 0, 'long', 39, 'str', 0, 'long', 0) $s=GUICtrlRead($sock) If $s="" Then regwrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","ProxyEnable","REG_DWORD","0") else regwrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","ProxyEnable","REG_DWORD","1") regwrite("HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Internet Settings\","ProxyServer","REG_SZ","socks="&$s) endif $l = GUICtrlRead($link) _IENavigate ($oIE,$l) endif WEnd But code don't run Can u help me ? Link to comment Share on other sites More sharing options...
DaleHohm Posted April 25, 2009 Share Posted April 25, 2009 The code I gave you is intended to make registry changes take effect. Run it AFTER you make the registry updates is you want it to make a difference. Dale Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model Automate input type=file (Related) Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded Better Better? IE.au3 issues with Vista - Workarounds SciTe 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 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