Jump to content



Photo

What's wrong with this code?


  • Please log in to reply
7 replies to this topic

#1 Roostaamir

Roostaamir

    Seeker

  • Active Members
  • 6 posts

Posted 26 April 2012 - 11:53 AM

Hi again
I am totally new to autoit,so sorry about asking stupid questions

The thing I am trying to do is to close an internet explorer window
So the code should be like this:

WinClose ( " Internet Explorer " )

But it won't work,and internet explorer won't close

What's the problem?





#2 Xenobiologist

Xenobiologist

    Xx Code~Mega xX

  • MVPs
  • 4,729 posts

Posted 26 April 2012 - 12:14 PM

See WinTitleMatchMode in AutoitSetOption.
The title is not "Internet Explorer" I guess, that is only a part of the title.
Scripts & functions Organize Includes Let Scite organize the include files *newYahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication)_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

#3 PhoenixXL

PhoenixXL

    Be what you are, believe me its always the BEST...

  • Active Members
  • PipPipPipPipPipPip
  • 1,329 posts

Posted 26 April 2012 - 12:27 PM

Maybe It wont Be the title(or maybe the starting) of your Internet Explorer

You can try it out with CLASS or You can use Process Close / Kill

Example
If WinExists('[CLASS:IEFrame]') Then ;to find the Class Use Autoit v3 Window Tool WinClose('[CLASS:IEFrame]','') Local $x=ProcessClose('iexplore.exe');If Unable to close the Window then Close the Process If $x=0 Then WinKill('[CLASS:IEFrame]','');If Unable to close iexplore.exe then Kill the Window EndIf

PredictText: Predict Text of an Edit Control Like Scite. | Remote Gmail: Execute your Scripts through Gmail. | StringRegExp: Share and learn RegExp. | Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). | Database: An easier approach for _SQ_LITE beginners. | MathsEx: A UDF for Fractions and LCM, GCF/HCF. | FloatingText: An UDF for make your text floating. | Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead.

#4 PhoenixXL

PhoenixXL

    Be what you are, believe me its always the BEST...

  • Active Members
  • PipPipPipPipPipPip
  • 1,329 posts

Posted 26 April 2012 - 12:27 PM

Thumbs Up If it Helps u out
PredictText: Predict Text of an Edit Control Like Scite. | Remote Gmail: Execute your Scripts through Gmail. | StringRegExp: Share and learn RegExp. | Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). | Database: An easier approach for _SQ_LITE beginners. | MathsEx: A UDF for Fractions and LCM, GCF/HCF. | FloatingText: An UDF for make your text floating. | Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead.

#5 Roostaamir

Roostaamir

    Seeker

  • Active Members
  • 6 posts

Posted 26 April 2012 - 03:45 PM

Thanks for the code
Now I have another question
What exactly is the title of a window?
Isn't it the one that is shown in the tasks section of the taskmanager?
For example if I navigate to my router in IE I will see this in the taskmanager:
Dsl router - Windows Internet Explorer
Isn't this the title?(I tried this one too,but it didn't work)

#6 somdcomputerguy

somdcomputerguy

  • Active Members
  • PipPipPipPipPipPip
  • 2,380 posts

Posted 26 April 2012 - 06:01 PM

Dsl router - Windows Internet Explorer
Isn't this the title?(I tried this one too,but it didn't work)

Yes. Setting WinTitleMatchMode (as suggested earlier) to 2 will match just the phrase 'Internet Explorer' in that whole title string, and that will probably resolve this issue.
- Bruce /* somdcomputerguy */If you change the way you look at things, the things you look at change.

#7 Roostaamir

Roostaamir

    Seeker

  • Active Members
  • 6 posts

Posted 27 April 2012 - 05:58 AM

I got it now
Thanks for the help guys

#8 PhoenixXL

PhoenixXL

    Be what you are, believe me its always the BEST...

  • Active Members
  • PipPipPipPipPipPip
  • 1,329 posts

Posted 27 April 2012 - 12:04 PM

Your Welcome

Any Query More Help is Always Appreciated.........

Regards
Phoenix XL
PredictText: Predict Text of an Edit Control Like Scite. | Remote Gmail: Execute your Scripts through Gmail. | StringRegExp: Share and learn RegExp. | Run As System: A command line wrapper around PSEXEC.exe to execute your apps scripts as System (LSA). | Database: An easier approach for _SQ_LITE beginners. | MathsEx: A UDF for Fractions and LCM, GCF/HCF. | FloatingText: An UDF for make your text floating. | Clipboard Extendor: A clipboard monitoring tool. Custom ScrollBar: Scroll Bar made with GDI+, user can use bitmaps instead.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users