All Activity

This stream auto-updates   

  1. Past hour
  2. When something get not updated. It start to die... I don't know why must of MVP-developers here always are avoiding this questions. but good after all you are the developers. there are many people waiting something more of AutoIt. AutoIt could be improve/better but there are not AutoIt developer actually that's the truth. I going to stop writing know because I don't want my account banned lol maybe waht I said hurt someone... I really Love AutoIt for fast developing no too much related to GUI design of course. I use it every day and when I don't I miss it. lol AutoIt a progamming lenguage?. Totally yes a full Programming language. @TheDcoder You can use Mono C#. Saludos
  3. Here's a proof of concept: #include <Array.au3> #include <MsgBoxConstants.au3> #include <ProcessConstants.au3> #include <Security.au3> #include <SecurityConstants.au3> #include <StructureConstants.au3> #include <WinAPI.au3> #include <WinAPIFiles.au3> Global $b_AddNetworkDrives = True Global $g_CmdLineRaw = $CmdLineRaw If Not @Compiled Then MsgBox(0, "Hint", "Run program compiled to test...") Exit EndIf If StringInStr($g_CmdLineRaw, "SMF_GetMappedDrives", 2) Then ; Executed by non-elevated Child process If Not IsAdmin() Then _UAC_GetMappedDrives_Child() Exit ElseIf Not IsAdmin() Then ; Run elevated Main process ; !!! HINT !!! ; > The UAC elevated process MUST NOT contain a manifest with the "requestedExecutionLevel = requireAdministrator" ; > the _RunNonElevated() function will not work for these executables ; > instead manually start the process with elevated rights manually, either through the "runas" verb or by right-click ; !!! HINT !!! ShellExecute(@ScriptFullPath, "", @WorkingDir, "runas") Exit EndIf If $b_AddNetworkDrives Then ; Executed by elevated Main process If IsAdmin() Then _UAC_GetMappedDrives_Parent() EndIf Exit Func _UAC_GetMappedDrives_Parent() Local $tSecurity = DllStructCreate("int Length;ptr Descriptor;int InheritHandle") ; $tagSECURITY_ATTRIBUTES DllStructSetData($tSecurity, 1, DllStructGetSize($tSecurity)) DllStructSetData($tSecurity, 2, 0) Local $hFileMap = _WinAPI_CreateFileMapping(-1, 65536, "SMF_MappedDrives_Buffer", 0x0004, DllStructGetPtr($tSecurity)) Local $iPID = _RunNonElevated('"' & @ScriptFullPath & '" SMF_GetMappedDrives') ProcessWaitClose($iPID, 10) Local $pAddress = _WinAPI_MapViewOfFile($hFileMap) Local $tData = DllStructCreate('wchar[32768]', $pAddress) Local $s_MappedDrives_Data_Child = DllStructGetData($tData, 1) _WinAPI_UnmapViewOfFile($pAddress) _WinAPI_CloseHandle($hFileMap) Local $aDrives_Child If Not StringInStr($s_MappedDrives_Data_Child, "GetMappedDrives Results - Child:") Then Local $aDrives_Child[1] $aDrives_Child[0] = -1 ; Error, no info transfered from non-elevated process Else $s_MappedDrives_Data_Child = StringReplace($s_MappedDrives_Data_Child, "GetMappedDrives Results - Child:" & @LF, "") $aDrives_Child = StringSplit($s_MappedDrives_Data_Child, @LF) StringReplace($s_MappedDrives_Data_Child, @LF, "") ; Detect number of lines in data = number of found mappings $aDrives_Child[0] = @extended EndIf Local $aDrives = DriveGetDrive("NETWORK") If @error Or Not IsArray($aDrives) Then Local $aDrives[1] $aDrives[0] = 0 EndIf Local $a_Drive_Mapping[28][5] $a_Drive_Mapping[0][1] = "Elevated Mode" $a_Drive_Mapping[0][3] = "Non-Elevated Mode" $a_Drive_Mapping[0][4] = "Number of Differences in mapped drives" $a_Drive_Mapping[1][1] = $aDrives[0] ; Number of Mapping in Elevated mode $a_Drive_Mapping[1][3] = $aDrives_Child[0] ; Number of Mapping in Non-Elevated mode $a_Drive_Mapping[1][4] = 0 ; Number of differences in mapped drive paths Local $aDrives_Child_Split For $i = 2 To 27 $a_Drive_Mapping[$i][0] = Chr($i + 95) & ":" For $y = 1 To $aDrives[0] If $aDrives[$y] = Chr($i + 95) & ":" Then $a_Drive_Mapping[$i][1] = DriveMapGet($aDrives[$y]) $a_Drive_Mapping[$i][2] = DriveStatus($a_Drive_Mapping[$i][1]) ExitLoop EndIf Next For $y = 1 To $aDrives_Child[0] If StringLeft($aDrives_Child[$y], 3) = Chr($i + 95) & ":=" Then $aDrives_Child[$y] = StringTrimLeft($aDrives_Child[$y], 3) $aDrives_Child_Split = StringSplit($aDrives_Child[$y], "|") If $aDrives_Child_Split[0] = 2 Then $a_Drive_Mapping[$i][3] = $aDrives_Child_Split[1] $a_Drive_Mapping[$i][4] = $aDrives_Child_Split[2] EndIf ExitLoop EndIf Next If $a_Drive_Mapping[$i][1] <> $a_Drive_Mapping[$i][3] Then $a_Drive_Mapping[1][4] += 1 Next If $a_Drive_Mapping[1][4] > 0 Then ; add action if difference in mappings found EndIf _ArrayDisplay($a_Drive_Mapping, IsAdmin()) EndFunc ;==>_UAC_GetMappedDrives_Parent Func _UAC_GetMappedDrives_Child() Local $s_MappedDrives_Data = "GetMappedDrives Results - Child:" & @LF Local $aDrives = DriveGetDrive("NETWORK") If Not @error Then For $i = 1 To $aDrives[0] $s_MappedDrives_Data &= $aDrives[$i] & "=" & DriveMapGet($aDrives[$i]) & "|" & DriveStatus($aDrives[$i]) & @LF Next EndIf Local $hFileMap = _WinAPI_OpenFileMapping("SMF_MappedDrives_Buffer") Local $pAddress = _WinAPI_MapViewOfFile($hFileMap) Local $tData = DllStructCreate('wchar[32768]', $pAddress) DllStructSetData($tData, 1, $s_MappedDrives_Data) _WinAPI_UnmapViewOfFile($pAddress) _WinAPI_CloseHandle($hFileMap) EndFunc ;==>_UAC_GetMappedDrives_Child Func _RunNonElevated($sCommandLine = "") If Not IsAdmin() Then Return Run($sCommandLine) ; if current process is run non-elevated then just Run new one. ; Structures needed for creating process Local $tSTARTUPINFO = DllStructCreate($tagSTARTUPINFO) Local $tPROCESS_INFORMATION = DllStructCreate($tagPROCESS_INFORMATION) ; Process handle of some process that's run non-elevated. For example "Explorer" Local $hProcess = _WinAPI_OpenProcess($PROCESS_ALL_ACCESS, 0, ProcessExists("explorer.exe")) ; If successful If $hProcess Then ; Token... Local $hTokOriginal = _Security__OpenProcessToken($hProcess, $TOKEN_ALL_ACCESS) ; Process handle is no longer needed. Close it _WinAPI_CloseHandle($hProcess) ; If successful If $hTokOriginal Then ; Duplicate the original token ; https://stackoverflow.com/questions/7004310/bypassing-elevation-when-launching-a-new-process ; SetEnvironmentVariable function ; https://msdn.microsoft.com/en-us/library/windows/desktop/ms686206(v=vs.85).aspx Local $hTokDuplicate = _Security__DuplicateTokenEx($hTokOriginal, $TOKEN_ALL_ACCESS, $SECURITYIMPERSONATION, $TOKENPRIMARY) ; Close the original token _WinAPI_CloseHandle($hTokOriginal) ; If successful If $hTokDuplicate Then ; Create process with this new token Local $aRet = DllCall("kernel32.dll", "int", "SetEnvironmentVariable", "str", "__compat_layer", "str", "RunAsInvoker") _Security__CreateProcessWithToken($hTokDuplicate, 0, $sCommandLine, 0, @ScriptDir, $tSTARTUPINFO, $tPROCESS_INFORMATION) ; Close that token _WinAPI_CloseHandle($hTokDuplicate) ; Close get handles _WinAPI_CloseHandle(DllStructGetData($tPROCESS_INFORMATION, "hProcess")) _WinAPI_CloseHandle(DllStructGetData($tPROCESS_INFORMATION, "hThread")) ; Return PID of newly created process Return DllStructGetData($tPROCESS_INFORMATION, "ProcessID") EndIf EndIf EndIf EndFunc ;==>_RunNonElevated
  4. Today
  5. Is it possible to automatically resize fonts when controls are resized? #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $Form1 = GUICreate("Form1", 623, 449, 192, 114) $Label1 = GUICtrlCreateLabel("TESTE 1", 176, 128, 80, 30, $SS_CENTERIMAGE + $SS_CENTER) GUICtrlSetFont(-1, 12, 800, 0, "Arial Black") GUICtrlSetBkColor(-1, 0XFF0000) GUISetState(@SW_SHOW) Sleep(1000) GUICtrlSetData($Label1, "") ControlMove($Form1, "", $Label1, 176, 128, 160, 60) GUICtrlSetData($Label1, "TESTE 2") Sleep(2000) Exit
  6. And don’t be fooled visual code can use visual studio project files to produce x86 or x64 exe files. I am now learning how to create my own CS project files and config files Out of the box if you create.net core apps you’re only create DLLs The point is anyone with even a crappy laptop could do it
  7. Visual Code and you already have .net installed. You can target .NET versions. I use this on my super crappies laptop MSBuild is built into windows i can help you if ever interested. I can even build my projects using MS build with sublime text editor But you can debug with visual Code
  8. No. Everything is already built in and you can use visual code for lightweight
  9. Well, Visual Studio is very large, 7 GB last time I checked. Also doesn't it download the C# compilers and tools? My laptop cannot handle that beast of an IDE anyway, keeps freezing and eats all of the resources.
  10. Better than the alternatives so far and it isn’t hard with free VC or free VS the diff is, I’m not limited in any way and I can have compiled speeds. Learning is fun!
  11. C# is a big beast packed with tons of wrappers and libraries for almost everything. Not really a simple one to work with...
  12. Lol. I can get tons more done with less coding using C# and I can automate ANY windows app. WPF or not. Autoit is fine for most scripting needs but I needed more built in functionality
  13. There is a good chance that they lost the source code... or some have been saying that.
  14. hello, I have a script that I would not like to close before the end of its execution. If the user decides to close Windows I would like to prevent the shutdown of Windows. For that I found several examples on this forum for example this one: Blocking works well with just a While Loop execution. But if we add other autoit commands (run, inetget ...), the script is closed on closing Windows after a few seconds. Do you have any solution to prevent closing. Thank you.
  15. Totally agree. An even worse case is Python, for which a few laughably half-hearted compiler attempts have been written that produce total and utter garbage. In my own area of application (scientific computation), even commercial alternatives such as Matlab produce equally inept "compiled" exes that either crash or require several parallel universe lifetimes to complete. Then I'd rather stick with AutoIt's solid, stable stub interpreter (with straightforward syntax, nice GUI and other graphics capabilities up and running in a day, and full Windows functionality under the hood) while farming out the computational hard labour to a dedicated dll. The one feature of stub interpreters that is often overlooked is that it drastically shortens development time, as you can do fast testing cycles in the interpreter, and afterwards, turning the script into an exe is not going throw tons of new errors your way. Try tracing transient memory leaks or similar Heisenbugs in MSVC for comparison... Just out of interest, some parts are still assembly, and even a recent Word patch (ye olde Equation Editor) was done at this level.
  16. Here is a PowerShell method of removing duplicate lines from an unsorted file, from within AutoIt. It may be faster on big files. On small files, KaFu's example is faster. ; Remove Duplicate Rows From A Text File Using Powershell... unsorted file, where order is important. ; Command from: http://www.secretgeek.net/ps_duplicates Local $hTimer = TimerInit() local $sFileIn = @ScriptDir & '\temp-6.txt' local $sFileOut = @ScriptDir & '\newlist.txt' Local $sCmd = '$hash = @{}' & @CRLF & _ 'gc ' & $sFileIn & '| % {if ($hash.$_ -eq $null) {$_} $hash.$_ = 1;} > ' & $sFileOut RunWait('"C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe" ' & $sCmd, "", @SW_HIDE, 2 + 4) ; Run command in PowerShell. ConsoleWrite("Time Taken: " & round(TimerDiff($hTimer)/1000,4) & "Secs" & @CRLF) ShellExecute($sFileOut) ; See unique file.
  17. I will answer myself. To make it work you just have to put your body html into frameset: #include <IE.au3> Local $oIE = _IECreate() Local $sHTML = "<!DOCTYPE html>" $sHTML &= "<HTML>" & @CRLF $sHTML &= "<HEAD>" & @CRLF $sHTML &= "<TITLE>Example</TITLE>" & @CRLF $sHTML &= "</HEAD>" & @CRLF $sHTML &= "<FRAMESET>" & @CRLF $sHTML &= "<FRAME name=main src=about:blank>" & @CRLF $sHTML &= "</FRAMESET>" & @CRLF $sHTML &= "</HTML>" _IEDocWriteHTML($oIE, $sHTML) Local $oFrameMain = _IEFrameGetObjByName($oIE, "main") _IEBodyWriteHTML($oFrameMain, "<p>try to use ctrl+f to find this text</p>")
  18. Hello again. Both functions, _FileReadToArray() and _ArrayUnique(), have parameters that enable or disable the line count being assigned to the first element of the array- see AutoIt help file. Or you can click on these functions that are blue in colour in the code box below to see the online AutoIt help. #include <File.au3> #include <Array.au3> ProcessAndCleanFiles() Func ProcessAndCleanFiles() Local $sFileName = "\\poop\IC3.txt" ; FileToWorkOn ;Remove the extra /'s at the end of each TestCodeLineFor IC3 Local $Whattowrite = StringRegExpReplace(FileRead($sFileName), "(?m)/*$", "") Local $hFileOpen = FileOpen($sFileName, 2) FileWrite($hFileOpen, $Whattowrite) FileClose($hFileOpen) ; Remove duplicates from file Local $aFile, $aArray _FileReadToArray($sFileName, $aFile, 0) ; $iFlags parameter, $FRTA_NOCOUNT (0) - array is 0-based use UBound() to get size, _ArrayDisplay($aFile) $aArray = _ArrayUnique($aFile, 0, 0, 0, 0) ; $iCount parameter, $ARRAYUNIQUE_NOCOUNT (0) returns a list without a count. _ArrayDisplay($aArray) _FileWriteFromArray($sFileName, $aArray) EndFunc ;==>ProcessAndCleanFiles
  19. is an older version. This one does not return an array.
  20. Well, maybe, I don't know. Many, including me, wish this generated machine code output other than a stub interpreting scripts. But I see the wisdom in the way is kept. That's what I meant by script language vs programming language. Then again, javascript is also interpreted and is called a language ? Windows is written in C, or it was. AutoIt language is more Pascal looking ( in my range of experience with coding ). AutoIt was initially designed for PC "roll out" situations to reliably automate and configure thousands of PCs. Over time it has become a powerful language that supports complex expressions, user functions, loops and everything else that veteran scripters would expect. Features: Easy to learn BASIC-like syntax Simulate keystrokes and mouse movements Manipulate windows and processes ... ... AutoIt has been designed to be as small as possible and stand-alone with no external .dll files or registry entries required making it safe to use on Servers. Scripts can be compiled into stand-alone executables with Aut2Exe. The above comes from the help file By the way, I'm not the OP, just wanted to have a say. A small say. In my view, AutoIt does exactly what it was designed to do. So my main was about the aesthetics, ..how pretty controls look on screen. To me, in Win10, the common controls are purposely sabotaged, more so than in previous versions of the OS, that's all. PS: I'm re-reading your post @Skysnake, and now interpreted it differently. Sowy. I'm not very good at english. Yes I agree fully.
  21. more on #comments-start and -end... What is the possibility of addindg "Region" -like definitions to comments? Then something like this would be possible (pseudo code) #Region ************* GUI layout ****************** GuiCreate("MyGui") #comments-start #only use with xyz x y z #comments-end #only use with xyz GuiCtrlCreateWidget("MyWidget") #EndRegion ************* GUI layout ****************** Or is there a better way that should be used?
  22. This is what I saw without noticing the dating. ..then I wanted to know, wassup. I did not reawaken the post. @jazzyjeff still here. This week. so who knows. I wrote a better example here ( of a posting of my own ) and did not announce it by adding a new post, But at times, I know I brainfart. Let me know where and how and I'll do my best to attend to my behaviour.
  23. a pretty stable general purpose scripting language ... a programming language ... a little paraphrasing...
  24. You are correct, please excuse me. It was late.
  25. Well, this is interesting! Thank you for this information. If this is the case, then there are one or more differences between the COM Object methods and the internal IE 11 methods, or something of this nature. Something does not add up still, and that is this link that i've posted earlier: https://msdn.microsoft.com/en-us/library/aa741364(v=vs.85).aspx Therefore, one more workaround can be used: #Include <ie.au3> Global Const $base_url = 'https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset' $oIE = _IEAttach($base_url, 'url') if @error then $oIE = _IECreate($base_url) EndIf Local $command = 'document.getElementsByTagName("html").item(0).dataset.ffoOpensans' $oIE.document.parentWindow.execscript($command) Local $result = $oIE.document.getElementsByTagName('html').item(0).dataset.ffoOpensans MsgBox(0, '', $result) One more problem arises from this workaround: How do we simplify the code ? Is there a way of running the following code (i've already tried brackets and parantheses) ? Local $command = 'document.getElementsByTagName("html").item(0).dataset.ffoOpensans' $oIE.document.parentWindow.execscript($command) Local $result = $oIE.$command This issue is still unresolved.
  26. i was agreeing. customer service issues with the ill informed sucks. and software signing should not help with the ML and heuristic detections (as those should be detonations/behavioral and signing wouldnt change that), though I have no faith those arent triggering on something static.
  27. Hello, i meant the coordinates varies from desktop to desktop.how shall i explain through code?????! i have problem in selecting component ,which command in autoit helps in that ? find the attachment below of a component capacitor.am unable to select it .
  1. Load more activity