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

Intercept reg query

$
0
0

Question

1. Is there any way to intercept reg queries, for example, how sysinternals procmon is capable of showing them.

 

Scenario

I have a piece of a software that has a function triggered by a button, that was designed for XP that does not work with windows 7. Specifically it would switch the theme to high contrast.

 

I made a script for the switch, but I would like to get the button to work. The position of the button can change and has the same color pallet as other buttons, so easy detection options do not seem to work.

 

However when using procmon I can see reg keys that it attempts to query when the button is pressed. If I could detect when those keys are being queried, I could run the intended function.


Array filter

$
0
0
I would like to eliminate the elements in an array according to the elements of another one I tried to do this:
AutoIt         
Func __Print(ByRef Const $aArray, $iBase = Default, $iUBound = Default)        Dim $MODULESARRAY[119]    $MODULESARRAY[0] = "blabla"  ...         If Not IsArray($aArray) Then Return SetError(1, 0, 0)     Local $iLast = UBound($aArray) - 1     If $iUBound = Default Or $iUBound > $iLast Then $iUBound = $iLast     If $iBase < 0 Or $iBase = Default Then $iBase = 0     If $iBase > $iUBound Then Return SetError(3, 0, 0)             For $i = $iBase To $iUBound                $trovato = 0                $returntext = ""                For $a = 1 To UBound($MODULESARRAY)                   $sString = StringReplace($aArray[$i], "\", " ")                   If StringInStr($sString, $MODULESARRAY[$a-1]) Then                   $trovato = 1                   Endif                Next                If $trovato = 0 Then                   $returntext &= "[" & $i - $iBase & "]" & $aArray[$i] & "<br>"                EndIf             Next             Return $returntext EndFunc

but dosen't work

please help me :)

Copying a word document to another document

$
0
0

Hello,

I am implementing a repetitive process of my project through autoit and  I have a workflow in which i am having two word file.
 

 

1.In the first file i have a table and  i want to type text in 1st row,  2nd column and i want to copy(Screenshot taken by PrtSc) from clipboard to end of page,  and now  i want to copy all content to clipboard and close this file without saving.

 

2. And in second doc file i want to copy all data from clipboard to end of file and save it before closing.

i want to do these 1,2 operation repeatedly with HotKeySet()..

Below is the code i am writing, its executing for the first time but not executing second time. Please help me. thanks in advance.

 

Func Copy()
 
$oword = ObjCreate("Word.Application")
$oword.visible = True
$oword.Documents.open("Evidence_Copy.docx")
$oword.Selection.Move($wdCell,1) ;moving to another cell
$oword.Selection.TypeText("1")
$oword.Selection.Move($wdSection,1)  ;moving to end of page
$oword.Selection.Paste()                      ;pasting from clipboard
$oword.Selection.WholeStory               ;selecting whole document
$oword.Selection.Copy()                      ; copy all content
 
 
$word = ObjCreate("Word.Application")
$word.visible = True
$word.Documents.open("Evidence.doc")
$word.Selection.Move($wdSection,1)               ;end of page
$word.Selection.Paste()
 
$oword.Documents.Close($WdDoNotSaveChanges)
$oword.Application.Quit()
$word.Documents.Close($wdSaveChanges)
$word.Application.Quit()
EndFunc

IE8 scripts/exes stopped working - $oIE no longer an object

$
0
0

Two days ago,  two of my EXEs and associated scrips stopped working.

 

Since then I downloaded and installed the latest autoit and SciTE:

>Running:(3.3.10.2):C:\Program Files (x86)\AutoIt3\autoit3.exe 
SciTE
Version 3.3.7
    Dec 12 2013 20:45:19
 

 

I've tried to build a simple sample to exhibit the problem as follows:

 

;===============================================================================
Opt("MustDeclareVars", 1) ;0=no, 1=require pre-declare
Opt("WinTitleMatchMode", -1); ; match from start - case insensitive
 
#include <IE.au3>
 
 
;Local $oIE = _IECreate("www.google.com", 1, 1, 0)
;Local $oIE = _IECreate("www.google.com", 0, 0, 0)
 
 
 
 
Local $sExtendedSave = @extended
Local $sErrorSave = @error
 
sleep(10000)
ConsoleWrite( "$oIE>" & $oIE & "<"& @CRLF _
& "$sExtendedSave>"   & $sExtendedSave & "<"& @CRLF _
& "$sErrorSave>"   & $sErrorSave &"<"& @CRLF _
)
 
 
Local $sHTML = _IEDocReadHTML($oIE)
 
Local $sExtendedSave = @extended
Local $sErrorSave = @error
 
ConsoleWrite( "$oIE>" & $oIE & "<"& @CRLF _ ; & "$oHTML>"   & $oHTML & "<"& @CRLF _
& "$sExtendedSave>"   & $sExtendedSave & "<"& @CRLF _
& "$sErrorSave>"   & $sErrorSave &"<" & @CRLF & @CRLF _
& "$sHTML>"   & $sHTML &"<" & @CRLF & @CRLF _
)
 
Exit
 
