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

$ES_PASSWORD

$
0
0

Is it posible to change state on GUICtrlCreateInput when input alredy enter.

Or moust I use GUICtrlDelete and create new.

 

I need to show password if Checkbox is selected.

AutoIt         
#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 615, 438, 192, 124) $Input1 = GUICtrlCreateInput("", 32, 48, 217, 21,$ES_PASSWORD) $Checkbox1 = GUICtrlCreateCheckbox("ShowPassword", 32, 80, 241, 17) GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE          Exit         Case $Checkbox1          If _IsChecked($Checkbox1) Then           GUICtrlSetState($Input1, ??????????????)          Else           GUICtrlSetState($Input1, $ES_PASSWORD)          EndIf     EndSwitch WEnd Func _IsChecked($idControlID)     Return BitAND(GUICtrlRead($idControlID), $GUI_CHECKED) = $GUI_CHECKED EndFunc   ;==>_IsChecked

Variable must be of type "Object"

$
0
0
Hi All
Am trying to write a script that retreives the values form the database but it gives me an error "Variable must be of type "Object". Can someone help me please.

The code is as follows...
----------------------------------------------------------------------------------
$constrim="DRIVER={SQL Server};SERVER=WIN-1VETHTGJK1N\EPOSERVER;DATABASE=AntiVirus;uid=Administrator;pwd=Welcome2mcafee;"

$adCN = ObjCreate ("ADODB.Connection") ; <== Create SQL connection
$adCN.Open ($constrim) ; <== Connect with required credentials

MsgBox(0,"",$constrim )

if @error Then
MsgBox(0, "ERROR", "Failed to connect to the database")
Exit
Else
MsgBox(0, "Success!", "Connection to database successful!")
EndIf

$sQuery = ObjGet("select * from Sample1 where USerID = 'ABC'")
$result = $adCN.Execute($sQuery)
MsgBox(0, "", $result.Fields( "UserID" ).Value)
$adCN.Close

String to 2D array

$
0
0

Hi,

 

Been searching all over for quite a while now, but cannot find anything about it! From clipboard, I get a string containing line feeds and tabs. I want to make it into a multi dimensional array. Something like this:

 

4010506 1341001 4019001 4010014 2425012 4010030

1 5 4 3 8 7
1 5 4 3 8 7
1 5 4 3 8 7

 

Granted this forum does not support tabs, so it's a white space instead. so white spaces = next column and linefeed = next row. How do I convert such string to an array?

_FTP_DirPutContents doesn't return any errors

$
0
0

Hi, i wrote simple ftp script to upload folder to list of ftp servers, but function _FTP_DirPutContents doesn't return errors in any case, even when i disconnect from intenet manually during uploading

 

here is my script

