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

How to Automate Silverlight Application using AutoIT

$
0
0

We need to automate Silverlight Application. Can we use AutoIT for the same? If yes then how?


Need help with #include <FTPEx.au3>

$
0
0

Hello everyone am a  new member here and i know that  i shouldn't ask for help without giving something in return but this  one is very important for me .

i want to make something like this . i want to make a ftp script that would create a directory on the server with computer name and date something like this  

 
 
$date = @MDAY & "-" & @MON & "-" & @YEAR


 $Dir = _FTP_CreateDir(@ComputerName & "/" & $date)
   _FTP_FileSend($Server, $Username, $Password, $Save, "/" & @ComputerName & "/" & $date & "/" & $file)


the previous script doesn't  work can anyone find the mistake and help me  ??
Thank you .

 

Unable to run a .bat file with psexec commands

$
0
0

Hi all, so I've been trying to write a script that'll run a local .bat file.

It's a simple idea that i run a batch file from autoit using the codes below with a simple run command.

#RequireAdmin Run( 'C:\AutoTestPackage\TestSuite\SmokeTest\Configure\Temp_Basic.bat' )

Then the batch file will execute the  command line

psexec -i -d \\SGP101TEST02 -u TEST02 -p admin3t -f -c C:\AutoTestPackage\TestSuite\SmokeTest\Configure\Basic_Configuration.bat

 

 

However when i run the script below, the cmd window would appear but it gives an error saying

'psexec.exe' is not recognized as an internal or external command.

 

I also tried directly writing this in autoit

Run( @ComSpec & " /k C:\Windows\System32\PsExec.exe \\SGP101TEST02 C:\AutoTestPackage\TestSuite\SmokeTest\Configure\Temp_Basic.bat > C:\Temp\My.log")

 

But same error 
 
Can anyone tell me what was going on?
Btw if i run the .bat manually it worked!

Move all content from folderA to folderB

$
0
0
Hey guys

How can I move ALL content from folderA to folderB?


$source = 'C:\folderA' $dest = 'C:\folderB' dirmove($source, $dest, 1) ; This just moves folderA under folderB, which is not what I want!

filemove --> only moves files, not directories

ill a byte array from DllStructGetData($lpBuffer, 1)

$
0
0

Edit:
hit return and it submitted before I had actually posed my question....

Delete specific folder found in a text file

$
0
0

Hello,

 

I am trying to build a script that reads a text file with multiple lines (every line has a folder name that needs to be deleted).

Then I want to look for the folder name in the folder list (using _FileListToArrayRec) and if the folder name is found - delete it.

 

This is the code I have so far, but it fails on line 43 - "Array variable has incorrect number of subscripts or subscript dimension range exceeded"
would appreciate some help.