The console output I get from this run is:
>"C:\Program Files (x86)\AutoIt3\SciTE\AutoIt3Wrapper\AutoIt3Wrapper.exe" /run /prod /ErrorStdOut /in "S:\Operations\Reports\_PredictNonPayment\Q553\programs\testCreate.au3" /UserParams    
+>11:40:03 Starting AutoIt3Wrapper v.2.1.4.0 SciTE v.3.3.7.0 ;  Keyboard:00010409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64    Environment(Language:0409  Keyboard:00010409  OS:WIN_7/Service Pack 1  CPU:X64 OS:X64)
>Running AU3Check (3.3.10.2)  from:C:\Program Files (x86)\AutoIt3
+>11:40:03 AU3Check ended.rc:0
>Running:(3.3.10.2):C:\Program Files (x86)\AutoIt3\autoit3.exe "S:\Operations\Reports\_PredictNonPayment\Q553\programs\testCreate.au3"    
--> Press Ctrl+Alt+F5 to Restart or Ctrl+Break to Stop
$oIE><
$sExtendedSave>0<
$sErrorSave>0<
--> IE.au3 T3.0-1 Error from function _IEDocReadHTML, $_IEStatus_InvalidObjectType (Expected document element)
$oIE><
$sExtendedSave>1<
$sErrorSave>4<
 
$sHTML>0<
 
+>11:40:14 AutoIt3.exe ended.rc:0
>Exit code: 0    Time: 11.002
 
ErrorCode 4 is not documented in the help for _IEDocReadHTML
 
All help appreciated.
thanks
Phil
 
 

Consolewrite: has compile for console been removed?

$
0
0

I cannot get this to work in the most recent version 3.3.10.2. There is no output to a Windows 7 64-bit command prompt.

#AutoIt3Wrapper_Change2CUI=Y ConsoleWrite("Foo!" & @CRLF)

If I try running the 32/64-bit compilers from the start menu, there is no Console checkbox in the compiler.

 

Has this capability been removed and all errror output is expected to be through GUI's now?

 

 

Compiling Problem

$
0
0

Since installing the latest version (3.3.10.2, December 30th, 2013) of AutoIt, I am getting the following error when I try to compile a script.

Error: EndUpdateResource: Returncode = 0 - LastError:0:The operation completed successfully.

This is very similar to this issue I had a couple of years back.  Unfortunately, the cause does not seem to be the same.

 

Previously, I was housing the source on a network drive, and found that there was a latency issue on that server that was causing the problem.  Since repairing that server, I have not had this problem again until I installed the latest version.

 

To be sure it was not a similar issue, I have moved the source folder to my local drive (an OCZ-Vertex4 SSD drive that should have no latency problems at all), but it has made no difference.

 

Everything runs perfectly (from network or from local) if I run the script from within SCITE.

 

Wrapper directives are as follows

Any thoughts on what might be causing this?

 

-- Edit --

PC is running 64bit Windows 7 Enterprise N SP1 (fully patched), with Kaspersky Endpoint Security 8 (up to date)

Lenovo ThinkCentre M91 with 8Gig RAM

 

-- Edit 2 --

Note sure why 3 lines in the code above are being replaced by jibberish, but they should be

  1. #AutoIt3Wrapper_Res_Field=Company|Company Name
  2. #AutoIt3Wrapper_Res_Field=Author|Willichan
  3. #AutoIt3Wrapper_Res_Field=Website|http://companyurl.com

Problem extracting folder's icon

$
0
0

Hello. I am writing some kind of a toolbar and i am not able to properly extract and set the folder's icon. The icon is set, but it's usually the wrong one. Can any1 look at this code and tell me what i do wrong? The problem starts here: "Case $GUI_EVENT_DROPPED"

And I would also like to get rid of this pop up window that appears while getting the icon index, but i am not really into MDSN, I don't know how to use it properly. Can I also get your advice on this matter? :)

