Jump to content

How to use these commands....


Recommended Posts

Can anyone tell me?:

Q1. How do I use the return values from functions

Return Value

Success: Returns 1. 
Failure: Returns 0 if window is not active.

Q2. Can I find windows etc by their class? If so how? ( I think it has something to do with Opt("WinTitleMatchMode", 4) but not sure,

Q3. What about classnamesNN, how do I use that?

Thanks :)

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

  • Developers

Can anyone tell me?:

Q1. How do I use the return values from functions

<{POST_SNAPBACK}>

If anyfunction() then
  ;function returned ok
endif
If Not anyfunction() then
  ;function returned Not completed ok
endif

Q2. Can I find windows etc by their class? If so how? ( I think it has something to do with Opt("WinTitleMatchMode", 4) but not sure,

<{POST_SNAPBACK}>

Mode 4

Advanced mode.

In this mode special sequences are used in the title parameter so that window classnames and handles can be used.  The text parameter remains the same.

The special sequences must contain no whitespace.  They are:

    "classname=CLASSNAME"

    "active"

    "last" or ""

"classname=" matches a window based on its classname.  For example to identify a window that has the classname "MYCLASS1" then you would use "classname=MYCLASS1" for the title parameter.

"active" matches the currently active window (same as "" in the default WinTitleMatchMode).

"last" uses the last successful window match so you don't have to keep specifying the title and text again and again. e.g.

    AutoItSetOption("WinTitleMatchMode", 4)

    WinWaitActive("Untitled - Notepad")

    WinClose("last")    ; Closes the previously matched notepad window

Note: If "classname=", "active", "last" or "" are not used as the title then the window matching takes place as in Mode 1 making this a good mode for general use.

Q3. What about classnamesNN, how do I use that?

<{POST_SNAPBACK}>

The classname is used in Control??? commands which are functions to directly work with controls...

ClassNameNN

Each Microsoft standard control has a "classname" such as "button" or "edit". In AutoIt this is combined with the "instance" of that control to give the "ClassNameNN" method. If you have a simple dialog with a few buttons on it they will generally be referred to as "Button1", "Button2", "Button3", etc. 

This method is useful when the Control ID is not applicable (for static text or custom controls).

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Thank you very much I will continue to lurn :)

Q4. Can I just take this from the window spy and plug it into pixel search?

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size: X:0 Y: 794 W: 1280 H: 151

PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )

i.e. Is left=X, Top=Y, Right=W, Bottom=H, ?

Edited by Neoborn

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

  • Developers

Thank you very much I will continue to lurn :D

Q4. Can I just take this from the window spy and plug it into pixel search?

>>>>>>>>>>> Control Under Mouse <<<<<<<<<<<

Size:        X:0    Y: 794   W: 1280    H: 151

PixelSearch( 0, 0, 20, 300, 0xFF0000, 10 )

<{POST_SNAPBACK}>

:) .. Doesn't look right.... this is the syntax:

PixelSearch ( left, top, right, bottom, color [, shade-variation] [, step]] )

So your PixelSearch() command will search the area 0,0 to 20,300 and the 10 is presumably the step? if so, its at the wrong spot.

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

i.e. Is left=X, Top=Y, Right=W, Bottom=H, ?

~Projects~1. iPod Ejector 1.0 - Tool Used To Eject iPod in Windows - Uses DevEject.exe :P2. SmartFTP Close Popup Tool - Closes reminders from freeware SmartFTP.~Helpful Links For New Users~1. LXP's Learning AutoIT PDF Guide - <<< Go here for a PDF Guide on learning AutoIT from the ground up!<<<2. AutoIt 1-2-3 <<<Want to learn more about AutoIT quickly? Go Here<<<3. How To Install The Beta And Production Versions Of AutoIT / SciteAutoIT

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...