AutoIt         
;123 #include <FTPEx.au3> #include <Array.au3> #include <File.au3> #include<Date.au3> ;$curdate = @MON & "." & @MDAY & "." & @YEAR $curdate = stringreplace(_NowDate()&' '&_NowTime(),':','-') $server = '' $username = '' $pass = '' $inifile = 'ftp_script.ini' $aRetArray = 0 if not _FileReadToArray($inifile, $aRetArray,1,";") Then     MsgBox(4096, "Ошибка[1]", "Не удалось прочитать файл настроек в массив "&$inifile&', ошибка '&@error)     Exit endif ;MsgBox(4096, "тест", $aRetArray[0][0]) ;_ArrayDisplay($aRetArray, "settings show", Default); if $aRetArray[0][0] < 1 Then    MsgBox(4096, "Ошибка", "не правильное кол-во считанных строк настроек")     Exit  EndIf ;$aRetArray IP;login;pass;sourcedir;targetdir for $i = 1 to $aRetArray[0][0]    ;MsgBox(4096, "тест", 'внутри цикла')    ;игнорирование закомеченных строк начинающихся с ;    if StringCompare(StringLeft($aRetArray[$i][0],2),"//") = 0 Then       ;MsgBox(4096, "тест", "пропущена строка настроек "&$i)       ContinueLoop    endif    ;проверка все ли параметры указаны    for $i2 = 0 to 4       if StringCompare($aRetArray[$i][$i2],"") = 0 Then          MsgBox(4096, "Ошибка", "пустой параметр "&$aRetArray[$i][$i2]&" № "&$i2&" в строке настроек № "&$i)          Exit       endif    Next    ;получение списка файлов из настроек    $FileList = _FileListToArray($aRetArray[$i][3], '*', 1)    if not IsArray($FileList) then       MsgBox(4096, "Ошибка", 'В sourcedir нет файлов для копирования, строка № '&$i)       exit    endif    $server = $aRetArray[$i][0]    $username = $aRetArray[$i][1]    $pass = $aRetArray[$i][2]    ;коннект по фтп к серверу    $Open = _FTP_Open('MyFTP Control')    if $Open = 0 Then       MsgBox(4096, "Ошибка", 'В $Open = _FTP_Open(MyFTP Control) строка № '&$i)       exit    EndIf    $Conn = _FTP_Connect($Open, $server, $username, $pass,1)    if $Conn = 0 Then       MsgBox(4096, "Ошибка "&@ERROR, 'В $Conn = _FTP_Connect($Open, $server, $username, $pass,1) строка № '&$i&" serv "&$server&" username "&$username&" pass "&$pass)       exit    EndIf    ;$serverdirs = stringsplit($aRetArray[$i][4],"/")    ;MsgBox(4096, "тест", UBound($serverdirs))    ;    $remote_dir_list = _FTP_ListToArray($Conn,1)    if $remote_dir_list[0] = 0 Then       MsgBox(4096, "Ошибка", 'В _FTP_ListToArray строка № '&$i)       exit    endif    ;_ArrayDisplay($remote_dir_list, "target dirs", Default);     if UBound($remote_dir_list) > 0 Then         for $n = 1 to UBound($remote_dir_list)-1             if _FTP_DirPutContents($Conn,$aRetArray[$i][3],$remote_dir_list[$n]&"/"&$aRetArray[$i][4],1) = 0 Then                MsgBox(4096, "Ошибка", 'В _FTP_DirPutContents строка № '&$i)             endif         next     EndIf     $Ftpc = _FTP_Close($Open) next MsgBox(4096, "Завершено успешно!", 'Завершено успешно!') exit

so at

if _FTP_DirPutContents($Conn,$aRetArray[$i][3],$remote_dir_list[$n]&"/"&$aRetArray[$i][4],1) = 0 Then    MsgBox(4096, "Ошибка", 'В _FTP_DirPutContents строка № '&$i) endif

no errors happen when i disconnect internet, but why the hell? :D

 

to work this script need a file called ftp_script.ini near executable and this file should contain a line like

 

IP;login;password;source_folder_name;sub_folder1/sub_folder2

 

(source_folder_name must be near executable as well)

 

Script will check all remote folders from "home folder" on ftp and try enter them like

each_remote_folder+/+sub_folder1/sub_folder2

Picture as button.

$
0
0

Im trying to get a picture to work as a button, and it works just fine if i only have 1 picture.

But if i have a background picture, i get some issues, in 1 case the button dont show but WORKS.

In the other case my button shows but dont works..

 

 

Button dont show, but works.

AutoIt         
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $UI = GUICreate("Installer UI", 477, 237, 641, 272) $Installer = GUICtrlCreatePic(@ScriptDir & "\Data\Installer.bmp", 208, 168, 257, 57) $BK = GUICtrlCreatePic(@ScriptDir & "\Data\BK.bmp", 0, 0, 476, 236) GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Installer             MsgBox(0, "a", "a")     EndSwitch WEnd

Button shows, but DONT work

AutoIt         
#include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $UI = GUICreate("Installer UI", 477, 237, 641, 272) $BK = GUICtrlCreatePic(@ScriptDir & "\Data\BK.bmp", 0, 0, 476, 236) $Installer = GUICtrlCreatePic(@ScriptDir & "\Data\Installer.bmp", 208, 168, 257, 57) GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case $GUI_EVENT_CLOSE             Exit         Case $Installer             MsgBox(0, "a", "a")     EndSwitch WEnd

Any ideas? :-/

 

 

