Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 02/28/2018 in all areas

  1. This time I want to share this utility I developed to speed-up the helpdesk activity in our windows domain, used every day by my collegues. Our windows machines have no simple to remember name, and when a user calls it's good to quick find a set of informations about the user, the machine, the account and so on. In our domain every user and machine has a well made description, and many fields are completed. So, based on the fantastic UDF AD.au3 for active directory, I have this script that can: search both on user name - machine description, retrieving account name, name/surname, phone number , and for the machine the machine name, the description, the operating system. You can check if an account is locked, the domain group membership of an user, the expiration date of the password, you can connect via VNC (tightvnc 64bit please), you can even call the user (but this is based on a particular setup in our environment, we have another script to send commands to the desktop IPphone). The code: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Icone\glaze\kcontrol.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ;UMD User.Machine.Domain ; (c) NSC 2017-2018 ; V.0.3 december 2017 ; V.0.4 english translated and phone fiel added ; V.0.6 autodeploy and update ; V.0.61 support for old vnc 32bit ; V.0.65 search on machine name with radio button ; V.0.66 search on machine name added to default search, removed radio buttons ; V.0.67 radio buttons restored ; V.0.70 VNC connect with no checkbox if only 1 machine found, VNC called with vnconf file, added call functionality via DTdial key combo, user password info ; V.0.71 bugfix ; V.0.75 added ip retrieval, ping if online, reverse host lookup, added tips on every command. ; V.0.76 code cleaned ;#RequireAdmin #include <WinAPISys.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <MsgBoxConstants.au3> #include "GUIListViewEx.au3" #include <Array.au3> #include <File.au3> #include <AD.au3> #include <_zip.au3> #include <Inet.au3> #Cs ------- notes ------------------ https://social.technet.microsoft.com/wiki/contents/articles/12037.active-directory-get-aduser-default-and-extended-properties.aspx https://social.technet.microsoft.com/wiki/contents/articles/12056.active-directory-get-adcomputer-default-and-extended-properties.aspx #CE Global $idListview, $id2Listview, $Icercato, $search1, $search2, $List_lines_Index, $List2_lines_Index, $trovati1, $trovatiPHONE1, $trovati2, $umdver = "V.0.76" Global $gollogcount = 0, $lastlog = "sicrlf", $cachelog = "", $guititle = "UMD - Users-Machines-Domain " & $umdver & " NSC 2017-2018", $Gollogedit, $logfile = @ScriptDir & "\UMD_", $months2NOTzip = 1 Global $geleft = 590, $getop = 15, $gewidth = 400, $geheight = 550 Global $prgname = "umd.exe", $umddir = "c:\autoit\UMD\", $sourceexepath = "\\yourpath", $toping = ("your ip to ping") ; environment related: $sourceexepath is for autodeploy/autoupdate, these operations depend on pinging $toping Global $OU1 = "OU=Users,OU=IT,DC=??,DC=???,DC=local", $OU2 = "OU=Clients,OU=IT,DC=??,DC=???,DC=local" ;domain related, the first is the domain OU (organizational unit) where to search for users, the second the OU for machines Global $only1machine = 0, $lastmachinefound = "", $only1user = 0, $lastphonefound = "" Global $idchkbox1, $idchkbox2, $idchkbox3 GuiGO() Func GuiGO() Local $guiheight = 620 ; gui height GUICreate($guititle, 1000, $guiheight, 100, 200, -1, $WS_EX_ACCEPTFILES) GUISetBkColor(0x6FA8DC) GUICtrlCreateLabel("Search on Users", 5, 1, 150, 15) CLVW() GUICtrlCreateLabel("Search on Machines", 5, 286, 150, 15) $idradio1 = GUICtrlCreateRadio("on user name / machine description", 180, 286, 200, 15) GUICtrlSetState(-1, $gui_checked) GUICtrlSetTip(-1, "search in both user name - machine description, populate both lists") $idradio2 = GUICtrlCreateRadio("only on machine name", 400, 286, 150, 15) GUICtrlSetState(-1, $gui_unchecked) GUICtrlSetTip(-1, "search only in the machine name field, populates only the list below") CLVW2() $Bcerca = GUICtrlCreateButton("Search (or enter)", 5, 570, 90, 30) GUICtrlSetTip(-1, "search the string in the yellow input box") $Block = GUICtrlCreateButton("User locked? ", 95, 570, 90, 30) GUICtrlSetTip(-1, "check if selected user account is locked, only an admin can unlock it") $Busergroups = GUICtrlCreateButton("User Groups", 185, 570, 90, 30) GUICtrlSetTip(-1, "list the domain groups for the selected user") $Buserpsw = GUICtrlCreateButton("User Password", 275, 570, 90, 30) GUICtrlSetTip(-1, "retrieve password expiration") $idchkbox2 = GUICtrlCreateCheckbox("psw extra info", 275, 600, 150, 15) GUICtrlSetFont(-1, 8, 400, 0, "consolas") GUICtrlSetState(-1, $gui_unchecked) GUICtrlSetTip(-1, "all the domain info about password") $Bcall = GUICtrlCreateButton("CALL", 495, 570, 40, 30) GUICtrlSetTip(-1, "phone CALL number") $Bvnc = GUICtrlCreateButton("VNC", 535, 570, 40, 30) GUICtrlSetFont(-1, 12, 800, 0, "consolas") GUICtrlSetTip(-1, "launch VNC, if one machine no need to check it") $idchkbox1 = GUICtrlCreateCheckbox("VNC readOnly", 495, 600, 90, 15) GUICtrlSetFont(-1, 8, 400, 0, "consolas") GUICtrlSetState(-1, $gui_unchecked) GUICtrlSetTip(-1, "launch VNC in read only mode") $Icercato = GUICtrlCreateInput("", 590, 570, 400, 30, BitOR($GUI_SS_DEFAULT_INPUT, $WS_BORDER)) GUICtrlSetBkColor(-1, 0xffff4d) GUICtrlSetFont(-1, 12, 800, 0, "consolas") GUICtrlSetColor(-1, 0x000099) GUICtrlSetTip(-1, "insert here a string to search...") $idchkbox3 = GUICtrlCreateCheckbox("ip check / nslookup", 590, 600, 150, 15) GUICtrlSetFont(-1, 8, 400, 0, "consolas") GUICtrlSetState(-1, $gui_unchecked) GUICtrlSetTip(-1, "retrieve IP, check online and performs a reverse check 'nslookup', warning can slow down operations !") GUICtrlCreateLabel("Operation LOG", 590, 1) $Gollogedit = GUICtrlCreateEdit("", $geleft, $getop, $gewidth, $geheight, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_BORDER, $WS_VSCROLL)) GUICtrlSetBkColor(-1, 0x3333ff) GUICtrlSetData(-1, "" & @CRLF) GUICtrlSetFont(-1, 9, 800, 0, "consolas") GUICtrlSetColor(-1, 0xffff4d) GUISetState(@SW_SHOW) GOLLOG("UMD " & $umdver & " STARTED") autodeploy() While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GOLLOG("<<<< STOP <<<<") Exit Case $Bcerca If BitAND(GUICtrlRead($idradio1), $GUI_CHECKED) = $GUI_CHECKED Then Multisearch("username-machinedescription") If BitAND(GUICtrlRead($idradio2), $GUI_CHECKED) = $GUI_CHECKED Then Multisearch("machinename-username") Case $Block lock() Case $Busergroups usergroups() Case $Buserpsw userpsw() Case $Bcall DTdialCALL() Case $Bvnc VNC() Case $Icercato If BitAND(GUICtrlRead($idradio1), $GUI_CHECKED) = $GUI_CHECKED Then Multisearch("username-machinedescription") If BitAND(GUICtrlRead($idradio2), $GUI_CHECKED) = $GUI_CHECKED Then Multisearch("machinename-username") EndSwitch WEnd EndFunc ;==>GuiGO Func userpsw() _AD_Open() Local $checked_List = _GUIListViewEx_ReturnArray($List_lines_Index, 1) If Not @error Then For $i = 0 To UBound($checked_List) - 1 If $checked_List[$i] = "true" Then GOLLOG("PSW info for " & $trovati1[$i + 1]) Local $arrayuserpsw = _AD_GetPasswordInfo($trovati1[$i + 1]) If BitAND(GUICtrlRead($idchkbox2), $GUI_CHECKED) = $GUI_CHECKED Then Local $arraydesk[13] = [" ", "max psw age:", "min psw age:", "n° enforced psw:", "min lenght:", "lock duration:", "lock attempts:", "lock reset", "psw last changed:", "psw expires on:", "UTC last changed:", "UTC expires on:", "psw properties:"] For $i = 1 To UBound($arrayuserpsw) - 1 GOLLOG($arraydesk[$i] & " " & $arrayuserpsw[$i]) Next Else GOLLOG("Password expires on: " & $arrayuserpsw[9]) EndIf EndIf Next Else MsgBox(0, "nothing selected", "Empty Check Array") EndIf _AD_Close() EndFunc ;==>userpsw Func usergroups() _AD_Open() Local $checked_List = _GUIListViewEx_ReturnArray($List_lines_Index, 1) If Not @error Then For $i = 0 To UBound($checked_List) - 1 If $checked_List[$i] = "true" Then GOLLOG("Query groups of " & $trovati1[$i + 1]) Local $arrayusergroups = _AD_GetUserGroups($trovati1[$i + 1], False) _ArrayDisplay($arrayusergroups) EndIf Next Else MsgBox(0, "nothing selected", "Empty Check Array") EndIf _AD_Close() EndFunc ;==>usergroups Func VNCcall($machine) IniWrite("C:\autoit\UMD\vncconf.vnc", "connection", "host", $machine) If BitAND(GUICtrlRead($idchkbox1), $GUI_CHECKED) = $GUI_CHECKED Then IniWrite("C:\autoit\UMD\vncconf.vnc", "options", "viewonly", "1") Else IniWrite("C:\autoit\UMD\vncconf.vnc", "options", "viewonly", "0") EndIf Run("c:\program files\tightvnc\tvnviewer.exe -optionsfile=C:\autoit\UMD\vncconf.vnc -password=apollo") EndFunc ;==>VNCcall Func VNC() If $only1machine = 1 Then GOLLOG("VNC to :" & $lastmachinefound) VNCcall($lastmachinefound) Else Local $checked_List = _GUIListViewEx_ReturnArray($List2_lines_Index, 1) If Not @error Then For $i = 0 To UBound($checked_List) - 1 If $checked_List[$i] = "true" Then GOLLOG("connecting to :" & $trovati2[$i + 1]) VNCcall($trovati2[$i + 1]) EndIf Next Else MsgBox(0, "multiple machines and nothing selected", "Empty Check Array") EndIf EndIf EndFunc ;==>VNC Func CALLnow($number2call) ; Create a subGUI Local $callGUI = GUICreate("calling", 200, 40) Local $callinput = GUICtrlCreateInput($number2call, 10, 5, 180, 20) GUISetState(@SW_SHOW, $callGUI) GUICtrlSetState($callinput, $GUI_FOCUS) Sleep(500) Send("+{END}") Sleep(200) If @OSVersion = "WIN_8" Or @OSVersion = "WIN_81" Or @OSVersion = "WIN_10" Then Send("{LWINdown}<") Else Send("{LWINdown}z") EndIf Sleep(100) Send("{LWINup}") Sleep(1000) ; Delete the previous subGUI GUIDelete($callGUI) EndFunc ;==>CALLnow Func DTdialCALL() If ProcessExists("dtdial.exe") Then If $only1user = 1 Then GOLLOG("to call :" & $lastphonefound) Local $number2call = InputBox("UMD calling", "modify the number", $lastphonefound) CALLnow($number2call) Else Local $checked_List = _GUIListViewEx_ReturnArray($List_lines_Index, 1) If Not @error Then For $i = 0 To UBound($checked_List) - 1 If $checked_List[$i] = "true" Then GOLLOG("call selected :" & $trovatiPHONE1[$i + 1]) Local $number2call = InputBox("UMD calling", "modify the number", $trovatiPHONE1[$i + 1]) If $number2call = "" Then GOLLOG("nothing to call") Else CALLnow($number2call) EndIf EndIf Next Else MsgBox(0, "multiple machines and nothing selected", "Empty Check Array") EndIf EndIf Else GOLLOG("*** call function") GOLLOG("*** not available") GOLLOG("*** outside DT phone system") EndIf EndFunc ;==>DTdialCALL Func lock() _AD_Open() Local $checked_List = _GUIListViewEx_ReturnArray($List_lines_Index, 1) If Not @error Then For $i = 0 To UBound($checked_List) - 1 If $checked_List[$i] = "true" Then If _AD_IsObjectLocked($trovati1[$i + 1]) = 1 Then GOLLOG($trovati1[$i + 1]) GOLLOG("account is LOCKED !") If MsgBox(36, "Unlock ?", "Do you want to unlock account " & $trovati1[$i + 1] & " ?") = $idyes Then If _AD_UnlockObject($trovati1[$i + 1]) = 0 Then GOLLOG("error " & @error) Else GOLLOG("Unlock DONE !") EndIf Else GOLLOG("not unlocked...") EndIf Else GOLLOG($trovati1[$i + 1]) GOLLOG("account is UNlocked.") EndIf EndIf Next Else MsgBox(0, "nothing selected", "Empty Check Array") EndIf _AD_Close() EndFunc ;==>lock Func Multisearch($searchtype) GOLLOG("_____Load domain data_____") renewlistview() Local $cercato = GUICtrlRead($Icercato) Local $List_lines = '', $List2_lines = '', $string2search = '' $trovatiPHONE1 = 0 Dim $trovati1[1] = ["zero"] Dim $trovatiPHONE1[1] Dim $trovati2[1] = ["zero"] _AD_Open() GOLLOG("Searched for " & $cercato) If $searchtype = "username-machinedescription" Then $search1 = _AD_GetObjectsInOu($OU1, "", 2, "SamAccountName,name,ipphone,telephonenumber") If @error = 0 Then Local $conta1 = 0 Local $conta1trovati = 0 $string2search = '' While $search1[0][0] > $conta1 $conta1 += 1 If StringInStr($search1[$conta1][0], $cercato) <> 0 Then $List_lines = $search1[$conta1][0] & "|" & $search1[$conta1][1] & "|" & $search1[$conta1][2] & " " & $search1[$conta1][3] $lastphonefound = $search1[$conta1][2] & " " & $search1[$conta1][3] ; to save last machine found GUICtrlCreateListViewItem($List_lines, $idListview) _ArrayAdd($trovati1, $search1[$conta1][0]) _ArrayAdd($trovatiPHONE1, $search1[$conta1][2] & " " & $search1[$conta1][3]) $conta1trovati += 1 EndIf WEnd ; Initiate LVEx - use filling array - no count parameter - default insert mark colour (black) - drag image - sortable + not select all text + editable headers $List_lines_Index = _GUIListViewEx_Init($idListview, $List_lines, 0, 0, True, 1 + 2 + 8) GOLLOG("checked n° " & $conta1 & " users") GOLLOG("Found n° " & $conta1trovati & " users") If $conta1trovati = 1 Then $only1user = 1 Else $only1user = 0 EndIf Else GOLLOG("error in user search " & @error) EndIf $search2 = _AD_GetObjectsInOu($OU2, "", 2, "name,description,operatingSystem") ;search in machines If @error = 0 Then Local $conta2 = 0 Local $conta2trovati = 0 $string2search = '' While $search2[0][0] > $conta2 $conta2 += 1 If StringInStr($search2[$conta2][1], $cercato) <> 0 Or StringInStr($search2[$conta2][0], $cercato) <> 0 Then $List2_lines = $search2[$conta2][0] & "|" & $search2[$conta2][1] & "|" & $search2[$conta2][2] $lastmachinefound = $search2[$conta2][0] ; to save last machine found GUICtrlCreateListViewItem($List2_lines, $id2Listview) If BitAND(GUICtrlRead($idchkbox3), $GUI_CHECKED) = $GUI_CHECKED Then ; V.0.75 IPrelated($search2[$conta2][0]) EndIf _ArrayAdd($trovati2, $search2[$conta2][0]) $conta2trovati += 1 EndIf WEnd ; Initiate LVEx - use filling array - no count parameter - default insert mark colour (black) - drag image - sortable + not select all text + editable headers $List2_lines_Index = _GUIListViewEx_Init($id2Listview, $List2_lines, 0, 0, True, 1 + 2 + 8) GOLLOG("Checked n° " & $conta2 & " machines") GOLLOG("Found n° " & $conta2trovati & " machines") If $conta2trovati = 1 Then $only1machine = 1 Else $only1machine = 0 EndIf Else GOLLOG("error in machines search " & @error) EndIf EndIf ; second searchtype----------------------------------------------------------------------_-_--------------------------- If $searchtype = "machinename-username" Then $search2 = _AD_GetObjectsInOu($OU2, "", 2, "name,description,operatingSystem") ;search in machines If @error = 0 Then Local $conta2 = 0 Local $conta2trovati = 0 $string2search = '' While $search2[0][0] > $conta2 $conta2 += 1 If StringInStr($search2[$conta2][0], $cercato) <> 0 Then $List2_lines = $search2[$conta2][0] & "|" & $search2[$conta2][1] & "|" & $search2[$conta2][2] GUICtrlCreateListViewItem($List2_lines, $id2Listview) If BitAND(GUICtrlRead($idchkbox3), $GUI_CHECKED) = $GUI_CHECKED Then ; V.0.75 IPrelated($search2[$conta2][0]) EndIf _ArrayAdd($trovati2, $search2[$conta2][0]) $conta2trovati += 1 EndIf WEnd ; Initiate LVEx - use filling array - no count parameter - default insert mark colour (black) - drag image - sortable + not select all text + editable headers $List2_lines_Index = _GUIListViewEx_Init($id2Listview, $List2_lines, 0, 0, True, 1 + 2 + 8) GOLLOG("Checked n° " & $conta2 & " machines") GOLLOG("Found n° " & $conta2trovati & " machines") Else GOLLOG("error in machines search " & @error) EndIf EndIf _AD_Close() EndFunc ;==>Multisearch Func IPrelated($pinghost) Local $sIPAddress = "" Local $shostname = "" Local $pcping = Ping($pinghost) If $pcping = 0 Then Select Case @error = 1 Local $errorping = "host is offline" Case @error = 2 Local $errorping = "host is unreachable" Case @error = 3 Local $errorping = "bad destination" Case @error = 4 Local $errorping = "not found for other errors" EndSelect GOLLOG($pinghost & " " & $errorping) Else GOLLOG($pinghost & " ping in " & $pcping & " ms") ; Start the TCP service. TCPStartup() $sIPAddress = TCPNameToIP($pinghost) $shostname = _TCPIpToName($sIPAddress, 0) TCPShutdown() ; Close the TCP service. GOLLOG("IP address is: " & $sIPAddress) GOLLOG("reverse lookup:" & $shostname) EndIf EndFunc ;==>IPrelated Func autodeploy() ; pensato per la prima installazione e update Local $TipDT = Ping($toping) Local $ntest = 1 While $TipDT = 0 And $ntest < 3 Sleep(200) $TipDT = Ping($toping) $ntest += 1 WEnd If $TipDT = 0 Then GOLLOG("unable to check updates") Else If Not FileExists($umddir) Then GOLLOG("Procedo con Autodeploy") If DirCreate($umddir) Then GOLLOG("-> creata cartella " & $umddir) Else GOLLOG("-> problema ! non creata cartella " & $umddir) EndIf GOLLOG("posiziono eseguibile in " & $umddir) FileCopy(@ScriptDir & "\umd.exe", $umddir & "umd.exe", 1) If Not FileExists(@DesktopDir & "\umd.lnk") Then GOLLOG("desktop link creation...") FileCreateShortcut($umddir & "\" & $prgname, @DesktopDir & "\umd.lnk") EndIf GOLLOG("posiziono VNConf in " & $umddir) FileCopy($sourceexepath & "\vncconf.vnc", $umddir & "\" & "vncconf.vnc", 1) GOLLOG("AutoDeploy completato") ; ora devo spegnere e riavviare quello in \cpa_da Local $sCmdFile ; phoenix modificata NON è quella standard di autoupdate FileDelete(@TempDir & "\phoenix.bat") $sCmdFile = 'ping 127.0.0.1 -n 2 > NUL' & @CRLF _ & ':loop' & @CRLF _ & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ & 'start c:\autoit\umd\umd.exe' & @CRLF _ & 'del %0' FileWrite(@TempDir & "\phoenix.bat", $sCmdFile) GOLLOG("program is closing, see ya in deployed version...") Sleep(1000) Run(@TempDir & "\phoenix.bat", @TempDir, @SW_HIDE) Exit ; exit and real update EndIf Local $currtime = FileGetTime(@ScriptDir & "\" & $prgname, $FT_MODIFIED, 1) Local $newtime = FileGetTime($sourceexepath & "\" & $prgname, $FT_MODIFIED, 1) If $newtime > $currtime Then GOLLOG("update available!") If Not FileExists(@DesktopDir & "\umd.lnk") Then GOLLOG("desktop link creation...") FileCreateShortcut($umddir & "\" & $prgname, @DesktopDir & "\umd.lnk") EndIf Local $sCmdFile GOLLOG("posiziono VNConf in " & $umddir) FileCopy($sourceexepath & "\vncconf.vnc", $umddir & "\" & "vncconf.vnc", 1) FileDelete(@TempDir & "\phoenix.bat") $sCmdFile = 'ping 127.0.0.1 -n 2 > NUL' & @CRLF _ & ':loop' & @CRLF _ & 'del "' & @ScriptFullPath & '"' & @CRLF _ & 'if exist "' & @ScriptFullPath & '" goto loop' & @CRLF _ & 'copy "' & $sourceexepath & '"\"' & $prgname & '" "' & @ScriptFullPath & @CRLF _ & 'start ' & @ScriptFullPath & @CRLF _ & 'del %0' FileWrite(@TempDir & "\phoenix.bat", $sCmdFile) GOLLOG("program is closing, see ya in next version..") Sleep(1000) Run(@TempDir & "\phoenix.bat", @TempDir, @SW_HIDE) Exit ; exit and real update Else GOLLOG("UMD already updated") EndIf EndIf EndFunc ;==>autodeploy Func renewlistview() ; cancella e ricrea GUICtrlDelete($idListview) GUICtrlDelete($id2Listview) CLVW() CLVW2() EndFunc ;==>renewlistview Func CLVW() ;crea listview utenti $idListview = GUICtrlCreateListView("SamAccountName|Name|phone", 5, 15, 570, 265, $LVS_SHOWSELALWAYS) _GUICtrlListView_SetExtendedListViewStyle($idListview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) _GUICtrlListView_SetColumnWidth($idListview, 0, 175) _GUICtrlListView_SetColumnWidth($idListview, 1, 175) _GUICtrlListView_SetColumnWidth($idListview, 2, 150) GUICtrlSetFont(-1, 9, 800, 0, "consolas") EndFunc ;==>CLVW Func CLVW2() ;crea listview macchine $id2Listview = GUICtrlCreateListView("Name|Description|Operating System", 5, 300, 570, 265, $LVS_SHOWSELALWAYS) _GUICtrlListView_SetExtendedListViewStyle($id2Listview, BitOR($LVS_EX_FULLROWSELECT, $LVS_EX_CHECKBOXES)) _GUICtrlListView_SetColumnWidth($id2Listview, 0, 120) _GUICtrlListView_SetColumnWidth($id2Listview, 1, 180) _GUICtrlListView_SetColumnWidth($id2Listview, 2, 230) GUICtrlSetFont(-1, 9, 800, 0, "consolas") EndFunc ;==>CLVW2 Func GOLLOG($logtext) ; Gollog V.2.3 gestione CRLF si o no ; gestione a capo automatico oltre i xx caratteri; gestione pulitura ogni totmila char Perla pearl ; basta aggiungere |nocrlf50 a fine stringa, dove 50 sono gli xx caratteri, conta la prima riga dove si supera quel limite. ; to declare $gollogcount = 0,$lastlog="sicrlf",$cachelog="",$guititle = "nomegui",$Gollogedit,$logfile = @ScriptDir & "\GOLLOG_LOG_", $months2NOTzip = 3 ; e anche le misure dell'edit: $geleft = 32, $getop = 32, $gewidth = 553, $geheight = 377 ; #include <File.au3> #include <GuiEdit.au3> #include <_zip.au3> ; to insert FUNCs: GOLLOG CLEANEDIT GOLzipZIP $gollogcount += StringLen($logtext) Local $logfiletimerange = @YEAR & @MON Local $linelimit = StringRight($logtext, 2) If StringRight($logtext, 9) = "|nocrlf" & $linelimit Then $logtext = StringTrimRight($logtext, 9) Local $acapo = "no" Else Local $acapo = "si" $gollogcount += 4 If $gollogcount > 13000 Then Sleep(3000) cleanedit() $gollogcount = 0 EndIf EndIf If $acapo = "no" And (StringLen($cachelog) <= $linelimit) Then ;pearl perla non a capo se If $lastlog = "nocrlf" Then If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, $logtext) EndIf Else If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, @MDAY & "/" & @MON & "_" & @HOUR & ":" & @MIN & " " & $logtext) EndIf EndIf $cachelog = $cachelog & $logtext $lastlog = "nocrlf" Else If $lastlog = "nocrlf" Then If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, $logtext & @CRLF) EndIf $cachelog = $cachelog & $logtext _FileWriteLog($logfile & $logfiletimerange & ".txt", $cachelog) $cachelog = "" Else If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, @MDAY & "/" & @MON & "_" & @HOUR & ":" & @MIN & " " & $logtext & @CRLF) EndIf _FileWriteLog($logfile & $logfiletimerange & ".txt", $logtext) EndIf $lastlog = "sicrlf" EndIf EndFunc ;==>GOLLOG Func cleanedit() ; cleaning of edit every n° lines (in program put if $nlines > xlines then this function) GUICtrlDelete($Gollogedit) $Gollogedit = GUICtrlCreateEdit("", $geleft, $getop, $gewidth, $geheight) ;, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_BORDER)) GUICtrlSetData(-1, "" & @CRLF) GUICtrlSetFont(-1, 9, 800, 0, "consolas") GUICtrlSetColor(-1, 0xffff4d) GUICtrlSetBkColor(-1, 0x3333ff) GUICtrlSetCursor(-1, 3) EndFunc ;==>cleanedit Func GOLzipLOG($months2NOTzip) ; zipping old log leaving unzipped only n months GOLLOG("Starting old logs zipping..") ; path extraction zone Local $logfiletimerange = @YEAR & @MON Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = "" Local $arraylogpath = _PathSplit($logfile & $logfiletimerange & ".txt", $sDrive, $sDir, $sFileName, $sExtension) Local $logpath = $arraylogpath[1] & $arraylogpath[2] Local $hSearch = FileFindFirstFile($logfile & "*.txt") ; searching for logs Local $logconta = 0 While 1 ; single file processing cycle Local $sFileName = FileFindNextFile($hSearch) ; If there is no more file matching the search. If @error Then ExitLoop Local $stringtime = StringTrimRight(StringRight($sFileName, 10), 4) ;obtaining year-month like 201609 If $logfiletimerange - $stringtime > $months2NOTzip Then ;zipping If Not FileExists($logfile & ".zip") Then If Not _Zip_Create($logfile & ".zip", 1) Then GOLLOG("Error " & @error & " creating " & $logfile & ".zip") Else GOLLOG("Created new log archive: " & $logfile & ".zip") EndIf Else GOLLOG("adding to archive: " & $logfile & ".zip") EndIf If Not _zip_additem($logfile & ".zip", $logpath & $sFileName) Then GOLLOG("Error " & @error & " zipping: " & $logpath & $sFileName) Else GOLLOG("Added: " & $logpath & $sFileName) $logconta += 1 If Not FileDelete($logpath & $sFileName) Then GOLLOG("ERROR - Unable to DELETE log file " & $logpath & $sFileName) EndIf EndIf EndIf WEnd GOLLOG("Finished = " & $logconta & " log files zipped") EndFunc ;==>GOLzipLOG The minimum for make it work in your domain (no admin rights required, no writing on domain performed) is to modify these globals: Global $prgname = "umd.exe", $umddir = "c:\autoit\UMD\", $sourceexepath = "\\the .exe path for autodeploy", $toping = ("ip to ping") ; environment related: $sourceexepath is for autodeploy/autoupdate, these operations depend on pinging $toping Global $OU1 = "OU=Users,OU=IT,DC=??,DC=???,DC=local", $OU2 = "OU=Clients,OU=IT,DC=??,DC=???,DC=local" ;domain related, the first is the domain OU (organizational unit) where to search for users, the second the OU for machines. You have to recompile modifying at minimum $toping with a NON pingable IP (to disable auto deploy - update) and certainly the domain OU for your users and machines. The vncconf.vnc is to be modified with the standard (I hope for you..) VNC password in your company, OR you can remove the line and VNC will request the psw every time. After, Just copy the executable and the other file (vncconf.vnc) in a folder in your PC and try it. The autodeploy/update feature work in this way: if the script can ping $toping value, then pick the executable from $sourceexepath, and perform "installation" (link and copying .exe, no win register involved) or updating. Let me know your experience.. vncconf.vnc UMD.au3
    2 points
  2. 100% correct,,, since we can compile the source code to .exe file at anytime, there is no need to run any
    2 points
  3. I hope any of you is seriously running any exe posted by any member unless trusted...... in other words: Think before you act! Jos
    2 points
  4. yes. you can still do the challenge! do it! and then eek it out so they learn. that's what this site tries to do anyway.
    2 points
  5. @Earthshine, I agree with you, I wrote the code so @adelbak can learn how can be done in AutoIT, but for sure next time he will do things by his own. Also, the trick is not actually by writing the function only, it was also by saving the output to a file, because showing a message box by itself and trying to write the string will not solve the issue as 4 bytes of data for every char will be written, but instead we have to have 1 byte for every char. That's why I wrote all the whole script
    2 points
  6. Here you go @adelbak, I need to mention that you can pass as many IMEIs params as you want, it's not limited to 1 or 2 params #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Change2CUI=y #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; Written by Jowy ; Creation of IMEI file ; Creation Date: 28/02/2018 #Region Include #include <FileConstants.au3> #include <Array.au3> #include <String.au3> #EndRegion Include #Region Variables #cs test params: 531302165213560 501939357823635 Global Const $sStr = "357369035621901" #ce Global Const $aOutMask = [0xAB, 0xA0, 0x6F, 0x2F, 0x1F, 0x1E, 0x9A, 0x45, 0x0, 0x0, 0x0, 0x0] Global $hOutputFile = 0 Global Const $sOUT_FILE = "MP0B_001_NEW" Global Const $iZero = Asc("0") Global $sFileContent = "" #EndRegion Variables #Region Main ;~ check if no parameters where provided; i.e. no imei If $CmdLine[0] = 0 Then PrintUsage() Exit 1 EndIf For $i = 1 To $CmdLine[0] ConsoleWrite("New IMEI " & $i & " (15 digits): " & $CmdLine[$i] & @CRLF) Local $aReturn = ParseIMEI($CmdLine[$i]) If Not @error Then WriteToFile($aReturn) Else ConsoleWrite("Invalid IMEI " & $CmdLine[$i] & " format!" & @CRLF) CloseFile() Exit 1 EndIf Next ConsoleWrite("New IMEI in file = " & $sOUT_FILE & @CRLF) CloseFile() #EndRegion Main #Region Functions Func CloseFile() If $hOutputFile <> 0 Then FileClose($hOutputFile) EndIf EndFunc ;==>CloseFile Func WriteToFile(ByRef $aArray) If $hOutputFile = 0 Then $hOutputFile = FileOpen(@ScriptDir & "\" & $sOUT_FILE, $FO_OVERWRITE + $FO_ANSI) ; I'm using overwrite, so if previous file exists, it will be overwritten. EndIf If $hOutputFile <> -1 Then For $xItem In $aArray FileWrite($hOutputFile, BinaryMid($xItem, 1, 1)) Next Else ConsoleWrite("Unable to open file for writing !" & @CRLF) Exit 1 EndIf EndFunc ;==>WriteToFile Func PrintUsage() ConsoleWrite("Usage: " & @CRLF & @ScriptName & " <IEMI_1 15 digits> [IMEI_2 15 digits] ... [IMEI_X 15 digits]" & @CRLF) EndFunc ;==>PrintUsage Func ParseIMEI($sIMEI) Local $aOutput If StringLen($sIMEI) = 15 And StringIsDigit($sIMEI) Then $aOutput = Calc_IMEI($sIMEI) Return SetError(0, 0, $aOutput) Else Return SetError(1, 1, "") EndIf EndFunc ;==>ParseIMEI Func Calc_IMEI($sInput) Local $j = 0 Local $aOutput[12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] ;~ Local $aInput = StringRegExp($sInput, "(?i)(\d)", 3) Local $aInput = StringToASCIIArray($sInput) ;~ _ArrayDisplay($aInput) For $i = 0 To UBound($aInput) - 1 Step 2 ; (15 - 1 = 14) ;~ since $sInput is always having digits from 0 to 9, there is no need to check any digit as all the string have been checked $aOutput[$j] = ($aInput[$i] - $iZero) If $i >= 14 Then ExitLoop EndIf $aOutput[$j] += BitShift(($aInput[$i + 1] - $iZero), -4) $aOutput[$j] = BitXOR($aOutput[$j], $aOutMask[$j]) $j += 1 Next $aOutput[$j] = BitXOR($aOutput[$j], $aOutMask[$j]) $aOutput[8] = 0x57 $aOutput[9] = 0xDB $aOutput[10] = 0 $aOutput[11] = 0 For $i = 0 To 9 If BitAND($i, 0x1) Then $aOutput[11] += $aOutput[$i] Else $aOutput[10] += $aOutput[$i] EndIf Next Return $aOutput EndFunc ;==>Calc_IMEI #EndRegion Functions Here are my results:
    2 points
  7. Nothing special - just another analogue clock. -> Read https://en.wikipedia.org/wiki/Swiss_railway_clock for more information. Requires Windows7+ OS! Widget style GUI: ;The Hilfiker / MobaTime Swiss Railway Clock ;Coded by UEZ build 2019-07-07 ;Thanks to Eukalyptus for the _CreateBrushedAluminum() function! #pragma Compile(Icon, "GDI+ Swiss Railway Clock.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #AutoIt3Wrapper_UseX64=n Break(0) #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPISysWin.au3> ProcessSetPriority(@AutoItPID, $PROCESS_LOW) _GDIPlus_Startup() Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit Global $iW, $iH, $iX, $iY, $sTitle = "GDI+ Swiss Railway Clock v1.16" $iW = IniRead(@ScriptDir & "\GDI+ Swiss Railway Clock.ini", "Settings", "GUI_Size", 200) $iW = $iW < 100 ? 100 : $iW > 800 ? 800 : $iW $iH = $iW $iX = IniRead(@ScriptDir & "\GDI+ Swiss Railway Clock.ini", "Settings", "GUI_PosX", -1) $iY = IniRead(@ScriptDir & "\GDI+ Swiss Railway Clock.ini", "Settings", "GUI_PosY", -1) Global Const $fRad = ACos(-1) / 180, $fDeg = 180 / ACos(-1), $iTimer = 30, $ULW_ALPHA = 2, $SC_DRAGMOVE = 0xF012, $fDeltaShadow = 20 Global $hBitmap, $hHBitmap, $hCanvas, $hBitmap_Clock, $hBrush_Shadow, $hBrush_Update, $hPen_Update, $fDiameter = $iW, $fShadowAngle, $fMin_next, _ $fRadius = $fDiameter / 2, $fSec, $fMin, $fHr, $fAmplitude = 3, $fSize, $hOld Global $tSize = DllStructCreate($tagSIZE), $tSource = DllStructCreate($tagPOINT), $tBlend = DllStructCreate($tagBLENDFUNCTION) $tSize.X = $iW $tSize.Y = $iH $tBlend.Alpha = 255 $tBlend.Format = 1 Global Const $hScrDC = _WinAPI_GetDC($hGUI), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC) AutoItSetOption("GUIOnEventMode", 1) GDIPlus_SwissRailwayClockWidget() AutoItSetOption("GUIOnEventMode", 0) _GDIPlus_Shutdown() Func GDIPlus_SwissRailwayClockWidget() $bExit = False $hGUI = GUICreate($sTitle, $iW, $iH, $iX, $iY, $WS_POPUP, BitOR($WS_EX_TOPMOST, $WS_EX_LAYERED)) GUISetState(@SW_SHOW, $hGUI) ;create canvas elements $hBitmap = _GDIPlus_BitmapCreateFromScan0($iW + $fDeltaShadow, $iH + $fDeltaShadow) $hCanvas = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local Const $iAlpha = 0x0D / $iW * 200 $hBrush_Shadow = _GDIPlus_BrushCreateSolid(BitShift(0x0D + $iAlpha, -24) + 0x202020) $hPen_Update = _GDIPlus_PenCreate(0xFFA02020) $hBrush_Update = _GDIPlus_BrushCreateSolid(0) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) $hBitmap_Clock = GenerateClockBg($fDiameter) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") $fMin_next = @MIN GUIRegisterMsg($WM_LBUTTONDOWN, "_WM_LBUTTONDOWN") GUIRegisterMsg($WM_TIMER, "Draw") ;$WM_TIMER = 0x0113 Local $iID = DllCall("User32.dll", "uint_ptr", "SetTimer", "hwnd", $hGUI, "uint_ptr", 1, "uint", $iTimer, "ptr", 0)[0] Do If $bExit Then ExitLoop Until Not Sleep(100) ;release resources GUIRegisterMsg($WM_TIMER, "") DllCall("user32.dll", "bool", "KillTimer", "hwnd", $hGUI, "uint_ptr", $iID) GUIRegisterMsg($WM_LBUTTONDOWN, "") _GDIPlus_PenDispose($hPen_Update) _GDIPlus_BrushDispose($hBrush_Shadow) _GDIPlus_BrushDispose($hBrush_Update) _GDIPlus_GraphicsDispose($hCanvas) _GDIPlus_ImageDispose($hCanvas) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_DeleteDC($hMemDC) IniWrite(@ScriptDir & "\GDI+ Swiss Railway Clock.ini", "Settings", "GUI_Size", WinGetPos($hGUI)[2]) IniWrite(@ScriptDir & "\GDI+ Swiss Railway Clock.ini", "Settings", "GUI_PosX", WinGetPos($hGUI)[0]) IniWrite(@ScriptDir & "\GDI+ Swiss Railway Clock.ini", "Settings", "GUI_PosY", WinGetPos($hGUI)[1]) GUIDelete($hGUI) EndFunc ;==>GDIPlus_SwissRailwayClockWidget Func Draw($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GDIPlus_GraphicsClear($hCanvas, 0x00000000) _GDIPlus_GraphicsDrawImageRect($hCanvas, $hBitmap_Clock, 0, 0, $fDiameter + $fDeltaShadow, $fDiameter + $fDeltaShadow) UpdateClock($hCanvas, $fDiameter) $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, DllStructGetPtr($tSize), $hMemDC, DllStructGetPtr($tSource), 0, DllStructGetPtr($tBlend), $ULW_ALPHA) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hHBitmap) EndFunc ;==>Draw Func _WM_LBUTTONDOWN($hWnd, $iMsg, $wParam, $lParam) Switch $hWnd Case $hGUI _SendMessage($hWnd, $WM_SYSCOMMAND, $SC_DRAGMOVE, 0) EndSwitch EndFunc ;==>_WM_LBUTTONDOWN Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func UpdateClock($hGfx, $fDiameter) Static $bBounce = 0, $f = 0 Local $m1 = $fDiameter * 0.015 ;hour $fHr = 30 * (@HOUR + @MIN / 60) _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fHr) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Local $iWidth1 = $fDiameter * 0.0375, _ $iHeight1 = $fDiameter / 2.5, _ $iWidth12 = $iWidth1 / 2, _ $fPosY = $fDiameter * 0.2, $iWidth2, $iWidth22, $fPosY2 _GDIPlus_BrushSetSolidColor($hBrush_Update, 0xFF101010) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth12 + Cos(($fShadowAngle - $fHr) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fHr) * $fRad) * $m1, _ "float", $iWidth1, "float", $iHeight1) ;~ DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ ;~ "float", $fRadius - $iWidth12, _ ;~ "float", $fPosY, _ ;~ "float", $iWidth1, "float", $iHeight1) Local $tPoints = DllStructCreate("float p[8]"), $factor = $iW / 160 ; 1----2 ; | | ; 4----3 ;1 $tPoints.p(1) = $fRadius - $iWidth12 $tPoints.p(2) = $fPosY ;2 $tPoints.p(3) = $tPoints.p(1) + $iWidth1 $tPoints.p(4) = $fPosY ;3 $tPoints.p(5) = $tPoints.p(3) + $factor $tPoints.p(6) = $fPosY + $iHeight1 ;4 $tPoints.p(7) = $tPoints.p(1) - $factor $tPoints.p(8) = $tPoints.p(6) DllCall($__g_hGDIPDll, "int", "GdipFillPolygon", "handle", $hGfx, "handle", $hBrush_Update, _ "struct*", $tPoints, "int", 4, "int", "FillModeAlternate") _GDIPlus_GraphicsResetTransform($hGfx) ;min If $fMin_next <> @MIN Then $bBounce = 1 Switch $bBounce Case 1 $fMin = (6 * Mod(($fMin_next + 1), 60)) + Sin($f * 1.9) * $fAmplitude If $fAmplitude = 0 Then $fMin_next = @MIN $f = 0 $fAmplitude = 3 $bBounce = 0 Else $fAmplitude -= 0.5 $fAmplitude = $fAmplitude <= 0 ? 0 : $fAmplitude $f += 1 EndIf Case Else $fMin = (6 * @MIN) EndSwitch _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fMin) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) $iWidth1 = $fDiameter * 0.03 $iHeight1 = $fRadius $iWidth12 = $iWidth1 / 2 $fPosY = $fDiameter * 0.1 DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth12 + Cos(($fShadowAngle - $fMin) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fMin) * $fRad) * $m1, _ "float", $iWidth1, "float", $iHeight1) ;~ DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ ;~ "float", $fRadius - $iWidth12, _ ;~ "float", $fPosY, _ ;~ "float", $iWidth1, "float", $iHeight1) ;1 $tPoints.p(1) = $fRadius - $iWidth12 $tPoints.p(2) = $fPosY ;2 $tPoints.p(3) = $tPoints.p(1) + $iWidth1 $tPoints.p(4) = $fPosY ;3 $tPoints.p(5) = $tPoints.p(3) + $factor $tPoints.p(6) = $fPosY + $iHeight1 ;4 $tPoints.p(7) = $tPoints.p(1) - $factor $tPoints.p(8) = $tPoints.p(6) DllCall($__g_hGDIPDll, "int", "GdipFillPolygon", "handle", $hGfx, "handle", $hBrush_Update, _ "struct*", $tPoints, "int", 4, "int", "FillModeAlternate") _GDIPlus_GraphicsResetTransform($hGfx) ;sec $fSec = 6 * (@SEC * 1.02564 + @MSEC / 1000) If $fSec >= 360 Then $fSec = 0 _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fSec) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) $fPosY = $fDiameter * 0.27 $fPosY2 = $fDiameter * 0.19 $iWidth1 = $fDiameter * 0.0095 $iHeight1 = $fRadius * 1.3 - $fPosY $iWidth12 = $iWidth1 / 2 $iWidth2 = $fDiameter * 0.083333 $iWidth22 = $iWidth2 / 2 ;shadow seconds DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius + Cos(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $iWidth1 + $fDiameter * 0.006667, "float", $iHeight1 + $fDiameter * 0.006667) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth22 + Cos(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $fPosY2 + Sin(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $iWidth2, "float", $iWidth2) ;seconds _GDIPlus_BrushSetSolidColor($hBrush_Update, 0xFFC01010) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth12, _ "float", $fPosY, _ "float", $iWidth1, "float", $iHeight1) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth22, _ "float", $fPosY2, _ "float", $iWidth2, "float", $iWidth2) _GDIPlus_GraphicsResetTransform($hGfx) ;button in the center DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth1, _ "float", $fRadius - $iWidth1, _ "float", 2 * $iWidth1, "float", 2 * $iWidth1) DllCall($__g_hGDIPDll, "int", "GdipDrawEllipse", "handle", $hGfx, "handle", $hPen_Update, _ "float", $fRadius - $iWidth1, _ "float", $fRadius - $iWidth1, _ "float", 2 * $iWidth1, "float", 2 * $iWidth1) EndFunc ;==>UpdateClock Func GenerateClockBg($fDiameter, $iBGColor = 0xF8FFFFFF) Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($fDiameter + $fDeltaShadow, $fDiameter + $fDeltaShadow), $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap), _ $hBrush = _GDIPlus_BrushCreateSolid($iBGColor), $fBorderSize = $fDiameter * 0.03333, _ $hEffect = _GDIPlus_EffectCreateBlur($fDiameter / 50, 1), $hPen = _GDIPlus_PenCreate(0xA0000000, $fBorderSize) _GDIPlus_GraphicsSetSmoothingMode($hGfx, 4) _GDIPlus_GraphicsSetPixelOffsetMode($hGfx, 4) _GDIPlus_GraphicsSetTextRenderingHint($hGfx, 4) Local Const $fSize = $fDiameter * 0.942 - $fBorderSize / 2 Local Const $hLBrush = _GDIPlus_LineBrushCreate($fBorderSize, $fBorderSize, $fSize, $fSize, 0xFCFFFFFF, 0xF8F0F0F0, 3) _GDIPlus_LineBrushSetSigmaBlend($hLBrush, 0.33333) _GDIPlus_LineBrushSetGammaCorrection($hLBrush) Local Const $hMatrix = _GDIPlus_MatrixCreate() _GDIPlus_MatrixTranslate($hMatrix, -$fSize, -$fSize, True) _GDIPlus_MatrixRotate($hMatrix, 90, True) _GDIPlus_MatrixTranslate($hMatrix, $fSize, $fSize, True) _GDIPlus_LineBrushMultiplyTransform($hLBrush, $hMatrix, True) _GDIPlus_MatrixDispose($hMatrix) _GDIPlus_GraphicsFillEllipse($hGfx, $fBorderSize, $fBorderSize, $fSize, $fSize, $hLBrush) ;~ Local Const $hPath = _GDIPlus_PathCreate() ;~ _GDIPlus_PathAddEllipse($hPath, $fBorderSize, $fBorderSize, $fSize, $fSize) ;~ Local $hLBrush = _GDIPlus_PathBrushCreateFromPath($hPath) ;~ _GDIPlus_PathBrushSetCenterColor($hLBrush, 0xF8F0F0FF) ;~ _GDIPlus_PathBrushSetCenterPoint($hLBrush, $fSize * 0.70, $fSize * 0.70) ;~ _GDIPlus_PathBrushSetSurroundColor($hLBrush, 0xFBFFFFFF) ;~ _GDIPlus_PathBrushSetGammaCorrection($hLBrush, True) ;~ _GDIPlus_GraphicsFillPath($hGfx, $hPath, $hLBrush) ;~ _GDIPlus_PathDispose($hPath) Local $fShadow_vx = $fDiameter * 0.0095, $fShadow_vy = $fDiameter * 0.01 $fShadowAngle = ATan($fShadow_vy / $fShadow_vx) * $fDeg If $fShadow_vx < 0 And $fShadow_vy >= 0 Then $fShadowAngle += 180 If $fShadow_vx < 0 And $fShadow_vy < 0 Then $fShadowAngle -= 180 _GDIPlus_GraphicsDrawEllipse($hGfx, $fBorderSize + $fShadow_vx, $fBorderSize + $fShadow_vy, $fSize, $fSize, $hPen) _GDIPlus_BitmapApplyEffect($hBitmap, $hEffect) _GDIPlus_BrushSetSolidColor($hBrush) _GDIPlus_PenSetColor($hPen, 0xF0000000) Local Const $hBitmap_Texture = _CreateBrushedAluminum($fDiameter, $fDiameter, $fShadowAngle) Local Const $hTexture = _GDIPlus_TextureCreate($hBitmap_Texture) DllCall($__g_hGDIPDll, "int", "GdipSetPenBrushFill", "ptr", $hPen, "ptr", $hTexture) _GDIPlus_GraphicsDrawEllipse($hGfx, $fBorderSize, $fBorderSize, $fSize, $fSize, $hPen) _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, -6) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Local $iWidth1 = $fDiameter * 0.026667, $iHeight1 = $fDiameter / 10, $iWidth12 = $iWidth1 / 2, $fPosY = $fDiameter * 0.083333, _ $iWidth2 = $fDiameter * 0.013333, $iHeight2 = $fDiameter * 0.0416667, $iWidth22 = $iWidth2 / 2 For $i = 0 To 59 _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, 6) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Switch Mod($i, 5) Case 0 _GDIPlus_GraphicsFillRect($hGfx, $fRadius - $iWidth12, $fPosY, $iWidth1, $iHeight1, $hBrush) Case Else _GDIPlus_GraphicsFillRect($hGfx, $fRadius - $iWidth22, $fPosY, $iWidth2, $iHeight2, $hBrush) EndSwitch Next _GDIPlus_GraphicsResetTransform($hGfx) Local Const $hBitmap_Logo = _GDIPlus_BitmapCreateFromMemory(_Au3_Icon()) Local Const $hBitmap_Logo_Scaled = _GDIPlus_ImageResize($hBitmap_Logo, $fDiameter * 0.125, $fDiameter * 0.125) Local $aDim = _GDIPlus_ImageGetDimension($hBitmap_Logo_Scaled) _GDIPlus_GraphicsDrawImageRect($hGfx, $hBitmap_Logo_Scaled, $fRadius - $aDim[0] / 2, $fRadius / 2, $aDim[0], $aDim[1]) _GDIPlus_ImageDispose($hBitmap_Logo) _GDIPlus_ImageDispose($hBitmap_Logo_Scaled) Local Const $hFamily = _GDIPlus_FontFamilyCreate("Segoe Script"), $hFont = _GDIPlus_FontCreate($hFamily, $fDiameter * 0.025), $hFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) _GDIPlus_BrushSetSolidColor($hBrush, 0xE0000000) _GDIPlus_GraphicsDrawStringEx($hGfx, "Clock coded by" & @CRLF & "UEZ", $hFont, _GDIPlus_RectFCreate($fRadius - $fRadius * 0.2, $fRadius + $fRadius * 0.2, $fRadius * 0.4, $fRadius * 0.4), $hFormat, $hBrush) _GDIPlus_ImageDispose($hBitmap_Texture) _GDIPlus_BrushDispose($hTexture) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_EffectDispose($hEffect) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_BrushDispose($hLBrush) _GDIPlus_GraphicsDispose($hGfx) Return $hBitmap EndFunc ;==>GenerateClockBg Func _CreateBrushedAluminum($iW, $iH, $fLightAngle = 40, $iBlurDist = 12, $fBlurTrans = 0.6666, $fRed = 0.8, $fGreen = 0.9, $fBlue = 1, $iLightColor = 0xF0FFFFFF, $fLightSigma = 0.5, $fLightScale = 0.83) ;coded by Eukalyptus! $iBlurDist = Ceiling($iBlurDist) $iBlurDist += 1 - Mod($iBlurDist, 2) Local $iOverSize = 0 For $i = 1 To $iBlurDist Step 2 $iOverSize += $i + $i + 1 Next Local $iWO = $iW + $iOverSize ;========================================= ; Add Noise ;========================================= Local $iNoiseSize = 40 Local $hBmp_Noise = _GDIPlus_BitmapCreateFromScan0($iNoiseSize, $iNoiseSize) Local $hGfx_Noise = _GDIPlus_ImageGetGraphicsContext($hBmp_Noise) Local $tData = _GDIPlus_BitmapLockBits($hBmp_Noise, 0, 0, $iNoiseSize, $iNoiseSize, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB) Local $iStride = DllStructGetData($tData, "Stride") Local $iWidth = DllStructGetData($tData, "Width") Local $iHeight = DllStructGetData($tData, "Height") Local $pScan0 = DllStructGetData($tData, "Scan0") Local $tPixel = DllStructCreate("dword[" & $iWidth * $iHeight & "];", $pScan0) Local $iAmp For $row = 0 To $iHeight - 1 For $col = 0 To $iWidth - 1 $iAmp = Random(0, 0xFF, 1) DllStructSetData($tPixel, 1, BitOR(0xFF000000, BitShift($iAmp, -16), BitShift($iAmp, -8), $iAmp), $row * $iWidth + $col + 1) Next Next _GDIPlus_BitmapUnlockBits($hBmp_Noise, $tData) ;========================================= ; Create Full NoiseBitmap ;========================================= Local $hBmp_Full = _GDIPlus_BitmapCreateFromScan0($iWO, $iH) Local $hGfx_Full = _GDIPlus_ImageGetGraphicsContext($hBmp_Full) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 3) Local $iXOff, $iYOff, $iSizeX, $iSizeY For $y = 0 To $iH Step $iNoiseSize / 2 For $x = 0 To $iWO Step $iNoiseSize / 2 $iXOff = Random(0, $iNoiseSize / 2, 1) $iYOff = Random(0, $iNoiseSize / 2, 1) $iSizeX = $iNoiseSize - $iXOff $iSizeY = $iNoiseSize - $iYOff _GDIPlus_GraphicsDrawImageRectRect($hGfx_Full, $hBmp_Noise, $iXOff, $iYOff, $iSizeX, $iSizeY, $x, $y, $iSizeX, $iSizeY) Next Next _GDIPlus_GraphicsDispose($hGfx_Noise) _GDIPlus_BitmapDispose($hBmp_Noise) ;========================================= ; MotionBlur ;========================================= Local $hBmp_Full2 = _GDIPlus_BitmapCreateFromScan0($iWO, $iH) Local $hGfx_Full2 = _GDIPlus_ImageGetGraphicsContext($hBmp_Full2) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full2, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 3) Local $tColorMatrix = DllStructCreate("float[5]; float[5]; float[5]; float[5]; float[5];") DllStructSetData($tColorMatrix, 1, 1, 1) DllStructSetData($tColorMatrix, 2, 1, 2) DllStructSetData($tColorMatrix, 3, 1, 3) DllStructSetData($tColorMatrix, 4, $fBlurTrans, 4) DllStructSetData($tColorMatrix, 5, 1, 5) Local $hImgAttrib = _GDIPlus_ImageAttributesCreate() DllCall($__g_hGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "struct*", $tColorMatrix, "struct*", 0, "int", 0) For $i = 1 To $iBlurDist Step 2 DllCall($__g_hGDIPDll, "int", "GdipDrawImageRectRect", "ptr", $hGfx_Full2, "ptr", $hBmp_Full, _ "float", $i, "float", 0, "float", $iWO, "float", $iH, _ "float", 0, "float", 0, "float", $iWO, "float", $iH, _ "int", 2, "ptr", $hImgAttrib, "ptr", 0, "ptr", 0) If $i >= $iBlurDist Then DllStructSetData($tColorMatrix, 1, $fRed, 1) DllStructSetData($tColorMatrix, 2, $fGreen, 2) DllStructSetData($tColorMatrix, 3, $fBlue, 3) DllStructSetData($tColorMatrix, 4, 1, 4) DllCall($__g_hGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "struct*", $tColorMatrix, "struct*", 0, "int", 0) EndIf DllCall($__g_hGDIPDll, "int", "GdipDrawImageRectRect", "ptr", $hGfx_Full, "ptr", $hBmp_Full2, _ "float", $i + 1, "float", 0, "float", $iWO, "float", $iH, _ "float", 0, "float", 0, "float", $iWO, "float", $iH, _ "int", 2, "ptr", $hImgAttrib, "ptr", 0, "ptr", 0) Next _GDIPlus_ImageAttributesDispose($hImgAttrib) _GDIPlus_GraphicsDispose($hGfx_Full2) _GDIPlus_BitmapDispose($hBmp_Full2) _GDIPlus_GraphicsDispose($hGfx_Full) ;========================================= ; Add Light ;========================================= Local $hBmp_Alu = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hGfx_Alu = _GDIPlus_ImageGetGraphicsContext($hBmp_Alu) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Alu, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Alu, 3) _GDIPlus_GraphicsDrawImage($hGfx_Alu, $hBmp_Full, -$iOverSize, 0) _GDIPlus_BitmapDispose($hBmp_Full) Local $tPointF1 = DllStructCreate("float; float;") Local $tPointF2 = DllStructCreate("float; float;") DllStructSetData($tPointF2, 2, $iH * $fLightScale) $aResult = DllCall($__g_hGDIPDll, "int", "GdipCreateLineBrush", "struct*", $tPointF1, "struct*", $tPointF2, "uint", 0, "uint", $iLightColor, "int", 0, "handle*", 0) If @error Or Not IsArray($aResult) Then Return SetError(1, 4, False) Local $hBrush = $aResult[6] _GDIPlus_LineBrushSetSigmaBlend($hBrush, $fLightSigma) _GDIPlus_LineBrushSetGammaCorrection($hBrush) DllCall($__g_hGDIPDll, "int", "GdipRotateLineTransform", "ptr", $hBrush, "float", $fLightAngle, "int", 0) _GDIPlus_GraphicsFillRect($hGfx_Alu, 0, 0, $iW, $iH, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfx_Alu) Return $hBmp_Alu EndFunc ;==>_CreateBrushedAluminum ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2018-02-02 Func _Au3_Icon($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Au3_Icon $Au3_Icon &= 'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAP0ElEQVR4XtWZW4hs6VXHf+v79qWquruquqtvZ/r0uc8540yScTIQQ0JkDOYyGhIkhhAxxhdR8mDAgAg+6FsE9UVffNMH8S0ERAwS1DFeEo3m6owzmUySc+Zc+15VXZd9+dZyp6ro4pDTORlGIfnDn703TW/+//X9v/Wt3i3PPfccP85w/GhBgLqkS23ixhpRfau6bgItIPpRN5Ag0Xl88jYrxu/E+KA492E0vJd44d245BKQ/H8bkAe80wMOEE5HA5c8SpQ822yv/ubW9vnfffyxR3+vs7r6YcS9HewZnP9ZXPwE0Py/NuCBJj65iERvQPybcNFP4JKzuPgq+CeR6GnwV3FJB4juM+mSNj55Ehe97/LFC5947PL2ey5tb755daW1+fiVc295+qk3fuTShfPPPnb10d+J60sfI6o9BbRer4EIaOLis1Nh6dtBfs6ljY82ljqfiNLFX8X597uk/ksrG4/8ftJo/lq62P51XPQOJHoc3DV8egZYxLkLcW3xQ088fvWTj2ysXItjnxRlGY6Ojmxvb98iJwtnz6xeXO80tx+9tP0Rcf6tuHhzLuS1YwmJLiHuslRVbzQbjydJsrXSbl4RIVlpLZ0xM71+e+cbC41a+8zayuVxlo9CCPnX/vslt7S89iEzy4/7R/+MT7+Lhq2V5dbbO63Ftbwog/feDYdDt7e3R71eo9vt2tbWlkZRRC1NFkHWQDpACmQ/bBuVWUyaiN+Kk9oH2q3mO/Ky0HNn1p9sNxeaBpiBmpl3TlTNqouoqkmFoKp5XuT1NKlVFS5ffOXm54ui2EFIr17afudCLV1SM5mBity+fRuAzc1NVC1EkfN3dg+/9e1vf/ePMfssYXz9hzXQJKo/BTyKlovrZ7Y+fPXi1luryubOOeKqPBpKQiilLAMhBAwEw7x3RN9jFImPIhTR8TjPQghFvZY2s7wYpkmc' $Au3_Icon &= 'Ag5ARFBVuXHjBpVPqurTaDRMVRERQgjll776wp9YKP+KMP5a9NCsS7SBuHMgb2stt9+13FraXltubYegmkRRMh4POTwccdAbMy4CQTFDBBEDABMvYmnirNVIaC3UpVFP667WqFdmrRLfYA7MDIBWq0WaplQRIo5j8d6bVvDOxbV6fXV03C0BeYgBvyxx7R1prfbs2srym8+e6bxhtrwMjnt276Bv3UGOuYQ4bVCrJ1JVWtxEvxO0xBHIiiBVpbnbLexetysLidjmygKLCwsYzjATwACpQK/XY2VlBTNjZ2cHVTXvvYkgg3F2lI2z2+ByIEScjgRx23GSPvPU41d+BQE1zMqCnb197h2NxCeLttBeliiOmCUGDIIJFgIbzYh2IyUoqBrHo0LuHQ4ozMl37g1sqTaUrdWWJbW6haAChnOOPM/Z3d1lNBpRVX/CEJTIOxkOs2Mt8z4iAHa6ARdvVnzL+a3NnzfMVNEyz/z1Wzt2XHgWW+tUwkUV8tKYlQ81IZLA9nJMI40IaohAFAnLSxHeSm7sDWi0VuR4cMxLN/fl0maLxsICqlRUVldXOTg4IEkSOp2OVUAE1Iz+YLSHyAAYndZGE1yyAXqt1Wq/b3Vl6WxQC/lo4F5+dccK15Dmchs1yEpAHCAwEe+IKbm8GhN5T6mKEwGmwgAWFxdYHo7Y6fdoLDUZDz0vvnrI1S1lYXEJnRmuhANYBalozolT1dDt97+Chq+j+f6DDUh0Bh8/k9br7754buOng5oW2ci9fGNHxtRoLrbIgwEecw5sasAQRAPnVx3eC0UIE/FmxhxgwMZqm1G+T/d4SL3eoAzKizcPefycUG8soqqEEAxMzFARIcvL8fWbO18YH/c+DfICcPwgA4JZa2lp6b3XLp39kK8QQtBbd/ZlUIgttJakNFA8OIeZQ5hVPyhnm0Y9dpTBEMDMeBBMPGc6i/RvdRnnCVWTIMvHfPPWEU+c97iohpmad47jcda/u3Pw/MHh' $Au3_Icon &= '0b+Zll8GfREtd08bJSJ81DgeDO6WQYOBHh3uy04/M5c0RCaxEBSHmsNMUKBUo5Uo6w0hVwEzToOZQcW01uCR5ZQym2zqSRcbZyW39gdgATPEgLu7hy/v7+3+jWn5GUz/Hi1vAPagUaKGS65geqndbD2ZJnE8Hh3bzb0BuFgkignq0FnmMWaCIHElFzuO0jwOQ+bR+YFGaomHMJyumIvAp1RdirVmnaRWMxGcqwi2i9mrhGyHOe43gEQrLq698+wj6x9f77SvWYVefyjjgOBjwKMiGG4uXsBZydU1jyGoKhpK8iLHe08cJ4gID4aAAhZQA8GBj7Gi4Ob+gMuPREBCGUKJWQNYBASw08bpBbDVtZXWNQPLs6FVvV6QyHAROmuRChigCGjg0rIjdTqpYlHk3L5zl2rO4Tu39iZmDDCzCZnfT4gTmL8PnAMXczTIyPOAqlk1JJ73Sf2NOH9pZoIHGYiApXqjcQVMMXQ8GssoV8NFgngMhyLA1IgLGRfa0K4beZCJ2J3dXfa7Q6I4pV9E3D0YYmV2f/7n90RRTC1yWChQExAPPsJUORzkTjVYNaVuXLm0/UHEXcDXaqcZSBBZi6NoAwRMGWUlhkzE4zwgqBoGYIGzLWG1rmQlOIHjfo+j45z11RUKE6ivcHsYca+bI9j0d21OMMR5Uq9okaEA4k5YGTBMKVV1MBwfYhpVbJy+AuKaYJEZqAbpjQoQx5yCMTspG8ZG05Opm4kL9IYZucJOd0AZL4G4yQgQxTXAMO6PkAF5NqY/KjAXA8LcgGecl6JBEcH1+sd3QFpA68EGosbC7IfxNNqlZaWdCAem92Y0IuXiMuQB5EQUdNotttY7bK52OL+6yLWO8pObsLboCMr3nws2NZAFAZ8whZwY0aAoAoY16rVVIIAVD+5CpklVqcvVmHwFM1TVBTU5GRNwiBnLDcfVjpIHB6bMAbVaQqNeQ8RQVcBRmCGnHWYYWZ5jEoGraDoTP6WpEYKK91YV' $Au3_Icon &= 'pX1ld+/Ah6zonxYhFCsXGumqqk2fDDspCkanIVxbKRkHh6l+X09XNcoQKEolmKAnwgUDzO7fyKZKVgTwMYh7gEFsQtNw697BC6HIR4ic0oUEESQKqkFEHCYmjpMe5zAudCLGFoHp97dDQEQwZmbKchqPYZ9B/4DxoIdqeSJezQhlwTAvwaecQDiBiMwe8cvtxS0fpxfAWoB7QIQoQlm8/NIrNz9z7fLZ94vzSeycZaWJYDzxSB1MmW2q+0TrieAReZ6RF4FRHhgXSqEQJkl0PLadkiR+ZkIIoWCUGdRjmB/rJxQRvBfMQIwESEGSmQG930AY7+HS5/N8fCXPy6KeuiSNnR2Pc1mqJ5ONOywU78BsLjwfjRj0e5NO0s+UIH5aUV+HKJlm21fUkkwhwVAzBCiLgmCAiwG7n6b4yIub6VcsA7uO6Q4QHjRKFGg5rObzs/VasmiqZZr4qJrd7bGtBcnyAifzHIeg9LoH7B70GWoEyRIsLEzFu1nnMuaVRRjmBUupYgrihLIsURyIZ155nVIDjSRR50Sq9tx7+ZXrf46Gf8TKm4CdMguJz4uil+fFKIp80lxo2NZ6g+oZVQXmq9w9OuDmzhFaW4HFzrTSGNicU9hJsPMAmAIOwyjLAM7PzOr9xGgvpZhBvz/aE/HerMiA0WldSIGeqXZFJC6Dulq9ThmChBAwM0wVMxgOj7m730NrHVhYB+fAwikjtIAACGqAKjp7V1AD8QD3VZ5Q4H1kywux5EXQ732Ra7eab0I1AO40AyCupxpe2T/qf9P7yMTUiqKwk9YnMhnWDg+PyKUOjc682gg/EMJ8jzKFqoG4k8xjYUot6LQagikGriyDdnv9zyNyBJSnG9C8b0X2D3mpN9MkcveJB1SV7tE+B4MwFY8ADxEv833pBEwAM8bjMaNxBshcvJYQcpyPbKtTpyjNIufk7l73q1qMvoiVuwCnGRAgixvNKxe21t+VZVlpZq6izA4pBsd9dg5HkDZn' $Au3_Icon &= 'J2eYb9RTMPdn1GLBcJhN33WUCcQNCMWEUwMF2+st0RCsAkf94W7/ePAVzO4Ag1MNzNDcPrP+B2aBEALARLzBJDp7B10CHnwCIQct59l/iAlBaUSgBoJRBp2KdxHo7F3FiFaraZ0Fb3kRDCyr/pz8pyIbfRa4B+hpBhLAti9cfmahnjyd53kBRFYBwFSt1+vZOC8hSkHnFZsygCmg87zcvwSIMR2bDcyUrFSAaSFCCeWIWr1hV9YbMspKjSPnrt/e/fdsNPg7TL9xWnyYn2qkYL/ovVPVWVLNBGA4HNLrDzmz1rbVVsMIGRVtugoFWDE3MjMzp4HmRGSIQBXNybfOLC/BbGqgGFq93uCJc21GeaFR5P0oK3pl0Bugz6P57R+U0wgoN7fO/8Zyq/nRooJhEYZUsLIsqDqA1Bs1lpotW9IgiXfcORqJlSNwCfgIxE84H78FYHofCupRCfjJp8K9wz4BD24SQVtpt+XiRsOqTY2A6/aGt1+9c+8vLBSfI4RXgIzTQQSki43axzHVEILI/Eua9fsDd9TtXd/c2Iy9d49kQfP2YhotNWJ5dW/EMJusguBicBMTcwPCFKqYQCgDg1FGXhqIWpQmnD/Tpplig9EYAesNsnu37tz7S9Pw14Tsf4AeD0F0/tLlReekphoEEDAB0SzL5ODoqI/qn+0e9ZezUp9dbjbOJ/W0aRAurNUlK+vubndsw6zAilwQARy4+SqIlZShIGt2LIQgca1h651l1tt1iqKQ42EIceTdzn7v+b39/U+L889j4VtT8Q+HfOUbL3zq7Ob6J800VlWbfR3W3b193z06/EPEfwoXP+ai+BdWO+0PFEXIq/3wBjAwVGazd29U0q+YFYGghjFF7KDmApVGGQ2PbWOtI1WzIC8Vg1Bp94fdwau37+78KdhzaHgFLbpA4OEgwmzNmPR8RCZDVuj2elG3e/S5NIn/KMuLQyR+Ucv80zs7ey+BbVVinIjUVpcXL816O82613Zd' $Au3_Icon &= 'gMTEOQcCqIo4RlkpVRu2Uk129w8DneWxeO9v3N79l+pCnuVfxvRfCdkLwIDXAPnSf33tU+fOnvktEXNFUUi1af3e3sHXNRQfA746P0+p4eJlxJ9D5I3OR09fPnfml6vD5m6rubCdRC4FAUDNdDTOe977ej2NUjOjdzxgNBwVh73h3/ooGXrvk2w8esE0PI9Nus11oM9rhHzhi//xtpXV1c+msW92uz0ODw6fA/1t4Es8GDEu3kDcFRclP6Ua2nGcbMdxvI4hzossLdQvAeRFeS/Liv00jddUtej2Bs9pKP4TDYdgOdBD3C4h2wcCrx1M/8kn7j2Y/gxwM03Tz2RZdouHo4GLOuA2EGliNBGpY3qM8+uAoeV3MBvjXBucTJ5dfIcwGgIGlIDxOjAx8DrhgQioEdUjxCmmEQDlaDATGTPF+JRKv24Dbp71GX9M8L84Jo46QVTs6gAAAABJRU5ErkJggg==' Local $bString = _WinAPI_Base64Decode($Au3_Icon) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\au3-icon2.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Au3_Icon Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode Download: GDI+ Swiss Railway Clock v1.16 (Widget).au3 GUI version (discontinued): ;the Hilfiker / MobaTime Swiss Railway Clock ;coded by UEZ build 2018-03-01 ;thanks to Eukalyptus for the _CreateBrushedAluminum() function! #Pragma Compile(Icon, "GDI+ Swiss Railway Clock.ico") #AutoIt3Wrapper_Run_Au3Stripper=y #Au3Stripper_Parameters=/so /pe /rm #AutoIt3Wrapper_Run_After=del /f /q "%scriptdir%\%scriptfile%_stripped.au3" #AutoIt3Wrapper_UseX64=n Break(0) #include <GDIPlus.au3> #include <GuiConstantsEx.au3> #include <WindowsConstants.au3> ProcessSetPriority(@AutoItPID, $PROCESS_LOW) _GDIPlus_Startup() Global $hGUI, $iFPS = 0, $iShowFPS = 0, $bExit Global Const $iW = 512, $iH = $iW, $iWh = $iW / 2, $iHh = $iH / 2, $sTitle = "GDI+ Swiss Railway Clock v1.1" Global Const $fRad = ACos(-1) / 180, $fDeg = 180 / ACos(-1), $iTimer = 30, $fDeltaShadow = $iW * 0.020 Global $hDC, $hCanvas, $hBitmap_Clock, $hBrush_Shadow, $hBrush_Update, $hPen_Update, $fDiameter = $iW, $hDC_backbuffer, $fShadowAngle, $fMin_next, _ $fRadius = $fDiameter / 2, $fSec, $fMin, $fHr, $fAmplitude = 3 AutoItSetOption("GUIOnEventMode", 1) GDIPlus_SwissRailwayClock() AutoItSetOption("GUIOnEventMode", 0) _GDIPlus_Shutdown() Func GDIPlus_SwissRailwayClock() $bExit = False $hGUI = GUICreate($sTitle, $iW + $fDeltaShadow, $iH + $fDeltaShadow, -1, -1, -1, $WS_EX_TOPMOST) GUISetBkColor(0xFFFFFF, $hGUI) GUISetState(@SW_SHOW, $hGUI) ;~ GUISetCursor(16, 1) ;create canvas elements $hDC = _WinAPI_GetDC($hGUI) Local Const $hHBitmap = _WinAPI_CreateCompatibleBitmap($hDC, $iW + $fDeltaShadow, $iH + $fDeltaShadow) $hDC_backbuffer = _WinAPI_CreateCompatibleDC($hDC) Local Const $DC_obj = _WinAPI_SelectObject($hDC_backbuffer, $hHBitmap) $hCanvas = _GDIPlus_GraphicsCreateFromHDC($hDC_backbuffer) $hBrush_Shadow = _GDIPlus_BrushCreateSolid(0x14A0A0A0) $hPen_Update = _GDIPlus_PenCreate(0xFFA02020) $hBrush_Update = _GDIPlus_BrushCreateSolid(0) _GDIPlus_GraphicsSetSmoothingMode($hCanvas, $GDIP_SMOOTHINGMODE_HIGHQUALITY) _GDIPlus_GraphicsSetPixelOffsetMode($hCanvas, $GDIP_PIXELOFFSETMODE_HIGHQUALITY) $fDiameter = $fDiameter < 128 ? 128 : $fDiameter > 1024 ? 1024 : $fDiameter $hBitmap_Clock = GenerateClockBg($fDiameter) GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit_About") $fMin_next = @MIN GUIRegisterMsg($WM_TIMER, "Draw") ;$WM_TIMER = 0x0113 Local $iID = DllCall("User32.dll", "uint_ptr", "SetTimer", "hwnd", $hGUI, "uint_ptr", 1, "uint", $iTimer, "ptr", 0)[0] Do If $bExit Then ExitLoop Until Not Sleep(100) ;release resources GUIRegisterMsg($WM_TIMER, "") DllCall("user32.dll", "bool", "KillTimer", "hwnd", $hGUI, "uint_ptr", $iID) _GDIPlus_PenDispose($hPen_Update) _GDIPlus_BrushDispose($hBrush_Shadow) _GDIPlus_BrushDispose($hBrush_Update) _GDIPlus_GraphicsDispose($hCanvas) _WinAPI_SelectObject($hDC_backbuffer, $DC_obj) _WinAPI_DeleteDC($hDC_backbuffer) _WinAPI_DeleteObject($hHBitmap) _WinAPI_ReleaseDC($hGUI, $hDC) GUIDelete($hGUI) EndFunc ;==>GDIPlus_SwissRailwayClock Func Draw($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam _GDIPlus_GraphicsDrawImageRect($hCanvas, $hBitmap_Clock, 0, 0, $fDiameter + $fDeltaShadow, $fDiameter + $fDeltaShadow) UpdateClock($hCanvas, $fDiameter) _WinAPI_BitBlt($hDC, 0, 0, $iW + $fDeltaShadow, $iH + $fDeltaShadow, $hDC_backbuffer, 0, 0, $SRCCOPY) EndFunc Func _Exit_About() $bExit = True EndFunc ;==>_Exit_About Func UpdateClock($hGfx, $fDiameter) Static $bBounce = 0, $f = 0 Local $m1 = $fDiameter * 0.015 ;hour $fHr = 30 * (@HOUR + @MIN / 60) _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fHr) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Local $iWidth1 = $fDiameter * 0.0375, _ $iHeight1 = $fDiameter / 2.5, _ $iWidth12 = $iWidth1 / 2, _ $fPosY = $fDiameter * 0.2, $iWidth2, $iWidth22, $fPosY2 _GDIPlus_BrushSetSolidColor($hBrush_Update, 0xFF101010) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth12 + Cos(($fShadowAngle - $fHr) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fHr) * $fRad) * $m1, _ "float", $iWidth1, "float", $iHeight1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth12, _ "float", $fPosY, _ "float", $iWidth1, "float", $iHeight1) _GDIPlus_GraphicsResetTransform($hGfx) ;min If $fMin_next <> @MIN Then $bBounce = 1 Switch $bBounce Case 1 $fMin = (6 * Mod(($fMin_next + 1), 60)) + Sin($f * 1.9) * $fAmplitude If $fAmplitude = 0 Then $fMin_next = @MIN $f = 0 $fAmplitude = 3 $bBounce = 0 Else $fAmplitude -= 0.5 $fAmplitude = $fAmplitude <= 0 ? 0 : $fAmplitude $f += 1 EndIf Case Else $fMin = (6 * @MIN) EndSwitch _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fMin) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) $iWidth1 = $fDiameter * 0.03 $iHeight1 = $fRadius $iWidth12 = $iWidth1 / 2 $fPosY = $fDiameter * 0.1 DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth12 + Cos(($fShadowAngle - $fMin) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fMin) * $fRad) * $m1, _ "float", $iWidth1, "float", $iHeight1) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth12, _ "float", $fPosY, _ "float", $iWidth1, "float", $iHeight1) _GDIPlus_GraphicsResetTransform($hGfx) ;sec $fSec = 6 * (@SEC * 1.02564 + @MSEC / 1000) If $fSec >= 360 Then $fSec = 0 _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, $fSec) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) $fPosY = $fDiameter * 0.27 $fPosY2 = $fDiameter * 0.19 $iWidth1 = $fDiameter * 0.0095 $iHeight1 = $fRadius * 1.3 - $fPosY $iWidth12 = $iWidth1 / 2 $iWidth2 = $fDiameter * 0.083333 $iWidth22 = $iWidth2 / 2 ;shadow seconds DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius + Cos(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $fPosY + Sin(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $iWidth1 + $fDiameter * 0.006667, "float", $iHeight1 + $fDiameter * 0.006667) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Shadow, _ "float", $fRadius - $iWidth22 + Cos(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $fPosY2 + Sin(($fShadowAngle - $fSec) * $fRad) * $m1, _ "float", $iWidth2, "float", $iWidth2) ;seconds _GDIPlus_BrushSetSolidColor($hBrush_Update, 0xFFC01010) DllCall($__g_hGDIPDll, "int", "GdipFillRectangle", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth12, _ "float", $fPosY, _ "float", $iWidth1, "float", $iHeight1) DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth22, _ "float", $fPosY2, _ "float", $iWidth2, "float", $iWidth2) _GDIPlus_GraphicsResetTransform($hGfx) ;button in the center DllCall($__g_hGDIPDll, "int", "GdipFillEllipse", "handle", $hGfx, "handle", $hBrush_Update, _ "float", $fRadius - $iWidth1, _ "float", $fRadius - $iWidth1, _ "float", 2 * $iWidth1, "float", 2 * $iWidth1) DllCall($__g_hGDIPDll, "int", "GdipDrawEllipse", "handle", $hGfx, "handle", $hPen_Update, _ "float", $fRadius - $iWidth1, _ "float", $fRadius - $iWidth1, _ "float", 2 * $iWidth1, "float", 2 * $iWidth1) EndFunc Func GenerateClockBg($fDiameter) Local Const $hBitmap = _GDIPlus_BitmapCreateFromScan0($fDiameter + $fDeltaShadow, $fDiameter + $fDeltaShadow), $hGfx = _GDIPlus_ImageGetGraphicsContext($hBitmap), _ $hBrush = _GDIPlus_BrushCreateSolid(0xFF000000), $fBorderSize = $fDiameter * 0.03333, _ $hEffect = _GDIPlus_EffectCreateBlur($fDiameter / 50, 0), $hPen = _GDIPlus_PenCreate(0xA0000000, $fBorderSize) _GDIPlus_GraphicsSetSmoothingMode($hGfx, 4) _GDIPlus_GraphicsSetPixelOffsetMode($hGfx, 4) _GDIPlus_GraphicsSetTextRenderingHint($hGfx, 4) _GDIPlus_GraphicsClear($hGfx, 0xFFFFFFFF) Local Const $fSize = $fDiameter * 0.95 - $fBorderSize / 2 Local $fShadow_vx = $fDiameter * 0.0095, $fShadow_vy = $fDiameter * 0.01 $fShadowAngle = ATan($fShadow_vy / $fShadow_vx) * $fDeg If $fShadow_vx < 0 And $fShadow_vy >= 0 Then $fShadowAngle += 180 If $fShadow_vx < 0 And $fShadow_vy < 0 Then $fShadowAngle -= 180 _GDIPlus_GraphicsDrawEllipse($hGfx, $fBorderSize + $fShadow_vx, $fBorderSize + $fShadow_vy, $fSize, $fSize, $hPen) _GDIPlus_BitmapApplyEffect($hBitmap, $hEffect) _GDIPlus_PenSetColor($hPen, 0xF0000000) Local Const $hBitmap_Texture = _CreateBrushedAluminum($fDiameter, $fDiameter, $fShadowAngle) Local Const $hTexture = _GDIPlus_TextureCreate($hBitmap_Texture) DllCall($__g_hGDIPDll, "int", "GdipSetPenBrushFill", "ptr", $hPen, "ptr", $hTexture) _GDIPlus_GraphicsDrawEllipse($hGfx, $fBorderSize, $fBorderSize, $fSize, $fSize, $hPen) _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, -6) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Local $iWidth1 = $fDiameter * 0.026667, $iHeight1 = $fDiameter / 10, $iWidth12 = $iWidth1 / 2, $fPosY = $fDiameter * 0.083333, _ $iWidth2 = $fDiameter * 0.013333, $iHeight2 = $fDiameter * 0.0416667, $iWidth22 = $iWidth2 / 2 For $i = 0 to 59 _GDIPlus_GraphicsTranslateTransform($hGfx, $fRadius, $fRadius) _GDIPlus_GraphicsRotateTransform($hGfx, 6) _GDIPlus_GraphicsTranslateTransform($hGfx, -$fRadius, -$fRadius) Switch Mod($i, 5) Case 0 _GDIPlus_GraphicsFillRect($hGfx, $fRadius - $iWidth12, $fPosY, $iWidth1, $iHeight1, $hBrush) Case Else _GDIPlus_GraphicsFillRect($hGfx, $fRadius - $iWidth22, $fPosY, $iWidth2, $iHeight2, $hBrush) EndSwitch Next _GDIPlus_GraphicsResetTransform($hGfx) Local Const $hBitmap_Logo = _GDIPlus_BitmapCreateFromMemory(_Au3_Icon()) Local Const $hBitmap_Logo_Scaled = _GDIPlus_ImageResize($hBitmap_Logo, $fDiameter * 0.08, $fDiameter * 0.08) Local $aDim = _GDIPlus_ImageGetDimension($hBitmap_Logo_Scaled) _GDIPlus_GraphicsDrawImageRect($hGfx, $hBitmap_Logo_Scaled, $fRadius - $aDim[0] / 2, $fRadius / 1.75, $aDim[0], $aDim[1]) _GDIPlus_ImageDispose($hBitmap_Logo) _GDIPlus_ImageDispose($hBitmap_Logo_Scaled) Local Const $hFamily = _GDIPlus_FontFamilyCreate("Segoe Script"), $hFont = _GDIPlus_FontCreate($hFamily, $fDiameter * 0.025), $hFormat = _GDIPlus_StringFormatCreate() _GDIPlus_StringFormatSetAlign($hFormat, 1) _GDIPlus_StringFormatSetLineAlign($hFormat, 1) ;~ _GDIPlus_BrushSetSolidColor($hBrush, 0xFF400000) _GDIPlus_GraphicsDrawStringEx($hGfx, "Clock by" & @CRLF & "UEZ", $hFont, _GDIPlus_RectFCreate($fRadius - $fRadius * 0.2, $fRadius + $fRadius * 0.2, $fRadius * 0.4, $fRadius * 0.4), $hFormat, $hBrush) _GDIPlus_ImageDispose($hBitmap_Texture) _GDIPlus_BrushDispose($hTexture) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_EffectDispose($hEffect) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfx) Return $hBitmap EndFunc Func _CreateBrushedAluminum($iW, $iH, $fLightAngle = 40, $iBlurDist = 12, $fBlurTrans = 0.6666, $fRed = 0.8, $fGreen = 0.9, $fBlue = 1, $iLightColor = 0xF0FFFFFF, $fLightSigma = 0.5, $fLightScale = 0.83) ;coded by Eukalyptus! $iBlurDist = Ceiling($iBlurDist) $iBlurDist += 1 - Mod($iBlurDist, 2) Local $iOverSize = 0 For $i = 1 To $iBlurDist Step 2 $iOverSize += $i + $i + 1 Next Local $iWO = $iW + $iOverSize ;========================================= ; Add Noise ;========================================= Local $iNoiseSize = 40 Local $hBmp_Noise = _GDIPlus_BitmapCreateFromScan0($iNoiseSize, $iNoiseSize) Local $hGfx_Noise = _GDIPlus_ImageGetGraphicsContext($hBmp_Noise) Local $tData = _GDIPlus_BitmapLockBits($hBmp_Noise, 0, 0, $iNoiseSize, $iNoiseSize, BitOR($GDIP_ILMREAD, $GDIP_ILMWRITE), $GDIP_PXF32ARGB) Local $iStride = DllStructGetData($tData, "Stride") Local $iWidth = DllStructGetData($tData, "Width") Local $iHeight = DllStructGetData($tData, "Height") Local $pScan0 = DllStructGetData($tData, "Scan0") Local $tPixel = DllStructCreate("dword[" & $iWidth * $iHeight & "];", $pScan0) Local $iAmp For $row = 0 To $iHeight - 1 For $col = 0 To $iWidth - 1 $iAmp = Random(0, 0xFF, 1) DllStructSetData($tPixel, 1, BitOR(0xFF000000, BitShift($iAmp, -16), BitShift($iAmp, -8), $iAmp), $row * $iWidth + $col + 1) Next Next _GDIPlus_BitmapUnlockBits($hBmp_Noise, $tData) ;========================================= ; Create Full NoiseBitmap ;========================================= Local $hBmp_Full = _GDIPlus_BitmapCreateFromScan0($iWO, $iH) Local $hGfx_Full = _GDIPlus_ImageGetGraphicsContext($hBmp_Full) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 3) Local $iXOff, $iYOff, $iSizeX, $iSizeY For $y = 0 To $iH Step $iNoiseSize / 2 For $x = 0 To $iWO Step $iNoiseSize / 2 $iXOff = Random(0, $iNoiseSize / 2, 1) $iYOff = Random(0, $iNoiseSize / 2, 1) $iSizeX = $iNoiseSize - $iXOff $iSizeY = $iNoiseSize - $iYOff _GDIPlus_GraphicsDrawImageRectRect($hGfx_Full, $hBmp_Noise, $iXOff, $iYOff, $iSizeX, $iSizeY, $x, $y, $iSizeX, $iSizeY) Next Next _GDIPlus_GraphicsDispose($hGfx_Noise) _GDIPlus_BitmapDispose($hBmp_Noise) ;========================================= ; MotionBlur ;========================================= Local $hBmp_Full2 = _GDIPlus_BitmapCreateFromScan0($iWO, $iH) Local $hGfx_Full2 = _GDIPlus_ImageGetGraphicsContext($hBmp_Full2) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Full2, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 3) Local $tColorMatrix = DllStructCreate("float[5]; float[5]; float[5]; float[5]; float[5];") DllStructSetData($tColorMatrix, 1, 1, 1) DllStructSetData($tColorMatrix, 2, 1, 2) DllStructSetData($tColorMatrix, 3, 1, 3) DllStructSetData($tColorMatrix, 4, $fBlurTrans, 4) DllStructSetData($tColorMatrix, 5, 1, 5) Local $hImgAttrib = _GDIPlus_ImageAttributesCreate() DllCall($__g_hGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "struct*", $tColorMatrix, "struct*", 0, "int", 0) For $i = 1 To $iBlurDist Step 2 DllCall($__g_hGDIPDll, "int", "GdipDrawImageRectRect", "ptr", $hGfx_Full2, "ptr", $hBmp_Full, _ "float", $i, "float", 0, "float", $iWO, "float", $iH, _ "float", 0, "float", 0, "float", $iWO, "float", $iH, _ "int", 2, "ptr", $hImgAttrib, "ptr", 0, "ptr", 0) If $i >= $iBlurDist Then DllStructSetData($tColorMatrix, 1, $fRed, 1) DllStructSetData($tColorMatrix, 2, $fGreen, 2) DllStructSetData($tColorMatrix, 3, $fBlue, 3) DllStructSetData($tColorMatrix, 4, 1, 4) DllCall($__g_hGDIPDll, "int", "GdipSetImageAttributesColorMatrix", "ptr", $hImgAttrib, "int", 1, "int", 1, "struct*", $tColorMatrix, "struct*", 0, "int", 0) EndIf DllCall($__g_hGDIPDll, "int", "GdipDrawImageRectRect", "ptr", $hGfx_Full, "ptr", $hBmp_Full2, _ "float", $i + 1, "float", 0, "float", $iWO, "float", $iH, _ "float", 0, "float", 0, "float", $iWO, "float", $iH, _ "int", 2, "ptr", $hImgAttrib, "ptr", 0, "ptr", 0) Next _GDIPlus_ImageAttributesDispose($hImgAttrib) _GDIPlus_GraphicsDispose($hGfx_Full2) _GDIPlus_BitmapDispose($hBmp_Full2) _GDIPlus_GraphicsDispose($hGfx_Full) ;========================================= ; Add Light ;========================================= Local $hBmp_Alu = _GDIPlus_BitmapCreateFromScan0($iW, $iH) Local $hGfx_Alu = _GDIPlus_ImageGetGraphicsContext($hBmp_Alu) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Alu, 4) _GDIPlus_GraphicsSetInterpolationMode($hGfx_Full, 3) _GDIPlus_GraphicsDrawImage($hGfx_Alu, $hBmp_Full, -$iOverSize, 0) _GDIPlus_BitmapDispose($hBmp_Full) Local $tPointF1 = DllStructCreate("float; float;") Local $tPointF2 = DllStructCreate("float; float;") DllStructSetData($tPointF2, 2, $iH * $fLightScale) $aResult = DllCall($__g_hGDIPDll, "int", "GdipCreateLineBrush", "struct*", $tPointF1, "struct*", $tPointF2, "uint", 0, "uint", $iLightColor, "int", 0, "handle*", 0) If @error Or Not IsArray($aResult) Then Return SetError(1, 4, False) Local $hBrush = $aResult[6] _GDIPlus_LineBrushSetSigmaBlend($hBrush, $fLightSigma) _GDIPlus_LineBrushSetGammaCorrection($hBrush) DllCall($__g_hGDIPDll, "int", "GdipRotateLineTransform", "ptr", $hBrush, "float", $fLightAngle, "int", 0) _GDIPlus_GraphicsFillRect($hGfx_Alu, 0, 0, $iW, $iH, $hBrush) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfx_Alu) Return $hBmp_Alu EndFunc ;==>_CreateBrushedAluminum ;Code below was generated by: 'File to Base64 String' Code Generator v1.20 Build 2018-02-02 Func _Au3_Icon($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Au3_Icon $Au3_Icon &= 'iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAP0ElEQVR4XtWZW4hs6VXHf+v79qWquruquqtvZ/r0uc8540yScTIQQ0JkDOYyGhIkhhAxxhdR8mDAgAg+6FsE9UVffNMH8S0ERAwS1DFeEo3m6owzmUySc+Zc+15VXZd9+dZyp6ro4pDTORlGIfnDn703TW/+//X9v/Wt3i3PPfccP85w/GhBgLqkS23ixhpRfau6bgItIPpRN5Ag0Xl88jYrxu/E+KA492E0vJd44d245BKQ/H8bkAe80wMOEE5HA5c8SpQ822yv/ubW9vnfffyxR3+vs7r6YcS9HewZnP9ZXPwE0Py/NuCBJj65iERvQPybcNFP4JKzuPgq+CeR6GnwV3FJB4juM+mSNj55Ehe97/LFC5947PL2ey5tb755daW1+fiVc295+qk3fuTShfPPPnb10d+J60sfI6o9BbRer4EIaOLis1Nh6dtBfs6ljY82ljqfiNLFX8X597uk/ksrG4/8ftJo/lq62P51XPQOJHoc3DV8egZYxLkLcW3xQ088fvWTj2ysXItjnxRlGY6Ojmxvb98iJwtnz6xeXO80tx+9tP0Rcf6tuHhzLuS1YwmJLiHuslRVbzQbjydJsrXSbl4RIVlpLZ0xM71+e+cbC41a+8zayuVxlo9CCPnX/vslt7S89iEzy4/7R/+MT7+Lhq2V5dbbO63Ftbwog/feDYdDt7e3R71eo9vt2tbWlkZRRC1NFkHWQDpACmQ/bBuVWUyaiN+Kk9oH2q3mO/Ky0HNn1p9sNxeaBpiBmpl3TlTNqouoqkmFoKp5XuT1NKlVFS5ffOXm54ui2EFIr17afudCLV1SM5mBity+fRuAzc1NVC1EkfN3dg+/9e1vf/ePMfssYXz9hzXQJKo/BTyKlovrZ7Y+fPXi1luryubOOeKqPBpKQiilLAMhBAwEw7x3RN9jFImPIhTR8TjPQghFvZY2s7wYpkmc' $Au3_Icon &= 'Ag5ARFBVuXHjBpVPqurTaDRMVRERQgjll776wp9YKP+KMP5a9NCsS7SBuHMgb2stt9+13FraXltubYegmkRRMh4POTwccdAbMy4CQTFDBBEDABMvYmnirNVIaC3UpVFP667WqFdmrRLfYA7MDIBWq0WaplQRIo5j8d6bVvDOxbV6fXV03C0BeYgBvyxx7R1prfbs2srym8+e6bxhtrwMjnt276Bv3UGOuYQ4bVCrJ1JVWtxEvxO0xBHIiiBVpbnbLexetysLidjmygKLCwsYzjATwACpQK/XY2VlBTNjZ2cHVTXvvYkgg3F2lI2z2+ByIEScjgRx23GSPvPU41d+BQE1zMqCnb197h2NxCeLttBeliiOmCUGDIIJFgIbzYh2IyUoqBrHo0LuHQ4ozMl37g1sqTaUrdWWJbW6haAChnOOPM/Z3d1lNBpRVX/CEJTIOxkOs2Mt8z4iAHa6ARdvVnzL+a3NnzfMVNEyz/z1Wzt2XHgWW+tUwkUV8tKYlQ81IZLA9nJMI40IaohAFAnLSxHeSm7sDWi0VuR4cMxLN/fl0maLxsICqlRUVldXOTg4IEkSOp2OVUAE1Iz+YLSHyAAYndZGE1yyAXqt1Wq/b3Vl6WxQC/lo4F5+dccK15Dmchs1yEpAHCAwEe+IKbm8GhN5T6mKEwGmwgAWFxdYHo7Y6fdoLDUZDz0vvnrI1S1lYXEJnRmuhANYBalozolT1dDt97+Chq+j+f6DDUh0Bh8/k9br7754buOng5oW2ci9fGNHxtRoLrbIgwEecw5sasAQRAPnVx3eC0UIE/FmxhxgwMZqm1G+T/d4SL3eoAzKizcPefycUG8soqqEEAxMzFARIcvL8fWbO18YH/c+DfICcPwgA4JZa2lp6b3XLp39kK8QQtBbd/ZlUIgttJakNFA8OIeZQ5hVPyhnm0Y9dpTBEMDMeBBMPGc6i/RvdRnnCVWTIMvHfPPWEU+c97iohpmad47jcda/u3Pw/MHh' $Au3_Icon &= '0b+Zll8GfREtd08bJSJ81DgeDO6WQYOBHh3uy04/M5c0RCaxEBSHmsNMUKBUo5Uo6w0hVwEzToOZQcW01uCR5ZQym2zqSRcbZyW39gdgATPEgLu7hy/v7+3+jWn5GUz/Hi1vAPagUaKGS65geqndbD2ZJnE8Hh3bzb0BuFgkignq0FnmMWaCIHElFzuO0jwOQ+bR+YFGaomHMJyumIvAp1RdirVmnaRWMxGcqwi2i9mrhGyHOe43gEQrLq698+wj6x9f77SvWYVefyjjgOBjwKMiGG4uXsBZydU1jyGoKhpK8iLHe08cJ4gID4aAAhZQA8GBj7Gi4Ob+gMuPREBCGUKJWQNYBASw08bpBbDVtZXWNQPLs6FVvV6QyHAROmuRChigCGjg0rIjdTqpYlHk3L5zl2rO4Tu39iZmDDCzCZnfT4gTmL8PnAMXczTIyPOAqlk1JJ73Sf2NOH9pZoIHGYiApXqjcQVMMXQ8GssoV8NFgngMhyLA1IgLGRfa0K4beZCJ2J3dXfa7Q6I4pV9E3D0YYmV2f/7n90RRTC1yWChQExAPPsJUORzkTjVYNaVuXLm0/UHEXcDXaqcZSBBZi6NoAwRMGWUlhkzE4zwgqBoGYIGzLWG1rmQlOIHjfo+j45z11RUKE6ivcHsYca+bI9j0d21OMMR5Uq9okaEA4k5YGTBMKVV1MBwfYhpVbJy+AuKaYJEZqAbpjQoQx5yCMTspG8ZG05Opm4kL9IYZucJOd0AZL4G4yQgQxTXAMO6PkAF5NqY/KjAXA8LcgGecl6JBEcH1+sd3QFpA68EGosbC7IfxNNqlZaWdCAem92Y0IuXiMuQB5EQUdNotttY7bK52OL+6yLWO8pObsLboCMr3nws2NZAFAZ8whZwY0aAoAoY16rVVIIAVD+5CpklVqcvVmHwFM1TVBTU5GRNwiBnLDcfVjpIHB6bMAbVaQqNeQ8RQVcBRmCGnHWYYWZ5jEoGraDoTP6WpEYKK91YV' $Au3_Icon &= 'pX1ld+/Ah6zonxYhFCsXGumqqk2fDDspCkanIVxbKRkHh6l+X09XNcoQKEolmKAnwgUDzO7fyKZKVgTwMYh7gEFsQtNw697BC6HIR4ic0oUEESQKqkFEHCYmjpMe5zAudCLGFoHp97dDQEQwZmbKchqPYZ9B/4DxoIdqeSJezQhlwTAvwaecQDiBiMwe8cvtxS0fpxfAWoB7QIQoQlm8/NIrNz9z7fLZ94vzSeycZaWJYDzxSB1MmW2q+0TrieAReZ6RF4FRHhgXSqEQJkl0PLadkiR+ZkIIoWCUGdRjmB/rJxQRvBfMQIwESEGSmQG930AY7+HS5/N8fCXPy6KeuiSNnR2Pc1mqJ5ONOywU78BsLjwfjRj0e5NO0s+UIH5aUV+HKJlm21fUkkwhwVAzBCiLgmCAiwG7n6b4yIub6VcsA7uO6Q4QHjRKFGg5rObzs/VasmiqZZr4qJrd7bGtBcnyAifzHIeg9LoH7B70GWoEyRIsLEzFu1nnMuaVRRjmBUupYgrihLIsURyIZ155nVIDjSRR50Sq9tx7+ZXrf46Gf8TKm4CdMguJz4uil+fFKIp80lxo2NZ6g+oZVQXmq9w9OuDmzhFaW4HFzrTSGNicU9hJsPMAmAIOwyjLAM7PzOr9xGgvpZhBvz/aE/HerMiA0WldSIGeqXZFJC6Dulq9ThmChBAwM0wVMxgOj7m730NrHVhYB+fAwikjtIAACGqAKjp7V1AD8QD3VZ5Q4H1kywux5EXQ732Ra7eab0I1AO40AyCupxpe2T/qf9P7yMTUiqKwk9YnMhnWDg+PyKUOjc682gg/EMJ8jzKFqoG4k8xjYUot6LQagikGriyDdnv9zyNyBJSnG9C8b0X2D3mpN9MkcveJB1SV7tE+B4MwFY8ADxEv833pBEwAM8bjMaNxBshcvJYQcpyPbKtTpyjNIufk7l73q1qMvoiVuwCnGRAgixvNKxe21t+VZVlpZq6izA4pBsd9dg5HkDZn' $Au3_Icon &= 'J2eYb9RTMPdn1GLBcJhN33WUCcQNCMWEUwMF2+st0RCsAkf94W7/ePAVzO4Ag1MNzNDcPrP+B2aBEALARLzBJDp7B10CHnwCIQct59l/iAlBaUSgBoJRBp2KdxHo7F3FiFaraZ0Fb3kRDCyr/pz8pyIbfRa4B+hpBhLAti9cfmahnjyd53kBRFYBwFSt1+vZOC8hSkHnFZsygCmg87zcvwSIMR2bDcyUrFSAaSFCCeWIWr1hV9YbMspKjSPnrt/e/fdsNPg7TL9xWnyYn2qkYL/ovVPVWVLNBGA4HNLrDzmz1rbVVsMIGRVtugoFWDE3MjMzp4HmRGSIQBXNybfOLC/BbGqgGFq93uCJc21GeaFR5P0oK3pl0Bugz6P57R+U0wgoN7fO/8Zyq/nRooJhEYZUsLIsqDqA1Bs1lpotW9IgiXfcORqJlSNwCfgIxE84H78FYHofCupRCfjJp8K9wz4BD24SQVtpt+XiRsOqTY2A6/aGt1+9c+8vLBSfI4RXgIzTQQSki43axzHVEILI/Eua9fsDd9TtXd/c2Iy9d49kQfP2YhotNWJ5dW/EMJusguBicBMTcwPCFKqYQCgDg1FGXhqIWpQmnD/Tpplig9EYAesNsnu37tz7S9Pw14Tsf4AeD0F0/tLlReekphoEEDAB0SzL5ODoqI/qn+0e9ZezUp9dbjbOJ/W0aRAurNUlK+vubndsw6zAilwQARy4+SqIlZShIGt2LIQgca1h651l1tt1iqKQ42EIceTdzn7v+b39/U+L889j4VtT8Q+HfOUbL3zq7Ob6J800VlWbfR3W3b193z06/EPEfwoXP+ai+BdWO+0PFEXIq/3wBjAwVGazd29U0q+YFYGghjFF7KDmApVGGQ2PbWOtI1WzIC8Vg1Bp94fdwau37+78KdhzaHgFLbpA4OEgwmzNmPR8RCZDVuj2elG3e/S5NIn/KMuLQyR+Ucv80zs7ey+BbVVinIjUVpcXL816O82613Zd' $Au3_Icon &= 'gMTEOQcCqIo4RlkpVRu2Uk129w8DneWxeO9v3N79l+pCnuVfxvRfCdkLwIDXAPnSf33tU+fOnvktEXNFUUi1af3e3sHXNRQfA746P0+p4eJlxJ9D5I3OR09fPnfml6vD5m6rubCdRC4FAUDNdDTOe977ej2NUjOjdzxgNBwVh73h3/ooGXrvk2w8esE0PI9Nus11oM9rhHzhi//xtpXV1c+msW92uz0ODw6fA/1t4Es8GDEu3kDcFRclP6Ua2nGcbMdxvI4hzossLdQvAeRFeS/Liv00jddUtej2Bs9pKP4TDYdgOdBD3C4h2wcCrx1M/8kn7j2Y/gxwM03Tz2RZdouHo4GLOuA2EGliNBGpY3qM8+uAoeV3MBvjXBucTJ5dfIcwGgIGlIDxOjAx8DrhgQioEdUjxCmmEQDlaDATGTPF+JRKv24Dbp71GX9M8L84Jo46QVTs6gAAAABJRU5ErkJggg==' Local $bString = _WinAPI_Base64Decode($Au3_Icon) If @error Then Return SetError(1, 0, 0) $bString = Binary($bString) If $bSaveBinary Then Local Const $hFile = FileOpen($sSavePath & "\au3-icon2.png", 18) If @error Then Return SetError(2, 0, $bString) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Au3_Icon Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode If you want to run in x64 mode please use AutoIt version 3.3.14.3 since the bug in function _GDIPlus_EffectCreate() has been fixed!
    2 points
  8. Hi outthere here is my script-stuff to create ownerdrawn menuitems with icons and colors. It uses GUIRegisterMsg() and WM_DRAWITEM / WM_MEASUREITEM - messages proceeding. Holger Update 06.05.2008: !!! Warning: Script breaking !!! Please change the following commands to: _TrayCreateItem(Text, ...) _TrayCreateMenu(Text , ...) - Fixed: some old values (thanks to aGorilla) - Fixed: ..SetText() functions (thanks to MrCreatoR) - Added the following commands: _SetMenuIconBkGrdColor(Color) ; set icon background gradient color _SetTrayIconBkGrdColor(Color) ; set icon background gradient color New sidebar menu commands: _CreateSideMenu(MenuID) ; returns a SideMenuID/index _DeleteSideMenu(SideMenuID) ; delete a menu sidebar _SetSideMenuText(SideMenuID, Text) ; set a text for the sidebar _SetSideMenuColor(SideMenuID, Color) ; set text color _SetSideMenuBkColor(SideMenuID, Color) ; set text background color _SetSideMenuBkGradColor(SideMenuID, Color) ; set text background gradient color _SetSideMenuImage(SideMenuID, Bitmapfile [, Resourcename/number [, Expand/Compress Bitmap]]) Just take a look into the samples how to use them! At the moment there are some known issues: - missing 64bit compatibility (already in progress, to fully work with "AutoIt3_x64.exe") - moving the mouse cursor on the sidebar menu image/text also changes the current menu item selection - for sidebar menu image only bitmaps are supported at the moment (min.8bpp) Update 23.03.2008: !!! Warning: Please update all your scripts and add after _TrayIconCreate() the command _TrayIconSetState() - otherwise you will not see any tray icons!!! Also update your icon numbers like for GUI icons - Fixed: some things (thanks to nickston) - Changed: _TrayIconCreate() do not show automatically the icon - Changed: icon behaviour now more similar to GUI icons (I hope) - Added: command.txt - Removed: unicode macro History: CODEUpdate 21.03.2008: - Changed: dynamic array sizing of the saved menu items - Added: _TrayDeleteItem(menuID), _GUICtrlODMenuItemDelete($nID) - please delete menu (items) with these commands - Added: _TrayIconSetState() modes 4 and 8 for flashing and flashstopping of tray icons - Added: _SetFlashTimeOut([timeOut]) to set the flash timeout - Added: OnEvent sample Update 23.02.2008: - Fixed: GDI object overload while using bold font Update 22.02.2008: - Added: _TrayItemSetSelIcon(ItemID, IconFile, IconID) - set the icon if the item is selected - Added: _GUICtrlODMenuItemSetIcon(ItemID, IconFile, IconID) - set the icon of the item - Added: _GUICtrlODMenuItemSetSelIcon(ItemID, IconFile, IconID) - set the icon if the item is selected - Added: "ModernMenuRaw.au3" which only includes the unknown constants, should better work with 'Au3Check' now Update 12.01.2008-2: - Fixed: Missing underscore in "CreateMenuFontByName"-function (Font fallback function) (thanks to MsCreatoR and GEOSoft). - Changed: If a menuitem is disabled then the rect only is showing around the item - Added: Underscore in menutext only showing when pressing "Alt"-key Update 12.01.2008: - Changed: 'local' Dll calls to global DllOpen to speedup (some virusscanners sometimes slowdown the process cause of opening these Dll's again and again) - Added: Using of @Tab for accelerator showing/drawing Update 07.12.2007: - Changed: all stuff in only 1 ZIP file - Fixed: now works with 3.2.10.0 and 3.2.8.1 Update 03.08.2007 - Fixed: error in _TrayIconDelete() and new creation - Added: additional parameter to _TrayIconCreate(ToolTip, IconFile, IconID, Callback, Msg, hIcon) to use existing icon handles - Added: sample_Win2Tray: 'moves' all minimized windows to the tray Update 28.07.2007 - Fixed: wrong call of function CreateFont() - Thanks to SleepyExtreme for info - Changed: included samples to demonstrate using of icon clicks Update 26.07.2007 - Fixed: missing function: LoadIcon() Update 21.07.2007 - added bold item support - limited to menuitems only, menus are not supported Update 17.07.2007: - now you can also menu icons for the tray - added commands for Tray: _TrayIconCreate() _TrayCreateMenu() _TrayCreateItem() _TrayItemSetIcon() _TrayIconSetState() _TrayTip() So you can have more than 1 tray icon for 1 Autoit3-script. Update 01.07.2007: - now works with unicode (3.2.4.9) - new command: _GUICtrlODMenuItemSetText(ControlID, NewText) Update 21.08.2006: - delete 1 line in libs to work with current release 3.2.0.X (error: cannot redeclare constant...) - Thanks to Javascript_Freek for info Update 02.02.2006: - added Checked-state for normal menu items and radio menu items - added a like ModernMenuLib-script for easier create/use these menustuff (see sample in the ModernMenuLib-folder) ModernMenuLib_with_Tray.zip
    1 point
  9. Hi everyone, I would like to share a simple snippet where I use for my hotkey script. I was searching for a solution whereby pressing a same key, I could have different outcome according to the way the key is being pressed. 1) Double tap/press fast (like double click the mouse) - outcome A 2) Long press or HOLD for awhile (2-4 sec) - outcome B #Include <Timers.au3> Global $interval_timer, $counter HotKeySet("{F10}", "_terminate") While 1 Sleep(10) WEnd Func _terminate() Local $itv_timer $itv_timer = _Timer_Diff($interval_timer) $interval_timer = _Timer_Init() ;ConsoleWrite($itv_timer & @CRLF) ;to review the timer difference so I can decide the range to capture double tap sequence If $itv_timer > 100 And $itv_timer < 250 Then $counter = 0 $interval_timer = _Timer_Init() MsgBox("","","double tap detected") Elseif $counter >= 25 Then $counter = 0 $interval_timer = _Timer_Init() MsgBox("","","long press detected") ElseIf $itv_timer < 50 Then $counter = $counter + 1 ConsoleWrite($counter & @CRLF) Else $counter = 0 EndIf EndFunc The trick here is to collect and use the frequency of the hotkey is called, and the time difference between each time the hotkey is being called. My coding style is not efficient and can be such a mess most of the time, any suggestion or better coding are welcome. I hope you find this one helpful.
    1 point
  10. BugFix version - 27 Dec 23 Fixed: No default value set for the MaxWidth parameter - took 12 years for someone to notice it! New UDF and new examples below and in zip. I just realised that although I have posted versions of this UDF many times in Help topics, I had never actually posted a "final" version here in Example scripts - better late than never, I suppose! StringSize takes a text string and calculates the size of label required to hold it as well as formatting the string to fit. Now AutoIt will, of course, size a label automatically to fit a text string, but it will not format the string in any way - what you use as the string is what you get in the label. If you do set any label sizes the text will be wrapped, but you can only determine the correct size of the label by trial and error. StringSize will, however, reformat the string to fit in a given width and tell you the required height so that you can read it all - whatever the font type or size - and you do not have to do the formatting beforehand. Here is a simple example to show what I mean (you need the UDF in the same folder for all the examples): And here is an example showing how StringSize can deal with different fonts and text sizes: You can see that the GUI is perfectly sized each time and that the button is always the right size and in the right place. StringSize returns an array which contains the formatted text to display and the size of the label needed to display it. All you need to do is to use the array elements when you create your label. Try changing the values in $aFont and $aSize if you want to try you own favourites - but beware, StringSize will return an error if you make the size so large that it cannot fit a word into the label width. NEW A more complex example showing how formatted and unformatted text can be sized correctly. The width of GUI holding the unformatted text varies randomly in width (the current value is displayed at top right): NEW And a final example showing how you can get your text in the largest possible font to fit in a given space: Finally here is the UDF itself: And all 5 files in zip format: StringSize.zip I hope you find this useful - I certainly do. M23
    1 point
  11. Windows Image Acquisition Object https://msdn.microsoft.com/en-us/library/windows/desktop/ms630826(v=vs.85).aspx#SharedSample011 The "WIA.Vector" COM Example posted earlier, Object example led me to other WIA COM Objects local $v $v = ObjCreate("WIA.vector") $v.Add(1) $v.Add(42) $v.Add(3) $v.Remove(1) $v.Remove(2) ConsoleWrite("$v(1) = " & $v(1) & @CRLF) $v.Clear $v.Add("This") $v.Add("Is") $v.Add("Cool") $v.Remove(1) $v.Remove(1) ConsoleWrite("$v(1) = " & $v(1) & @CRLF) Here are some quick and dirty examples I converted found on the net. Image Convert Format ; $lFormat = 2 ; 0 = BMP, 1 = GIF, 2 = JPEG, 3 = PNG, 4 = TIFF $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir WIA_ConvertImage($sInFile,$sOutFile, 4) Func WIA_ConvertImage($sInitialImage, _ $sOutputImage, _ $lFormat, _ $lQuality = 85) Select Case $lFormat = 0 $sFormatID = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}" $sExt = "BMP" Case $lFormat = 1 $sFormatID = "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}" $sExt = "GIF" Case $lFormat = 2 $sFormatID = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}" $sExt = "JPEG" Case $lFormat = 3 $sFormatID = "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}" $sExt = "PNG" Case $lFormat = 4 $sFormatID = "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}" $sExt = "TIFF" EndSelect If $lQuality > 100 Then $lQuality = 100 $oWIA = ObjCreate("WIA.ImageFile") $oIP = ObjCreate("WIA.ImageProcess") $oIP.Filters.Add ($oIP.FilterInfos("Convert").FilterID) $oIP.Filters(1).Properties("FormatID") = $sFormatID $oIP.Filters(1).Properties("Quality") = $lQuality $oWIA.LoadFile($sInitialImage) ; --- $oWIA = $oIP.Apply($oWIA) If FileExists($sOutputImage & "\OutFile." & $sExt) Then FileDelete($sOutputImage & "\OutFile." & $sExt) EndIf $oWIA.SaveFile ($sOutputImage & "\OutFile." & $sExt) ConsoleWrite("File Saved : " & $sOutputImage & "\OutFile." & $sExt & @CRLF) EndFunc Image Resize $sInFile = "C:\Temp\Test.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_ResizeImage($sInFile,$sOutFile,100,200) Func WIA_ResizeImage($sInitialImage, _ $sResizedImage, _ $lMaximumWidth, _ $lMaximumHeight) $oWIA = ObjCreate("WIA.ImageFile") $oIP = ObjCreate("WIA.ImageProcess") $oIP.Filters.Add ($oIP.FilterInfos("Scale").FilterID) $oIP.Filters(1).Properties("MaximumWidth") = $lMaximumWidth $oIP.Filters(1).Properties("MaximumHeight") = $lMaximumHeight $oWIA.LoadFile($sInitialImage) $oWIA = $oIP.Apply($oWIA) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $oWIA.SaveFile($sResizedImage) EndFunc Image File Properties local $Img = ObjCreate("WIA.ImageFile") ; $Img.LoadFile ( "C:\Temp\Plastiflex Logo New.jpg") $Img.LoadFile (@ScriptDir & "\Vector.bmp") local $s = "Width = " & $Img.Width & @CrLf _ & "Height = " & $Img.Height & @CrLf _ & "Depth = " & $Img.PixelDepth & @CrLf _ & "HorizontalResolution = " & $Img.HorizontalResolution & @CrLf _ & "VerticalResolution = " & $Img.VerticalResolution & @CrLf _ & "FrameCount = " & $Img.FrameCount & @CrLf ;ConsoleWrite($s & @CRLF) If $Img.IsIndexedPixelFormat then $s = $s & "Pixel data contains palette indexes" & @CrLf EndIf If $Img.IsAlphaPixelFormat then $s = $s & "Pixel data has alpha information" & @CrLf EndIf If $Img.IsExtendedPixelFormat then $s = $s & "Pixel data has extended color information (16 bit/channel)" & @CrLf EndIf If $Img.IsAnimated then $s = $s & "Image is animated" & @CrLf EndIf If $Img.Properties.Exists("40091") then $v = $Img.Properties("40091").Value $s = $s & "Title = " & $v & @CrLf EndIf If $Img.Properties.Exists("40092") then $v = $Img.Properties("40092").Value $s = $s & "Comment = " & $v & @CrLf EndIf If $Img.Properties.Exists("40093") then $v = $Img.Properties("40093").Value $s = $s & "Author = " & $v & @CrLf EndIf If $Img.Properties.Exists("40094") then $v = $Img.Properties("40094").Value $s = $s & "Keywords = " & $v & @CrLf EndIf If $Img.Properties.Exists("40095") then $v = $Img.Properties("40095").Value $s = $s & "Subject = " & $v & @CrLf EndIf ConsoleWrite($s & @CRLF) Local $IP = ObjCreate("WIA.ImageProcess") For $fi In $IP.FilterInfos $s = $fi.Name & @CRLF & _ "==================================================" & @CRLF & _ $fi.Description ConsoleWrite( $s & @CRLF) Next Image Rotate ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_RotateImage($sInFile,$sOutFile,90) Func WIA_RotateImage($sInitialImage,$sRotatedImage, $sDegrees) Local $Img = ObjCreate("WIA.ImageFile") Local $oIP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) $oIP.Filters.Add( $oIP.FilterInfos("RotateFlip").FilterID) $oIP.Filters(1).Properties("RotationAngle") = $sDegrees $Img = $oIP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sRotatedImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Crop $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_RotateCrop($sInFile,$sOutFile) Func WIA_RotateCrop($sInitialImage,$sRotatedImage) Local $Img = ObjCreate("WIA.ImageFile") Local $oIP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) $oIP.Filters.Add ($oIP.FilterInfos("Crop").FilterID) $oIP.Filters(1).Properties("Left") = ($Img.Width / 4) $oIP.Filters(1).Properties("Top") = ($Img.Height / 4) $oIP.Filters(1).Properties("Right") = ($Img.Width / 4) $oIP.Filters(1).Properties("Bottom") = ($Img.Height / 4) $Img = $oIP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sRotatedImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Stamp ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $sInFile = "C:\Temp\Logo.jpg" $sStamp = @ScriptDir & "\Test1.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_Imagestamp($sInFile,$sStamp,$sOutFile) Func WIA_Imagestamp($sInitialImage, _ $sThumbImage, _ $sStampedImage) $Img = ObjCreate("WIA.ImageFile") $Thumb = ObjCreate("WIA.ImageFile") $IP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) $Thumb.LoadFile($sThumbImage) $IP.Filters.Add($IP.FilterInfos("Stamp").FilterID) $IP.Filters(1).Properties("ImageFile") = $Thumb $IP.Filters(1).Properties("Left") = $Img.Width - $Thumb.Width $IP.Filters(1).Properties("Top") = $Img.Height - $Thumb.Height $Img.LoadFile($sInitialImage) $Img = $IP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sStampedImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Set Title ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ;https://msdn.microsoft.com/en-us/library/windows/desktop/ms630800(v=vs.85).aspx Const $VectorOfBytesImagePropertyType = 1101 $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_ImagesAddTitle($sInFile,$sOutFile) Func WIA_ImagesAddTitle($sInitialImage,$sOutImage) $Img = ObjCreate("WIA.ImageFile") $IP = ObjCreate("WIA.ImageProcess") $v = ObjCreate("WIA.Vector") $Img.LoadFile($sInitialImage) $IP.Filters.Add( $IP.FilterInfos("Exif").FilterID) $IP.Filters(1).Properties("ID") = 40091 $IP.Filters(1).Properties("Type") = $VectorOfBytesImagePropertyType $v.SetFromString( "This Title tag written by Windows Image Acquisition Library v2.0") $IP.Filters(1).Properties("Value") = $v $Img = $IP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sOutImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Convert II ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") Const $wiaFormatJPEG = "{B96B3CAE-0728-11D3-9D7B-0000F81EF32E}" Const $wiaFormatBMP = "{B96B3CAB-0728-11D3-9D7B-0000F81EF32E}" Const $wiaFormatPNG = "{B96B3CAF-0728-11D3-9D7B-0000F81EF32E}" Const $wiaFormatGIF = "{B96B3CB0-0728-11D3-9D7B-0000F81EF32E}" Const $wiaFormatTIFF = "{B96B3CB1-0728-11D3-9D7B-0000F81EF32E}" Local $sInFile = "C:\Temp\Vector.bmp" Local $sOutFile = @ScriptDir & "\Test.jpg" WIA_ImageConvertJPG($sInFile,$sOutFile,$wiaFormatJPEG) Func WIA_ImageConvertJPG($sInitialImage, _ $sImage, _ $wiaFormat) Local $Img = ObjCreate("WIA.ImageFile") Local $IP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) $IP.Filters.Add ($IP.FilterInfos("Convert").FilterID) $IP.Filters(1).Properties("FormatID").Value = $wiaFormat $IP.Filters(1).Properties("Quality").Value = 5 $Img = $IP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile ($sImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Variant ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") $sInFile = "C:\Temp\Logo.jpg" $sOutFile = @ScriptDir & "\Test.jpg" WIA_ImagesModified($sInFile,$sOutFile) Func WIA_ImagesModified($sInitialImage,$sOutImage) $Img = ObjCreate("WIA.ImageFile") $IP = ObjCreate("WIA.ImageProcess") $Img.LoadFile($sInitialImage) Local $v,$i,$IP $v = $Img.ARGBData For $i = 1 To $v.Count Step 21 $v($i) = 0xFFFF00FF ; opaque pink (A=255,R=255,G=0,B=255) Next $IP.Filters.Add($IP.FilterInfos("ARGB").FilterID) $IP.Filters(1).Properties("ARGBData") = $v $Img = $IP.Apply($Img) If FileExists($sOutFile) Then FileDelete($sOutFile) EndIf $Img.SaveFile($sOutImage) EndFunc Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Image Properties ; Initialize error handler $oMyError = ObjEvent("AutoIt.Error","MyErrFunc") ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms630800(v=vs.85).aspx Const $RationalImagePropertyType = 1006 Const $StringImagePropertyType = 1002 $sInFile = "C:\Temp\Logo.jpg" Local $Img = ObjCreate("WIA.ImageFile") $Img.LoadFile($sInFile) For $p In $Img.Properties $s = $p.Name & "(" & $p.PropertyID & ") = " If $p.IsVector Then $s = $s & "[vector data not emitted]" ElseIf $p.Type = $RationalImagePropertyType Then $s = $s & $p.Value.Numerator & "/" & $p.Value.Denominator ElseIf $p.Type = $StringImagePropertyType Then $s = $s & """" & $p.Value & """" Else $s = $s & $p.Value EndIf ConsoleWrite(@CRLF & $s & @CRLF & @CRLF) Next Func MyErrFunc() $HexNumber=hex($oMyError.number,8) Msgbox(0,"COM Error Test","We intercepted a COM Error !" & @CRLF & @CRLF & _ "err.description is: " & @TAB & $oMyError.description & @CRLF & _ "err.windescription:" & @TAB & $oMyError.windescription & @CRLF & _ "err.number is: " & @TAB & $HexNumber & @CRLF & _ "err.lastdllerror is: " & @TAB & $oMyError.lastdllerror & @CRLF & _ "err.scriptline is: " & @TAB & $oMyError.scriptline & @CRLF & _ "err.source is: " & @TAB & $oMyError.source & @CRLF & _ "err.helpfile is: " & @TAB & $oMyError.helpfile & @CRLF & _ "err.helpcontext is: " & @TAB & $oMyError.helpcontext _ ) SetError(1) ; to check for after this function returns Endfunc Enjoy ptrex
    1 point
  12. TheSaint

    DeleteIf Same

    Just a little program I whipped up a few days ago, that I thought some might appreciate. It uses hash checking to match source with destination, and if equal, deletes the source. It is pretty basic code, but does some nice tricky things ... including working by drag & drop for source and destination. NOTE - Source and Destination paths are never the same. The source file or folder must exist in the Destination folder. Essentially, I use this to clear folders on my transfer thumb drive ... thus making sure I have indeed backed up all. In reality, just a form of double-checking, because I do a lot of transfers between Netbook and Laptop and eventually external HDDs, using a thumb drive as the transfer medium ... between the PCs anyway. I keep multiple copies of everything ... and yes, even online (Google Drive) for smaller size content. Hopefully its basic usage should be self evident. Enjoy! WARNING - The process is an immediate one, when source is dragged & dropped on that input (providing Destination has already been set). There are no prompts. DeleteIf Same v1.1.zip 515.95 kB (148 downloads) (includes source, but not the icon which I got for myself as an online freebie) DeleteIf Same v1.2.zip 522.24 kB (159 downloads) (includes source) update detail at Post #4 DeleteIf Same v1.3.zip (includes source) update detail at Post #5 Older Screenshots P.S. I have belatedly realized (as is often the case) that I should have labelled the first input as, Destination Path To Compare Inside, and other as, Source To Delete If A Match Within Destination. Oh well, just a slight amendment to each, but does make things clearer.
    1 point
  13. yep. do it in a SAFE VM not connected to any other network assets. isolated, if you must. seems this user just wanted to infect others. another reason to not jump at the chance to do unpaid work. it's not false positive! it has hits on MS and MALEWARE Bytes as well. this was a nefarious post and the second poster was right that no help should be given seeing how his virus was thwarted at another site. this is a good lesson to learn early. and don't download anything binary. for me, if a user does anything like that, they are permanently ignored, no help ever offered, don't care about them anymore. can't be trusted.
    1 point
  14. oh my goodness, I just took the sample code from what he posted and not from the zip file, that's good you send it for virustotal, but I think it's false positive.. and I hope so..
    1 point
  15. he uploaded a binary imei.exe in a zip file I converted it to a txt file before uploading to virustotal
    1 point
  16. @Bilgus, the txt file uploaded by @adelbak you mean ?
    1 point
  17. Well being that his upload is a virus or at least a false positive and he had the source I doubt he will do much of any learning since it would have been just as easy to recompile it from source as convert to Autoit https://www.virustotal.com/#/file/8f65e7741f0c543f38a8e1f09f1fcf191babfabbc83c793a9f152c681f258471/detection
    1 point
  18. Well darn I guess I should have checked to see if someone else was doing it before I started and you did a full conversion too nice jowy $sImei = InputBox("test imei", "imei", 0) $aRet = calc_imei($sImei) If @error Then MsgBox(0, "error", "pos: " & @extended & " is invalid") Local $sOut = "" For $i = 0 To UBound($aRet) - 1 $sOut &= " " & Hex($aRet[$i], 2) Next MsgBox(0, "Hex Out", $sOut) Func calc_imei($s_Imei) Local Const $aInvalid[12] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] Local Const $aMask[12] = [0xAB, 0xA0, 0x6F, 0x2F, 0x1F, 0x1E, 0x9A, 0x45, 0x0, 0x0, 0x0, 0x0] Local $a_Imei = StringToASCIIArray($s_Imei, "") Local $a_Out = $aInvalid If Not IsArray($a_Imei) Or UBound($a_Imei) <> 15 Then Return SetError(1, 0, $aInvalid) ;wrong length $j = 0 For $i = 0 To UBound($a_Imei) - 1 Step 2 ; for (i=0, j=0; i < 15; i++, j++);; i++; If $a_Imei[$i] < Asc('0') Or $a_Imei[$i] > Asc('9') Then Return SetError(2, $i, $aInvalid) ;if (inp_imei[i] < '0' || inp_imei[i] > '9') $a_Out[$j] = $a_Imei[$i] - Asc('0') ;out_imei[j] = (inp_imei[i] - '0'); If $i < 14 Then ;if (i >= 14) break; If $a_Imei[$i + 1] < Asc('0') Or $a_Imei[$i + 1] > Asc('9') Then Return SetError(2, $i + 1, $aInvalid) $a_Out[$j] += BitShift($a_Imei[$i + 1] - Asc('0'), -4) ;out_imei[j] += ((inp_imei[i+1] - '0') << 4);left shift 4 $a_Out[$j] = BitXOR($a_Out[$j], $aMask[$j]) ;out_imei[j] = out_imei[j] ^ out_mask[j]; $j += 1 EndIf Next $a_Out[$j] = BitXOR($a_Out[$j], $aMask[$j]) ;out_imei[j] = out_imei[j] ^ out_mask[j]; $a_Out[8] = 0x57 ;out_imei[8] = 0x57; //????? ???? ? 0x0, ?? ?? ??? ?? ?????? $a_Out[9] = 0xDB ;out_imei[9] = 0xDB; //????? ???? ? 0x0, ?? ?? ??? ?? ?????? $a_Out[10] = 0 ;out_imei[10] = out_imei[11] = 0 $a_Out[11] = 0 ; ;simple checksum For $i = 0 To 9 Step 2 ;for (i = 0; i < 10; i++) $a_Out[10] += $a_Out[$i] ;;out_imei[10] += out_imei[i]; $a_Out[11] += $a_Out[$i + 1] ;if (i & 0x1); out_imei[11] += out_imei[i] Next Return $a_Out EndFunc
    1 point
  19. Local $aSize2 = _StringSize(" ", $iFontSize, $iWeight, 0, $sFontName) for $i = 0 to 3 $aSize[$i] += $aSize2[$i] Next I believe this would work as a workaround Reading through MSDN I found this https://msdn.microsoft.com/library/windows/desktop/bb761596 Under certain conditions, EM_GETRECT might not return the exact values that EM_SETRECT or EM_SETRECTNP set—it will be approximately correct, but it can be off by a few pixels. Rich Edit: Supported in Microsoft Rich Edit 1.0 and later. The formatting rectangle does not include the selection bar, which is an unmarked area to the left of each paragraph. When clicked, the selection bar selects the line. For information about the compatibility of rich edit versions with the various system versions, see About Rich Edit Controls.
    1 point
  20. Try: Local $hFileOpen = FileOpen("D:\Sample.txt", 2) FileWrite($hFileOpen, $sSearch & @CRLF) FileClose($hFileOpen)
    1 point
  21. See post #1 for the widget version.
    1 point
  22. Don't know, it works fine on my system, both Google sample I posted and @jdelaney sample. Can you test if the following works for you? #include <IE.au3> Local $oIE = _IECreate("https://www.google.co.nz") Local $oInput = _IEGetObjByName($oIE, "q") $oInput.Value = "k" MsgBox(0, "Google Search", "Google Search Filed Updated.", 1) ;~ For some reason IE needs to lose focus before being able to get access to ListBox items Local $oListBoxs = _IETagNameGetCollection($oIE, "ul") Local $sSearch = "" For $oListBox In $oListBoxs If $oListBox.getAttribute("role") = "listbox" Then $oListItems = _IETagNameGetCollection($oListBox, "div") For $oListItem In $oListItems If $oListItem.getAttribute("role") = "option" Then If $oListItem.GetAttribute("role") = "option" Then $sSearch &= StringStripWS($oListItem.Innertext, 7) & @CRLF EndIf Next EndIf Next MsgBox(32, "Search Items", $sSearch)
    1 point
  23. Today I want to share this little project made to check and notify the expiration of domain users password, in a Microsoft domain. Briefly, the script check users domain password expiration and takes actions. The script can work on multiple domain groups, taking different actions for every group, there is an .ini file with some options. Groups to be checked are defined in the .ini, and the groups must contain only users no other groups. The list of users of every group is obtained and if the password expiration in (remaining) days is matched (two possibilities) an email is sent. It can be a mail sent directly to the user (ini file : tomail=user) or it can be a mail sent to only one address (ini file : tomail=the@mail.it) (like domain admins...) and in this case the mail contains a report with the users approaching expiration. An operation log is always generated. In the ini (also the posted one) you can set to have no mail sent (for testing) and/or to have a GUI, but also the GUI is intended only for test, this script is scheduled on a server not logged in, so normally no GUI . Update 2018/03/16 : added switch to reset the password expiration, useful if you have for example an user (or 500) with psw expiration withing 3 days and you want to restore expiration within 90 days WITHOUT changing password. Used the way as advised by Microsoft (see the link), but with sth AD.au3 , the fantastic Active Directory UDF # First change the pwdlastset to 0 because Microsoft wants it this way $todouser.pwdLastSet = 0 Set-ADUser -Instance $todouser # Change the pwdlastset to the current date/time of the associate DC $todouser.pwdLastSet = -1 Set-ADUser -Instance $todouser Why you should act this way ? Big companies have strange policies listen to me ... The code: #Region ;**** Directives created by AutoIt3Wrapper_GUI **** #AutoIt3Wrapper_Icon=Icone\Faenza\117.ico #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI **** ; PEG ; Password Expiration Guardian ; (C) NSC 2018 ; check user domain password expiration and takes actions ; the script can work on multiple domain groups, taking differente actions for every group. ; the groups must contains only users no other groups ; the list of users of every group is obtained and if the password expiration in day is matched (two possibilities) an email is sent. ; It can be a mail sent directly to the user (ini file : tomail=user) ; or it can be a mail sent to only one address (ini file : tomail=the@mail.it) ; and in this case the mail contains a report with the users approaching expiration ; V.0.5 check based on one domain group ; V.1.0 ini file and check based on multiple domain groups ; V.1.5 ini file with general section to activate "test" GUI, and to enable disable mail send ; V.1.6 march 2018 italian "home made" translation of days and months in date ; V.1.7 added flag pwdLastSet to reset pass expiration - intended to use like a one time on/off switch to reset psw expiration #include <AD.au3> #include <File.au3> #include <GuiEdit.au3> #include <_zip.au3> #include <Date.au3> #include <Inet.au3> #include <GUIConstantsEx.au3> #include <GuiEdit.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <Debug.au3> Global $appname = "PEG", $appver = "V.1.7" Global $inifile = @ScriptDir & "\" & $appname & ".ini" Global $geleft = 5, $getop = 5, $gewidth = 790, $geheight = 540 Global $gollogcount = 0, $lastlog = "sicrlf", $cachelog = "", $guititle = "PEG " & $appver, $Gollogedit, $logfile = @ScriptDir & "\" & $appname & "_LOG_", $months2NOTzip = 3 Global $INIgroup, $INItomail, $INImailsubject, $INIsmpt, $INIfromname, $INIfromaddress, $INIdays1, $INIdays2, $INItosend, $arrayINIsections, $guiactive, $flagITA, $flagpwdLastSet ; START program GOLLOG(">>>>>> " & $appname & " " & $appver & " START >>>>>>") CFGctrl() If $guiactive = 1 Then GUI() $groupnumber = 0 While $groupnumber < $arrayINIsections[0] $groupnumber += 1 If $arrayINIsections[$groupnumber] <> "general" Then CFGload($arrayINIsections[$groupnumber]) loaduserS() EndIf WEnd If $guiactive = 1 Then While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE GOLLOG("<<<< STOP <<<<") Exit EndSwitch WEnd EndIf GOLLOG("<<<<<< PEG STOP <<<<<<<") Exit ;STOP program Func GUI() GUICreate($guititle, 800, 560, 100, 200, -1) GUISetBkColor(0x693F54) ; will change background color $Gollogedit = GUICtrlCreateEdit("", $geleft, $getop, $gewidth, $geheight, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_BORDER, $WS_VSCROLL)) GUICtrlSetBkColor(-1, 0xC7BBC1) GUICtrlSetData(-1, "" & @CRLF) GUICtrlSetFont(-1, 9, 800, 0, "consolas") GUICtrlSetColor(-1, 0x090608) GUISetState(@SW_SHOW) GOLLOG("PEG " & $appver & " gui STARTED") EndFunc ;==>GUI Func loaduserS() GOLLOG("workin on group: " & $INIgroup) Local $Nscad = 0 Dim $report[1] = ["Report:"] Local $singlereport = "" Local $usermail = "" Local $username = "" Local $datediff = "" Local $arrayuserpsw Local $iErr _AD_Open() $search1 = _AD_GetGroupMembers($INIgroup) ;$search1 = _AD_RecursiveGetGroupMembers($INIgroup); testing recursive .. in the future maybe If @error = 0 Then Local $conta1 = 0 While $search1[0] > $conta1 $conta1 += 1 $arrayuserpsw = _AD_GetPasswordInfo($search1[$conta1]) $datediff = _DateDiff("D", _NowCalc(), $arrayuserpsw[9]) GOLLOG("USER: " & $search1[$conta1]) GOLLOG("Password expires on: " & $arrayuserpsw[9] & " in " & $datediff & " days") If $datediff = $INIdays1 Or $datediff = $INIdays2 Then GOLLOG("expiration match !") If $INItomail = "user" Then ; this IF is relative to .ini file parameter TOSEND $usermail = _AD_GetObjectAttribute($search1[$conta1], "mail") GOLLOG("sending mail to: " & $usermail) If $flagITA = 1 Then $dataITA = dataITA($arrayuserpsw[9]) Else $dataITA = _DateTimeFormat($arrayuserpsw[9], 1) EndIf Dim $report[1] = ["La tua password scadra' " & $dataITA & ", entro " & $datediff & " giorni."] _ArrayAdd($report, "Modificala per tempo !") If $INItosend = 0 Then GOLLOG("Not sent mail " & $Nscad & ": ") GOLLOG("from :" & $INIfromname & " | " & $INIfromaddress) GOLLOG("to :" & $usermail & " | subject: " & $INImailsubject) Local $reporttext = _ArrayToString($report) GOLLOG("text :" & $reporttext) Else Local $iResponse = _INetSmtpMail($INIsmpt, $INIfromname, $INIfromaddress, $usermail, $INImailsubject, $report, "EHLO " & @ComputerName, "-1") ; perla pearl mail send HS smtp (ehlo required) $iErr = @error If $iResponse = 1 Then GOLLOG("Success! " & "Mail to user sent") Else GOLLOG("Error! " & "Mail failed with error code " & $iErr) EndIf EndIf Else $username = _AD_GetObjectAttribute($search1[$conta1], "displayname") _ArrayAdd($report, "USER: " & $username) _ArrayAdd($report, "Password expires on: " & $arrayuserpsw[9] & " in " & $datediff & " days") $Nscad += 1 If $flagpwdLastSet = 1 Then ; warning : auto pass set GOLLOG("Re-set password expiration for " & $search1[$conta1]) If _AD_ModifyAttribute($search1[$conta1], "pwdLastSet", "0") Then GOLLOG("pwdLastSet to 0 - OK") Else GOLLOG("pwdLastSet to 0 - ERROR " & @error) EndIf If _AD_ModifyAttribute($search1[$conta1], "pwdLastSet", "-1") Then GOLLOG("pwdLastSet to -1 - OK") Else GOLLOG("pwdLastSet to -1 - ERROR " & @error) EndIf EndIf EndIf EndIf WEnd If $Nscad > 0 And $INItomail <> "user" Then _ArrayAdd($report, $Nscad & " user passwords near expiration") If $INItosend = 0 Then GOLLOG("Not sent mail " & $Nscad & ": ") GOLLOG("from :" & $INIfromname & " | " & $INIfromaddress) GOLLOG("to :" & $INItomail & " | subject: " & $INImailsubject) Local $reporttext = _ArrayToString($report) GOLLOG("text :" & $reporttext) Else Local $iResponse = _INetSmtpMail($INIsmpt, $INIfromname, $INIfromaddress, $INItomail, $INImailsubject, $report, "EHLO " & @ComputerName, "-1") ; perla pearl mail send HS smtp (ehlo required) Local $iErr = @error If $iResponse = 1 Then GOLLOG("Success! " & "Mail sent") Else GOLLOG("Error! " & "Mail failed with error code " & $iErr) EndIf EndIf EndIf GOLLOG("checked n° " & $conta1 & " users") Else GOLLOG("error in user search " & @error) EndIf _AD_Close() EndFunc ;==>loaduserS Func dataITA($inputdate) ; Input date in the format "YYYY/MM/DD[ HH:MM:SS]", and translates Tuesday 8 May 2018 -> Martedì 8 maggio 2018 - perla pearl Local $stringaDATAita = _DateTimeFormat($inputdate, 1) Select Case StringInStr($stringaDATAita, "Monday") $stringaDATAita = StringReplace($stringaDATAita, "Monday", "lunedi'") Case StringInStr($stringaDATAita, "Tuesday") $stringaDATAita = StringReplace($stringaDATAita, "Tuesday", "martedi'") Case StringInStr($stringaDATAita, "Wednesday") $stringaDATAita = StringReplace($stringaDATAita, "Wednesday", "mercoledi'") Case StringInStr($stringaDATAita, "Thursday") $stringaDATAita = StringReplace($stringaDATAita, "Thursday", "giovedi'") Case StringInStr($stringaDATAita, "Friday") $stringaDATAita = StringReplace($stringaDATAita, "Friday", "venerdi'") Case StringInStr($stringaDATAita, "Saturday") $stringaDATAita = StringReplace($stringaDATAita, "Saturday", "sabato") Case StringInStr($stringaDATAita, "Sunday") $stringaDATAita = StringReplace($stringaDATAita, "Sunday", "Domenica") EndSelect Select Case StringInStr($stringaDATAita, "January") $stringaDATAita = StringReplace($stringaDATAita, "January", "gennaio") Case StringInStr($stringaDATAita, "February") $stringaDATAita = StringReplace($stringaDATAita, "February", "febbraio") Case StringInStr($stringaDATAita, "March") $stringaDATAita = StringReplace($stringaDATAita, "March", "marzo") Case StringInStr($stringaDATAita, "April") $stringaDATAita = StringReplace($stringaDATAita, "April", "aprile") Case StringInStr($stringaDATAita, "May") $stringaDATAita = StringReplace($stringaDATAita, "May", "maggio") Case StringInStr($stringaDATAita, "June") $stringaDATAita = StringReplace($stringaDATAita, "June", "giugno") Case StringInStr($stringaDATAita, "July") $stringaDATAita = StringReplace($stringaDATAita, "July", "luglio") Case StringInStr($stringaDATAita, "August") $stringaDATAita = StringReplace($stringaDATAita, "August", "agosto") Case StringInStr($stringaDATAita, "September") $stringaDATAita = StringReplace($stringaDATAita, "September", "settembre") Case StringInStr($stringaDATAita, "October") $stringaDATAita = StringReplace($stringaDATAita, "October", "ottobre") Case StringInStr($stringaDATAita, "November") $stringaDATAita = StringReplace($stringaDATAita, "November", "novembre") Case StringInStr($stringaDATAita, "December") $stringaDATAita = StringReplace($stringaDATAita, "December", "dicembre") EndSelect Return ($stringaDATAita) EndFunc ;==>dataITA Func GOLLOG($logtext) ; Gollog V.2.3 gestione CRLF si o no ; gestione a capo automatico oltre i xx caratteri; gestione pulitura ogni totmila char Perla pearl ; basta aggiungere |nocrlf50 a fine stringa, dove 50 sono gli xx caratteri, conta la prima riga dove si supera quel limite. ; to declare $gollogcount = 0,$lastlog="sicrlf",$cachelog="",$guititle = "nomegui",$Gollogedit,$logfile = @ScriptDir & "\GOLLOG_LOG_", $months2NOTzip = 3 ; e anche le misure dell'edit: $geleft = 32, $getop = 32, $gewidth = 553, $geheight = 377 ; #include <File.au3> #include <GuiEdit.au3> #include <_zip.au3> ; to insert FUNCs: GOLLOG CLEANEDIT GOLzipZIP $gollogcount += StringLen($logtext) ;Local $logfile = @ScriptDir & "\GOLLOG_LOG_" ; now global Local $logfiletimerange = @YEAR & @MON Local $linelimit = StringRight($logtext, 2) If StringRight($logtext, 9) = "|nocrlf" & $linelimit Then $logtext = StringTrimRight($logtext, 9) Local $acapo = "no" Else Local $acapo = "si" $gollogcount += 4 If $gollogcount > 13000 Then Sleep(3000) cleanedit() ; MsgBox(64, "debug", $conta) $gollogcount = 0 EndIf EndIf If $acapo = "no" And (StringLen($cachelog) <= $linelimit) Then ;pearl perla non a capo se If $lastlog = "nocrlf" Then If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, $logtext) EndIf Else If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, @MDAY & "/" & @MON & "_" & @HOUR & ":" & @MIN & " " & $logtext) EndIf EndIf $cachelog = $cachelog & $logtext $lastlog = "nocrlf" Else If $lastlog = "nocrlf" Then If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, $logtext & @CRLF) EndIf $cachelog = $cachelog & $logtext _FileWriteLog($logfile & $logfiletimerange & ".txt", $cachelog) $cachelog = "" Else If WinExists($guititle) Then ; per non scrivere in gui se questa non esiste _GUICtrlEdit_AppendText($Gollogedit, @MDAY & "/" & @MON & "_" & @HOUR & ":" & @MIN & " " & $logtext & @CRLF) EndIf _FileWriteLog($logfile & $logfiletimerange & ".txt", $logtext) EndIf $lastlog = "sicrlf" EndIf EndFunc ;==>GOLLOG Func cleanedit() ; cleaning of edit every n° lines (in program put if $nlines > xlines then this function) GUICtrlDelete($Gollogedit) $Gollogedit = GUICtrlCreateEdit("", $geleft, $getop, $gewidth, $geheight) ;, BitOR($ES_AUTOVSCROLL, $ES_AUTOHSCROLL, $ES_WANTRETURN, $WS_BORDER)) GUICtrlSetData(-1, "" & @CRLF) GUICtrlSetFont(-1, 9, 800, 0, "consolas") GUICtrlSetColor(-1, 0090608) GUICtrlSetBkColor(-1, 0xF0DAE5) GUICtrlSetCursor(-1, 3) EndFunc ;==>cleanedit Func GOLzipLOG($months2NOTzip) ; zipping old log leaving unzipped only n months GOLLOG("Starting old logs zipping..") ; path extraction zone Local $logfiletimerange = @YEAR & @MON Local $sDrive = "", $sDir = "", $sFileName = "", $sExtension = "" Local $arraylogpath = _PathSplit($logfile & $logfiletimerange & ".txt", $sDrive, $sDir, $sFileName, $sExtension) Local $logpath = $arraylogpath[1] & $arraylogpath[2] Local $hSearch = FileFindFirstFile($logfile & "*.txt") ; searching for logs Local $logconta = 0 While 1 ; single file processing cycle Local $sFileName = FileFindNextFile($hSearch) ; If there is no more file matching the search. If @error Then ExitLoop Local $stringtime = StringTrimRight(StringRight($sFileName, 10), 4) ;obtaining year-month like 201609 If $logfiletimerange - $stringtime > $months2NOTzip Then ;zipping If Not FileExists($logfile & ".zip") Then If Not _Zip_Create($logfile & ".zip", 1) Then GOLLOG("Error " & @error & " creating " & $logfile & ".zip") Else GOLLOG("Created new log archive: " & $logfile & ".zip") EndIf Else GOLLOG("adding to archive: " & $logfile & ".zip") EndIf If Not _zip_additem($logfile & ".zip", $logpath & $sFileName) Then GOLLOG("Error " & @error & " zipping: " & $logpath & $sFileName) Else GOLLOG("Added: " & $logpath & $sFileName) $logconta += 1 If Not FileDelete($logpath & $sFileName) Then GOLLOG("ERROR - Unable to DELETE log file " & $logpath & $sFileName) EndIf EndIf EndIf WEnd GOLLOG("Finished = " & $logconta & " log files zipped") EndFunc ;==>GOLzipLOG Func CFGctrl() ; check ini files and load section names GOLLOG("checkin' INI file..|nocrlf50") If FileExists($inifile) Then $guiactive = IniRead($inifile, "general", "GUI", "?") If $guiactive = "?" Then GOLLOG("INI incomplete, missing section 'general', value GUI") ExitwithError() EndIf $flagITA = IniRead($inifile, "general", "dataITA", "?") If $flagITA = "?" Then GOLLOG("INI incomplete, missing section 'general', value dataITA") ExitwithError() EndIf $flagpwdLastSet = IniRead($inifile, "general", "pwdLastSet", "?") If $flagpwdLastSet = "?" Then GOLLOG("INI incomplete, missing section 'general', value pwdLastSet") ExitwithError() EndIf GOLLOG("reading section names...|nocrlf50") $arrayINIsections = IniReadSectionNames($inifile) GOLLOG("N°" & $arrayINIsections[0] - 1 & " groups to process") Else $message1 = "error: no saved settings !?" GOLLOG($message1) ExitwithError() EndIf GOLLOG("..completed") EndFunc ;==>CFGctrl Func CFGload($section) ; load single ini file section values $INIgroup = IniRead($inifile, $section, "group", "?") $INItomail = IniRead($inifile, $section, "tomail", "?") $INItosend = IniRead($inifile, $section, "tosend", "?") $INIdays1 = IniRead($inifile, $section, "days1", "?") $INIdays2 = IniRead($inifile, $section, "days2", "?") $INImailsubject = IniRead($inifile, $section, "mailsubject", "?") $INIsmpt = IniRead($inifile, $section, "smtp", "?") $INIfromname = IniRead($inifile, $section, "fromname", "?") $INIfromaddress = IniRead($inifile, $section, "fromaddress", "?") EndFunc ;==>CFGload Func ExitwithError() GOLLOG("**********ERROR and STOP****************") Exit EndFunc ;==>ExitwithError The example .ini: [group1] group=G_IT_PASSWORD_MONITORED days1=5 days2=2 tomail=yourgroup@yourdomain.it ;tosend=user; send mails to the domain user mail address, otherwise send to specified address tosend=0 ;tosend ;1 send mails, 0 disable mails for testing mailsubject=Domain users going to expire passwords smtp=smtp.your.own.server fromname=Password Expiration Guardian fromaddress=PEG@NSC.it [group2] group=G_IT_PASSWORD_NOTIFIED days1=5 days2=2 tomail=user ;tosend=user; send mails to the domain user mail address, otherwise send to specified address tosend=0 ;tosend ;1 send mails, 0 disable mails for testing mailsubject=Password is expiring ! smtp=smtp.your.own.server fromname=Password Expiration Guardian fromaddress=PEG@NSC.it [general] GUI=1 ;1 gui ON for testing, 0 gui disabled dataITA = 1 ;1 translates datetime in italian, 0 for ENG pwdLastSet = 0 ;1 tries to reset the 'pwdLastSet' attribute (you must have permissions), 0 do nothing
    1 point
  24. HankHell

    MacroMakerGUI

    I know this is a common thing people seem to ask for on the forums. And I was bored so I made this for those that wish to make their own macros on the fly. #cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.14.2 Author: HankHell Script Function: Macro Maker 1.10 #ce ---------------------------------------------------------------------------- #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <GUIListBox.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <AutoItConstants.au3> #include <Misc.au3> #include <GUIListBox.au3> #include <GuiComboBox.au3> Global $Form1 Global $CoordFinderButton1 Global $CoordFinderButton2 Global $CoordFinderButton3 Global $CoordFinderButton4 Global $Create Global $State = 1 Global $FindCoords = 0 Global $SwapState = 0 ;--------------------- Global $GetStartStop Global $GetStartStopNew = "{F1}" ;F1 to toggle the macro on/off Global $GUIOpen Global $GUIOpenNew = "{HOME}" ;HOME opens the GUI back up Global $GetEnd Global $End_Program_New = "{END}" ;END (near Home, PageUp) to close the program ;--------------------- Global $LeftClickA = "" Global $LeftClickB = "" Global $LeftClickC = "" Global $LeftClickD = "" Global $RightClickA = "" Global $RightClickB = "" Global $RightClickC = "" Global $RightClickD = "" ;--------------------- Global $PressKeyA = "" Global $PressKeyB = "" Global $PressKeyC = "" Global $PressKeyD = "" ;--------------------- Global $KeysToSendA = "" Global $KeysToSendB = "" Global $KeysToSendC = "" Global $KeysToSendD = "" Global $SendKeysToSendA = "" Global $SendKeysToSendB = "" Global $SendKeysToSendC = "" Global $SendKeysToSendD = "" ;--------------------- Global $SleepTimeA = "" Global $SleepTimeB = "" Global $SleepTimeC = "" Global $SleepTimeD = "" Global $SleepySleepTimeA = 0 Global $SleepySleepTimeB = 0 Global $SleepySleepTimeC = 0 Global $SleepySleepTimeD = 0 ;--------------------- Global $LogKeysToSendA Global $LogKeysToSendB Global $LogKeysToSendC Global $LogKeysToSendD ;--------------------- Global $LogSleepTimeA Global $LogSleepTimeB Global $LogSleepTimeC Global $LogSleepTimeD ;--------------------- Global $LeftClickCheckA Global $LeftClickCheckB Global $LeftClickCheckC Global $LeftClickCheckD Global $RightClickCheckA Global $RightClickCheckB Global $RightClickCheckC Global $RightClickCheckD ;--------------------- Global $Hotkeys = 0 Global $ToggleButton Global $GUIButton Global $GetEndButton Global $LogGetStartStop Global $LogGUIOpen Global $LogGetEnd ;--------------------- Global $X_Y_Send1 = "" Global $X_Y_Send2 = "" Global $X_Y_Send3 = "" Global $X_Y_Send4 = "" Global $L1X = "" Global $L1Y = "" Global $L2X = "" Global $L2Y = "" Global $L3X = "" Global $L3Y = "" Global $L4X = "" Global $L4Y = "" Global $L1_X = "" Global $L1_Y = "" Global $L2_X = "" Global $L2_Y = "" Global $L3_X = "" Global $L3_Y = "" Global $L4_X = "" Global $L4_Y = "" Global $LogL1X = "" Global $LogL1Y = "" Global $LogL2X = "" Global $LogL2Y = "" Global $LogL3X = "" Global $LogL3Y = "" Global $LogL4X = "" Global $LogL4Y = "" ;--------------------- Global $Replace1 Global $Replace2 Global $Replace3 Global $Replace4 Global $Replace5 Global $Replace6 Global $Replace7 Global $Replace8 Global $Replace9 Global $Replace10 Global $With1 Global $With2 Global $With3 Global $With4 Global $With5 Global $With6 Global $With7 Global $With8 Global $With9 Global $With10 Global $GetWith1 Global $GetWith2 Global $GetWith3 Global $GetWith4 Global $GetWith5 Global $GetWith6 Global $GetWith7 Global $GetWith8 Global $GetWith9 Global $GetWith10 Global $LogReplace1 Global $LogReplace2 Global $LogReplace3 Global $LogReplace4 Global $LogReplace5 Global $LogReplace6 Global $LogReplace7 Global $LogReplace8 Global $LogReplace9 Global $LogReplace10 Global $LogWith1 Global $LogWith2 Global $LogWith3 Global $LogWith4 Global $LogWith5 Global $LogWith6 Global $LogWith7 Global $LogWith8 Global $LogWith9 Global $LogWith10 Global $ReplaceWithCLEAR1 Global $ReplaceWithCLEAR2 Global $ReplaceWithCLEAR3 Global $ReplaceWithCLEAR4 Global $ReplaceWithCLEAR5 Global $ReplaceWithCLEAR6 Global $ReplaceWithCLEAR7 Global $ReplaceWithCLEAR8 Global $ReplaceWithCLEAR9 Global $ReplaceWithCLEAR10 Global $GetReplace1 Global $GetReplace2 Global $GetReplace3 Global $GetReplace4 Global $GetReplace5 Global $GetReplace6 Global $GetReplace7 Global $GetReplace8 Global $GetReplace9 Global $GetReplace10 ;--------------------- Global $KeyToClick1 Global $KeyToClick2 Global $KeyToClick3 Global $Combo1 Global $Combo2 Global $Combo3 Global $ComboBoxLeftClick1 Global $ComboBoxLeftClick2 Global $ComboBoxLeftClick3 Global $ComboBoxLeftClick4 Global $ComboBoxLeftClick5 Global $ComboBoxRightClick1 Global $ComboBoxRightClick2 Global $ComboBoxRightClick3 Global $ComboBoxClick1 Global $ComboBoxClick2 Global $ComboBoxClick3 Global $ComboBoxClick4 Global $ComboBoxClick5 Global $LogKeyToClick1 Global $LogKeyToClick2 Global $LogKeyToClick3 Global $LogCombo1 Global $LogCombo2 Global $LogCombo3 Global $KeyClick1 Global $KeyClick2 Global $KeyClick3 Global $ComboBoxMiddleButton1 Global $ComboBoxMiddleButton2 Global $ComboBoxMiddleButton3 ;--------------------- Global $DisableKeys1 Global $DisableKeys2 Global $DisableKeys3 Global $DisableKeys4 Global $DisableKeys5 Global $DisableKeys6 Global $DisableKeys7 Global $DisableKeys8 Global $DisableKeys9 Global $DisableKeys10 Global $LogDisableKeys1 Global $LogDisableKeys2 Global $LogDisableKeys3 Global $LogDisableKeys4 Global $LogDisableKeys5 Global $LogDisableKeys6 Global $LogDisableKeys7 Global $LogDisableKeys8 Global $LogDisableKeys9 Global $LogDisableKeys10 Global $KeysDisable1 Global $KeysDisable2 Global $KeysDisable3 Global $KeysDisable4 Global $KeysDisable5 Global $KeysDisable6 Global $KeysDisable7 Global $KeysDisable8 Global $KeysDisable9 Global $KeysDisable10 ;--------------------- Global $ButtonSwap ;--------------------- Global $HelpTab1 MacroMakerGUI() Func MacroMakerGUI();------------------------------------------------------------------------------- MACRO MAKER MAIN GUI $Form1 = GUICreate("MacroMaker", 410, 688, 198, 124) GUICtrlCreateInput("", -1, -1, 1, 1) ;-------------------------------------------------------- Change Hotkeys GUICtrlCreateGroup("Change_Hotkeys", 0, 5, 185, 97) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateLabel("Start/Stop", 8, 25, 68, 17) $GetStartStop = GUICtrlCreateInput("", 80, 25, 95, 21) GUICtrlSetData($GetStartStop, "{F1}") $Change_Hotkeys_Help = GUICtrlCreateButton("?", 95, 5, 11, 15) GUICtrlCreateLabel("Open GUI", 8, 46, 68, 17) $GUIOpen = GUICtrlCreateInput("", 80, 46, 95, 21) GUICtrlSetData($GUIOpen, "{HOME}") GUICtrlCreateLabel("End Program", 8, 67, 68, 17) $GetEnd = GUICtrlCreateInput("", 80, 67, 95, 21) GUICtrlSetData($GetEnd, "{END}") ;-------------------------------------------------------- Change Hotkeys {END} ;-------------------------------------------------------- Create Macro GUICtrlCreateGroup("Create_Macro", 0, 105, 185, 580) GUICtrlCreateGroup("", -99, -90, 1, 1) $Create_Macro_Help = GUICtrlCreateButton("?", 80, 105, 11, 15) GUICtrlCreateLabel("X=", 5, 128, 17, 17) $L1X = GUICtrlCreateInput("", 23, 128, 40, 21) GUICtrlCreateLabel("Y=", 69, 128, 17, 17) $L1Y = GUICtrlCreateInput("", 87, 128, 40, 21) $LeftClickA = GUICtrlCreateCheckbox("Leftclick", 5, 152, 73, 17) $RightClickA = GUICtrlCreateCheckbox("Rightclick", 5, 176, 73, 17) GUICtrlCreateLabel("Keys", 5, 200, 30, 17) $KeysToSendA = GUICtrlCreateInput("", 35, 200, 100, 21) GUICtrlCreateLabel("Delay", 5, 221, 30, 17) $SleepTimeA = GUICtrlCreateInput("", 35, 221, 65, 21) GUICtrlCreateLabel("ms", 105, 221, 17, 17) $CoordFinderButton1 = GUICtrlCreateButton("Get" & @CRLF & "Coords", 141, 111, 45, 30, $BS_MULTILINE) GUICtrlCreateLabel("X=", 5, 255, 17, 17) GUICtrlCreateLabel("Y=", 69, 255, 17, 17) $L2X = GUICtrlCreateInput("", 23, 255, 40, 21) $L2Y = GUICtrlCreateInput("", 87, 255, 40, 21) $LeftClickB = GUICtrlCreateCheckbox("Leftclick", 5, 280, 73, 17) $RightClickB = GUICtrlCreateCheckbox("Rightclick", 5, 304, 73, 17) GUICtrlCreateLabel("Keys", 5, 328, 30, 17) $KeysToSendB = GUICtrlCreateInput("", 35, 328, 100, 21) GUICtrlCreateLabel("Delay", 5, 349, 30, 17) $SleepTimeB = GUICtrlCreateInput("", 35, 349, 65, 21) GUICtrlCreateLabel("ms", 105, 349, 17, 17) $CoordFinderButton2 = GUICtrlCreateButton("Get" & @CRLF & "Coords", 141, 237, 45, 30, $BS_MULTILINE) GUICtrlCreateLabel("X=", 5, 382, 17, 17) GUICtrlCreateLabel("Y=", 69, 382, 17, 17) $L3X = GUICtrlCreateInput("", 23, 382, 40, 21) $L3Y = GUICtrlCreateInput("", 87, 382, 40, 21) $LeftClickC = GUICtrlCreateCheckbox("Leftclick", 5, 408, 73, 17) $RightClickC = GUICtrlCreateCheckbox("Rightclick", 5, 432, 73, 17) GUICtrlCreateLabel("Keys", 5, 455, 30, 17) $KeysToSendC = GUICtrlCreateInput("", 35, 455, 100, 21) GUICtrlCreateLabel("Delay", 5, 476, 30, 17) $SleepTimeC = GUICtrlCreateInput("", 35, 476, 65, 21) GUICtrlCreateLabel("ms", 105, 476, 17, 17) $CoordFinderButton3 = GUICtrlCreateButton("Get" & @CRLF & "Coords", 141, 364, 45, 30, $BS_MULTILINE) GUICtrlCreateLabel("X=", 5, 509, 17, 17) GUICtrlCreateLabel("Y=", 69, 509, 17, 17) $L4X = GUICtrlCreateInput("", 23, 509, 40, 21) $L4Y = GUICtrlCreateInput("", 87, 509, 40, 21) $LeftClickD = GUICtrlCreateCheckbox("Leftclick", 5, 537, 73, 17) $RightClickD = GUICtrlCreateCheckbox("Rightclick", 5, 561, 73, 17) GUICtrlCreateLabel("Keys", 5, 585, 30, 17) $KeysToSendD = GUICtrlCreateInput("", 35, 585, 100, 21) GUICtrlCreateLabel("Delay", 5, 606, 30, 17) $SleepTimeD = GUICtrlCreateInput("", 35, 606, 65, 21) GUICtrlCreateLabel("ms", 105, 606, 17, 17) $CoordFinderButton4 = GUICtrlCreateButton("Get" & @CRLF & "Coords", 141, 490, 45, 30, $BS_MULTILINE) $Create = GUICtrlCreateButton("Create", 48, 650, 75, 25) $CreateMacroCLEARALL = GUICtrlCreateButton("Clear" & @CRLF & "All", 138, 650, 30, 25, $BS_MULTILINE) ;-------------------------------------------------------- Create Macro {END} ;-------------------------------------------------------- Reassign Keys GUICtrlCreateGroup("Reassign_Keys", 200, 392, 220, 293) GUICtrlCreateGroup("", -99, -99, 1, 1) $Reassign_Keys_Help = GUICtrlCreateButton("?", 287, 392, 11, 15) GUICtrlCreateLabel("Replace", 216, 417, 44, 17) $Replace1 = GUICtrlCreateInput("", 264, 417, 42, 21) GUICtrlCreateLabel("with", 312, 417, 23, 17) $With1 = GUICtrlCreateInput("", 338, 417, 42, 21) $ReplaceWithCLEAR1 = GUICtrlCreateButton("-", 385, 417, 15, 15) GUICtrlCreateLabel("Replace", 216, 438, 44, 17) $Replace2 = GUICtrlCreateInput("", 264, 438, 42, 21) GUICtrlCreateLabel("with", 312, 438, 23, 17) $With2 = GUICtrlCreateInput("", 338, 438, 42, 21) $ReplaceWithCLEAR2 = GUICtrlCreateButton("-", 385, 438, 15, 15) GUICtrlCreateLabel("Replace", 216, 459, 44, 17) $Replace3 = GUICtrlCreateInput("", 264, 459, 42, 21) GUICtrlCreateLabel("with", 312, 459, 23, 17) $With3 = GUICtrlCreateInput("", 338, 459, 42, 21) $ReplaceWithCLEAR3 = GUICtrlCreateButton("-", 385, 459, 15, 15) GUICtrlCreateLabel("Replace", 216, 480, 44, 17) $Replace4 = GUICtrlCreateInput("", 264, 480, 42, 21) GUICtrlCreateLabel("with", 312, 480, 23, 17) $With4 = GUICtrlCreateInput("", 338, 480, 42, 21) $ReplaceWithCLEAR4 = GUICtrlCreateButton("-", 385, 480, 15, 15) GUICtrlCreateLabel("Replace", 216, 501, 44, 17) $Replace5 = GUICtrlCreateInput("", 264, 501, 42, 21) GUICtrlCreateLabel("with", 312, 501, 23, 17) $With5 = GUICtrlCreateInput("", 338, 501, 42, 21) $ReplaceWithCLEAR5 = GUICtrlCreateButton("-", 385, 501, 15, 15) GUICtrlCreateLabel("Replace", 216, 522, 44, 17) $Replace6 = GUICtrlCreateInput("", 264, 522, 42, 21) GUICtrlCreateLabel("with", 312, 522, 23, 17) $With6 = GUICtrlCreateInput("", 338, 522, 42, 21) $ReplaceWithCLEAR6 = GUICtrlCreateButton("-", 385, 522, 15, 15) GUICtrlCreateLabel("Replace", 216, 543, 44, 17) $Replace7 = GUICtrlCreateInput("", 264, 543, 42, 21) GUICtrlCreateLabel("with", 312, 543, 23, 17) $With7 = GUICtrlCreateInput("", 338, 543, 42, 21) $ReplaceWithCLEAR7 = GUICtrlCreateButton("-", 385, 543, 15, 15) GUICtrlCreateLabel("Replace", 216, 564, 44, 17) $Replace8 = GUICtrlCreateInput("", 264, 564, 42, 21) GUICtrlCreateLabel("with", 312, 564, 23, 17) $With8 = GUICtrlCreateInput("", 338, 564, 42, 21) $ReplaceWithCLEAR8 = GUICtrlCreateButton("-", 385, 564, 15, 15) GUICtrlCreateLabel("Replace", 216, 585, 44, 17) $Replace9 = GUICtrlCreateInput("", 264, 585, 42, 21) GUICtrlCreateLabel("with", 312, 585, 23, 17) $With9 = GUICtrlCreateInput("", 338, 585, 42, 21) $ReplaceWithCLEAR9 = GUICtrlCreateButton("-", 385, 585, 15, 15) GUICtrlCreateLabel("Replace", 216, 606, 44, 17) $Replace10 = GUICtrlCreateInput("", 264, 606, 42, 21) GUICtrlCreateLabel("with", 312, 606, 23, 17) $With10 = GUICtrlCreateInput("", 338, 606, 42, 21) $ReplaceWithCLEAR10 = GUICtrlCreateButton("-", 385, 606, 15, 15) $ReplaceWithCLEARALL = GUICtrlCreateButton("Clear All", 350, 645, 50, 15) $HideMainGUI1 = GUICtrlCreateButton("Hide GUI", 350, 660, 50, 15) $ReplaceKeys = GUICtrlCreateButton("Replace Keys", 260, 650, 75, 25) ;-------------------------------------------------------- Reassign Keys {END} ;-------------------------------------------------------- Key Into Click GUICtrlCreateGroup("Key_Into_Click", 200, 245, 217, 143) GUICtrlCreateGroup("", -99, -99, 1, 1) $Key_Into_Click_Help = GUICtrlCreateButton("?", 285, 245, 11, 15) GUICtrlCreateLabel("Turn", 207, 268, 29, 17) $KeyToClick1 = GUICtrlCreateInput("", 236, 268, 42, 21) GUICtrlCreateLabel("into", 284, 268, 21, 17) $Combo1 = GUICtrlCreateCombo("", 305, 268, 76, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($Combo1, "Left Click|Right Click|Middle Button", "") $KeyComboCLEAR1 = GUICtrlCreateButton("-", 385, 268, 15, 15) GUICtrlCreateLabel("Turn", 207, 289, 29, 17) $KeyToClick2 = GUICtrlCreateInput("", 236, 289, 42, 21) GUICtrlCreateLabel("into", 284, 289, 21, 17) $Combo2 = GUICtrlCreateCombo("", 305, 289, 76, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($Combo2, "Left Click|Right Click|Middle Button", "") $KeyComboCLEAR2 = GUICtrlCreateButton("-", 385, 289, 15, 15) GUICtrlCreateLabel("Turn", 207, 310, 29, 17) $KeyToClick3 = GUICtrlCreateInput("", 236, 310, 42, 21) GUICtrlCreateLabel("into", 284, 310, 21, 17) $Combo3 = GUICtrlCreateCombo("", 305, 310, 76, 25, BitOR($CBS_DROPDOWN,$CBS_AUTOHSCROLL)) GUICtrlSetData($Combo3, "Left Click|Right Click|Middle Button", "") $KeyComboCLEAR3 = GUICtrlCreateButton("-", 385, 310, 15, 15) $ReplaceKeys2 = GUICtrlCreateButton("Replace Keys", 260, 347, 75, 25) $KeyClickCLEARALL = GUICtrlCreateButton("Clear All", 350, 342, 50, 15) $HideMainGUI2 = GUICtrlCreateButton("Hide GUI", 350, 357, 50, 15) ;-------------------------------------------------------- Key Into Click {END} ;-------------------------------------------------------- Disable Keys GUICtrlCreateGroup("Disable_Keys", 200, 62, 217, 180) GUICtrlCreateGroup("", -99, -99, 1, 1) $Disable_Keys_Help = GUICtrlCreateButton("?", 285, 62, 11, 15) $DisableKeys1 = GUICtrlCreateInput("", 236, 84, 42, 21) $DisableKeysCLEAR1 = GUICtrlCreateButton("-", 282, 84, 15, 15) $DisableKeys2 = GUICtrlCreateInput("", 330, 84, 42, 21) $DisableKeysCLEAR2 = GUICtrlCreateButton("-", 376, 84, 15, 15) $DisableKeys3 = GUICtrlCreateInput("", 236, 105, 42, 21) $DisableKeysCLEAR3 = GUICtrlCreateButton("-", 282, 105, 15, 15) $DisableKeys4 = GUICtrlCreateInput("", 330, 105, 42, 21) $DisableKeysCLEAR4 = GUICtrlCreateButton("-", 376, 105, 15, 15) $DisableKeys5 = GUICtrlCreateInput("", 236, 126, 42, 21) $DisableKeysCLEAR5 = GUICtrlCreateButton("-", 282, 126, 15, 15) $DisableKeys6 = GUICtrlCreateInput("", 330, 126, 42, 21) $DisableKeysCLEAR6 = GUICtrlCreateButton("-", 376, 126, 15, 15) $DisableKeys7 = GUICtrlCreateInput("", 236, 147, 42, 21) $DisableKeysCLEAR7 = GUICtrlCreateButton("-", 282, 147, 15, 15) $DisableKeys8 = GUICtrlCreateInput("", 330, 147, 42, 21) $DisableKeysCLEAR8 = GUICtrlCreateButton("-", 376, 147, 15, 15) $DisableKeys9 = GUICtrlCreateInput("", 236, 168, 42, 21) $DisableKeysCLEAR9 = GUICtrlCreateButton("-", 282, 168, 15, 15) $DisableKeys10 = GUICtrlCreateInput("", 330, 168, 42, 21) $DisableKeysCLEAR10 = GUICtrlCreateButton("-", 376, 168, 15, 15) $DisableKeys = GUICtrlCreateButton("Disable Keys", 260, 205, 75, 25) $DisableKeysCLEARALL = GUICtrlCreateButton("Clear All", 350, 200, 50, 15) $HideMainGUI3 = GUICtrlCreateButton("Hide GUI", 350, 215, 50, 15) ;-------------------------------------------------------- Disable Keys {END} ;-------------------------------------------------------- Swap Mouse Button GUICtrlCreateGroup("Swap_Mouse_Buttons", 200, 5, 217, 55) GUICtrlCreateGroup("", -99, -99, 1, 1) $ButtonSwap = GUICtrlCreateCheckbox("Swap Left and Right Buttons", 220, 25, 152, 21) ;-------------------------------------------------------- Swap Mouse Button {END} LogKeys() GUISetState(@SW_SHOW, $Form1) While $State = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE End() Case $GetStartStop $GetStartStopNew = ControlGetText("", "", $GetStartStop) $LogGetStartStop = ControlGetText("", "", $GetStartStop);LOG $ToggleButton = 1 Case $GUIOpen $GUIOpenNew = ControlGetText("", "", $GUIOpen) $LogGUIOpen = ControlGetText("", "", $GUIOpen);LOG $GUIButton = 1 Case $GetEnd $End_Program_New = ControlGetText("", "", $GetEnd) $LogGetEnd = ControlGetText("", "", $GetEnd);LOG $GetEndButton = 1 ;----------------------------------------------------------- Case $Change_Hotkeys_Help HelpTabs1() Case $Create_Macro_Help HelpTabs2() Case $Reassign_Keys_Help HelpTabs3() Case $Key_Into_Click_Help HelpTabs4() Case $Disable_Keys_Help HelpTabs5() ;----------------------------------------------------------- Case $L1X $X_Y_Send1 = 1 $L1_X = ControlGetText("", "", $L1X) $LogL1X = ControlGetText("", "", $L1X);LOG Case $L1Y $X_Y_Send1 = 1 $L1_Y = ControlGetText("", "", $L1Y) $LogL1Y = ControlGetText("", "", $L1Y);LOG Case $L2X $X_Y_Send2 = 1 $L2_X = ControlGetText("", "", $L2X) $LogL2X = ControlGetText("", "", $L2X);LOG Case $L2Y $X_Y_Send2 = 1 $L2_Y = ControlGetText("", "", $L2Y) $LogL2Y = ControlGetText("", "", $L2Y);LOG Case $L3X $X_Y_Send3 = 1 $L3_X = ControlGetText("", "", $L3X) $LogL3X = ControlGetText("", "", $L3X);LOG Case $L3Y $X_Y_Send3 = 1 $L3_Y = ControlGetText("", "", $L3Y) $LogL3Y = ControlGetText("", "", $L3Y);LOG Case $L4X $X_Y_Send4 = 1 $L4_X = ControlGetText("", "", $L4X) $LogL4X = ControlGetText("", "", $L4X);LOG Case $L4Y $X_Y_Send4 = 1 $L4_Y = ControlGetText("", "", $L4Y) $LogL4Y = ControlGetText("", "", $L4Y);LOG ;----------------------------------------------------------- Case $LeftClickA If GUICtrlRead($LeftClickA) = $GUI_CHECKED Then $LeftClickCheckA = 1 EndIf If GUICtrlRead($LeftClickA) = $GUI_UNCHECKED Then $LeftClickCheckA = 0 EndIf Case $LeftClickB If GUICtrlRead($LeftClickB) = $GUI_CHECKED Then $LeftClickCheckB = 1 EndIf If GUICtrlRead($LeftClickB) = $GUI_UNCHECKED Then $LeftClickCheckB = 0 EndIf Case $LeftClickC If GUICtrlRead($LeftClickC) = $GUI_CHECKED Then $LeftClickCheckC = 1 EndIf If GUICtrlRead($LeftClickC) = $GUI_UNCHECKED Then $LeftClickCheckC = 0 EndIf Case $LeftClickD If GUICtrlRead($LeftClickD) = $GUI_CHECKED Then $LeftClickCheckD = 1 EndIf If GUICtrlRead($LeftClickD) = $GUI_UNCHECKED Then $LeftClickCheckD = 0 EndIf ;----------------------------------------------------------- Case $RightClickA If GUICtrlRead($RightClickA) = $GUI_CHECKED Then $RightClickCheckA = 1 EndIf If GUICtrlRead($RightClickA) = $GUI_UNCHECKED Then $RightClickCheckA = 0 EndIf Case $RightClickB If GUICtrlRead($RightClickB) = $GUI_CHECKED Then $RightClickCheckB = 1 EndIf If GUICtrlRead($RightClickB) = $GUI_UNCHECKED Then $RightClickCheckB = 0 EndIf Case $RightClickC If GUICtrlRead($RightClickC) = $GUI_CHECKED Then $RightClickCheckC = 1 EndIf If GUICtrlRead($RightClickC) = $GUI_UNCHECKED Then $RightClickCheckC = 0 EndIf Case $RightClickD If GUICtrlRead($RightClickD) = $GUI_CHECKED Then $RightClickCheckD = 1 EndIf If GUICtrlRead($RightClickD) = $GUI_UNCHECKED Then $RightClickCheckD = 0 EndIf ;----------------------------------------------------------- Case $KeysToSendA $PressKeyA = 1 $SendKeysToSendA = ControlGetText("", "", $KeysToSendA) $LogKeysToSendA = ControlGetText("", "", $KeysToSendA);LOG Case $KeysToSendB $PressKeyB = 1 $SendKeysToSendB = ControlGetText("", "", $KeysToSendB) $LogKeysToSendB = ControlGetText("", "", $KeysToSendB);LOG Case $KeysToSendC $PressKeyC = 1 $SendKeysToSendC = ControlGetText("", "", $KeysToSendC) $LogKeysToSendC = ControlGetText("", "", $KeysToSendC);LOG Case $KeysToSendD $PressKeyD = 1 $SendKeysToSendD = ControlGetText("", "", $KeysToSendD) $LogKeysToSendD = ControlGetText("", "", $KeysToSendD);LOG ;----------------------------------------------------------- Case $SleepTimeA $SleepySleepTimeA = ControlGetText("", "", $SleepTimeA) $LogSleepTimeA = ControlGetText("", "", $SleepTimeA);LOG Case $SleepTimeB $SleepySleepTimeB = ControlGetText("", "", $SleepTimeB) $LogSleepTimeB = ControlGetText("", "", $SleepTimeB);LOG Case $SleepTimeC $SleepySleepTimeC = ControlGetText("", "", $SleepTimeC) $LogSleepTimeC = ControlGetText("", "", $SleepTimeC);LOG Case $SleepTimeD $SleepySleepTimeD = ControlGetText("", "", $SleepTimeD) $LogSleepTimeD = ControlGetText("", "", $SleepTimeD);LOG ;----------------------------------------------------------- Case $CoordFinderButton1 $X_Y_Send1 = 1 $FindCoords = 1 CoordFinder() Case $CoordFinderButton2 $X_Y_Send2 = 1 $FindCoords = 2 CoordFinder() Case $CoordFinderButton3 $X_Y_Send3 = 1 $FindCoords = 3 CoordFinder() Case $CoordFinderButton4 $X_Y_Send4 = 1 $FindCoords = 4 CoordFinder() Case $Create Sleep(100) GUISetState(@SW_HIDE, $Form1) Macro() Case $CreateMacroCLEARALL ClearAllMacroKeys() ;----------------------------------------------------------- Case $ReplaceWithCLEAR1 ClearKeys1() Case $ReplaceWithCLEAR2 ClearKeys2() Case $ReplaceWithCLEAR3 ClearKeys3() Case $ReplaceWithCLEAR4 ClearKeys4() Case $ReplaceWithCLEAR5 ClearKeys5() Case $ReplaceWithCLEAR6 ClearKeys6() Case $ReplaceWithCLEAR7 ClearKeys7() Case $ReplaceWithCLEAR8 ClearKeys8() Case $ReplaceWithCLEAR9 ClearKeys9() Case $ReplaceWithCLEAR10 ClearKeys10() Case $ReplaceWithCLEARALL ClearKeysALL() ;----------------------------------------------------------- Case $KeyComboCLEAR1 KeyClickCLEAR1() Case $KeyComboCLEAR2 KeyClickCLEAR2() Case $KeyComboCLEAR3 KeyClickCLEAR3() Case $KeyClickCLEARALL KeyClickCLEARALL() ;----------------------------------------------------------- Case $DisableKeysCLEAR1 DisableKeysCLEAR1() Case $DisableKeysCLEAR2 DisableKeysCLEAR2() Case $DisableKeysCLEAR3 DisableKeysCLEAR3() Case $DisableKeysCLEAR4 DisableKeysCLEAR4() Case $DisableKeysCLEAR5 DisableKeysCLEAR5() Case $DisableKeysCLEAR6 DisableKeysCLEAR6() Case $DisableKeysCLEAR7 DisableKeysCLEAR7() Case $DisableKeysCLEAR8 DisableKeysCLEAR8() Case $DisableKeysCLEAR9 DisableKeysCLEAR9() Case $DisableKeysCLEAR10 DisableKeysCLEAR10() Case $DisableKeysCLEARALL DisableKeysCLEARALL() ;----------------------------------------------------------- Case $ReplaceKeys ReplaceKeys() ReassignKeysNotification() Case $ReplaceKeys2 KeyIntoClick() ReassignKeysNotification() Case $DisableKeys DisableKeys() DisableKeysNotification() Case $HideMainGUI1 HideMacroMakerGUI() Case $HideMainGUI2 HideMacroMakerGUI() Case $HideMainGUI3 HideMacroMakerGUI() Case $ButtonSwap MouseClickSwap() If GUICtrlRead($ButtonSwap) = $GUI_CHECKED Then $SwapState = 1 EndIf If GUICtrlRead($ButtonSwap) = $GUI_UNCHECKED Then $SwapState = 0 EndIf MouseClickSwap() EndSwitch WEnd EndFunc ;------------------------------------------------------------------------------- MACRO MAKER MAIN GUI {END} Func Macro();------------------------------------------------------------------------------- CREATE MACRO $Hotkeys = 1 Hotkeys() Global $ToggleState Global $Toggle = True If $Toggle = False Then $ToggleState = True Else $ToggleState = False EndIf EndFunc Func Toggle() $ToggleState = NOT $ToggleState While $ToggleState If $LogL1X = "" Then $X_Y_Send1 = 0 EndIf If $LogL1Y = "" Then $X_Y_Send1 = 0 EndIf If $X_Y_Send1 = 1 Then MouseMove($L1_X, $L1_Y, 10) EndIf If $LeftClickCheckA = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $RightClickCheckA = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $PressKeyA = 1 Then Send($SendKeysToSendA) EndIf Sleep($SleepySleepTimeA) ;------------------------------ If $LogL2X = "" Then $X_Y_Send2 = 0 EndIf If $LogL2Y = "" Then $X_Y_Send2 = 0 EndIf If $X_Y_Send2 = 1 Then MouseMove($L2_X, $L2_Y, 10) EndIf If $LeftClickCheckB = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $RightClickCheckB = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $PressKeyB = 1 Then Send($SendKeysToSendB) EndIf Sleep($SleepySleepTimeB) ;------------------------------ If $LogL3X = "" Then $X_Y_Send3 = 0 EndIf If $LogL3Y = "" Then $X_Y_Send3 = 0 EndIf If $X_Y_Send3 = 1 Then MouseMove($L3_X, $L3_Y, 10) EndIf If $LeftClickCheckC = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $RightClickCheckC = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $PressKeyC = 1 Then Send($SendKeysToSendC) EndIf Sleep($SleepySleepTimeC) ;------------------------------ If $LogL4X = "" Then $X_Y_Send4 = 0 EndIf If $LogL4Y = "" Then $X_Y_Send4 = 0 EndIf If $X_Y_Send4 = 1 Then MouseMove($L4_X, $L4_Y, 10) EndIf If $LeftClickCheckD = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $RightClickCheckD = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $PressKeyD = 1 Then Send($SendKeysToSendD) EndIf Sleep($SleepySleepTimeD) ;------------------------------ If Not $ToggleState Then Sleep(100) EndIf WEnd EndFunc Func ClearAllMacroKeys() $SleepySleepTimeA = 0 $SendKeysToSendA = "" $PressKeyA = "" $LogL1X = "" $LogL1Y = "" $LeftClickCheckA = 0 $RightClickCheckA = 0 $LogKeysToSendA = "" $LogSleepTimeA = "" GUICtrlSetData($L1X, "") GUICtrlSetData($L1Y, "") GUICtrlSetState($LeftClickA, $GUI_UNCHECKED) GUICtrlSetState($RightClickA, $GUI_UNCHECKED) GUICtrlSetData($KeysToSendA, "") GUICtrlSetData($SleepTimeA, "") ;-------------------------------- $SleepySleepTimeB = 0 $SendKeysToSendB = "" $PressKeyB = "" $LogL2X = "" $LogL2Y = "" $LeftClickCheckB = 0 $RightClickCheckB = 0 $LogKeysToSendB = "" $LogSleepTimeB = "" GUICtrlSetData($L2X, "") GUICtrlSetData($L2Y, "") GUICtrlSetState($LeftClickB, $GUI_UNCHECKED) GUICtrlSetState($RightClickB, $GUI_UNCHECKED) GUICtrlSetData($KeysToSendB, "") GUICtrlSetData($SleepTimeB, "") ;-------------------------------- $SleepySleepTimeC = 0 $SendKeysToSendC = "" $PressKeyC = "" $LogL3X = "" $LogL3Y = "" $LeftClickCheckC = 0 $RightClickCheckC = 0 $LogKeysToSendC = "" $LogSleepTimeC = "" GUICtrlSetData($L3X, "") GUICtrlSetData($L3Y, "") GUICtrlSetState($LeftClickC, $GUI_UNCHECKED) GUICtrlSetState($RightClickC, $GUI_UNCHECKED) GUICtrlSetData($KeysToSendC, "") GUICtrlSetData($SleepTimeC, "") ;-------------------------------- $SleepySleepTimeD = 0 $SendKeysToSendD = "" $PressKeyD = "" $LogL4X = "" $LogL4Y = "" $LeftClickCheckD = 0 $RightClickCheckD = 0 $LogKeysToSendD = "" $LogSleepTimeD = "" GUICtrlSetData($L4X, "") GUICtrlSetData($L4Y, "") GUICtrlSetState($LeftClickD, $GUI_UNCHECKED) GUICtrlSetState($RightClickD, $GUI_UNCHECKED) GUICtrlSetData($KeysToSendD, "") GUICtrlSetData($SleepTimeD, "") EndFunc Func OpenGUI() $Hotkeys = 0 Hotkeys() MacroMakerGUI() EndFunc ;------------------------------------------------------------------------------- CREATE MACRO {END} Func CoordFinder();------------------------------------------------------------------------------- COORD FINDER HotKeySet($GetStartStopNew, "EndCoordFinder") Global $FindCoordsState $FindCoordsState = 1 While $FindCoordsState = 1 Sleep(50) Get_Mouse_Pos() WEnd EndFunc Func Get_Mouse_Pos() $Mpos = MouseGetPos() $Mpos_x = $Mpos[0] $Mpos_y = $Mpos[1] If $FindCoords = 1 Then GUICtrlSetData($L1X, $Mpos_x) GUICtrlSetData($L1Y, $Mpos_y) $LogL1X = ControlGetText("", "", $L1X);LOG $LogL1Y = ControlGetText("", "", $L1Y);LOG $L1_X = ControlGetText("", "", $L1X) $L1_Y = ControlGetText("", "", $L1Y) EndIf If $FindCoords = 2 Then GUICtrlSetData($L2X, $Mpos_x) GUICtrlSetData($L2Y, $Mpos_y) $LogL2X = ControlGetText("", "", $L2X);LOG $LogL2Y = ControlGetText("", "", $L2Y);LOG $L2_X = ControlGetText("", "", $L2X) $L2_Y = ControlGetText("", "", $L2Y) EndIf If $FindCoords = 3 Then GUICtrlSetData($L3X, $Mpos_x) GUICtrlSetData($L3Y, $Mpos_y) $LogL3X = ControlGetText("", "", $L3X);LOG $LogL3Y = ControlGetText("", "", $L3Y);LOG $L3_X = ControlGetText("", "", $L3X) $L3_Y = ControlGetText("", "", $L3Y) EndIf If $FindCoords = 4 Then GUICtrlSetData($L4X, $Mpos_x) GUICtrlSetData($L4Y, $Mpos_y) $LogL4X = ControlGetText("", "", $L4X);LOG $LogL4Y = ControlGetText("", "", $L4Y);LOG $L4_X = ControlGetText("", "", $L4X) $L4_Y = ControlGetText("", "", $L4Y) EndIf EndFunc Func EndCoordFinder() $FindCoordsState = 0 $FindCoords = 0 Hotkeys() LogKeys() EndFunc ;------------------------------------------------------------------------------- COORD FINDER {END} Func MouseClickSwap();---------------------------------------------------- MOUSE CLICK SWAP DllCall("user32.dll", "int", "SwapMouseButton", "int", $SwapState) EndFunc ;---------------------------------------------------- MOUSE CLICK SWAP {END} Func DisableKeys();------------------------------------------------------------------------------- DISABLE KEYS $KeysDisable1 = ControlGetText("", "", $DisableKeys1) $LogDisableKeys1 = ControlGetText("", "", $DisableKeys1);LOG HotKeySet($KeysDisable1, "BlankKey") $KeysDisable2 = ControlGetText("", "", $DisableKeys2) $LogDisableKeys2 = ControlGetText("", "", $DisableKeys2);LOG HotKeySet($KeysDisable2, "BlankKey") $KeysDisable3 = ControlGetText("", "", $DisableKeys3) $LogDisableKeys3 = ControlGetText("", "", $DisableKeys3);LOG HotKeySet($KeysDisable3, "BlankKey") $KeysDisable4 = ControlGetText("", "", $DisableKeys4) $LogDisableKeys4 = ControlGetText("", "", $DisableKeys4);LOG HotKeySet($KeysDisable4, "BlankKey") $KeysDisable5 = ControlGetText("", "", $DisableKeys5) $LogDisableKeys5 = ControlGetText("", "", $DisableKeys5);LOG HotKeySet($KeysDisable5, "BlankKey") $KeysDisable6 = ControlGetText("", "", $DisableKeys6) $LogDisableKeys6 = ControlGetText("", "", $DisableKeys6);LOG HotKeySet($KeysDisable6, "BlankKey") $KeysDisable7 = ControlGetText("", "", $DisableKeys7) $LogDisableKeys7 = ControlGetText("", "", $DisableKeys7);LOG HotKeySet($KeysDisable7, "BlankKey") $KeysDisable8 = ControlGetText("", "", $DisableKeys8) $LogDisableKeys8 = ControlGetText("", "", $DisableKeys8);LOG HotKeySet($KeysDisable8, "BlankKey") $KeysDisable9 = ControlGetText("", "", $DisableKeys9) $LogDisableKeys9 = ControlGetText("", "", $DisableKeys9);LOG HotKeySet($KeysDisable9, "BlankKey") $KeysDisable10 = ControlGetText("", "", $DisableKeys10) $LogDisableKeys10 = ControlGetText("", "", $DisableKeys10);LOG HotKeySet($KeysDisable10, "BlankKey") EndFunc Func BlankKey() Send("") EndFunc Func DisableKeysCLEAR1() $LogDisableKeys1 = "" GUICtrlSetData($DisableKeys1, "") HotKeySet($KeysDisable1) EndFunc Func DisableKeysCLEAR2() $LogDisableKeys2 = "" GUICtrlSetData($DisableKeys2, "") HotKeySet($KeysDisable2) EndFunc Func DisableKeysCLEAR3() $LogDisableKeys3 = "" GUICtrlSetData($DisableKeys3, "") HotKeySet($KeysDisable3) EndFunc Func DisableKeysCLEAR4() $LogDisableKeys4 = "" GUICtrlSetData($DisableKeys4, "") HotKeySet($KeysDisable4) EndFunc Func DisableKeysCLEAR5() $LogDisableKeys5 = "" GUICtrlSetData($DisableKeys5, "") HotKeySet($KeysDisable5) EndFunc Func DisableKeysCLEAR6() $LogDisableKeys6 = "" GUICtrlSetData($DisableKeys6, "") HotKeySet($KeysDisable6) EndFunc Func DisableKeysCLEAR7() $LogDisableKeys7 = "" GUICtrlSetData($DisableKeys7, "") HotKeySet($KeysDisable7) EndFunc Func DisableKeysCLEAR8() $LogDisableKeys8 = "" GUICtrlSetData($DisableKeys8, "") HotKeySet($KeysDisable8) EndFunc Func DisableKeysCLEAR9() $LogDisableKeys9 = "" GUICtrlSetData($DisableKeys9, "") HotKeySet($KeysDisable9) EndFunc Func DisableKeysCLEAR10() $LogDisableKeys10 = "" GUICtrlSetData($DisableKeys10, "") HotKeySet($KeysDisable10) EndFunc Func DisableKeysCLEARALL() DisableKeysCLEAR1() DisableKeysCLEAR2() DisableKeysCLEAR3() DisableKeysCLEAR4() DisableKeysCLEAR5() DisableKeysCLEAR6() DisableKeysCLEAR7() DisableKeysCLEAR8() DisableKeysCLEAR9() DisableKeysCLEAR10() EndFunc Func DisableKeysNotification() MsgBox($MB_SYSTEMMODAL, "Info", "Keys Disabled") EndFunc ;------------------------------------------------------------------------------- DISABLE KEYS {END} Func KeyIntoClick();------------------------------------------------------------------------------- KEY INTO CLICK $KeyClick1 = ControlGetText("", "", $KeyToClick1) HotKeySet($KeyClick1, "ReplaceKeyClick1") $KeyClick2 = ControlGetText("", "", $KeyToClick2) HotKeySet($KeyClick2, "ReplaceKeyClick2") $KeyClick3 = ControlGetText("", "", $KeyToClick3) HotKeySet($KeyClick3, "ReplaceKeyClick3") $ComboBoxClick1 = ControlGetText("", "", $Combo1) $LogCombo1 = ControlGetText("", "", $Combo1);LOG $LogKeyToClick1 = ControlGetText("", "", $KeyToClick1);LOG If $ComboBoxClick1 = "Left Click" Then $ComboBoxLeftClick1 = 1 Else $ComboBoxLeftClick1 = 0 EndIf If $ComboBoxClick1 = "Right Click" Then $ComboBoxRightClick1 = 1 Else $ComboBoxRightClick1 = 0 EndIf If $ComboBoxClick1 = "Middle Button" Then $ComboBoxMiddleButton1 = 1 Else $ComboBoxMiddleButton1 = 0 EndIf $ComboBoxClick2 = ControlGetText("", "", $Combo2) $LogCombo2 = ControlGetText("", "", $Combo2);LOG $LogKeyToClick2 = ControlGetText("", "", $KeyToClick2);LOG If $ComboBoxClick2 = "Left Click" Then $ComboBoxLeftClick2 = 1 Else $ComboBoxLeftClick2 = 0 EndIf If $ComboBoxClick2 = "Right Click" Then $ComboBoxRightClick2 = 1 Else $ComboBoxRightClick2 = 0 EndIf If $ComboBoxClick2 = "Middle Button" Then $ComboBoxMiddleButton2 = 1 Else $ComboBoxMiddleButton2 = 0 EndIf $ComboBoxClick3 = ControlGetText("", "", $Combo3) $LogCombo3 = ControlGetText("", "", $Combo3);LOG $LogKeyToClick3 = ControlGetText("", "", $KeyToClick3);LOG If $ComboBoxClick3 = "Left Click" Then $ComboBoxLeftClick3 = 1 Else $ComboBoxLeftClick3 = 0 EndIf If $ComboBoxClick5 = "Right Click" Then $ComboBoxRightClick3 = 1 Else $ComboBoxRightClick3 = 0 EndIf If $ComboBoxClick3 = "Middle Button" Then $ComboBoxMiddleButton3 = 1 Else $ComboBoxMiddleButton3 = 0 EndIf EndFunc Func ReplaceKeyClick1() If $ComboBoxLeftClick1 = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $ComboBoxRightClick1 = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $ComboBoxMiddleButton1 = 1 Then MouseClick($MOUSE_CLICK_MIDDLE) EndIf EndFunc Func ReplaceKeyClick2() If $ComboBoxLeftClick2 = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $ComboBoxRightClick2 = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $ComboBoxMiddleButton2 = 1 Then MouseClick($MOUSE_CLICK_MIDDLE) EndIf EndFunc Func ReplaceKeyClick3() If $ComboBoxLeftClick3 = 1 Then MouseClick($MOUSE_CLICK_PRIMARY) EndIf If $ComboBoxRightClick3 = 1 Then MouseClick($MOUSE_CLICK_SECONDARY) EndIf If $ComboBoxMiddleButton3 = 1 Then MouseClick($MOUSE_CLICK_MIDDLE) EndIf EndFunc Func KeyClickCLEAR1() $LogCombo1 = "" $LogKeyToClick1 = "" GUICtrlSetData($Combo1, "") GUICtrlSetData($KeyToClick1, "") GUICtrlSetData($Combo1, "Left Click|Right Click|Middle Button", "") HotKeySet($KeyClick1) EndFunc Func KeyClickCLEAR2() $LogCombo2 = "" $LogKeyToClick2 = "" GUICtrlSetData($Combo2, "") GUICtrlSetData($KeyToClick2, "") GUICtrlSetData($Combo2, "Left Click|Right Click|Middle Button", "") HotKeySet($KeyClick2) EndFunc Func KeyClickCLEAR3() $LogCombo3 = "" $LogKeyToClick3 = "" GUICtrlSetData($Combo3, "") GUICtrlSetData($KeyToClick3, "") GUICtrlSetData($Combo3, "Left Click|Right Click|Middle Button", "") HotKeySet($KeyClick3) EndFunc Func KeyClickCLEARALL() KeyClickCLEAR1() KeyClickCLEAR2() KeyClickCLEAR3() EndFunc ;------------------------------------------------------------------------------- KEY INTO CLICK {END} Func ReplaceKeys();------------------------------------------------------------------------------- REASSIGN KEYS $GetReplace1 = ControlGetText("", "", $Replace1) $LogReplace1 = ControlGetText("", "", $Replace1);LOG $GetWith1 = ControlGetText("", "", $With1) $LogWith1 = ControlGetText("", "", $With1);LOG HotKeySet($GetReplace1, "ReplaceWith1") $GetReplace2 = ControlGetText("", "", $Replace2) $LogReplace2 = ControlGetText("", "", $Replace2);LOG $GetWith2 = ControlGetText("", "", $With2) $LogWith2 = ControlGetText("", "", $With2);LOG HotKeySet($GetReplace2, "ReplaceWith2") $GetReplace3 = ControlGetText("", "", $Replace3) $LogReplace3 = ControlGetText("", "", $Replace3);LOG $GetWith3 = ControlGetText("", "", $With3) $LogWith3 = ControlGetText("", "", $With3);LOG HotKeySet($GetReplace3, "ReplaceWith3") $GetReplace4 = ControlGetText("", "", $Replace4) $LogReplace4 = ControlGetText("", "", $Replace4);LOG $GetWith4 = ControlGetText("", "", $With4) $LogWith4 = ControlGetText("", "", $With4);LOG HotKeySet($GetReplace4, "ReplaceWith4") $GetReplace5 = ControlGetText("", "", $Replace5) $LogReplace5 = ControlGetText("", "", $Replace5);LOG $GetWith5 = ControlGetText("", "", $With5) $LogWith5 = ControlGetText("", "", $With5);LOG HotKeySet($GetReplace5, "ReplaceWith5") $GetReplace6 = ControlGetText("", "", $Replace6) $LogReplace6 = ControlGetText("", "", $Replace6);LOG $GetWith6 = ControlGetText("", "", $With6) $LogWith6 = ControlGetText("", "", $With6);LOG HotKeySet($GetReplace6, "ReplaceWith6") $GetReplace7 = ControlGetText("", "", $Replace7) $LogReplace7 = ControlGetText("", "", $Replace7);LOG $GetWith7 = ControlGetText("", "", $With7) $LogWith7 = ControlGetText("", "", $With7);LOG HotKeySet($GetReplace7, "ReplaceWith7") $GetReplace8 = ControlGetText("", "", $Replace8) $LogReplace8 = ControlGetText("", "", $Replace8);LOG $GetWith8 = ControlGetText("", "", $With8) $LogWith8 = ControlGetText("", "", $With8);LOG HotKeySet($GetReplace8, "ReplaceWith8") $GetReplace9 = ControlGetText("", "", $Replace9) $LogReplace9 = ControlGetText("", "", $Replace9);LOG $GetWith9 = ControlGetText("", "", $With9) $LogWith9 = ControlGetText("", "", $With9);LOG- HotKeySet($GetReplace9, "ReplaceWith9") $GetReplace10 = ControlGetText("", "", $Replace10) $LogReplace10 = ControlGetText("", "", $Replace10);LOG $GetWith10 = ControlGetText("", "", $With10) $LogWith10 = ControlGetText("", "", $With10);LOG HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith1() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith1) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith2() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith2) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith3() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith3) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith4() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith4) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith5() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith5) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith6() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith6) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith7() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith7) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith8() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith8) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith9() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith9) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ReplaceWith10() HotKeySet($GetReplace1) HotKeySet($GetReplace2) HotKeySet($GetReplace3) HotKeySet($GetReplace4) HotKeySet($GetReplace5) HotKeySet($GetReplace6) HotKeySet($GetReplace7) HotKeySet($GetReplace8) HotKeySet($GetReplace9) HotKeySet($GetReplace10) Send($GetWith10) HotKeySet($GetReplace1, "ReplaceWith1") HotKeySet($GetReplace2, "ReplaceWith2") HotKeySet($GetReplace3, "ReplaceWith3") HotKeySet($GetReplace4, "ReplaceWith4") HotKeySet($GetReplace5, "ReplaceWith5") HotKeySet($GetReplace6, "ReplaceWith6") HotKeySet($GetReplace7, "ReplaceWith7") HotKeySet($GetReplace8, "ReplaceWith8") HotKeySet($GetReplace9, "ReplaceWith9") HotKeySet($GetReplace10, "ReplaceWith10") EndFunc Func ClearKeys1() $GetReplace1 = $LogReplace1 $GetWith1 = "" $LogWith1 = "" GUICtrlSetData($Replace1, "") GUICtrlSetData($With1, "") HotKeySet($GetReplace1) ReplaceKeys() EndFunc Func ClearKeys2() $GetReplace2 = $LogReplace2 $GetWith2 = "" $LogWith2 = "" GUICtrlSetData($Replace2, "") GUICtrlSetData($With2, "") HotKeySet($GetReplace2) ReplaceKeys() EndFunc Func ClearKeys3() $GetReplace3 = $LogReplace3 $GetWith3 = "" $LogWith3 = "" GUICtrlSetData($Replace3, "") GUICtrlSetData($With3, "") HotKeySet($GetReplace3) ReplaceKeys() EndFunc Func ClearKeys4() $GetReplace4 = $LogReplace4 $GetWith4 = "" $LogWith4 = "" GUICtrlSetData($Replace4, "") GUICtrlSetData($With4, "") HotKeySet($GetReplace4) ReplaceKeys() EndFunc Func ClearKeys5() $GetReplace5 = $LogReplace5 $GetWith5 = "" $LogWith5 = "" GUICtrlSetData($Replace5, "") GUICtrlSetData($With5, "") HotKeySet($GetReplace5) ReplaceKeys() EndFunc Func ClearKeys6() $GetReplace6 = $LogReplace6 $GetWith6 = "" $LogWith6 = "" GUICtrlSetData($Replace6, "") GUICtrlSetData($With6, "") HotKeySet($GetReplace6) ReplaceKeys() EndFunc Func ClearKeys7() $GetReplace7 = $LogReplace7 $GetWith7 = "" $LogWith7 = "" GUICtrlSetData($Replace7, "") GUICtrlSetData($With7, "") HotKeySet($GetReplace7) ReplaceKeys() EndFunc Func ClearKeys8() $GetReplace8 = $LogReplace8 $GetWith8 = "" $LogWith8 = "" GUICtrlSetData($Replace8, "") GUICtrlSetData($With8, "") HotKeySet($GetReplace8) ReplaceKeys() EndFunc Func ClearKeys9() $GetReplace9 = $LogReplace9 $GetWith9 = "" $LogWith9 = "" GUICtrlSetData($Replace9, "") GUICtrlSetData($With9, "") HotKeySet($GetReplace9) ReplaceKeys() EndFunc Func ClearKeys10() $GetReplace10 = $LogReplace10 $GetWith10 = "" $LogWith10 = "" GUICtrlSetData($Replace10, "") GUICtrlSetData($With10, "") HotKeySet($GetReplace10) ReplaceKeys() EndFunc Func ClearKeysALL() ClearKeys1() ClearKeys2() ClearKeys3() ClearKeys4() ClearKeys5() ClearKeys6() ClearKeys7() ClearKeys8() ClearKeys9() ClearKeys10() EndFunc ;------------------------------------------------------------------------------- REASSIGN KEYS {END} Func LogKeys();------------------------------------------------------------------------------- LOGS If $ToggleButton = 1 Then GUICtrlSetData($GetStartStop, $LogGetStartStop) EndIf If $GUIButton = 1 Then GUICtrlSetData($GUIOpen, $LogGUIOpen) EndIf If $GetEndButton = 1 Then GUICtrlSetData($GetEnd, $LogGetEnd) EndIf ;---------------------------------------------------- Create Macro If $X_Y_Send1 = 1 Then GUICtrlSetData($L1X, $LogL1X) GUICtrlSetData($L1Y, $LogL1Y) EndIf If $X_Y_Send2 = 1 Then GUICtrlSetData($L2X, $LogL2X) GUICtrlSetData($L2Y, $LogL2Y) EndIf If $X_Y_Send3 = 1 Then GUICtrlSetData($L3X, $LogL3X) GUICtrlSetData($L3Y, $LogL3Y) EndIf If $X_Y_Send4 = 1 Then GUICtrlSetData($L4X, $LogL4X) GUICtrlSetData($L4Y, $LogL4Y) EndIf ;---------------------------------------------------- If $LeftClickCheckA = 1 Then GUICtrlSetState($LeftClickA, $GUI_CHECKED) EndIf If $LeftClickCheckA = 0 Then GUICtrlSetState($LeftClickA, $GUI_UNCHECKED) EndIf If $LeftClickCheckB = 1 Then GUICtrlSetState($LeftClickB, $GUI_CHECKED) EndIf If $LeftClickCheckB = 0 Then GUICtrlSetState($LeftClickB, $GUI_UNCHECKED) EndIf If $LeftClickCheckC = 1 Then GUICtrlSetState($LeftClickC, $GUI_CHECKED) EndIf If $LeftClickCheckC = 0 Then GUICtrlSetState($LeftClickC, $GUI_UNCHECKED) EndIf If $LeftClickCheckD = 1 Then GUICtrlSetState($LeftClickD, $GUI_CHECKED) EndIf If $LeftClickCheckD = 0 Then GUICtrlSetState($LeftClickD, $GUI_UNCHECKED) EndIf ;---------------------------------------------------- If $RightClickCheckA = 1 Then GUICtrlSetState($RightClickA, $GUI_CHECKED) EndIf If $RightClickCheckA = 0 Then GUICtrlSetState($RightClickA, $GUI_UNCHECKED) EndIf If $RightClickCheckB = 1 Then GUICtrlSetState($RightClickB, $GUI_CHECKED) EndIf If $RightClickCheckB = 0 Then GUICtrlSetState($RightClickB, $GUI_UNCHECKED) EndIf If $RightClickCheckC = 1 Then GUICtrlSetState($RightClickC, $GUI_CHECKED) EndIf If $RightClickCheckC = 0 Then GUICtrlSetState($RightClickC, $GUI_UNCHECKED) EndIf If $RightClickCheckD = 1 Then GUICtrlSetState($RightClickD, $GUI_CHECKED) EndIf If $RightClickCheckD = 0 Then GUICtrlSetState($RightClickD, $GUI_UNCHECKED) EndIf ;---------------------------------------------------- If $PressKeyA = 1 Then GUICtrlSetData($KeysToSendA, $LogKeysToSendA) EndIf If $PressKeyB = 1 Then GUICtrlSetData($KeysToSendB, $LogKeysToSendB) EndIf If $PressKeyC = 1 Then GUICtrlSetData($KeysToSendC, $LogKeysToSendC) EndIf If $PressKeyD = 1 Then GUICtrlSetData($KeysToSendD, $LogKeysToSendD) EndIf ;---------------------------------------------------- GUICtrlSetData($SleepTimeA, $LogSleepTimeA) GUICtrlSetData($SleepTimeB, $LogSleepTimeB) GUICtrlSetData($SleepTimeC, $LogSleepTimeC) GUICtrlSetData($SleepTimeD, $LogSleepTimeD) ;---------------------------------------------------- Reassign Keys GUICtrlSetData($Replace1, $LogReplace1) GUICtrlSetData($With1, $LogWith1) GUICtrlSetData($Replace2, $LogReplace2) GUICtrlSetData($With2, $LogWith2) GUICtrlSetData($Replace3, $LogReplace3) GUICtrlSetData($With3, $LogWith3) GUICtrlSetData($Replace4, $LogReplace4) GUICtrlSetData($With4, $LogWith4) GUICtrlSetData($Replace5, $LogReplace5) GUICtrlSetData($With5, $LogWith5) GUICtrlSetData($Replace6, $LogReplace6) GUICtrlSetData($With6, $LogWith6) GUICtrlSetData($Replace7, $LogReplace7) GUICtrlSetData($With7, $LogWith7) GUICtrlSetData($Replace8, $LogReplace8) GUICtrlSetData($With8, $LogWith8) GUICtrlSetData($Replace9, $LogReplace9) GUICtrlSetData($With9, $LogWith9) GUICtrlSetData($Replace10, $LogReplace10) GUICtrlSetData($With10, $LogWith10) ;---------------------------------------------------- Key Into Click GUICtrlSetData($KeyToClick1, $LogKeyToClick1) GUICtrlSetData($Combo1, "") GUICtrlSetData($Combo1, "Left Click|Right Click|Middle Button", $LogCombo1) GUICtrlSetData($KeyToClick2, $LogKeyToClick2) GUICtrlSetData($Combo2, "") GUICtrlSetData($Combo2, "Left Click|Right Click|Middle Button", $LogCombo2) GUICtrlSetData($KeyToClick3, $LogKeyToClick3) GUICtrlSetData($Combo3, "") GUICtrlSetData($Combo3, "Left Click|Right Click|Middle Button", $LogCombo3) ;---------------------------------------------------- Disable Keys GUICtrlSetData($DisableKeys1, $LogDisableKeys1) GUICtrlSetData($DisableKeys2, $LogDisableKeys2) GUICtrlSetData($DisableKeys3, $LogDisableKeys3) GUICtrlSetData($DisableKeys4, $LogDisableKeys4) GUICtrlSetData($DisableKeys5, $LogDisableKeys5) GUICtrlSetData($DisableKeys6, $LogDisableKeys6) GUICtrlSetData($DisableKeys7, $LogDisableKeys7) GUICtrlSetData($DisableKeys8, $LogDisableKeys8) GUICtrlSetData($DisableKeys9, $LogDisableKeys9) GUICtrlSetData($DisableKeys10, $LogDisableKeys10) ;---------------------------------------------------- Mouse Button Swap If $SwapState = 1 Then GUICtrlSetState($ButtonSwap, $GUI_CHECKED) EndIf If $SwapState = 0 Then GUICtrlSetState($ButtonSwap, $GUI_UNCHECKED) EndIf EndFunc ;------------------------------------------------------------------------------- LOGS {END} Func MacroHelp();------------------------------------------------------------------------------- MACRO HELP Global $MacroHelpState = 1 Local $idListview = GUICtrlCreateListView("Send() Command| Resulting Keypress", 10, 32, 390, 358) Local $idItem1 = GUICtrlCreateListViewItem("{!}|!", $idListview) Local $idItem2 = GUICtrlCreateListViewItem("{#}|#", $idListview) Local $idItem3 = GUICtrlCreateListViewItem("{+}|+", $idListview) Local $idItem4 = GUICtrlCreateListViewItem("{^}|^", $idListview) Local $idItem5 = GUICtrlCreateListViewItem("{{}|{", $idListview) Local $idItem6 = GUICtrlCreateListViewItem("{}}|}", $idListview) Local $idItem7 = GUICtrlCreateListViewItem("{SPACE}|SPACEBAR key", $idListview) Local $idItem8 = GUICtrlCreateListViewItem("{ENTER}|ENTER key", $idListview) Local $idItem9 = GUICtrlCreateListViewItem("{ALT}|ALT", $idListview) Local $idItem10 = GUICtrlCreateListViewItem("{BACKSPACE} or {BS}|BACKSPACE", $idListview) Local $idItem11 = GUICtrlCreateListViewItem("{DELETE} or {DEL}|DELETE", $idListview) Local $idItem12 = GUICtrlCreateListViewItem("{UP}|Up arrow", $idListview) Local $idItem13 = GUICtrlCreateListViewItem("{DOWN}|Down arrow", $idListview) Local $idItem14 = GUICtrlCreateListViewItem("{LEFT}|Left arrow", $idListview) Local $idItem15 = GUICtrlCreateListViewItem("{RIGHT}|Right arrow", $idListview) Local $idItem16 = GUICtrlCreateListViewItem("{HOME}|HOME", $idListview) Local $idItem17 = GUICtrlCreateListViewItem("{END}|END", $idListview) Local $idItem18 = GUICtrlCreateListViewItem("{ESCAPE} or {ESC}|ESCAPE", $idListview) Local $idItem19 = GUICtrlCreateListViewItem("{INSERT} or {INS}|INS", $idListview) Local $idItem20 = GUICtrlCreateListViewItem("{PGUP}|PageUp", $idListview) Local $idItem21 = GUICtrlCreateListViewItem("{PGDN}|PageDown", $idListview) Local $idItem22 = GUICtrlCreateListViewItem("{F1} - {F12}|Function keys", $idListview) Local $idItem23 = GUICtrlCreateListViewItem("{PRINTSCREEN}|Print Screen key", $idListview) Local $idItem24 = GUICtrlCreateListViewItem("{LWIN}|Left Windows key", $idListview) Local $idItem25 = GUICtrlCreateListViewItem("{RWIN}|Right Windows key", $idListview) Local $idItem26 = GUICtrlCreateListViewItem("{NUMLOCK on}|NUMLOCK (on/off/toggle)", $idListview) Local $idItem27 = GUICtrlCreateListViewItem("{CAPSLOCK off}|CAPSLOCK (on/off/toggle)", $idListview) Local $idItem28 = GUICtrlCreateListViewItem("{SCROLLLOCK toggle}|SCROLLLOCK (on/off/toggle)", $idListview) Local $idItem29 = GUICtrlCreateListViewItem("{BREAK}|for Ctrl+Break processing", $idListview) Local $idItem30 = GUICtrlCreateListViewItem("{PAUSE}|PAUSE", $idListview) Local $idItem31 = GUICtrlCreateListViewItem("{NUMPAD0} - {NUMPAD9}|Numpad digits", $idListview) Local $idItem32 = GUICtrlCreateListViewItem("{NUMPADMULT}|Numpad Multiply", $idListview) Local $idItem33 = GUICtrlCreateListViewItem("{NUMPADADD}|Numpad Add", $idListview) Local $idItem34 = GUICtrlCreateListViewItem("{NUMPADSUB}|Numpad Subtract", $idListview) Local $idItem35 = GUICtrlCreateListViewItem("{NUMPADDIV}|Numpad Divide", $idListview) Local $idItem36 = GUICtrlCreateListViewItem("{NUMPADDOT}|Numpad period", $idListview) Local $idItem37 = GUICtrlCreateListViewItem("{NUMPADENTER}|Enter key on the numpad", $idListview) Local $idItem38 = GUICtrlCreateListViewItem("{APPSKEY}|Windows App key", $idListview) Local $idItem39 = GUICtrlCreateListViewItem("{LALT}|Left ALT key", $idListview) Local $idItem40 = GUICtrlCreateListViewItem("{RALT}|Right ALT key", $idListview) Local $idItem41 = GUICtrlCreateListViewItem("{LCTRL}|Left CTRL key", $idListview) Local $idItem42 = GUICtrlCreateListViewItem("{RCTRL}|Right CTRL key", $idListview) Local $idItem43 = GUICtrlCreateListViewItem("{LSHIFT}|Left Shift key", $idListview) Local $idItem44 = GUICtrlCreateListViewItem("{RSHIFT}|Right Shift key", $idListview) Local $idItem45 = GUICtrlCreateListViewItem("{SLEEP}|Computer SLEEP key", $idListview) Local $idItem46 = GUICtrlCreateListViewItem("{ALTDOWN}|Holds the ALT key down until {ALTUP} is sent", $idListview) Local $idItem47 = GUICtrlCreateListViewItem("{SHIFTDOWN}|Holds the SHIFT key down until {SHIFTUP} is sent", $idListview) Local $idItem48 = GUICtrlCreateListViewItem("{CTRLDOWN}|Holds the CTRL key down until {CTRLUP} is sent", $idListview) Local $idItem49 = GUICtrlCreateListViewItem("{LWINDOWN}|Holds the left Windows key down until {LWINUP} is sent", $idListview) Local $idItem50 = GUICtrlCreateListViewItem("{RWINDOWN}|Holds the right Windows key down until {RWINUP} is sent", $idListview) Local $idItem51 = GUICtrlCreateListViewItem("{ASC nnnn}|Send the ALT+nnnn key combination", $idListview) Local $idItem52 = GUICtrlCreateListViewItem("{BROWSER_BACK}|Select the browser 'back' button", $idListview) Local $idItem53 = GUICtrlCreateListViewItem("{BROWSER_FORWARD}|Select the browser 'forward' button", $idListview) Local $idItem54 = GUICtrlCreateListViewItem("{BROWSER_REFRESH}|Select the browser 'refresh' button", $idListview) Local $idItem55 = GUICtrlCreateListViewItem("{BROWSER_STOP}|Select the browser 'stop' button", $idListview) Local $idItem56 = GUICtrlCreateListViewItem("{BROWSER_SEARCH}|Select the browser 'search' button", $idListview) Local $idItem57 = GUICtrlCreateListViewItem("{BROWSER_FAVORITES}|Select the browser 'favorites' button", $idListview) Local $idItem58 = GUICtrlCreateListViewItem("{BROWSER_HOME}|Launch the browser and go to the home page", $idListview) Local $idItem59 = GUICtrlCreateListViewItem("{VOLUME_MUTE}|Mute the volume", $idListview) Local $idItem60 = GUICtrlCreateListViewItem("{VOLUME_DOWN}|Reduce the volume", $idListview) Local $idItem61 = GUICtrlCreateListViewItem("{VOLUME_UP}|Increase the volume", $idListview) Local $idItem62 = GUICtrlCreateListViewItem("{MEDIA_NEXT}|Select next track in media player", $idListview) Local $idItem63 = GUICtrlCreateListViewItem("{MEDIA_PREV}|Select previous track in media player", $idListview) Local $idItem64 = GUICtrlCreateListViewItem("{MEDIA_STOP}|Stop media player", $idListview) Local $idItem65 = GUICtrlCreateListViewItem("{MEDIA_PLAY_PAUSE}|Play/pause media player", $idListview) Local $idItem66 = GUICtrlCreateListViewItem("{LAUNCH_MAIL}|Launch the email application", $idListview) Local $idItem67 = GUICtrlCreateListViewItem("{LAUNCH_MEDIA}|Launch media player", $idListview) Local $idItem68 = GUICtrlCreateListViewItem("{LAUNCH_APP1}|Launch user app1", $idListview) Local $idItem69 = GUICtrlCreateListViewItem("{LAUNCH_APP2}|Launch user app2", $idListview) Local $idItem70 = GUICtrlCreateListViewItem("{OEM_102}|Either the angle bracket key or the backslash key on the RT 102-key keyboard", $idListview) GUISetState(@SW_SHOW) EndFunc Func CloseMacroHelp() $MacroHelpState = 0 GUIDelete($HelpTab1) EndFunc Func HelpTabs1() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Change_Hotkeys") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("Hotkeys will be used to control the whole program.", 15, 37, 390, 20) GUICtrlCreateLabel("Start/Stop - Will begin and pause the current macro; as a toggle function.", 15, 57, 390, 20) GUICtrlCreateLabel("Open GUI - Opens the GUI window back up when pressed; immediately cancels", 15, 77, 390, 20) GUICtrlCreateLabel("the currently running macro.", 15, 97, 390, 20) GUICtrlCreateLabel("End Program - Closes the MacroMaker program when the GUI is hidden during", 15, 117, 390, 20) GUICtrlCreateLabel("a macro.", 15, 137, 390, 20) GUICtrlCreateLabel("Open GUI key can be used whenever the GUI window is hidden.", 15, 177, 390, 20) GUICtrlCreateLabel("Start/Stop key is also used to set the coordinates for 'Get Coords'.", 15, 217, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc Func HelpTabs2() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Create_Macro") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("The order in which macros will execute is from top to bottom.", 15, 37, 390, 20) GUICtrlCreateLabel("All macros will begin paused on creation, Start/Stop key to activate.", 15, 57, 390, 20) GUICtrlCreateLabel("Macros will repeat indefinitely until the Start/Stop key is pressed.", 15, 77, 390, 20) GUICtrlCreateLabel("X, Y position - moves mouse to the location.", 15, 97, 390, 20) GUICtrlCreateLabel("Leftclick/Rightclick - will press the corresponding click.", 15, 117, 390, 20) GUICtrlCreateLabel("Keys - will type out anything in plain text; use {ENTER} to press the ENTER key.", 15, 137, 390, 20) GUICtrlCreateLabel("You can use {ENTER} YourMessageHere {ENTER} on a single 'Keys' line.", 15, 157, 390, 20) GUICtrlCreateLabel("Delay - sets a delay between macro functions. (in milliseconds)", 15, 177, 390, 20) GUICtrlCreateLabel("Get Coords - once pressed, use the Start/Stop key to set the coordinates.", 15, 197, 390, 20) GUICtrlCreateLabel("Leave anything you don't wish to use blank.", 15, 237, 390, 20) GUICtrlCreateLabel("", 15, 257, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc Func HelpTabs3() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Reassign_Keys") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("Reassign Keys will allow you to change any key into any other key or keys.", 15, 37, 390, 20) GUICtrlCreateLabel("Replace - key you want to replace.", 15, 57, 390, 20) GUICtrlCreateLabel("With - keypress to set the key as.", 15, 77, 390, 20) GUICtrlCreateLabel("The buttons to the right of each input box will clear the data and", 15, 117, 390, 20) GUICtrlCreateLabel("immediately take effect.", 15, 137, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc Func HelpTabs4() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Key_Into_Click") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("Key Into Click will change any keyboard key into a mouseclick.", 15, 37, 390, 20) GUICtrlCreateLabel("Turn - selected key to change.", 15, 57, 390, 20) GUICtrlCreateLabel("Into - Change the key into a click.", 15, 77, 390, 20) GUICtrlCreateLabel("Key can be held down to repeat the click until released.", 15, 97, 390, 20) GUICtrlCreateLabel("The buttons to the right of each input box will clear the data and", 15, 137, 390, 20) GUICtrlCreateLabel("immediately take effect.", 15, 157, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc Func HelpTabs5() Global $MacroHelpState = 1 Global $MacroHelp $HelpTab1 = GUICreate("Disable_Keys") GUICtrlCreateTab(10, 10, 392, 382) $keystab = GUICtrlCreateTabItem("Keys") MacroHelp() GUICtrlCreateTabItem("Info") GUICtrlCreateLabel("Disable Keys will disable any keyboard key.", 15, 37, 390, 20) GUICtrlCreateLabel("The buttons to the right of each input box will clear the data and", 15, 77, 390, 20) GUICtrlCreateLabel("immediately take effect.", 15, 97, 390, 20) GUICtrlCreateTabItem("") GUICtrlSetState($keystab, $GUI_SHOW) GUISetState(@SW_SHOW) While $MacroHelpState = 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE CloseMacroHelp() EndSwitch WEnd EndFunc ;------------------------------------------------------------------------------- MACRO HELP {END} Func Hotkeys();------------------------------------------------------------------------------- SHARED If $Hotkeys = 0 Then HotKeySet($GetStartStopNew) HotKeySet($GUIOpenNew) HotKeySet($End_Program_New) EndIf If $Hotkeys = 1 Then HotKeySet($GetStartStopNew, "Toggle") HotKeySet($GUIOpenNew, "OpenGUI") HotKeySet($End_Program_New, "End") EndIf EndFunc Func ReassignKeysNotification() MsgBox($MB_SYSTEMMODAL, "Info", "Keys Reassigned") EndFunc Func HideMacroMakerGUI() GUISetState(@SW_HIDE, $Form1) HotKeySet($GUIOpenNew, "OpenMacroMakerGUI") EndFunc Func OpenMacroMakerGUI() GUISetState(@SW_SHOW, $Form1) HotKeySet($GUIOpenNew) EndFunc Func End() $SwapState = 0 MouseClickSwap() Exit EndFunc ;------------------------------------------------------------------------------- SHARED {END} I might update the code sometime in the future to include more macro features. I plan to eventually clean the code up a bit MacroMaker 1.10.au3 MacroMaker 1.10.exe
    1 point
  25. Melba23

    _ArraySearch not working?

    nitekram, That makes even less sense than the first post. If you want to see if the element contains the string "<->" then you need to use the "partial search" parameter as explained above. In that case the return will be -1 if the string is not found and 0+ if it is. So I think your code would need to be: If _ArraySearch($array, '<-->', 0, 0, 0, 1) = -1 Then ; Not found so - code Else ; Found so - continue EndIf But I am not entirely sure I have your desired outcome correct. M23
    1 point
  26. dantay9

    Change exe details

    Some of that can be changed with wrappers for the compiler.
    1 point
×
×
  • Create New...