#cs ScriptDetails: ---------------- AutoIt Version: 3.3.8.1 Author: Pooja Krishna, poojakrishna@gmail.com Client: Antonio, lulu.tony @ Skype Script: HideWindow.Au3 Requirements ------------ 1. Run inetcpl.cpl 2. Make the window invisible 3. Change the tabs and set values on the hidden window. Other Info ---------- Example link: http://www.autoitscript.com/forum/topic/156155-shellexecutehidden-allow-no-windows-to-become-visible/page-2 Script Functions: ---------------- _Main _ShowSplash #ce ;Global variables Global $nSplash = 1 ;Splash screen ON Global $sError = "" ;Error Global $sSplashHead = @ScriptName & " - Status" ;Title of splash screen _Main() ;Call the main function If $sError Then Msgbox(0,@ScriptName & "- Error", $sError);Show if there is an error Else Msgbox(0,@ScriptName & "- Completed", "Script finished executing");Completed EndIF ;#Function#--------------------------------------------------------------------------------------------------------------------- ;Name.........: _Main ;Description..: Makes the internet property window hidden and makes edits on it. ;Syntax.......: _Main() ;Parameters...: None ;Return Values: Success: Returns 1. ; Failure: Returns 0 and sets @error. ;Remarks......: Nil ;------------------------------------------------------------------------------------------------------------------------------- Func _Main() _ShowSplash("Executing inetcpl.cpl") $sRet = Run(@ComSpec & " /c " & 'inetcpl.cpl', "", @SW_HIDE) ; Executing inetcpl.cpl but will no hide at launch If @error Then $sError = "An error occurred when trying to retrieve the window handle." Return EndIf _ShowSplash("Waiting for inetcpl.cpl") $nRet = WinWaitActive( "Internet Properties", "", 20 ); Waiting until the window is active If $nRet = 0 Then $sError = "Time out occured while waiting for the window" Return EndIf $sHandle = WinGetHandle ( "Internet Properties", "" );getting handle If @error Then $sError = "An error occurred when trying to retrieve the window handle." Return EndIf _ShowSplash("Hiding window") $nRet = WinSetState ($sHandle, "", @SW_HIDE);Hiding window If $nRet = 0 Then $sError = "An error occurred when trying to Hide the window." Return EndIf _ShowSplash("Setting data on hidden window") $nRet = ControlSetText ( $sHandle, "", "[CLASS:Edit; INSTANCE:1]", "test text entered while hidden" );making an edit If $nRet = 0 Then $sError = "An error occurred when trying to Hide the window." Return EndIf sleep(2500) _ShowSplash("Window shown") ;Shows the window $nRet = WinSetState ($sHandle, "", @SW_SHOW ) EndFunc ;=>_Main ;#Function#--------------------------------------------------------------------------------------------------------------------- ;Name.........: _ShowSplash ;Description..: Shows a splash screen with the parameter text. ;Syntax.......: _ShowSplash($sSplashtext) ;Parameters...: $sSplashtext-> Text display on the splash screen ;Return Values: None ;Remarks......: Nil ;------------------------------------------------------------------------------------------------------------------------------- Func _ShowSplash($sSplashtext) if $nSplash = 1 then $hSplash = SplashTextOn($sSplashHead, $sSplashtext, 500, 40, -1, 60, 0, "", 10) ;Show splas screen with given text EndIf EndFunc;=>_ShowSplash