And when using a picture as a button is there a way to make it change to another picture if you hover with the mouse? Or atleast make it picture look more buttonish :P

LLH Mouse AND Keyboard?

$
0
0

Hello guys, i have found many example of low level hook but they are separate, one for mouse and one for keyboard. Insead i'd like and hook for check a mouse-keyboard combination like control + click. Please don't suggest to use IsPressed or things like that.

Many thanks

2D array | vertical scrolling / rotating | _ArrayExtract won't get 1st row?

$
0
0

If I wanna be able to "vertically rotate" (scroll up and down) 2D array rows, like...

row 0
row 1
row 2

to

row 2
row 0
row 1

etc. (both directions, where the one that disappears goes to the other end) ...

1) Do I have to make my own function, or is there a simple trick I am missing?

 

2) If I have to make my own function, would it be more or less like this one I made up?
 

Problem here is that only "UP" is working...

 

* I may be missing something very simple...? :-)

 

* Why can't I seem to get the first row with _ArrayExtract($_aArray, 0, 0) somehow anyway...?

Plain Text         
#include <Array.au3> HotKeySet("{PGUP}", "_ArrayUp") HotKeySet("{PGDN}", "_ArrayDown") Global $aArray[3][2] = [["0 ", " car"],["1 ", " bike"],["2 ", " boat"]] ToolTip(_ArrayToString($aArray), 0,0) While 1     Sleep(100) WEnd Func _2D_ArrayScroll_vert ( $_aArray, $direction = 0 )     Local $aSplit_1, $aSplit_2     If $direction = 0 Then    ; scroll DOWN         ; get all rows except last         $aSplit_1 = _ArrayExtract($_aArray, 0, UBound($_aArray) - 2 ) ;~             MsgBox(0,"", _ArrayToString($aSplit_1))         ; get last row only         $aSplit_2 = _ArrayExtract($_aArray, UBound($_aArray) - 1, UBound($_aArray) - 1 ) ;~             MsgBox(0,"", _ArrayToString($aSplit_2))         ; $aSplit_2 = 'last row' + 'all rows except last'         _ArrayAdd($aSplit_2, $aSplit_1)         $_aArray = $aSplit_2     Else                    ; scroll UP         $aSplit_1 = _ArrayExtract($_aArray, 1, UBound($_aArray) - 1 )             MsgBox(0,"", _ArrayToString($aSplit_1)) ; PROBLEM AREA: how to get 1st row of $_aArray into $aSplit_2 ? ;~      $aSplit_2 = $_aArray[0][2]  ; doesn't work  [1][2] neither         $aSplit_2 = _ArrayExtract($_aArray, 0, 0)  ; doesn't work, other variations get the wrong row, or too many rows             MsgBox(0,"", _ArrayToString($aSplit_2))         _ArrayAdd ($aSplit_1, $aSplit_2)         $_aArray = $aSplit_1     EndIf     $aArray = $_aArray     ToolTip(_ArrayToString($aArray), 0,0) EndFunc Func _ArrayDown()     _2D_ArrayScroll_vert ( $aArray ) EndFunc Func _ArrayUp()     _2D_ArrayScroll_vert ( $aArray, -1 ) EndFunc #cs ; DOWN 0 car 1 bike 2 boat 2 boat 0 car 1 bike ; UP 0 car 1 bike 2 boat 1 bike 2 boat 0 car #ce

Thanks!  :)

SciTE Console colour correction

$
0
0

Hi All,

 

I've been experimenting with the colour options for the SciTE script editor included with AutoIT's full installation, and seem to be having a bit of trouble achieving the colours I'm after....

 