AutoIt         
  1. #include <FileConstants.au3>
  2. #include <MsgBoxConstants.au3>
  3. #include <file.au3>
  4. #Include <Date.au3>
  5. #include <Array.au3>
  6.  
  7. ; ***** Create local logs
  8. $dir = (@WindowsDir & "\Log\")
  9. $log = FileOpen (@WindowsDir & "\Log\log.log",2+256)
  10.  
  11. Eof()
  12.  
  13. Func Eof()
  14.     ; Create a constant variable in Local scope of the filepath that will be read/written to.
  15.     Global Const $sFilePath = @scriptdir & "\folders.txt"
  16.  
  17.     ; Open the file for reading and store the handle to a variable.
  18.     Global $hFileOpen = FileOpen($sFilePath, $FO_READ)
  19.     If $hFileOpen = -1 Then
  20.         MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
  21.         Return False
  22.     EndIf
  23.  
  24.     ; Read the contents of the file using the handle returned by FileOpen.
  25.  
  26.      Global $aArray = FileReadToArray ($hFileOpen)
  27.       For $i = 0 To UBound($aArray) - 1 ; Loop through the array.
  28.             MsgBox($MB_SYSTEMMODAL, "", $aArray[$i])
  29.  
  30. $sRoot = (@ScriptDir)
  31.  
  32. ; Retrieve a list of all the folders in $sRoot, and store them as an array in $aList
  33. Global $aList = _FileListToArrayRec ($sRoot, "*", 2, -2) ; _FileListToArray("path" [, "Filter" [, Flag]])
  34. ; Look at what _FileListToArray() puts into $aList
  35. For $i = 1 To $aList[0]
  36.  
  37.  
  38. If FileExists($sRoot & "\" & $aList[$i] & "\" & $aArray[$i])  Then _filewritelog ($log, "Deleting, " & $aArray[$i])
  39. FileClose($hFileOpen)

ControlSetText on toolbarWindow

$
0
0

Hello!

 

I have a little script and in it a function that is responsible for handling saves in PDFCreator. When such a situation arise, it should set the destination folder to one predestinated in a global variable (a folder in our innernetwork).

 

Originally I achieved this by moving the window to 0,0 then mouseclick on a specified coordinates on the screen (I know, I know, thats why I want to change it something more reliable, more intelligent)

 

My candidates were ControlSetText, ControlSend and ControlCommand. I rejected ControlCommand outright since it isn't really for this. ControlSend cause the script to exit, when it reaches the first point where it would use the function.

 

ControlSetText returns the next console (run_debug_mode=Y)

 

>"C:\Program Files\AutoIt3\SciTE\..\autoit3.exe" /ErrorStdOut "D:\régi gép mentés\Desktop\Automata Tesztelés\UD - uszi új BÉTA\ud_uszi 3.0.1 teszter.au3"    
"D:\régi gép mentés\Desktop\Automata Tesztelés\UD - uszi új BÉTA\ud_uszi 3.0.1 teszter.au3" (1170) : ==> Error in expression.:
ControlSetText("Save as", "", "[CLASSNN:ToolbarWindow323]", & $PDFmentesPath)
ControlSetText("Save as", "", "[CLASSNN:ToolbarWindow323]", ^ ERROR
>Exit code: 1    Time: 34.31
 

 

Here is my function so far: (sorry its under construction)

AutoIt         
Func RenamePDF($TopUpName)     Sleep(1000)     WinActivate("PDFCreator 1.", "")     WinWaitActive("PDFCreator 1.", "")     ControlCommand("PDFCreator 1.", "", "[CLASSNN:ThunderRT6TextBox6]", "EditPaste", $TopUpName)     ControlSetText("PDFCreator 1.", "", "[CLASSNN:ThunderRT6TextBox6]", $TopUpName)     ControlClick("PDFCreator 1.", "", "[CLASSNN:ThunderRT6CommandButton7]")     $WindowWaitCheck = WinWaitActive("Mentés másként", "", 5)     If $WindowWaitCheck = 0 Then         ControlClick("PDFCreator 1.", "", "[CLASSNN:ThunderRT6CommandButton7]")     EndIf     WinMove("Save as", "", 0, 0)     ;MouseClick("", 565, 50) ;Not like this, to many possible errors!     ;Send("{BS}" & $PDFmentesPath & "{Enter}")     ;ControlCommand     ;ControlSend("Save as", "", "[CLASSNN:ToolbarWindow323]", & $PDFmentesPath)     ControlSetText("Save as", "", "[CLASSNN:ToolbarWindow323]", & $PDFmentesPath)     ControlClick("Save as", "", "[CLASSNN:Button1]")     Sleep(1500) EndFunc   ;==>RenamePDF

I have a guess that there is a problem in how I try to write/send the variable $PDFmentesPath, but not sure I know how should I do it. Trying random things that come to mind for now.

 

Thank you for your time and help!

UIA Invoke click for a UIA_TextControlTypeId - Is that possible?

$
0
0

Good Morning AutoIT Gurus :)

 

How is everyone this fine Tuesday?  :thumbsup:

 

I have been using SimpleSpy and inspect.exe to get data from various program windows - but this one, I'm not sure about since it's a button - but it's also text.

 

Could I treat UIA_TextControlTypeID (TextBlock) as a button and click on it somehow? -  If so, how would I do that? FYI - I have successfully been using code examples from LarsJ and Junkew in the past.

 

The reason I have to treat that text as a button is that the button itself has no data. (At least we have an element [][Button]) and the text within the button does... (At least we have an element [Run Threat Analysis Scan][TextBlock])

 

:idea:  SimpleSpy info:

 

Mouse position is retrieved 486-377
At least we have an element [Run Threat Analysis Scan][TextBlock]
 
Having the following values for all properties: 
Title is: <Run Threat Analysis Scan> Class   := <TextBlock> controltype:= <UIA_TextControlTypeId> ,<50020> , (0000C364) 397;367;154;16
*** Parent Information top down ***
7: Title is: <Desktop> Class   := <#32769> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) 0;0;1920;1080
"Title:=Desktop;controltype:=UIA_PaneControlTypeId;class:=#32769"
6: Title is: <Symantec Help v2.1> Class   := <Window> controltype:= <UIA_WindowControlTypeId> ,<50032> , (0000C370) 322;65;1024;680
"Title:=Symantec Help v2.1;controltype:=UIA_WindowControlTypeId;class:=Window"
5: Title is: <> Class   := <SharedWindow> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 330;143;1008;572
"Title:=;controltype:=UIA_CustomControlTypeId;class:=SharedWindow"
4: Title is: <> Class   := <Home2> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 342;193;996;522
"Title:=;controltype:=UIA_CustomControlTypeId;class:=Home2"
3: Title is: <> Class   := <ScrollViewer> controltype:= <UIA_PaneControlTypeId> ,<50033> , (0000C371) 342;193;996;522
"Title:=;controltype:=UIA_PaneControlTypeId;class:=ScrollViewer"
2: Title is: <> Class   := <Ui2Widget> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 357;250;263;169
"Title:=;controltype:=UIA_CustomControlTypeId;class:=Ui2Widget"
1: Title is: <> Class   := <UiActionButton> controltype:= <UIA_CustomControlTypeId> ,<50025> , (0000C369) 357;355;263;40
"Title:=;controltype:=UIA_CustomControlTypeId;class:=UiActionButton"
0: Title is: <> Class   := <Button> controltype:= <UIA_ButtonControlTypeId> ,<50000> , (0000C350) 357;355;263;40
"Title:=;controltype:=UIA_ButtonControlTypeId;class:=Button"
 
#include "UIAWrappers.au3" AutoItSetOption("MustDeclareVars", 1) Local $oP6=_UIA_getObjectByFindAll($UIA_oDesktop, "Title:=Symantec Help v2.1;controltype:=UIA_WindowControlTypeId;class:=Window", $treescope_children)  _UIA_Action($oP6,"setfocus") Local $oP5=_UIA_getObjectByFindAll($oP6, "Title:=;controltype:=UIA_CustomControlTypeId;class:=SharedWindow", $treescope_children)   Local $oP4=_UIA_getObjectByFindAll($oP5, "Title:=;controltype:=UIA_CustomControlTypeId;class:=Home2", $treescope_children)  Local $oP3=_UIA_getObjectByFindAll($oP4, "Title:=;controltype:=UIA_PaneControlTypeId;class:=ScrollViewer", $treescope_children) Local $oP2=_UIA_getObjectByFindAll($oP3, "Title:=;controltype:=UIA_CustomControlTypeId;class:=Ui2Widget", $treescope_children)  Local $oP1=_UIA_getObjectByFindAll($oP2, "Title:=;controltype:=UIA_CustomControlTypeId;class:=UiActionButton", $treescope_children) Local $oP0=_UIA_getObjectByFindAll($oP1, "Title:=;controltype:=UIA_ButtonControlTypeId;class:=Button", $treescope_children) ;~ First find the object in the parent before you can do something ;~$oUIElement=_UIA_getObjectByFindAll("RunThreatAnalysisScan.mainwindow", "title:=Run Threat Analysis Scan;ControlType:=UIA_TextControlTypeId", $treescope_subtree) Local $oUIElement=_UIA_getObjectByFindAll($oP0, "title:=Run Threat Analysis Scan;ControlType:=UIA_TextControlTypeId", $treescope_subtree) _UIA_action($oUIElement,"click")

This fails as well...

 

Window handle OK
UI Automation object OK
Automation element from window OK
Run Threat Analysis Scancondition OK
Find button ERR
 
AutoIt         
    Local $hWindow = WinGetHandle("Symantec Help v2.1")     If Not $hWindow Then Return ConsoleWrite("Window handle ERR" & @CRLF)     ConsoleWrite("Window handle OK" & @CRLF)     ; Create UI Automation object     Local $oUIAutomation = ObjCreateInterface($sCLSID_CUIAutomation, $sIID_IUIAutomation, $dtagIUIAutomation)     If Not IsObj($oUIAutomation) Then Return ConsoleWrite("UI Automation object ERR" & @CRLF)     ConsoleWrite("UI Automation object OK" & @CRLF)     ; Get UI Automation element from window handle     Local $pWindow, $oWindow     $oUIAutomation.ElementFromHandle($hWindow, $pWindow)     $oWindow = ObjCreateInterface($pWindow, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)     If Not IsObj($oWindow) Then Return ConsoleWrite("Automation element from window ERR" & @CRLF)     ConsoleWrite("Automation element from window OK" & @CRLF)     ; Condition to find "Run Threat Analysis Scan" button     Local $pCondition, $pCondition1, $pCondition2     $oUIAutomation.CreatePropertyCondition($UIA_ControlTypePropertyId, $UIA_ButtonControlTypeId, $pCondition1)     $oUIAutomation.CreatePropertyCondition($UIA_NamePropertyId, "Run Threat Analysis Scan", $pCondition2)     $oUIAutomation.CreateAndCondition($pCondition1, $pCondition2, $pCondition)     If Not $pCondition Then Return ConsoleWrite("Run Threat Analysis Scan condition ERR" & @CRLF)     ConsoleWrite("Run Threat Analysis Scancondition OK" & @CRLF)     ; Find "Run Threat Analysis Scan" button     Local $pButton, $oButton     $oWindow.FindFirst($TreeScope_Descendants, $pCondition, $pButton)     $oButton = ObjCreateInterface($pButton, $sIID_IUIAutomationElement, $dtagIUIAutomationElement)     If Not IsObj($oButton) Then Return ConsoleWrite("Find button ERR" & @CRLF)     ConsoleWrite("Find button OK" & @CRLF)     ; Click (invoke) "Run Threat Analysis Scan" button     Local $pInvoke, $oInvoke     $oButton.GetCurrentPattern($UIA_InvokePatternId, $pInvoke)     $oInvoke = ObjCreateInterface($pInvoke, $sIID_IUIAutomationInvokePattern, $dtagIUIAutomationInvokePattern)     If Not IsObj($oInvoke) Then Return ConsoleWrite("Invoke pattern ERR" & @CRLF)     ConsoleWrite("Invoke pattern OK" & @CRLF)     $oInvoke.Invoke()     Sleep(2000)

Thank you all very much - I do appreciate your help as always.  :ILA:

 


List of Applications

$
0
0

Is there a function that returns a list of currently running applications, similar to the list that appears on the Task Manager's Applications tab?

 

Thanks!

 

<Prospeed.au3> A simple working example please

$
0
0

 Hi

 

Can anyone provide a really simple basic example of the prospeed.au3 in action. I'm aware that there are many complete examples around but I have haven't been able to get any of these dated versions working because of syntax errors..... I just need a basic setup where I can manipulate an image within a XY axis using some of the UDF features.

 

 

Thanks

<Prospeed.au3>

v

AutoIt bcdedit.exe (Not work)

$
0
0
Hi all =)
 
i tried yesterday some on autoit so, i have friends , where get always kicked form a game server because the DEP off
they need always to write by him self the whole code in cmd, so i just thinking i could programm him some little programm where he just
need to press on the button and its fixxing  here my code :
<snip>
so i tryd it , but its still not changing , i always watch on CMD after every boot under {current}but can only still reading : AlwaysOff
 
i start this programm everytime as admin
 
I hope one of your nice guys can help me
 
Thanks in advance
 
 
PS : i don't want to use a VBscript , bat file

Can't work with specific window

$
0
0

Hi! First post on AutoIT Forum! :D I am facing a big problem. I have tried commands like WinMove, ControlClick, MouseClick and many others with success, interacting with Calculator window. Now I am trying to click o a button of HWiNFO32 program but i just can't. No ControlClick, no WinMove no MouseClick, not even Send command!!! What can I do? Is there a workaround? You can try it for yourself, try getting HWiNFO32 portable and then click on something or move the window. I can't. Where's the problem?

silly question (variables and memory)

$
0
0

Maybe this question is silly, but I'm still experimenting, and there are many things that I'm not sure how they work.

 

So the question. Functions like WinGetPos - can be used multiple times like this?

 

Local $variable1 = WinGetPos(something)

Local $variable2 = WinGetPos(somethingelse)

...

 

?

 

I mean - will variables remember these selections after the function is re-triggered on something else?

Splitting text file

$
0
0

Kinda new to autoit. I have this situation where I need to take the print output from a dos program and split the pages apart so it will print properly. This is a 25+ year old program, running in DosBox. The issue is that when printing statements the next page will start on the first, and so on. I've tried different dos->windows printer type programs and none of them will split the pages apart properly. 

 

I had this working at one point but some changes in their system have removed that possibility. 

 

I believe a simple autoit script could do this. 

 

My thinking was something like this:

 

Read the text file - Easy

Split the pages - Eh 

Print the pages - 

 

It's been a while since I've done any coding but I can't figure out how to split the pages apart. Each page starts out "COMPANY NAME, INC". I can split around that but I lose that line or "COMPANY NAME, INC" depending on which method. 

 

Anyone have an idea on splitting?

 

I found this code

AutoIt         
#include <File.au3> Global $FileArray $file = @ScriptDir & "\test.txt" ;"C:\SBT\Incoming\SBTFILE.txt" $newfile = @ScriptDir & "\split-" ; "C:\SBT\Work\SBTFILE-" _FileReadToArray($file, $FileArray) $filecount = 1 $sNewFile_Text = "" ProgressOn("Processing SBT File", "Reading The File...", "0 Lines") For $i = 1 To $FileArray[0]     If StringInStr($FileArray[$i], "****** END OF REPORT ******") Then         ; We need to write the current file         FileWrite($newfile & $filecount & ".txt", $sNewFile_Text & $FileArray[$i])         ; And start a new one         $filecount = $filecount + 1         $sNewFile_Text = ""     Else         ; Add line to string         $sNewFile_Text &= $FileArray[$i] & @CRLF     EndIf     $Percent = Int(($i / $FileArray[0]) * 100)     ProgressSet($Percent, $Percent & " Percent Complete") Next ProgressSet(100, "Done", "Complete") Sleep(1000) ProgressOff()

And modified the END OF REPORT to match the string I am looking for but can't figure out how to make it split right before that line.  That code makes files like this

 

File 1:

COMPANY NAME etc

 

File 2 and so forth:

ADDRESS

** REST OF PAGE **

COMPANY NAME

 

Your help is appreciated.

 

 

 

What is the error in this code

$
0
0

Hi all.

I am trying to get some data from a SQLite database. But this code is not working. Please suggest where is the error. 

  1. #include <Alert.au3>
  2. #include <Array.au3>
  3. #include <Misc.au3>
  4. #include <SQLite.au3>
  5. #include <SQLite.dll.au3>
  6.  
  7. Local $db = _SQLite_Open("E:\Autolt Works\SampleSQL.sql")
  8. Local $out, $row, $col
  9. Local $res = _SQLite_GetTable($db,"Select MEM_NAME from MEMBERS",$out, $row, $col)
  10.  
  11. If $res = $SQLITE_OK Then
  12.     _ArrayDisplay($out)
  13.     Alert("No way")
  14.  

And this is my database file.

Attached Thumbnails

  • 000093.jpg

gui adjustments

$
0
0

anyone knows of a to date function UDF that will help adjusting the gui to scale correctly with labels, font sizes.. (for different desktops/dpi)
 
I found this topic
http://www.autoitscript.com/forum/topic/93974-fontgui-resizing/#entry675142

I tried to run it with the example but it errors in scite :

$hDC = DllCall("user32.dll", "long", "ReleaseDC", "long", $hWnd, "long", $hDC)

 

(56) : ==> Variable used without being declared.:

and it seems to be declared huh.png

 

 

Thanks

Autoit how to implement javascript functions?

$
0
0

Hello coders. I've been working with the FF.au3 extension which allows user to do things in Firefox via javascript (_FFCmd function sends javascript and then returns values)

 

But in a lot of cases, there may come handy a javascript function, and now I found that it is probably essential to implement one. The case is:

http://stackoverflow.com/questions/15055185/document-getelementsbyclassname-exact-match-to-class

I've got elements with class "item" and class "item one"
if I do

_FFCmd("someMoreThings.getElementsByClassName('item')")

, it picks the items "item one" also. I need to pick only "item". That issue is solved by a javascript/jquery function on stackoverflow forum. How can I do something like that in AutoIt?

Thanks for help, Knuckles

EDIT: I'm thinking of using something like this:

document.getElementsByClassName('item' && !'item one');

JSLint says Weird condition. (so it's probably not the right way to do it)

Listview Group WM_NOTIFY trigger ?

$
0
0

Does anyone know, how to be notified when a Listview Group has been clicked, or expanded, etc. ?

AutoIt         
  1. #include <GUIConstantsEx.au3>
  2. #include <GuiImageList.au3>
  3. #include <GuiListView.au3>
  4. #include <WindowsConstants.au3>
  5. #include <MsgBoxConstants.au3>
  6.  
  7. Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam)
  8.     Local $tInfo, $tNMHDR = DllStructCreate($tagNMHDR, $lParam), $hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
  9.     Local $iIDFrom = DllStructGetData($tNMHDR, "IDFrom"), $iCode = DllStructGetData($tNMHDR, "Code")
  10.     Switch $hWndFrom
  11.         Case $hWndListView
  12.             Switch $iCode
  13.  
  14.             ;   Case $of?????? ; A Group was clicked       <---- I need help with this
  15.  
  16.  
  17.                 Case $LVN_COLUMNCLICK ; A column was clicked
  18.                     $tInfo = DllStructCreate($tagNMLISTVIEW, $lParam)
  19.                     _DebugPrint("$LVN_COLUMNCLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
  20.                             "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
  21.                             "-->Code:" & @TAB & $iCode & @CRLF & _
  22.                             "-->Item:" & @TAB & DllStructGetData($tInfo, "Item") & @CRLF & _
  23.                             "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
  24.                             "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
  25.                             "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
  26.                             "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
  27.                             "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
  28.                             "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
  29.                             "-->Param:" & @TAB & DllStructGetData($tInfo, "Param"))
  30.                     ; No return value
  31.                 Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
  32.                     $tInfo = DllStructCreate($tagNMITEMACTIVATE, $lParam)
  33.                     _DebugPrint("$NM_CLICK" & @CRLF & "--> hWndFrom:" & @TAB & $hWndFrom & @CRLF & _
  34.                             "-->IDFrom:" & @TAB & $iIDFrom & @CRLF & _
  35.                             "-->Code:" & @TAB & $iCode & @CRLF & _
  36.                             "-->Index:" & @TAB & DllStructGetData($tInfo, "Index") & @CRLF & _
  37.                             "-->SubItem:" & @TAB & DllStructGetData($tInfo, "SubItem") & @CRLF & _
  38.                             "-->NewState:" & @TAB & DllStructGetData($tInfo, "NewState") & @CRLF & _
  39.                             "-->OldState:" & @TAB & DllStructGetData($tInfo, "OldState") & @CRLF & _
  40.                             "-->Changed:" & @TAB & DllStructGetData($tInfo, "Changed") & @CRLF & _
  41.                             "-->ActionX:" & @TAB & DllStructGetData($tInfo, "ActionX") & @CRLF & _
  42.                             "-->ActionY:" & @TAB & DllStructGetData($tInfo, "ActionY") & @CRLF & _
  43.                             "-->lParam:" & @TAB & DllStructGetData($tInfo, "lParam") & @CRLF & _
  44.                             "-->KeyFlags:" & @TAB & DllStructGetData($tInfo, "KeyFlags"))
  45.                     ; No return value
  46.  
  47.             EndSwitch
  48.     EndSwitch
  49.     Return $GUI_RUNDEFMSG
  50. EndFunc   ;==>WM_NOTIFY
  51.  
  52. Func _DebugPrint($s_Text, $sLine = @ScriptLineNumber)
  53.     ConsoleWrite( _
  54.             "!===========================================================" & @CRLF & _
  55.             "+======================================================" & @CRLF & _
  56.             "-->Line(" & StringFormat("%04d", $sLine) & "):" & @TAB & $s_Text & @CRLF & _
  57.             "+======================================================" & @CRLF)
  58. EndFunc   ;==>_DebugPrint
  59.  
  60. If Not StringInStr($CmdLineRaw, "/ErrorStdOut") Then Exit MsgBox($MB_TOPMOST, @ScriptName, 'please run from the editor, thanks', 10)
  61.  
  62. Global $idListview, $hWndListView
  63. Example()
  64.  
  65. Func Example()
  66.     Local $aInfo, $hImage, $idListview
  67.  
  68.     GUICreate("ListView Group COLLAPSIBLE", 400, 300)
  69.  
  70.     $idListview = GUICtrlCreateListView("", 2, 2, 394, 268)
  71.     $hWndListView = GUICtrlGetHandle($idListview)
  72.  
  73.     ; Load images
  74.     $hImage = _GUIImageList_Create()
  75.     _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0xFF0000, 16, 16))
  76.     _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x00FF00, 16, 16))
  77.     _GUIImageList_Add($hImage, _GUICtrlListView_CreateSolidBitMap($idListview, 0x0000FF, 16, 16))
  78.     _GUICtrlListView_SetImageList($idListview, $hImage, 1)
  79.  
  80.     ; Add columns
  81.     _GUICtrlListView_AddColumn($idListview, "Column 1", 100)
  82.     _GUICtrlListView_AddColumn($idListview, "Column 2", 100)
  83.     _GUICtrlListView_AddColumn($idListview, "Column 3", 100)
  84.  
  85.     ; Add items
  86.     _GUICtrlListView_AddItem($idListview, "Row 1: Col 1", 0)
  87.     _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 2", 1)
  88.     _GUICtrlListView_AddSubItem($idListview, 0, "Row 1: Col 3", 2)
  89.     _GUICtrlListView_AddItem($idListview, "Row 2: Col 1", 1)
  90.     _GUICtrlListView_AddSubItem($idListview, 1, "Row 2: Col 2", 1)
  91.     _GUICtrlListView_AddItem($idListview, "Row 3: Col 1", 2)
  92.  
  93.     ; Build groups
  94.     _GUICtrlListView_InsertGroup($idListview, -1, 1, "Group 1", 1)
  95.     _GUICtrlListView_SetGroupInfo($idListview, 1, "Group 1", 0, $LVGS_COLLAPSIBLE + $LVGS_COLLAPSED) ; <---
  96.     _GUICtrlListView_InsertGroup($idListview, -1, 2, "Group 2")
  97.     _GUICtrlListView_SetGroupInfo($idListview, 2, "Group 2", 0, $LVGS_COLLAPSIBLE + $LVGS_COLLAPSED) ; <---
  98.     _GUICtrlListView_SetItemGroupID($idListview, 0, 1)
  99.     _GUICtrlListView_SetItemGroupID($idListview, 1, 2)
  100.     _GUICtrlListView_SetItemGroupID($idListview, 2, 2)
  101.  
  102.     GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
  103.  
  104.     ; Loop until the user exits.
  105.     Do
  106.     Until GUIGetMsg() = $GUI_EVENT_CLOSE
  107.  
  108.     GUIDelete()
  109. EndFunc   ;==>Example
  1.  

