Quantcast
Channel: AutoIt v3 - General Help and Support
Viewing all 12506 articles
Browse latest View live

How to get correctt all controls handle?

$
0
0

To get all controls in window I use script from forum, but there is problem if window have control with some names script get handle from first name like that:

 

 

   

[25]

Button1

0x000D0446

[28]

Button1

0x000D0446

[41]

Button1

0x000D0446

[17]

Button2

0x001902B0

[18]

Button3

0x003B0210

[9]

ComboBox1

0x004D02F4

[19]

ComboBox1

0x004D02F4

[21]

ComboBox1

0x004D02F4

[30]

ComboBox1

0x004D02F4

[35]

ComboBox1

0x004D02F4

[6]

Edit1

0x0017031A

[8]

Edit1

0x0017031A

[20]

Edit1

0x0017031A

[27]

Edit1

0x0017031A

[29]

Edit1

0x0017031A

[36]

Edit1

0x0017031A

 

Any ideas ?

AutoIt         
#include "Array.au3" Opt("WinTitleMatchMode", 4) $aArray = _WinGetControls('[CLASS:.......]') _ArrayDisplay($aArray) Func _WinGetControls($Title, $Text="") Local $WndControls, $aControls, $sLast="", $n=1 $WndControls = WinGetClassList($Title, $Text) $aControls = StringSplit($WndControls, @CRLF) Dim $aResult[$aControls[0]+1][2] For $i = 1 To $aControls[0]     If $aControls[$i] <> "" Then         If $sLast = $aControls[$i] Then             $n+=1         Else             $n=1         EndIf         $aControls[$i] &= $n         $sLast = StringTrimRight($aControls[$i],1)     EndIf     If $i < $aControls[0] Then         $aResult[$i][0] = $aControls[$i]     Else ; last item in array         $aResult[$i][0] = WinGetTitle($Title) ; return WinTitle     EndIf     $aResult[$i][1] = ControlGetHandle($Title, $Text, $aControls[$i])   Next $aResult[0][0] = "ClassnameNN" $aResult[0][1] = "Handle" Return $aResult EndFunc

ListView Background Colour Graphical Problem

$
0
0

Greetings,

 

     I'm experiencing a strange issue with the background colour in a ListView control when it's in a tab.  If another window opens (this is one of the functions my app will be doing), the background of the tab overrides the background colour of the empty listview area.  I tried setting the listview control to $GUI_ONTOP, but that doesn't seem to help. 

     The only way I've figured out to get around it is to reset the background colour of the listview control to force it to redraw.  Obviously, this doesn't look too great.  Does anyone have any ideas?

 

This is just sample code, but reproduces the error consistently for me.

AutoIt         
#include <GUIConstants.au3> #include <GuiListView.au3> $gui        = GUICreate("Test", 300, 300) $button1    = GUICtrlCreateButton("Open Folder", 5, 275, 80, 20) $button2    = GUICtrlCreateButton("Exit", 215, 275, 80, 20) $tab        = GUICtrlCreateTab(5, 5, 290, 200) $tab1       = GUICtrlCreateTabItem("Tab 1") $listview   = GUICtrlCreateListView("Column 1|Column 2", 20, 50, 260, 150) GUICtrlSetBkColor($listview, 0xAAAAAA) For $i = 0 To 5     _GUICtrlListView_AddItem($listview, "Item " & $i)     _GUICtrlListView_AddSubItem($listview, $i, "Subitem " & $i, 1) Next $tab2       = GUICtrlCreateTabItem("Tab 2") GUISetState() While 1     $msg = GUIGetMsg()     Switch $msg         Case $GUI_EVENT_CLOSE, $button2             Exit         Case $button1             Run('explorer.exe "' & @UserProfileDir)         Case Else             ;;;     EndSwitch WEnd

Thanks!

(REQUEST) need a good scripter

$
0
0

Hi there, I play a game called Endless online. I need someone to make a script that kills certain amount of monsters and  walks back to the house where The NPC is located click on him and repeats the Quest again. I REALLY REALLY would appreciate and love u forever if someone could help me and  ill give u an account and ill show u the quest my self to make it more clear. 