AutoIt         
#region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Resources\ikona.ico #AutoIt3Wrapper_Outfile=Flawless Toolbar v1.exe #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker #endregion ;**** Directives created by AutoIt3Wrapper_GUI **** #include <GUIConstantsEx.au3> #include <GuiConstants.au3> #include <WindowsConstants.au3> #include <Constants.au3> #include <GuiListView.au3> #include <WinAPI.au3> #include <GuiRichEdit.au3> #include <File.au3> #include <Array.au3> #include <WinAPIShellEx.au3> #include <APIShellExConstants.au3> #include <WinAPIDlg.au3> Opt("GUIOnEventMode", 1) Opt("TrayOnEventMode", 1) Opt("TrayMenuMode", 3) HotKeySet("^2", "_show_hide_console") HotKeySet("^1", "_hide_show_toolbar") HotKeySet("^!{NUMPADADD}", "_volume_up") HotKeySet("^!{NUMPADSUB}", "_volume_down") HotKeySet("^!{NUMPADDIV}", "_volume_mute") ;Dane ikonek Global $exeDir, $n = 0, $Start ;Dane okien Global $stateTool = True ;state of toolbar hidden / shown Global $stateConsole = False ;state of the consol: hidden/shown Global $stateOptions = False Global $tX = @DesktopWidth / 4 Global $tY = 0 Global $i = 2, $j = 6 ;this is used to calulate width and height of the console Global $tWidth = @DesktopWidth / $i, $tHeight = @DesktopHeight / $j + 10 Global $cHeight = @DesktopHeight / 2 ;hiding speed Global $hide_speed = 10; ;Effect glass Global $Struct = DllStructCreate("int cxLeftWidth;int cxRightWidth;int cyTopHeight;int cyBottomHeight;") Global $sStruct = DllStructCreate("dword;int;ptr;int") If Not IniRead(@ScriptDir & "\data_shortcuts.ini", "number", "n", "") Then     IniWrite(@ScriptDir & "\data_shortcuts.ini", "number", "n", $n) Else     $n = IniRead(@ScriptDir & "\data_shortcuts.ini", "number", "n", "") EndIf $cmd = Run(@ComSpec, "", @SW_HIDE, $STDERR_CHILD + $STDIN_CHILD + $STDOUT_CHILD) ;TOOLBAR $Toolbar = GUICreate("Flawless Toolbar by Zwierzak", $tWidth, $tHeight, $tX, $tY, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_ACCEPTFILES, $WS_EX_TOOLWINDOW)) $LV = GUICtrlCreateListView("", -1, -1, $tWidth + 30, $tHeight + 5, BitOR($LVS_SINGLESEL, $LVS_ICON, $LVS_EX_REGIONAL)) ;liczby dodawane aby ukryc "biale linie" _GUICtrlListView_SetIconSpacing($LV, 80, 80) _GUICtrlListView_SetView($LV, 1) ;sets icon size GUICtrlSetState($LV, $GUI_DROPACCEPTED) ;invisible button responsible for creating a hotkey to an active window $buttonDelete = GUICtrlCreateButton("Delete", 0, -50) $buttonExit = GUICtrlCreateButton("Exit", 50, -50) Local $AccelKeys[2][2] = [["{DEL}", $buttonDelete],["{ESC}", $buttonExit]] GUISetAccelerators($AccelKeys, $Toolbar) ;CONSOLE $hConsole = GUICreate("Flawless Console by Zwierzak", @DesktopWidth, $cHeight, 0, -$cHeight, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_TOOLWINDOW));zostanie stworzona ukryta $consoleList = _GUICtrlRichEdit_Create($hConsole, "", 0, 0, @DesktopWidth, $cHeight - 30, BitOR($ES_MULTILINE, $WS_VSCROLL, $ES_AUTOVSCROLL)) _GUICtrlRichEdit_SetReadOnly($consoleList) $consoleInput = GUICtrlCreateInput("", 0, $cHeight - 30, @DesktopWidth - 50, 30) GUICtrlSetFont($consoleInput, 12) $Enter = GUICtrlCreateButton("Enter", @DesktopWidth - 50, $cHeight - 30, 50, 30) GUICtrlSetState($Enter, $GUI_DEFBUTTON) ;OPTIONS $Options = GUICreate("Opcje", 400, 500, 192, 124) $Apply = GUICtrlCreateButton("Zapisz", 0, 470, 100, 30) $Cancel = GUICtrlCreateButton("Anuluj", 300, 470, 100, 30) $tabs = GUICtrlCreateTab(0, 0, 400, 470) $page1 = GUICtrlCreateTabItem("Ogolne") $Checkbox1 = GUICtrlCreateCheckbox("Uruchom przy starcie systemu", 8, 32, 161, 17) GUICtrlCreateTabItem("") ;TRAY $tr_options = TrayCreateItem("Opcje") $tr_hotkeys = TrayCreateItem("Klawisze skrótów") $tr_opis = TrayCreateItem("O programie") $tr_exit = TrayCreateItem("Exit") If @OSVersion = "WIN_VISTA" Or @OSVersion = "WIN_7" Then     _Vista_EnableBlurBehind($Toolbar)     _Vista_EnableBlurBehind($hConsole)     GUICtrlSetBkColor($LV, 0x000000)     GUICtrlSetColor($LV, 0xFFFFFF)     GUICtrlSetBkColor($consoleInput, 0x000000)     GUICtrlSetColor($consoleInput, 0xFFFFFF)     GUICtrlSetBkColor($Enter, 0x000000)     GUICtrlSetColor($Enter, 0xFFFFFF)     _GUICtrlRichEdit_SetBkColor($consoleList, 0x000000)     _GUICtrlRichEdit_SetCharColor($consoleList, 0xFFFFFF) EndIf _load_icons() _load_settings() GUISetOnEvent($GUI_EVENT_DROPPED, "GuiEvent", $Toolbar) GUISetOnEvent($GUI_EVENT_CLOSE, "GuiEvent", $Toolbar) GUISetOnEvent($GUI_EVENT_CLOSE, "_show_options", $Options) GUICtrlSetOnEvent($buttonDelete, "GuiEvent") GUICtrlSetOnEvent($buttonExit, "GuiEvent") GUICtrlSetOnEvent($Enter, "GuiEvent") GUICtrlSetOnEvent($Apply, "_save_settings") GUICtrlSetOnEvent($Cancel, "_show_options") TrayItemSetOnEvent($tr_exit, "_exit") TrayItemSetOnEvent($tr_options, "_show_options") TrayItemSetOnEvent($tr_opis, "_about") TrayItemSetOnEvent($tr_hotkeys, "_hotkeys") AdlibRegister("cout", 100) GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW, $Toolbar) GUISetState(@SW_SHOW, $hConsole) TrayTip("Info", "Klawisze skrótów opisane są w menu tray, znajdują się pod pozycją 'Klawisze skrótów' ", 10000) While 1     Sleep(100)     _Start() WEnd Func GuiEvent()     Switch @GUI_CtrlId         Case $GUI_EVENT_CLOSE, $buttonExit             _exit()         Case $buttonDelete             If _delete() = 0 Then ContinueCase             _GUICtrlListView_DeleteAllItems($LV)             _load_icons()         Case $Enter             Switch GUICtrlRead($consoleInput)                 Case "exit"                     _add_edit(GUICtrlRead($consoleInput) & @CRLF & "Exiting console...")                     GUICtrlSetData($consoleInput, "")                     Sleep(1000)                     _exit()                 Case "cls"                     Local $number = _GUICtrlRichEdit_GetLineCount($consoleList) ;return number of lines                     Local $last_line = _GUICtrlRichEdit_GetTextInLine($consoleList, $number) ;saves the last line                     _GUICtrlRichEdit_SetText($consoleList, "")                     _add_edit($last_line)                 Case Else                     StdinWrite($cmd, GUICtrlRead($consoleInput) & @CRLF)             EndSwitch             GUICtrlSetData($consoleInput, "")         Case $GUI_EVENT_DROPPED             Local $szDrive, $szDir, $szFname, $szExt, $name             $exeDir = @GUI_DragFile ;file directory             _PathSplit($exeDir, $szDrive, $szDir, $szFname, $szExt)             If $szExt = "" Then ;folder                 ;update                 $name = StringSplit($exeDir, "\")                     If $name[$name[0]] <> "" Then                         $name = $name[$name[0]]                     Else                         $name = $name[$name[0]-1]                     EndIf                     ; Select icon                 Local $aIcon = _WinAPI_PickIconDlg()                 If @error Then Exit                 ; Set icon to selected folder                 Local $tSHFCS = DllStructCreate($tagSHFOLDERCUSTOMSETTINGS & ';wchar szIconFile[' & (StringLen($aIcon[0]) + 1) & ']')                 DllStructSetData($tSHFCS, 'Size', DllStructGetPtr($tSHFCS, 'szIconFile') - DllStructGetPtr($tSHFCS))                 DllStructSetData($tSHFCS, 'Mask', $FCSM_ICONFILE)                 DllStructSetData($tSHFCS, 'IconFile', DllStructGetPtr($tSHFCS, 'szIconFile'))                 DllStructSetData($tSHFCS, 'SizeIF', 260)                 DllStructSetData($tSHFCS, 'IconIndex', -1)                 DllStructSetData($tSHFCS, 'szIconFile', -1)                 _WinAPI_ShellGetSetFolderCustomSettings($exeDir, $FCS_READ, $tSHFCS)                     MsgBox(0,"", "exe:" & $exeDir & @CRLF & DllStructGetData($tSHFCS, "IconFile") & @CRLF & DllStructGetData($tSHFCS, "SizeIF") & @CRLF & DllStructGetData($tSHFCS, "IconIndex") & @CRLF & DllStructGetData($tSHFCS, "szIconFile"))                     GUICtrlCreateListViewItem($name, $LV)                     GUICtrlSetImage(-1, "SHELL32.dll", DllStructGetData($tSHFCS, "IconIndex"), 1)                 _save($exeDir)             ElseIf $szExt = ".exe" Then ;aplikacja                 Update($exeDir)                 _save($exeDir)             ElseIf $szExt = ".lnk" Then ;skrot                 Local $dir = FileGetShortcut($exeDir)                 Update($dir[0])                 _save($dir[0])             EndIf     EndSwitch EndFunc   ;==>GuiEvent Func cout()     $line = StdoutRead($cmd)     $error = StderrRead($cmd)     If $error <> "" Then _add_edit(@CRLF & $error)     If $line <> "" Then _add_edit($line) EndFunc   ;==>cout Func _add_edit($text)     _GUICtrlRichEdit_SetFont($consoleList, 10, "Lucida Console")     _GUICtrlRichEdit_AppendText($consoleList, Console_CP852_to_UNICODE($text))     GUICtrlSetState($consoleInput, $GUI_FOCUS) EndFunc   ;==>_add_edit Func _save_settings()     If GUICtrlRead($Checkbox1) = 1 Then         FileCreateShortcut(@ScriptDir & "\" & @ScriptName, @StartupDir & "\" & @ScriptName, @ScriptDir)         IniWrite(@ScriptDir & "\settings.ini", "autostart", "value", "1")     Else         FileDelete(@StartupDir & "\" & @ScriptName & ".lnk")         IniWrite(@ScriptDir & "\settings.ini", "autostart", "value", "4")     EndIf     _show_options() EndFunc   ;==>_save_settings Func _load_settings()     GUICtrlSetState($Checkbox1, IniRead(@ScriptDir & "\settings.ini", "autostart", "value", "")) EndFunc   ;==>_load_settings Func _save($data)     ;data - directory to a fle     Local $szDrive, $szDir, $szFname, $szExt     $n = IniRead(@ScriptDir & "\data_shortcuts.ini", "number", "n", "")     _PathSplit($data, $szDrive, $szDir, $szFname, $szExt)     Local $wd = $szDrive & $szDir     $n += 1     IniWrite(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $n, $data);zapisuje sciezke     IniWrite(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $n & "_wd", $wd) ;zapisuje working dir     IniWrite(@ScriptDir & "\data_shortcuts.ini", "number", "n", $n) EndFunc   ;==>_save Func _load_icons()     $n = IniRead(@ScriptDir & "\data_shortcuts.ini", "number", "n", "")     For $i = 1 To $n Step +1         Update(IniRead(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $i, ""))     Next EndFunc   ;==>_load_icons Func Update($directory)     $IHM = _WinAPI_ExtractIconEx($directory, -1, 0, 0, 0)     Local $filename = FileGetVersion($directory, "ProductName")     If $filename = "" Then         Local $string = StringSplit($directory, "\");string[0]=ilosc elementow, string[string[o]]=ostatni element="name.exe"         Local $name = StringSplit($string[$string[0]], ".");name[1]=nazwa, name[2]="exe"         $filename = $name[1]     EndIf     GUICtrlCreateListViewItem($filename, $LV)     GUICtrlSetImage(-1, $directory, -1, 1) EndFunc   ;==>Update Func _delete()     $n_index = _GUICtrlListView_GetSelectionMark($LV)     If $n_index = -1 Then Return 0;if nothing is selected, return 0     $n_index += 1     $n = IniRead(@ScriptDir & "\data_shortcuts.ini", "number", "n", "")     IniDelete(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $n_index)     IniDelete(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $n_index & "_wd")     For $i = $n_index + 1 To $n Step +1         IniWrite(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $i - 1, IniRead(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $i, ""))         IniWrite(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $i - 1 & "_wd", IniRead(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $i & "_wd", ""))     Next     IniDelete(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $n)     IniDelete(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $n & "_wd")     IniWrite(@ScriptDir & "\data_shortcuts.ini", "number", "n", $n - 1);aktualizuje n     ;nie chcialo mi sie sprawdzac kiedy tworzy sie zerowy wpis, wiec po prostu zawsze go usuwam xD     IniDelete(@ScriptDir & "\data_shortcuts.ini", "shortcuts", "0")     IniDelete(@ScriptDir & "\data_shortcuts.ini", "shortcuts", "0_wd")     Return 1 EndFunc   ;==>_delete Func _Start()     If $Start Then         $Start = 0         Local $index = _GUICtrlListView_GetSelectionMark($LV)         Local $path = IniRead(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $index + 1, "") ;czyta sciezke         Local $wd = IniRead(@ScriptDir & "\data_shortcuts.ini", "shortcuts", $index + 1 & "_wd", "");czyta working dir         ShellExecute($path, "", $wd)     EndIf EndFunc   ;==>_Start Func _exit()     AdlibUnRegister("cout")     AdlibUnRegister("_hide_show_toolbar")     Exit EndFunc   ;==>_exit Func _show_options()     If $stateOptions = False Then         GUISetState(@SW_SHOW, $Options)         $stateOptions = True     Else         GUISetState(@SW_HIDE, $Options)         $stateOptions = False     EndIf EndFunc   ;==>_show_options Func _hide_show_toolbar()     $winpos = WinGetPos(WinGetTitle($Toolbar))     If $stateTool = True Then ;toolbar jest widoczny         While $winpos[1] + $winpos[3] > 0             $winpos = WinGetPos(WinGetTitle($Toolbar))             WinMove(WinGetTitle($Toolbar), "", $tX, $winpos[1] - 10)             Sleep($hide_speed)         WEnd         $stateTool = False     Else ;toolbar jest niewidoczny         While $winpos[1] < 0             $winpos = WinGetPos(WinGetTitle($Toolbar))             WinMove(WinGetTitle($Toolbar), "", $tX, $winpos[1] + 10)             Sleep($hide_speed)         WEnd         WinMove(WinGetTitle($Toolbar), "", $tX, $tY);umieszcza okno gdzie bylo przy tworzeniu         WinActivate(WinGetTitle($Toolbar))         $stateTool = True     EndIf EndFunc   ;==>_hide_show_toolbar Func _show_hide_console()     If $stateConsole = False Then ;konsola jest ukryta         Do             $winpos = WinGetPos(WinGetTitle($hConsole))             WinMove(WinGetTitle($hConsole), "", 0, $winpos[1] + 30)             Sleep($hide_speed)         Until $winpos[1] > 0         WinMove(WinGetTitle($hConsole), "", 0, 0)         $stateConsole = True         WinActivate(WinGetTitle($hConsole))     Else;kosnola jest widoczna         Do             $winpos = WinGetPos(WinGetTitle($hConsole))             WinMove(WinGetTitle($hConsole), "", 0, $winpos[1] - 30)             Sleep($hide_speed)         Until $winpos[1] < -$cHeight         $stateConsole = False     EndIf EndFunc   ;==>_show_hide_console Func _volume_mute()     Send("{Volume_mute}") EndFunc   ;==>_volume_mute Func _volume_up()     Send("{Volume_up}") EndFunc   ;==>_volume_up Func _volume_down()     Send("{Volume_down}") EndFunc   ;==>_volume_down Func _about()     MsgBox(64, "Flawless Toolbar", "Flawless Toolbar Beta by zwierzak(autoit.xaa.pl)") EndFunc   ;==>_about Func _hotkeys()     MsgBox(64, "Flawless Toolbar", "Aby pokazać / ukryć toolbara wciśnij ctrl+1" & @CRLF & "Aby pokazać / ukryć konsolę wciśnij ctrl+2" & @CRLF & "Aby skasować ikonkę z listy zaznacz ją i wciśnij 'delete'" & @CRLF & @CRLF & "Korzystając z klawiatury numerycznej..." & @CRLF & "Aby zwiekszyc głośność dźwięku wciśnij 'ctrl alt +'" & @CRLF & "Aby zmniejszyc głośność dźwięku wciśnij 'ctrl alt -'" & @CRLF & "Aby wyłączyć/włączyć dźwięk wciśnij 'ctrl alt /'") EndFunc   ;==>_hotkeys Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)     Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndLV, $tInfo     $hWndLV = GUICtrlGetHandle($LV)     $tNMHDR = DllStructCreate($tagNMHDR, $ilParam)     $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))     $iIDFrom = DllStructGetData($tNMHDR, "IDFrom")     $iCode = DllStructGetData($tNMHDR, "Code")     Switch $hWndFrom         Case $hWndLV             Switch $iCode                 Case $NM_DBLCLK                     Local $LVHT = _GUICtrlListView_HitTest($hWndLV)                     If $LVHT[0] <> -1 And StringRight($exeDir, 4) <> ".icl" Then                         $Start = 1;click approved                         $LHT = ($LVHT[0] + 1)                     EndIf             EndSwitch     EndSwitch     Return $GUI_RUNDEFMSG EndFunc   ;==>WM_NOTIFY Func _Vista_EnableBlurBehind($hWnd, $bColor = 0x000000)     Const $DWM_BB_ENABLE = 0x00000001     DllStructSetData($sStruct, 1, $DWM_BB_ENABLE)     DllStructSetData($sStruct, 2, "1")     DllStructSetData($sStruct, 4, "1")     GUISetBkColor($bColor, $hWnd)     $Ret = DllCall("dwmapi.dll", "int", "DwmEnableBlurBehindWindow", "hwnd", $hWnd, "ptr", DllStructGetPtr($sStruct))     If @error Then         Return 0     Else         Return $Ret     EndIf EndFunc   ;==>_Vista_EnableBlurBehind Func Console_CP852_to_UNICODE($sText = "")     ; Tablica zamienników Strony kodowej CMD (CP/OEM 852) na standard Unicode (UTF-8)     Dim $CODEPAGE[20][2]     $CODEPAGE[1][0] = "0x88"     $CODEPAGE[1][1] = "ł"     $CODEPAGE[2][0] = "0x9D"     $CODEPAGE[2][1] = "Ł"     $CODEPAGE[3][0] = "0x86"     $CODEPAGE[3][1] = "ć"     $CODEPAGE[4][0] = "0x8F"     $CODEPAGE[4][1] = "Ć"     $CODEPAGE[5][0] = "0x97"     $CODEPAGE[5][1] = "Ś"     $CODEPAGE[6][0] = "0x98"     $CODEPAGE[6][1] = "ś"     $CODEPAGE[7][0] = "0xE0"     $CODEPAGE[7][1] = "Ó"     $CODEPAGE[8][0] = "0xA2"     $CODEPAGE[8][1] = "ó"     $CODEPAGE[9][0] = "0xA5"     $CODEPAGE[9][1] = "ą"     $CODEPAGE[10][0] = "0xA4"     $CODEPAGE[10][1] = "Ą"     $CODEPAGE[11][0] = "0xA8"     $CODEPAGE[11][1] = "Ę"     $CODEPAGE[12][0] = "0xA9"     $CODEPAGE[12][1] = "ę"     $CODEPAGE[13][0] = "0xAB"     $CODEPAGE[13][1] = "ź"     $CODEPAGE[14][0] = "0x8D"     $CODEPAGE[14][1] = "Ź"     $CODEPAGE[15][0] = "0xBD"     $CODEPAGE[15][1] = "Ż"     $CODEPAGE[16][0] = "0xBE"     $CODEPAGE[16][1] = "ż"     $CODEPAGE[17][0] = "0xE3"     $CODEPAGE[17][1] = "Ń"     $CODEPAGE[18][0] = "0xE4"     $CODEPAGE[18][1] = "ń"     $CODEPAGE[19][0] = "0xF5"     $CODEPAGE[19][1] = "$"     $sRet = ""     For $iIter = 1 To StringLen($sText) Step 1         $itmp = StringMid($sText, $iIter, 1)         For $iRep = 1 To 19 Step 1             If Asc($itmp) = $CODEPAGE[$iRep][0] Then $itmp = $CODEPAGE[$iRep][1]         Next         $sRet &= $itmp     Next     Return $sRet EndFunc   ;==>Console_CP852_to_UNICODE ;Autor: zwierzak(autoit.xaa.pl)

