shreeks 0 Posted June 1, 2011 I need to know how to maximize the IE window without using HWND.this is my code.#include <IE.au3>$ie = ObjCreate("InternetExplorer.Application")$ie.visible = true$ie.navigate("http://ctsintcospsbo1:8080/AIC/HTML/AmIcognizant.html");ShellExecute("http://ctsintcospsbo1:8080/AIC/HTML/AmIcognizant.html")$HWND = _IEPropertyGet($ie, "hwnd") ; Window handling commandWinSetState($HWND, "", @SW_MAXIMIZE) ; Maximize the IE windowThis code throgh an error "Return SetError($_IEStatus_Success, 0, HWnd($o_object.HWnd()))Return SetError($_IEStatus_Success, 0, HWnd($o_object.HWnd()^ ERROR"Let me know how to resolve this issue.Thanks. Learning is Lifelong! Share this post Link to post Share on other sites
wakillon 403 Posted June 1, 2011 It's strange, it works for me... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
shreeks 0 Posted June 1, 2011 It's strange, it works for me... This is my code.Still am getting error.please clarify on this. #include <IE.au3> $ie = ObjCreate("InternetExplorer.Application") $ie.visible = true $ie.navigate("http://ctsintcospsbo1:8080/AIC/HTML/AmIcognizant.html") $HWND = _IEPropertyGet($ie, "hwnd") ; Window handling command WinSetState($HWND, "", @SW_MAXIMIZE) ; Maximize the IE window ;sleep(2000) ;MsgBox(0,"","t1") WinWaitActive('One Cognizant') $iPos = WinGetPos('One Cognizant') ;sleep(2000) $iPos = PixelSearch($iPos[0], $iPos[1], $iPos[2] + $iPos[0], $iPos[3] + $iPos[1],0x86A7BF, 1) ;0x947B91 sleep(1000) If Not @error Then MouseMove($iPos[0], $iPos[1]) MouseClick("left") else MsgBox(0,"","error") EndIf Attached the snapshot of the error screen. Thanks. Learning is Lifelong! Share this post Link to post Share on other sites
wakillon 403 Posted June 1, 2011 What's your IE Version ?#include <Array.au3> #include <IE.au3> $ie = ObjCreate("InternetExplorer.Application") $ie.visible = true $ie.navigate("http://ctsintcospsbo1:8080/AIC/HTML/AmIcognizant.html") $HWND = _IEPropertyGet($ie, "hwnd") ; Window handling command WinSetState ( $HWND, "", @SW_MAXIMIZE ) ; Maximize the IE window Do Sleep ( 100 ) Until _IsMaximized ( $HWND ) $_WinWaitActive = WinWaitActive ( $HWND, '' ) $_WinPos = WinGetPos ( $HWND, '' );_ArrayDisplay ( $_WinPos ) $iPos = PixelSearch ( $_WinPos[0], $_WinPos[1], $_WinPos[2], $_WinPos[3], 0x86A7BF, 1 ) ;0x947B91 If Not @error Then _ArrayDisplay ( $iPos ) MouseMove($iPos[0], $iPos[1]) MouseClick("left") Else MsgBox(0,"","error") EndIf Func _IsMaximized ( $_Hwnd ) If BitAnd ( WinGetState ( $_Hwnd ), 32 ) Then Return 1 EndFunc ;==> _IsMaximized ( )This script works with IE7... AutoIt 3.3.14.2 X86 - SciTE 3.6.0 - WIN 8.1 X64 - Other Example Scripts Share this post Link to post Share on other sites
DaleHohm 65 Posted June 1, 2011 Try replacing these lines: $ie = ObjCreate("InternetExplorer.Application") $ie.visible = true $ie.navigate("http://ctsintcospsbo1:8080/AIC/HTML/AmIcognizant.html") with this: $ie = _IECreate("http://ctsintcospsbo1:8080/AIC/HTML/AmIcognizant.html") which will insure the document has loaded before moving on. 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