Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/14/2021 in all areas

  1. Agree, but if you invoke secondary windows (like save as) it will appear on your screen.
    2 points
  2. argumentum

    What is faster?

    Faster: 1 file. Distribution: 1 file. Maintenance: many files. Case closed
    2 points
  3. False, silent installs do not interact with GUI controls. They simply execute code. Yes, those can interact with hidden windows, but send and mouseClick require that the window is in focus. Yes there is one that I used in the past to "hide" an application while it is still in focus. You can make the window totally transparent, and block all inputs from the user while the installer interact with the application. This of course is only viable for very short period of time...
    2 points
  4. Here a way you could do it : #include <GUIConstants.au3> #include <GuiComboBox.au3> #include <Constants.au3> Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 300, 200) ; Create a combobox control. Global $idComboBox = GUICtrlCreateCombo("AItem 1", 10, 10, 185, 20) Local $idButton_Close = GUICtrlCreateButton("Close", 210, 170, 85, 25) ; Add additional items to the combobox. GUICtrlSetData($idComboBox, "BItem 2|CItem 3|DItem 4", "EItem 2") GUISetState() GUIRegisterMsg($WM_COMMAND, WM_COMMAND) Local $sComboRead = "" ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $idButton_Close ExitLoop Case $idComboBox $sComboRead = GUICtrlRead($idComboBox) MsgBox($MB_SYSTEMMODAL, "", "The combobox is currently displaying: " & $sComboRead, 0, $hGUI) EndSwitch WEnd EndFunc ;==>Example Func WM_COMMAND($hWnd, $iMsg, $iwParam, $ilParam) Local $iIDFrom = _WinAPI_LoWord($iwParam), $iCode = _WinAPI_HiWord($iwParam) Local $sText, $sInd If $iIDFrom = $idComboBox Then If $iCode = $CBN_EDITCHANGE Then $sInd = _GUICtrlComboBox_GetEditText($idComboBox) For $i = 0 To _GUICtrlComboBox_GetCount($idComboBox) - 1 _GUICtrlComboBox_GetLBText($idComboBox, $i, $sText) If StringInStr($sText, $sInd) Then _GUICtrlComboBox_SetCurSel($idComboBox, $i) ExitLoop EndIf Next EndIf EndIf Return $GUI_RUNDEFMSG EndFunc ;==>WM_COMMAND
    1 point
  5. Yes, if you can hide it, he says it should work, or you could move it off screen so it isn't visible.
    1 point
  6. What exatly are you redeeming for multiple accounts?
    1 point
  7. Func prepareNox() ; Prepare Nox Player If Not WinExists("[CLASS:Qt5QWindowIcon]") Then Exit Local $hNox = WinActivate("[CLASS:Qt5QWindowIcon]", "") ; Instead of: Sleep(1000) WinWaitActive(hNox, "", 0) ; Optionally, add a timeout for it not to be active EndFunc ;==>prepareNox And since you're already using UI Automation, use it for setting the value of that box too. (Granted, I can't test this, so maybe your field doesn't support it) If you're using UIASpy, this example code is under Sample Code\Patterns... and Sample Code\Pattern Methods... Local $pValuePattern, $oValuePattern $oNoxSub.GetCurrentPattern($UIA_ValuePatternId, $pValuePattern) $oValuePattern = ObjCreateInterface($pValuePattern, $sIID_IUIAutomationValuePattern, $dtagIUIAutomationValuePattern) If Not IsObj($oValuePattern1) Then Return ConsoleWrite("$oValuePattern1 ERR" & @CRLF) ConsoleWrite("$oValuePattern OK" & @CRLF) Local $sValue = "" ; Set this to an empty string to clear the text $oValuePattern.SetValue($sValue) ConsoleWrite("$oValuePattern.SetValue()" & @CRLF)
    1 point
  8. 1 point
  9. It is because your if statement is badly written. You should consider reading help file to understand the very basic of the language. If $oButton.outertext = "Next Chapter:" Or $oButton.outertext = "Next Chapter: " Then == is case sensitive, and applies only to strings while = is not.
    1 point
  10. if $var = "string" then ok if $var = "string" or "string" then wrong if $var = "string" or $var = "string" then ok
    1 point
  11. Jos

    What is faster?

    There is no difference as they are all merged together at execution time.
    1 point
  12. If you want to interact with the buttons then you can’t hide the application.
    1 point
  13. Melba23

    [R] Problem with order

    YuChan, You are rapidly becoming annoying. I told you about the "sort" style and linked to the Wiki tutorial when you last asked this question in this thread. I strongly suggest you start learning some of the basics. Reading the Help file (at least the first few sections - Using AutoIt, Tutorials and the first couple of References) will help you enormously. You should also look at this excellent tutorial and download the really useful book you can find at You will find other tutorials in the Wiki to which I linked you. Please do start making some effort - at present you are not doing much to help yourself. And do post your code when yo have a question - we have to ask you every single time. M23
    1 point
  14. Yes, we’re lucky to have Autoit where On Error Goto 0 is built-in to every line
    1 point
  15. @PHAK You've done well. I was going to whip out an example for you but I was swamped at work. Try the suggestion above to see it it works. Other than that, i need to do this in my own dev environment so I can debug What do you mean by run in background and not be seen? I can't really figure it out either. You can compile this and it will run silent and interact with A.exe installer. It will create a log too that you can debug with.
    1 point
  16. I just tried WinSetState("Install", "", @SW_HIDE) on the installer and it hid the window. Are you saying that hiding the window interferes with the installation?
    1 point
  17. 1 point
  18. Growing up without GoTo**, it confuses me. It seems to make the logic less linear and harder to follow... plus I always forget if the code just jumps to the target, or if it acts like a function and returns at some point. If I think about it long enough, I eventually realize that makes no sense, but it's confusing as heck. I'd rather use another function, a bool, or nested Ifs. Funny... I opened a particularly stubborn jar of salsa with a flat head today ** Not entirely true, they're kind of used in VBA for error handling, but I hate them. I was taught to avoid them at all costs. Especially On Error GoTo 0, which "ignores" all errors Disclaimer: I've never programmed in C
    1 point
  19. if (actual_count == count) goto skip_strip; I’ve always felt that the “goto“ statement has gotten more criticism than it deserved. It’s brutal simplicity has been its downfall... Sure it can be successfully pressed into service in totally inappropriate ways, but so can a flat-head screwdriver, and we still have those around...
    1 point
  20. You need to click on password first then it will show the SHOW/HIDE button. Both have unique ids. To find those ids, right click on password field and select "Inspect" in contextual menu. To remove it try : _WD_ExecuteScript($sSession, "return document.getElementById('id_password_toggle').remove();", "")
    1 point
  21. Hard to say with no code. Try using hwnd to attach, you cannot be wrong with this method...
    1 point
  22. #AutoIt3Wrapper_icon = "icon path" #AutoIt3Wrapper_Res_Description = "description" #AutoIt3Wrapper_Res_LegalCopyright = "author information" #AutoIt3Wrapper_Res_Fileversion = "version number" This works for me.
    1 point
  23. This is pretty useful to me at least, I hope to others. Whenever you need to poke a button or such on a GUI, you can just make calls to this UDF and instruct it how long to wait, 0 is forever, anyway, let the code to the explaining. Feel free to help expand this UDF. I plan to create new ones as I go along that support all the Win32 and .NET Controls. Ultimately, I would like to be able to fully control any type of control, this works well with most. Just an example of what you can do. NOTE: Logger Author(s) .....: Michael Mims (zorphnog) ; the logging script can be obtained here ; https://www.autoitscript.com/forum/topic/156196-log4a-a-logging-udf/ WaitForControls.au3 log4a.au3
    1 point
  24. This is and example of the output in the console. It will be automatically written to a text file if this file is compiled to exe. The log file will be named the same as the exe with a .log and be present in the same location as the running exe. Install results: 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | inst7zinst7z:Begin 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | CheckClickCtrl():Begin 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Waiting for: [CLASS:#32770] 7-Zip 15.14 (x64) Setup [CLASS:Button; INSTANCE:2] &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Timeout: 0 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text : &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text Search : &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | [CLASS:#32770] 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | [CLASS:Button; INSTANCE:2] 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Trace | ExitLoop:Normal - [CLASS:Button; INSTANCE:2] 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | CheckClickCtrl():End 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | CheckClickCtrl():Begin 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Waiting for: [CLASS:#32770] 7-Zip 15.14 (x64) Setup [CLASS:Button; INSTANCE:2] Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Timeout: 0 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text : &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text : &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text : &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text : &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text : &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text : &Install 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text : Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | [CLASS:#32770] 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | [CLASS:Button; INSTANCE:2] 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Trace | ExitLoop:Normal - [CLASS:Button; INSTANCE:2] 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | CheckClickCtrl():End 10\02\2017 14:32:30 | WIN-4VR4FSF2H8Q | Info | inst7z():End +>14:32:30 AutoIt3.exe ended.rc:0 +>14:32:30 AutoIt3Wrapper Finish Uninstall results: 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | unInst7zinst7z:Begin 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | CheckClickCtrl():Begin 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Waiting for: [CLASS:#32770] 7-Zip 15.14 (x64) Uninstall [CLASS:Button; INSTANCE:1] &Uninstall 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Timeout: 0 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text : &Uninstall 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text Search : &Uninstall 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | [CLASS:#32770] 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | [CLASS:Button; INSTANCE:1] 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Trace | ExitLoop:Normal - [CLASS:Button; INSTANCE:1] 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | CheckClickCtrl():End 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | CheckClickCtrl():Begin 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Waiting for: [CLASS:#32770] 7-Zip 15.14 (x64) Uninstall [CLASS:Button; INSTANCE:1] Close 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Timeout: 0 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text : &Uninstall 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text : &Uninstall 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text : &Uninstall 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text : &Uninstall 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text : Close 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | Control Text Search : Close 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | [CLASS:#32770] 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | [CLASS:Button; INSTANCE:1] 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Trace | ExitLoop:Normal - [CLASS:Button; INSTANCE:1] 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | CheckClickCtrl():End 10\02\2017 14:35:00 | WIN-4VR4FSF2H8Q | Info | inst7z():End +>14:35:00 AutoIt3.exe ended.rc:0 +>14:35:00 AutoIt3Wrapper Finished. >Exit code: 0 Time: 0.7732
    1 point
  25. If you need a nicely formatted time which include milliseconds (h:mm:ss.mmm): $ms = {wherever you get your milliseconds from} $time = StringFormat("%d:%.2d:%06.3f", (Floor($ms / 3600000)), (Floor(Mod($ms,3600000) / 60000)), (Mod(Mod($ms,3600000),60000) / 1000))
    1 point
  26. Beta required: $oMyError = ObjEvent("AutoIt.Error", "ComError") $UserObj = ObjGet("WinNT://" & @LogonDomain & "/" & @UserName) If @error Then MsgBox(0, 'username', 'Error connecting to domain') Else MsgBox(0, 'username', $UserObj.FullName) EndIf $UserObj = "" $oMyError = ObjEvent("AutoIt.Error", "") ;COM Error function Func ComError() If IsObj($oMyError) Then $HexNumber = Hex($oMyError.number, 8) SetError($HexNumber) Else SetError(1) EndIf Return 0 EndFunc ;==>ComError
    1 point
×
×
  • Create New...