Hiding Installation window with changing title

$
0
0

Hey There. So I really tried to get this to work without asking and only by searching and thinking :sweating: But it looks like I can't do it on my own.I'm making a silent install script for internet download manager. the thing is the title of the Installation window changes after each step. So I ended up adding WinSetState 9 times :geek: and still it doesn't fully hide the Installation and I see splash of every window.

I think it should be posible to hide all windows in one command with using Class Or $hWnd but I couldn't figure it out.

So anybody can show me the Direction? :pirate:

Thanks in Advance :thumbsup:

Here Is The Code :

AutoIt         
Run("idmansetup.exe") WinWaitActive("Internet Download Manager Setup") WinSetState("Internet Download Manager Setup", "", @SW_HIDE) WinWaitActive("Internet Download Manager Installation Wizard") WinSetState("Internet Download Manager Installation Wizard", "", @SW_HIDE) Opt('SendKeyDelay',300) ControlClick("Internet Download Manager Installation Wizard", "", "[CLASS:Button; INSTANCE:2]") WinWaitActive("Please read IDM license") WinSetState("Please read IDM license", "", @SW_HIDE) ControlClick("Please read IDM license", "", "[CLASS:Button; INSTANCE:2]") WinWaitActive("Choose Destination Location") WinSetState("Choose Destination Location", "", @SW_HIDE) ControlSend("Choose Destination Location", "", "[CLASS:Button; INSTANCE:7]", "{SPACE}") ControlClick("Choose Destination Location", "", "[CLASS:Button; INSTANCE:2]") WinWaitActive("Start Installation of Internet Download Manager") WinSetState("Start Installation of Internet Download Manager", "", @SW_HIDE) ControlClick("Start Installation of Internet Download Manager", "", "[CLASS:Button; INSTANCE:2]") WinWaitActive("Installing") WinSetState("Installing", "", @SW_HIDE) WinWaitActive("Installation Complete") WinSetState("Installation Complete", "", @SW_HIDE) ControlClick("Installation Complete", "", "[CLASS:Button; INSTANCE:3]") WinWait("IDM browser integration") WinSetState("IDM browser integration", "", @SW_HIDE) ControlClick("IDM browser integration", "", "[CLASS:Button; INSTANCE:1]") WinWait("Windows Internet Explorer") WinSetState("Windows Internet Explorer", "", @SW_HIDE) ProcessClose ( "iexplore.exe" ) Sleep(2000) ProcessClose ( "idman.exe" )