How to get full path of a software *exe run in task manage.

$
0
0

Please help me on this, I just took a single application. For example: chrome.exe or a software that I do not know where it's located in my hard drive. Thank you all. Sorry for my english writing Vietnam should not prepare. Google translate ^^.

understand this code ??

$
0
0

hi , i am tired of trying to understand this source code :

 

 

Func FastTurn($LinksRechts,$HochRunter)
;81c424010000c74504 (HochRunter)c74500(lINKSrECHTS)90909090909090
;$HochRunter=0x00000000
;$LinksRechts=0x00000000
Local $adresse=0x062D3AC2
$opcode1="0x81c524010000c74504"
$opcode2="0xc74500"
$opcode3="0xc7450800000000";"0x90909090909090"

for $i=3 to StringLen($opcode1)-1 Step 2
$value = _MemoryWrite($adresse+($i-3)*0.5, $open,"0x"&Stringmid($opcode1,$i,2),"byte")
Next
$adresse=$adresse+(StringLen($opcode1)-2)*0.5
_MemoryWrite($adresse, $open,$HochRunter)
$adresse=$adresse+4

for $i=3 to StringLen($opcode2)-1 Step 2
$value = _MemoryWrite($adresse+($i-3)*0.5, $open,"0x"&Stringmid($opcode2,$i,2),"byte")
Next
$adresse=$adresse+(StringLen($opcode2)-2)*0.5
_MemoryWrite($adresse, $open,$LinksRechts)
$adresse=$adresse+4

for $i=3 to StringLen($opcode3)-1 Step 2
$value = _MemoryWrite($adresse+(($i-3)*0.5), $open,"0x"&Stringmid($opcode3,$i,2),"byte")
Next
EndFunc

Func FastTurnReset()
Local $adresse=0x062D3AC2
Local $opcode="0x8b4c240c8b5424108b44241481c524010000894d00895504894508"
for $i=3 to StringLen($opcode)-1 Step 2
_MemoryWrite($adresse+($i-3)*0.5, $open,"0x"&Stringmid($opcode,$i,2),"byte")
Next
Return 1
EndFunc


Local $ADDRmaxSpeedanzeige=0x4d597a

_MemoryWrite($ADDRmaxSpeedanzeige, $open,$maxSpeedanzeige)

 

can you help me ?

send message to Checkbox that fires click event?

$
0
0

Am trying to send message to a checkbox that not only checks it ( can do this) but also fires its "click" event. Is this possible? tia.

Better with more details ... mouse is off clicking another app so have to work with hotkeys and code for the AutoIt gui.

 

If GUICtrlRead ( Eval($currCB )) == $GUI_CHECKED Then
   GUICtrlSetState( Eval($currCB), $GUI_UNCHECKED) ; this works and unchecks box but does not fire click event
   ;GUICtrlSendMsg ( Eval($currCB), $BM_SETCHECK, $BST_UNCHECKED ) ; does not work - I have the wrong syntax I think
   ;ControlClick($krmaWind, "", Eval($currCB)) ; from suggestion below - does not work - AutoIt gui does not have focus
Else ....
 
Since AutoIt gui does not have focus and I am manipulating "in the background" with e.g. code above, not sure whether click event can be generated from a background app. tia.

Excel Import and Tabs Question

$
0
0

I have a folder with a load of csv's in it, anywhere from a couple of hundred to 10,000 sometimes

 

I need to add the data within them into a excel sheet one csv per tab, each csv could be 1 line to several hundred.

 

Now the ecxel sheet has to have a header and footer with supplier details and stuff like that in it

 

Is it better to

 

Make the header at runtime with data from another excel sheet i.e. suppliers etc

 

Or should i try and make it using Autoit so it generates it from an ini?

 

Or can i use a template pre made and fill that maybe?

 

Obviously the data from the csv must match with the supplier

 

Been asked to do this so i thought id best ask before i dive in on the wrong path

 

Any ideas?