After reading the given documentation for ConsoleWrite (the function i'm trying to use), I can see that the default colours are chosen with the following parameters:

! = Red > = Blue - = Orange + = Green

However, I'm receiving the following;

Capture.png

 

As you can see, the output is still formatted with colours, Only they're not what I was expecting.

 

I assume this is a setting in SciTE rather than the AutoIT language, Has anyone come across any settings within SciTE regarding console colouring? I've been through various properties and settings for SciTE. but can't seem to find anything that references console or colour.

 

May sound like i'm grasping at straws a bit here, But I'm after formatting certain outputs with red text more than anything.

 

Any help is greatly appreciated.

 

Kind Regards

 

Javi.


How to send a key to control which is not recognized

$
0
0

Hi guys.

Please take a look on this movie.

 

 

I have control which is recognized as "AutoIt Window Info" control when it's not. It's other program control.

Any idea how to send a key to that control? How to get "access" to this control (get handle or something)

 

sorry that movie is so long! I hope someone can spend that few minutes to try to help me !

thank you in advance!

2D array | vertical wrap around | _ArrayExtract won't get 1st row?

$
0
0

If I wanna be able to "vertically rotate" (scroll up and down) 2D array rows, like...

row 0
row 1
row 2

to

row 2
row 0
row 1

etc. (both directions, where the one that disappears goes to the other end) ...

1) Do I have to make my own function, or is there a simple trick I am missing?

 

2) If I have to make my own function, would it be more or less like this one I made up?
 

Problem here is that only "UP" is working...

 

* I may be missing something very simple...? :-)

 

* Why can't I seem to get the first row with _ArrayExtract($_aArray, 0, 0) somehow anyway...?

Plain Text         
#include <Array.au3> HotKeySet("{PGUP}", "_ArrayUp") HotKeySet("{PGDN}", "_ArrayDown") Global $aArray[3][2] = [["0 ", " car"],["1 ", " bike"],["2 ", " boat"]] ToolTip(_ArrayToString($aArray), 0,0) While 1     Sleep(100) WEnd Func _2D_ArrayScroll_vert ( $_aArray, $direction = 0 )     Local $aSplit_1, $aSplit_2     If $direction = 0 Then    ; scroll DOWN         ; get all rows except last         $aSplit_1 = _ArrayExtract($_aArray, 0, UBound($_aArray) - 2 ) ;~             MsgBox(0,"", _ArrayToString($aSplit_1))         ; get last row only         $aSplit_2 = _ArrayExtract($_aArray, UBound($_aArray) - 1, UBound($_aArray) - 1 ) ;~             MsgBox(0,"", _ArrayToString($aSplit_2))         ; $aSplit_2 = 'last row' + 'all rows except last'         _ArrayAdd($aSplit_2, $aSplit_1)         $_aArray = $aSplit_2     Else                    ; scroll UP         $aSplit_1 = _ArrayExtract($_aArray, 1, UBound($_aArray) - 1 )             MsgBox(0,"", _ArrayToString($aSplit_1)) ; PROBLEM AREA: how to get 1st row of $_aArray into $aSplit_2 ? ;~      $aSplit_2 = $_aArray[0][2]  ; doesn't work  [1][2] neither         $aSplit_2 = _ArrayExtract($_aArray, 0, 0)  ; doesn't work, other variations get the wrong row, or too many rows             MsgBox(0,"", _ArrayToString($aSplit_2))         _ArrayAdd ($aSplit_1, $aSplit_2)         $_aArray = $aSplit_1     EndIf     $aArray = $_aArray     ToolTip(_ArrayToString($aArray), 0,0) EndFunc Func _ArrayDown()     _2D_ArrayScroll_vert ( $aArray ) EndFunc Func _ArrayUp()     _2D_ArrayScroll_vert ( $aArray, -1 ) EndFunc #cs ; DOWN 0 car 1 bike 2 boat 2 boat 0 car 1 bike ; UP 0 car 1 bike 2 boat 1 bike 2 boat 0 car #ce

Thanks!  :)

_FTP_FilePut doesn't detect "file being used by another person or program"

$
0
0

Hi, function _FTP_FilePut doesn't detect file locks "file being used by another person or program" and return 1 as "all fine" result. Is here any solution? To simply test locks i used this console program http://www.jensscheffler.de/filelocker

RegExpReplace Count Incorrect

$
0
0

I'll always feel a n00b and therefore hesitant to post what I think is a bug... ;)

 

Having a first go with this one (that doesn't work in the release version either):

 

Manual for StringRegExpReplace states:

"Check @extended for the number of replacements performed"

 

However this seems not to be happening for my _WordCount( $text ) function

and I have to use _WordCount2( $text ) as a workaround.

 

"I hope this is a real bug"...? ;)