Someone infected my computer using AutoIt - Please help me with removal

$
0
0

So it seems that javacl.exe is running on my computers start up using some java script. This program is keylogging me and I've already been hacked. I tried closing the program in task manager, but when I do, my screen turns blue and my computer crashes. I tried deleting the java script but a new one is recreated afterwards. I'm really wondering what autoit is and why it's able to crash my computer if I try closing this program.

 

AutoIt v3 Active Window Info - hidden control

$
0
0

Can I use AutoIt v3 Active Window Info with hidden control ?

 

What are Dim, Global, Local, and Scopes?

$
0
0

Hi, I am having issues understanding something in the tutorial Melba23 gave me. At the bottom of page 22-

When declaring variables you have the option of declaring it in 3 scopes-
• Dim
o Local scope if the variable name doesn't already exist globally, where it is then global.
• Global
o Forces creation of the variable in the Global scope
• Local
o Forces creation of the variable in the Local/Function scope.
You should use Local or Global, instead of Dim, to explicitly state which scope is desired for a variable/constant/array. Examples of declaring variables are shown below:
Dim $x, $y, $z ; Notice we can declare variables of the same scope on the same line if desired. Global $RADIUS ; Global Variable Local $_daysWorking ; Local Variable

 

 

What are Dim, Global. Local, and Scope? What do they do?