GIF blinks and plays too fast

$
0
0

I don't know why this is happening but the gif plays smoothly on chrome (link for this gif)

 

I'm using GIFAnimation UDF from trancexx

AutoIt         
#include <WindowsConstants.au3> #include <GIFAnimation.au3> Global $bLoading = "0x4749463839612B000B00F10000FFFFFF07A3F685D1FA07A3F621FF0B4E45545343415045322E300301000000" & _     "21FE1A43726561746564207769746820616A61786C6F61642E696E666F0021F904090A0000002C000000002B000B00000232848E0" & _     "8CB96D9D883F3C50A1BDE56F3CB85E036865859A166277DDE9ABEA70C672D49D787CA2EFAC4B3F93EB8A020324C15000021F90409" & _     "0A0000002C000000002B000B0000023DC48E08CB200F6163B19A84C7AC7CF39861DEF78C6498989FCAA14A434A702CB8076BCDB1A" & _     "DE9240EB20165141A6F58F27D8ECA4ED3E29A2C6252C7AF000021F904090A0000002C000000002B000B0000023D848E08CB300F6163A9"     $Form1 = GUICreate("Example", 300, 300, -1, -1, BitOR($WS_THICKFRAME,$WS_SYSMENU)) GUISetBkColor(0xFFFFFF) $hGIF = _GUICtrlCreateGIF($bLoading, "", 125, 120,Default,Default,Default,0xFFFFFFFF) GUIRegisterMsg(133, "_Refresh") GUISetState(@SW_SHOW) While 1     $nMsg = GUIGetMsg()     Switch $nMsg         Case -3             Exit     EndSwitch WEnd Func _Refresh($hWnd, $iMsg, $wParam, $lParam)     #forceref $hWnd, $iMsg, $wParam, $lParam     _GIF_RefreshGIF($hGIF) EndFunc   ;==>_Refresh

Using this udf it plays faster and blinks when is beginning the animation again.

 

Hope I'm doing something wrong, its hard to find cool looking loading gifs with less than 1kb :\

Scripts failing

$
0
0

Hello, I noticed lately my scripts are failing. random parts of my code getting "has failed" errors, is anyone else getting the same issue? My PC might have been hacked or something. I even tried downgrading IE from Version 10 to Version 8. My codes have been working for more than 2 months now, today whenever I run them random codes get errors and I'm not changing anything. Just wondering if anyone else experienced hits

Viewing all 12506 articles
Browse latest View live


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