Global $text = "Six word sentence for testing purposes." MsgBox(0,"", "The sentence  '" & $text & "'  has  " & _WordCount( $text ) & "  words." & @CRLF & _ "The sentence  '" & $text & "'  has  " & _WordCount2( $text ) & "  words." ) ; manual states: "Check @extended for the number of replacements performed" (but doesn't seem to work?) Func _WordCount( $text )     StringRegExpReplace( $text, "(\s){1,}[\W|_](\s){1,}|\R", " ", 0 )     Return @extended + 1    ; nr of spaces + 1 = wordcount EndFunc ; workaround Func _WordCount2( $text )     StringReplace( StringRegExpReplace( $text, "(\s){1,}[\W|_](\s){1,}|\R", " ", 0 ), " ", "x")     Return @extended + 1    ; nr of spaces + 1 = wordcount EndFunc

About IE attach

$
0
0
HTML         
- <iframe width="594" height="169" id="iframe_busitype" src="http://bss.sh.chinaunicom.com:15011/unibss/pubBusiChooseAction.go?command=choosebusitype&telnum=15618181718&account_no=&barcode=&svc_type=&consign_no=&accPubPage=Y&sim=&busiId=92000&type=mobile" frameBorder="0" marginWidth="0" marginHeight="0">     - <html>         + <head>         - <body onload="">             <div id="commRtnPage" style="display: none;"/>             - <form name="loginForm" onsubmit="return validate()" action="/unibss/pubBusiChooseAction.go" method="post">                 <input name="command" type="hidden" value="choosebusitype"/>                 <br/>                 - <table align="center" class="index_table" border="0" cellSpacing="0" cellPadding="0">                     - <tbody>                         - <tr>                             + <td width="15">                             - <td style="border-bottom: #d0d0d0 1px solid; border-top: #d0d0d0 1px solid;">                                 - <table align="center" border="0" cellSpacing="0" cellPadding="0">                                     - <tbody>                                         + <tr>                                         - <tr>                                             - <td>                                                 - <table align="center" class="data" border="0" cellSpacing="1">                                                     - <tbody>                                                       + <tr>                                                       + <tr class="tr_out0" onmouseover="overRow(this)" onmouseout="outRow(this)" onclick="chooseRow(this)" ondblclick="popTr(this)">                                                       + <td class="data_desc">                                                       + <td class="data_desc">                                                       + <td class="data_desc">                                                       + <td class="data_desc" style="display: none;">                                                       + <td class="data_desc">                                                       + <td class="data_desc">                                                       + <td align="center" class="data_desc">                                                       + <td class="data_desc">                                                       + <td class="data_desc">                                                       + <td align="center" class="data_desc">                                                           <input name="btokok" class="standardButton" style="width: 60px;" onclick="chooseBusitype(this)" type="button" service_type="1001" value="选定"/>

How to Attach "<input name = "btokok" and click it?

 

This is my code.

    #include <IE.au3>     $oIE = _IEAttach("Query2.mht","URL")     $oForm = _IEFormGetObjByName($oIE,"loginForm")     $oFrame = _IEGetObjById($oForm,"iframe_busitype")     $oForm = _IEFormGetObjByName($oFrame,"loginForm")     $oBtn = _IEFormElementGetObjByName($oForm,"btokok")        ;Failed     $obtn = _IEGetObjByName($oForm,"btokok")    ;Failed too

2 "impossible" detection methods? (js window, menu choice)

$
0
0

1) When you bookmark a link in Firefox, it now has a kind of window that the AutoIt tool can't detect?

Is it a javascript thing maybe?

 

My ideal would be to have the description text deleted without having to press anything.
I could somehow assign macros to some button but auto-detection would be nicer :)
 

 

yazpIXh.png

 

2) Alternately, I am wondering if it is possible or could ever be made possible to detect which menu choice someone has clicked in a program and act upon that...?

 

Thanks  :)

Is possible hide propertie's button of _WinAPI_PrintDlg?

$
0
0