Hint/Tray Tip - how to get text

$
0
0
In the system tray icons are available different programs. 
I wonder if you can download the information from the message which is displayed by a given icon. 
 
for Example SKYPE 
"Skype (Disconnected)"
 
Thanks for any help
 
mLipok

Convert string to array

$
0
0

Hi,

 

How can i convert my string to an array if each time my string is added like this:

Local $string $string = "text1" $string = "text2" $string = "text3"

 

Any other solutions better than this?

Local $string[1] Local $1 = 1 For $i = 1 To 3  _ArrayAdd($string, "text" & $1)  $1 += 1 Next _ArrayDisplay($string)

Msgbox not timing out??

$
0
0

I run Win8.1(64bit) and compile au3 as x86(32bit) where could I start to troubleshoot msgbox's not timing out? I actually have to click a button (OK) for the msgbox to close & resume excuting the exe. These exe's are launched using Windows Task Manager.

 

If I run the exe's manual or start them with Windows Task Manager Msgbox timeout is ok. It appears intimitently

 

Any help appreciated

Thanks Chris

Submitting a form that only contains submit input resulting an error

$
0
0

How to click the tag <input type="submit" name="submit" id="submit" value="Publish this ad"> on this kind of form?

<form name="publish_form" id="publish_form" method="post" action="http://www.example.com/jobs/publish/xxxxx/">     <fieldset>         <div class="right">             <div class="suggestion">If you changed your mind, you may <a href="http://www.example.com/jobs/deactivate/xxxxx/" title="cancel posting this ad">cancel posting this ad</a></div>         </div>         <input type="submit" name="submit" id="submit" value="Publish this ad">          or          <a href="http://www.example.com/jobs/post/xxxxx/" title="Edit it">Edit it</a>     </fieldset> </form>

