Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 09/16/2020 in all areas

  1. Hello!!! In the past I had problems adding an application as a default for an extension in Windows 10. (It was easy in windows 7 using Registry) But since Windows 8 It requires to do some steps more. I wrote a tool (in other programming language) months ago for handling it. But now I just want to share an AutoIt version. Check on GitHub. Saludos
    2 points
  2. Place both func and endfunc outside the while/endwhile loops
    2 points
  3. Hello guys, @mLipok as @argumentum says it's just an array. I've updated the script according your suggestions. Thank you both Saludos
    1 point
  4. This is one of the most stupidest post ik have ever seen here... And I've seen a lot You probably have no idea why I said this until you figure it out somehow.
    1 point
  5. You should go back and research how AHK got its start.
    1 point
  6. As I wrote above you needed to declare the array after the range read, here is an example: Note I used random day, just so you can see the result, just close the tool and you should see message box for dates that don't equal the $idDate (converted to long date format). #NoTrayIcon #include <Excel.au3> #include <MsgBoxConstants.au3> #include <Array.au3> #include <Date.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <WindowsConstants.au3> #include "GUIScrollbars_Ex.au3" #include <FTPEx.au3> #include <GuiButton.au3> Global $idDate = "2020/10/25" Global $iIndex Global $oExcel = _Excel_Open() Global $oWorkbook = _Excel_BookOpen($oExcel, @ScriptDir & "\Test_1.xlsx",False,True) Global $aWorkSheets = _Excel_SheetList($oWorkbook) $oWorkbook.Sheets(2).Activate Global $Total_Rows = _Excel_RangeRead($oWorkbook, Default , $oWorkbook.ActiveSheet.Usedrange.Columns("C:C"),1) Global $Total_Rows_Count = Ubound($Total_Rows) Global $Names = _Excel_RangeRead($oWorkbook, 2, "B2:C"&Ubound($Total_Rows), 2) Global $aGroupNames[UBound($Names)][3] ;~ Declare the group name array, same number of rows as the spreadsheet CreateGUI() Func CreateGUI() Local $hGUI = GUICreate("My GUI list",700,500) ; will create a dialog box that when displayed is centered - UBound($Names, 1) - 1 _GUIScrollbars_Generate($hGUI, 500, 100+(UBound($Names, 1)*110)+50) For $iIndex = 0 to UBound($Names, 1) - 1 $aGroupNames[$iIndex][0] = $iIndex & "|" & $Names[$iIndex][1] & "|" & $Names[$iIndex][0] $aGroupNames[$iIndex][1] = GUICtrlCreateGroup($Names[$iIndex][0] &" "& $Names[$iIndex][1], 70, 100+$iIndex*110, 600, 100,-1,0x400000) $aGroupNames[$iIndex][2] = GUICtrlCreateDate("2020/10/" & Random(23, 26), 550, 150+$iIndex*110, 100, 20) Next GUISetState(@SW_SHOW) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop Case $GUI_EVENT_RESTORE _GUIScrollbars_Restore($hGUI) Case $GUI_EVENT_MINIMIZE _GUIScrollbars_Minimize($hGUI) EndSwitch WEnd Local $idLongDate = _DateTimeFormat($idDate, 1) For $i = 0 To UBound($aGroupNames) - 1 If $idLongDate <> GUICtrlRead($aGroupNames[$i][2]) Then MsgBox(4096, "Info", "Group Name = " & GUICtrlRead($aGroupNames[$i][1]) & @CRLF & "Date = " & GUICtrlRead($aGroupNames[$i][2])) Next EndFunc
    1 point
  7. I suggest to save DD in the User Include Folder which you can specify with SciTEConfig.
    1 point
  8. tarretarretarre

    Autoit-Events

    About AutoIt-Events AutoIt-Events is an event Observer and is a core dependency for Autoit-Socket-IO but can be used for any Autoit project. Example #include "Event.au3" ; Subscribe listeners _Event_Listen(UserCreatedEvent, SendWelcomeMail) _Event_Listen(UserCreatedEvent, RegisterNewsLetter) ; Fire event _Event(UserCreatedEvent, @UserName, "tarre.islam@gmail.com") Func UserCreatedEvent(Const ByRef $oEvent, $name, $email) ; via $oEvent you can pass data to its listeners $oEvent.add("name", $name) $oEvent.add("email", $email) $oEvent.add("id", 1) EndFunc Func SendWelcomeMail(Const $oEvent) MsgBox(64, "Welcome mail sent", "Welcome mail sent to " & $oEvent.item("name") & " with email " & $oEvent.item("email")) EndFunc Func RegisterNewsLetter(Const $oEvent) MsgBox(64, "News letter registred", "News letter bound to user id " & $oEvent.item("id")) EndFunc The code is also available at Github Autoit-Events-1.0.0.zip
    1 point
  9. tarretarretarre

    Autoit-Events

    I think i'm using a non intended feature of the "keep formatting when pasting" when copy and pasting from my git READMEs
    1 point
  10. mLipok

    Autoit-Events

    How you post this code ? Which CodeTag ? When I post code it looks differently. #include "Event.au3" ; Subscribe listeners _Event_Listen(UserCreatedEvent, SendWelcomeMail) _Event_Listen(UserCreatedEvent, RegisterNewsLetter) ; Fire event _Event(UserCreatedEvent, @UserName, "tarre.islam@gmail.com") Func UserCreatedEvent(Const ByRef $oEvent, $name, $email) ; via $oEvent you can pass data to its listeners $oEvent.add("name", $name) $oEvent.add("email", $email) $oEvent.add("id", 1) EndFunc Func SendWelcomeMail(Const $oEvent) MsgBox(64, "Welcome mail sent", "Welcome mail sent to " & $oEvent.item("name") & " with email " & $oEvent.item("email")) EndFunc Func RegisterNewsLetter(Const $oEvent) MsgBox(64, "News letter registred", "News letter bound to user id " & $oEvent.item("id")) EndFunc
    1 point
  11. ConsoleWrite(@ScriptFullPath & @CRLF) ConsoleWrite(@ScriptName & @CRLF) ConsoleWrite(@AutoItExe & @CRLF) ConsoleWrite(StringTrimLeft(@AutoItExe, StringInStr(@AutoItExe, '\', 0, -1)) & @CRLF) ; <--- this?
    1 point
  12. Can you post the full script + provide an example Excel workbook?
    1 point
  13. When you create the GUI, set the style (I can't remember extended or not) to not show these buttons. Create your own buttons in your own style in these positions to mimic their functionality.
    1 point
  14. You can create an array to hold the control information and then reference it later, example (untested). Global $Names = _Excel_RangeRead($oWorkbook, 2, "B2:C"&Ubound($Total_Rows), 2) Global $aGroupNames[UBound($Names) + 1][3] $hGUI = GUICreate("My GUI list",700,500) _GUIScrollbars_Generate($hGUI, 500, 100+(UBound($Names, 1)*110)+50) For $iIndex = 0 to UBound($Names, 1) - 1 $aGroupNames[$iIndex][0] = $iIndex & "|" & $Names[$iIndex][1] & "|" & $Names[$iIndex][0] $aGroupNames[$iIndex][1] = GUICtrlCreateGroup($Names[$iIndex][0] &" "& $Names[$iIndex][1], 70, 100+$iIndex*110, 600, 100,-1,0x400000) $aGroupNames[$iIndex][2] = GUICtrlCreateDate("2020/1/1", 550, 150+$iIndex*110, 100, 20) Next
    1 point
  15. Hi. My 2 cent just use the native Ini*() functions: $ini="C:\temp\sample.ini" $aSectionNames=IniReadSectionNames($ini) $KickOut=2 $ShiftUp=False for $i = 1 to $aSectionNames[0] if $i = $KickOut Then ; this is the section to kick out $ShiftUp=True EndIf if $ShiftUp Then if $i = $aSectionNames[0] Then ; the last section has to be removed, its content has been moved up alreay at this point IniDelete($ini,$aSectionNames[$i]) Else $NextSectionName=$aSectionNames[$i] ; the section name to move the content of the following section to $a2ShiftContent=IniReadSection($ini,$aSectionNames[$i+1]) ; the content of the following section IniWriteSection($ini,$NextSectionName,$a2ShiftContent) ; overwrite with content of the following section EndIf EndIf Next ShellExecute("notepad.exe",$ini) Rudi.
    1 point
×
×
  • Create New...