Hi Forum,

 

hide this.png

 

Is possible hide the button properties in _WinAPI_PrintDlg?
I search in MSDN but I can´t find this or this is impossible?

 

Because you want to hide (or disable) the button? 
And why not? It provides access to a lot of functions a lot of printers, I can not control (yet). This gives the end user the false impression of control. I see no useful reason to display it (or leave enabled). What is really needed is to select the printer, copies, and only.

 

Best regards,

Detefon


How to combine TrayMenu & window detection code?

$
0
0

Included is a working piece of code to enlarge the handy Move / Copy dialog windows in FastStone Image Viewer, and default to the Favorites tab :)

 

I am usually using a main program with hotkeys.

Therefore the While 1 ... WEnd loop.

 

I only recently made the beginning of a TrayMenu, but I have not come across how to ideally incorporate this with the While 1 ... loop yet...

 

If I only include _exampleTrayMenu() in the loop, that works.

If I only include the FastStone test without _exampleTrayMenu(), that works.

 

If I include both in the loop, like in the example, the FastStone code doesn't enlarge the window and the TrayMenu often jumps into Pause / flashing.

 

1) Where to put _exampleTrayMenu() code so all combines...?

 

2) How to most efficiently combine multiple window detection cases in the future?

 

3) ...or can you run more than one AutoIt .exe and would you advise that?

For me too, it would be clearer if I had all window detection code and small stuff in a 2nd .exe.

 

AutoIt         
#include <MsgBoxConstants.au3> #include <TrayConstants.au3> Opt("WinTitleMatchMode", 2) ; MAIN program loop While 1     If WinActive("[CLASS:TCopyMoveFolder]") Then         _FastStoneImgViewer()     Else         _exampleTrayMenu()         Sleep(100)     EndIf WEnd ; Detect opening of both Copy & Move windows in Faststone viewer, enlarge them and click 'Favorites' tab Func _FastStoneImgViewer()     ; if WinActive(" to Folder") (when Copy or Move window appears)     If WinActive( "[CLASS:TCopyMoveFolder]" ) Then         Local $hWnd = WinGetHandle("[CLASS:TCopyMoveFolder]")         ; click once on tab 'Favorites'         ControlClick( $hWnd, "", "[CLASS:TbsSkinPageControl; INSTANCE:1]", "left", 1, 70, 10 )         ; enlarge window         WinMove($hWnd, "", Default, 60, 900, 1060)         ; move buttons down         ; BUTTON Clear History List         ControlMove($hWnd, "", "[CLASS:TbsSkinButton; INSTANCE:1]", Default, 990)         ; BUTTON         ControlMove($hWnd, "", "[CLASS:TbsSkinButton; INSTANCE:2]", Default, 990)         ; BUTTON         ControlMove($hWnd, "", "[CLASS:TbsSkinButton; INSTANCE:3]", Default, 990)         ; BUTTON         ControlMove($hWnd, "", "[CLASS:TbsSkinButton; INSTANCE:4]", Default, 990)         ; ENLARGE the Inside Window         ControlMove($hWnd, "", "[CLASS:TbsSkinPageControl; INSTANCE:1]", Default, Default, 862, 910)         ; ensure focus is back to inside window and previously selected item (so 'select by keypress' will work)         ControlFocus( $hWnd, "", "[CLASS:TListView; INSTANCE:1]" )         WinWaitNotActive($hWnd)     EndIf EndFunc ; traymenu example from manual Func _exampleTrayMenu()     Local $iSettings = TrayCreateMenu("Settings") ; Create a tray menu sub menu with two sub items.     Local $iDisplay = TrayCreateItem("Display", $iSettings)     Local $iPrinter = TrayCreateItem("Printer", $iSettings)     TrayCreateItem("") ; Create a separator line.     Local $idAbout = TrayCreateItem("About")     TrayCreateItem("") ; Create a separator line.     Local $idExit = TrayCreateItem("Exit")     TraySetState($TRAY_ICONSTATE_SHOW) ; Show the tray menu.     While 1         Switch TrayGetMsg()             Case $idAbout ; Display a message box about the AutoIt version and installation path of the AutoIt executable.                 MsgBox($MB_SYSTEMMODAL, "", "AutoIt tray menu example." & @CRLF & @CRLF & _                         "Version: " & @AutoItVersion & @CRLF & _                         "Install Path: " & StringLeft(@AutoItExe, StringInStr(@AutoItExe, "\", 0, -1) - 1)) ; Find the folder of a full path.             Case $iDisplay, $iPrinter                 MsgBox($MB_SYSTEMMODAL, "", "A sub menu item was selected from the tray menu.")             Case $idExit ; Exit the loop.                 ExitLoop         EndSwitch     WEnd EndFunc