Is there a way to insert a value at the "Description" field of such this form?

$
0
0

Could you please show me a script that will set whatever value at the "Description:" field (ONLY!!) of such this kind of a web form: www.fiercewireless.com/jobs/post/

 

I tried to find a way but I am empty right now..


IE9 IE10 IE11 Wait for Save Notification Bar

$
0
0

Hi All,

 

I'm new here... but not a newbie with AutoIt ...

 

I'm fighting with the new (old in fact) behavior since IE9 to download files...

 

The new notification Bar (with the yellow color), is not scriptable with the "default" IE Autoit Tools.

 

Can someone please post a working snippet to wait for this bar and click the "save" button or better the "save as" button...

 

Many thanks and best regards from Switzerland....

PixelGetColor speed issues

$
0
0

This script takes a total of ~6 seconds for me, each test taking ~1 sec:

Plain Text         
Global $wnd=WinGetHandle("[ACTIVE]") Global $total_time Global $result $n1 = 60000 $start_time = TimerInit() For $i = 1 To $n1   PixelGetColor(1, 1) Next $time1=int(TimerDiff($start_time)) $total_time += $time1 $result &= "1. PixelGetColor: same screen pixel, omitting handle parameter: " & $time1 & " ms" & @LF Sleep(30) $start_time = TimerInit() For $x = 0 To 299   For $y = 0 To 199     PixelGetColor($x, $y)   Next Next $time1=int(TimerDiff($start_time)) $total_time += $time1 $result &= "2. PixelGetColor: screen rectangle 300x200 pixels, omitting handle parameter: " & $time1 & " ms" & @LF Sleep(30) $n1 = 60000 $start_time = TimerInit() For $i = 1 To $n1   PixelGetColor(1, 1, "") Next $time1=int(TimerDiff($start_time)) $total_time += $time1 $result &= "3. PixelGetColor: same screen pixel, using parameter "": " & $time1 & " ms" & @LF Sleep(30) $start_time = TimerInit() For $x = 0 To 299   For $y = 0 To 199     PixelGetColor($x, $y)   Next Next $time1=int(TimerDiff($start_time)) $total_time += $time1 $result &= "4. PixelGetColor: screen rectangle 300x200 pixels, using parameter "": " & $time1 & " ms" & @LF Sleep(30) $n1 = 60000 $start_time = TimerInit() For $i = 1 To $n1   PixelGetColor(1, 1, $wnd) Next $time1=int(TimerDiff($start_time)) $total_time += $time1 $result &= "5. PixelGetColor: same screen pixel, using parameter [Active]: " & $time1 & " ms" & @LF Sleep(30) $start_time = TimerInit() For $x = 0 To 299   For $y = 0 To 199     PixelGetColor($x, $y, $wnd)   Next Next $time1=int(TimerDiff($start_time)) $total_time += $time1 $result &= "6. PixelGetColor: screen rectangle 300x200 pixels, using parameter [Active]: " & $time1 & " ms" & @LF $result &= @LF $result &= "Total time: " & $total_time & " ms" ; exluding sleep's MsgBox(0, "mBox", $result)
  • What results do you get? (XP users particulary of interest)
  • Is my numbers normal/expected?
  • Is there any way to speed this up (staying with default functions)?

 

I've been looking for alternatives and one seems to be _GDIPlus_BitmapLockBits with a simple example available here.

That example makes my AutoIt crash completely though (even with handle "" specified). Another example also crashes for me, so I'm a bit lost.

 

Does the GDIPlus example(s) work for you?

 

I'd love to stay with PixelGetColor for now, if possible.

Any help greatly appreciated.

 

Machine:

WinXP Pro SP3

GPU 1GB GeForce

3 GB RAM

1600x1200x32

Window Classic theme

AutoIt v3.3.10.2

Doubt on _ArrayUnique() function

$
0
0

Hi All,

       Just Curious to know how the _ArrayUnique() function works... For example.. i have an array which look like below..

 

$Array[5][2]=[["A", 56],["B", 76],["C", 6],["D", 96],["A", 16]]

 

 