I already tried this code:

#include <IE.au3> Local $oForm = _IEFormGetObjByName($oIE, "publish_form") Sleep(2000) _IEFormSubmit($oForm)

But it caused a problem: --> IE.au3 T3.0-1 Error from function _IEFormSubmit, $_IEStatus_COMError (-2147352573)

Is there any other way to submit that kind of form?


mapped network drives & admin rights

$
0
0

Hi,

 

I just want to report some kind of bug. Not really AutoIt but a strange combination with windows.

 

I tried to do some regwrite and ordered #require admin for my script. But the key simply doesnt appear in the registry.

I nearly lost all hope playing around with any combinations of regwrite, runas, shellexecute for an hour then I realised:

 

The scrip doesnt even run :)

 

Why?

 

My windows was reinstalled and I only mapped my networkdrives as standard user. Programs with admin rights cannot access those drives by default.

The script itself was stored on this network drive so the autoitWrapper couldnt access it.

 

My recommedation:

 

A small error message to the command window "Script not found" would have helped me a lot.

To me it seemed all the time as if the script was executed properly.

 

best regards

 

Blues

Fast way to get an array out of an array?

$
0
0

Hi, plz don't slap me for this question^^

i am saving multiple arrays in a global array and want to retrieve them again:
 

Local $minorArray [2] $minorArray = $globalArray[9] stuff($minorArray[0]) stuff($minorArray[1])