Automated testing

$
0
0

Hello,

 

I try to use AutoIT for automated testing.

My first test is a recording of starting the Windows calc.exe, enter 2 * 3 and then I want to test the result. Of course it should be 6, but the result I get is 0, although calc,exe displays the correct result.

 

This is my first code:

 

#include <MsgBoxConstants.au3>
#region --- Au3Recorder generated code Start (v3.3.9.5 KeyboardLayout=00020409)  ---
 
#region --- Internal functions Au3Recorder Start ---
Func _Au3RecordSetup()
Opt('WinWaitDelay',100)
Opt('WinDetectHiddenText',1)
Opt('MouseCoordMode',0)
Local $aResult = DllCall('User32.dll', 'int', 'GetKeyboardLayoutNameW', 'wstr', '')
If $aResult[1] <> '00020409' Then
  MsgBox(64, 'Warning', 'Recording has been done under a different Keyboard layout' & @CRLF & '(00020409->' & $aResult[1] & ')')
EndIf
 
EndFunc
 
Func _WinWaitActivate($title,$text,$timeout=0)
WinWait($title,$text,$timeout)
If Not WinActive($title,$text) Then WinActivate($title,$text)
WinWaitActive($title,$text,$timeout)
EndFunc
 
_AU3RecordSetup()
#endregion --- Internal functions Au3Recorder End ---
 
_WinWaitActivate("Menu Start","")
MouseClick("left",42,500,1)
MouseClick("left",132,445,1)
Send("calc.exe{ENTER}")
_WinWaitActivate("Rekenmachine","")
Send("3*2{ENTER}")
#endregion --- Au3Recorder generated code End ---
WinWaitActive("[CLASS:'CalcFrame']", "", 1)
Local $sText = GUICtrlRead("[CLASS:'CalcFrame'];INSTANCE:1]")
MsgBox($MB_SYSTEMMODAL, "", "The result is: " & $sText)
 
What have I done wrong?
 

start outlook

$
0
0

H :bye: ello to the members of the forum

 

I'm searching  a way to open Outlook 2003 with autoit  .. do i need to use an UDF or can i use  an object ?

 

Thanks for your advices :sorcerer:

 

Jean-Marc

StringSplit... kinda

$
0
0

Hey fellas,

 

I have a string and please note it is going to be dynamic:

6||: [      |meatflycze|,      |oze_g|    ]  }}

What I need is to somehow extract the strings between these two characters: " | " and put them one after another. So the string above would become:

meatflycze, oze_g

Any ideas please?

A noob on its way, Making a map?

$
0
0

Alright, so here i am 3-4 days after starting to learn autoit, and i find it a great tool to be used in database management.

I greatly apriciate all the effort , especialy that which autoit gives!

 

So my problem: My idea is to create some kind of map (and create it so that it can memorise this map)? It would be like a chessboard,

Every group of coordinates would be in a block right? So we will have for example A1(block A1) A2,A3, but also B2, B3, or C.

 

So then i would like the program to react on it, for example i want to go from block A2 to- B4.

In order to do this it will do func() (am i wrong on this, should i put something else instead).

 

Important to know? There will be a point on screen which will always be the point that moves to the blocks, but its position would still stay the same on the screen.

 

So im sorry im a nub coming here for help with so little to give in return, in example a piece of code as a start.

I know a lil bit of autoit, getting more into it and would like to know ANY way in how to get CLOSER to knowing WHAT TO DO! :D

Viewing all 12506 articles
Browse latest View live


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