Now the first row and last row first column  of the array has same value. Here Last element is the one which added latest... in this case if i use _ArrayUnique() which one will be removed? either last element or first element?

 

 

Scripts and emails

$
0
0

Good Morning,

 

I am taking on a rather ambitous task of trying to automate a task when a certain email is received.  How i see it working in my head is an email will arive, kick off my script, and be able to "copy and paste" inforation from the email where I need it.  The script will be used to udate infromation contained in an application.  Navigating the application is the easy part its the email portion that for me is like a pig looking ata  wrist watch.

 

Can someone point me in the right direction to get started with this.  With my limited skill in using AutoIT I'm not even sure what to search for to start getting some answers. 

Greater Than

$
0
0

Hi

 

I have these two functions the one works and the other doesn't and do not understand why.

 

Basically if $Trans = 255 or higher then don't increase by 5.

 

Thanks for the help!

If Not $Trans <= 0 Then ; Works $Trans -= 5 ToolTip($Trans) WinSetTrans($GUI, "", $Trans) EndIf
If Not $Trans >= 255 Then ; Does not work. $Trans += 5 ToolTip($Trans) WinSetTrans($GUI, "", $Trans) EndIf

IE.au3 Clicking a Button behind Picture

$
0
0

(I solved myself - Sorry to disturb you. I should look more before asking for help)

Solution:

    Local $oInput, $oInputs = _IETagNameGetCollection($oIELogin, 'input')     For $oInput In $oInputs         If String($oInput.alt) = "giris" Then             _IEAction($oInput, "click")         EndIf     Next

Hello.

Iam trying to login a website automatically but I cannot click login. Here is the webpage HTML:

HTML         
<tbody><tr>     <td height="25" align="left" background="../images/baslik.gif"><span class="style13">  :: Öğrenci Girişi </span></td>   </tr> <form name="frmLogin" action="login.asp" method="post"></form>   <tr>     <td width="204" align="center" valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1">       <tbody><tr>         <td width="44%"><span class="style17">Kullanıcı Adı : </span></td>         <td width="56%"><input name="frmName" type="text" size="8"></td>       </tr>       <tr>         <td><span class="style17">Şifre : </span></td>         <td><input name="frmPass" type="password" size="8"></td>       </tr>       <tr>         <td> </td>         <td><input type="image" src="../images/cmdtamam.jpg" alt="giris" width="67" height="22" style="border:none"></td>       </tr>     </tbody></table></td>   </tr> <input type="hidden" name="submit" value="1"><input type="hidden" name="frmTip" value="3">  <tr>     <td height="25" align="left"><hr size="1"></td>   </tr>   <!--<tr>    <td height="25" align="left" valign="top" background="../images/baslik.gif"><span class="style13">  » Anket </span></td>  </tr>  <tr>    <td align="center" valign="top"><table width="100%" border="0" cellpadding="1" cellspacing="1">      <tr>        <td colspan="2"><span class="style17">Anket sorusu burada sorulacak ? </span></td>      </tr>      <tr>        <td><input name="radiobutton" type="radio" value="radiobutton"></td>        <td class="style2">1. Seçenek </td>      </tr>      <tr>        <td><input name="radiobutton" type="radio" value="radiobutton"></td>        <td class="style2">2. Seçenek </td>      </tr>      <tr>        <td width="18%"><span class="style17">          <input name="radiobutton" type="radio" value="radiobutton">        </span></td>        <td width="82%" class="style2">3. Seçenek </td>      </tr>      <tr>        <td> </td>        <td align="right"><img src="../images/dugme_tamam.gif" alt="giris" width="67" height="22"></td>      </tr>    </table></td>  </tr>-->   </tbody>

I have succesfully set the forms but can not submit it.

    $i=_IEGetObjByName($oIELogin,"frmName")     _IEFormElementSetValue($i,$username)     $i=_IEGetObjByName($oIELogin,"frmPass")     _IEFormElementSetValue($i,$password)

I have no idea which one should I click or how to click it:

<form name="frmLogin" action="login.asp" method="post"></form> or <input type="image" src="../images/cmdSubmit.jpg" alt="giris" width="67" height="22" style="border:none"> or <input type="hidden" name="submit" value="1"> or <input type="hidden" name="frmTip" value="3">

I have tried so many combinations but here is my last part of code for click:

        $oSubmit = _IEGetObjByName($oIELogin,"submit")     $oSubmit.click         $osubmit = _IEformgetobjbyname($oIE,"frmLogin")     _IEFormSubmit($oSubmit)     $oFormLogin = _IEFormGetObjByName($oIELogin,"frmLogin")     _IEAction($oFormLogin,"click")     _IEImgClick($oIELogin,"giris","alt",0,1)

2. mini question. is there a any difference between :

_IEFormGetObjByName

_IEGetObjByName

 

for getting this obj:

 

<form name="frmLogin" action="login.asp" method="post"></form>

 

 

Any help much appreciated:)

 

 

Edit: Code view

Send text to a SearchBar

$
0
0

Does anyone have a script that sends search queries to a searchbar program installed within a browser?


_arraydelete is slow

$
0
0
Hello

 

I'm looking for a function that would do the same as _arraydelete but faster.

 

The problem of _arraydelete is that it is very slow on large array.

 

Would you have this kind of function?

 

Thank you.

GUI CPU USAGE

$
0
0

ok everyone i have a litlle problem at my gui , is using like 10, 12% processor and idk why..i mean i use a lot of  Sleep and idk were is the problem

Attached Files

High Contrast/Night Mode

$
0
0

Questions in short.

1. How can I detect if windows is in high contrast mode. Here are MS' notes, but I don't know how to translate that into AI.

http://msdn.microsoft.com/en-us/library/system.windows.forms.systeminformation.highcontrast%28v=vs.110%29.aspx?cs-save-lang=1&cs-lang=vb#code-snippet-2

 

 

Scenario

I am pushing out new laptops for guys who work both day and night. They require dark/high contrast at night. The software they use, would automatically toggle the theme for them in XP , however it no longer works with windows 7.

 

Windows 7 has a hotkey to switch to high contrast mode, but the hotkey "left Shift + left Alt + PrtScn" is a pain to use on the laptops, because they need to use the fn (function) key to access the print screen and you need both hands to do it. Which is a problem as they are used in vehicles with limited space, and gear they wear is restrictive.

 

So my plan was to write a script that automatically toggles it on for them at sunset/sunrise.

 

I will use the method in the following link unless someone has a better idea

http://www.autoitscript.com/forum/topic/44432-high-contrast-mode/

Pixelsearch in an area

$
0
0

I know how to check if a certain pixel matches a hex color, but im wondering how i can check if there is a color showing up in a certain area.

For example:

want to check for a red color in the upper right corner.

anyone can help me out?

 

Latest _IEFrameGetObjByName now returns $_IEStatus_NoMatch

$
0
0

I'm struggling to get my code working in the latest IE.au3 that came with the newest stable version of AutoIt (v3.3.10.2). There's an old, but perfect example DaleHohm posted that illustrates the problem:

 

...true, iframe is not a normal frame, but it is included in the frames collection and can be accessed with this function. Here is an example:

#include <ie.au3> ; Create browser window with an iframe $oIE = _IECreate() Sleep (3000); sleep needed with IE.au3 T1.4 and below _IEBodyWriteHTML($oIE, "<h1>Test</H1><p><iframe src='about:blank' id ='foo'></iframe>") ; Get reference to iframe named foo and write to it $oFrame = _IEFrameGetObjByName($oIE, "foo") _IEBodyWriteHTML($oFrame, "hi"); string appears in frame

Dale

 

From the debug console:

IE.au3 T3.0-1 Warning from function _IEFrameGetObjByName, $_IEStatus_NoMatch (No frames matching name)

When I reverted to an older IE.au3, everything worked as expected.

 

Searched the forums, looked at the update history in the IE.au3 header, nothing's jumping out at me that I need to do differently to get this to work with the latest Include. Any ideas?

Viewing all 12506 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>