But i dont want to allocate the $minorArray all the time. I am looking for a faster access like:
 

$minorArray = $globalArray[9] ;or $param1 = $globalArray[9] [0] ;that would be a two-dimensional array ... ;or $param1 = ($globalArray[9]) [0] ; does not work either :/

Behind $globalArray is another array but i can't directly get an element of that item.

Do i always have to make an array to get an array? ^^

googling for nested arrays hasn't helped :/

Greetings, Wutklumpen

Need some help with Arrays, and searching them.

$
0
0

I have tried (it works mostly) to create a script that opens a text file, and looks for specific data 'www.test.com'. Then it strips out everything that does not contain 'www.test.com'. Then outputs to a text file that only has the lines with 'www.test.com' in them. I'm trying to duplicate some of the functionality of SED (native to Linux, but I use the windows version).
I created a script and it works beyond my dreams, I was ecstatic :)
Then it dawned on me that I need to put in some error correction. In case the text file did not contain the data I was looking for. That is what slowed me down by a lot.
The script works great except I can't figure out to search for a string in the array to see if it exists. That being the error correction.
Most of my script I understand what I'm doing, but these 'array' things, are killing me :(
I'm also getting stuck on the a loop. I want it to search for a string, if not found then 'error box', if found then to write a file.
If any kind soul could point me in the right direction, I would appreciate it a lot.

AutoIt         
#include <file.au3> #include <Array.au3> Dim $array $s = _FileReadToArray("testreppb.txt", $array);read the text file to an array of lines FileDelete ( "converted.txt" ) $value = InputBox("Input Box","Text to search") ClipPut($value) $bak = ClipGet() ; MsgBox(0, "Clipboard contains:", $bak) $file = FileOpen("converted.txt", 2);open the file to write the results to $searchstring = $bak MsgBox(0, "", $searchstring) _ArrayDisplay($array, "$avArray") Local $avArray = $array $searchstring = InputBox("_ArraySearch() demo", "String to find?") $iIndex = _ArraySearch($avArray, $searchstring) ; MsgBox(0, "test",  $iIndex) If @error Then MsgBox(0, "Not Found",  $searchstring) Else MsgBox(0, "Found",  $searchstring) EndIf for $n = 0 to $array[0]    if StringInStr($array[$n],$searchstring) then           MsgBox(0, "file write", $array[$n])    endif next

Resizing GUI to right side with WinMove

$
0
0

Wrong Topic Title: Resizing GUI to "LEFT" side

 

Hi
Iam trying to make an options GUI and that GUI can expand both sides "left" and "right" with WinMove and AutoItSetOption("GUIResizeMode",802). (That 802 indicates all controls wont move) However expanding right side is flawless but I cant expand window to left side.
 
 
small.jpg
I want this to expand like this when I click proper buttons:
big.jpg
 
I coulnt make left side expand.
 
Thanks for any help.

Find Full Path to an unused Program

$
0
0

Hi,

 

  Trying to to find a way to get the full path to a programs executable with that program not running.

I have searched the Help File and forums and have not been able to find a way that works the same every time.

 

This works but only on some programs: _GetInstalledPath ( I got this to find the full path to Irfan View's exe by only using "iview", "Irfan" as the criteria, strangely enough it only worked on that one program. )

 

This works too but only if you know the exact name of the exe. And in this same thread this was mentioned which leads me to believe that there is an easier more foolproof way.

 

  With all the WinApi Path modules, I cant believe there isn't one that does this... :(

 

Thanks in advance for any pointers.

Bill

Viewing all 12506 articles
Browse latest View live


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