Leaderboard
Popular Content
Showing content with the highest reputation on 09/23/2024 in all areas
-
The hidden AutoIt window
SOLVE-SMART and one other reacted to argumentum for a topic
If is to play around, it would be interesting to see the speed of writing and reading to a control vs. a global variable. I'd bet that the variable is faster. There are also the goodies of Au3Stripper in AutoIt3Wrapper that removes unused variables from the merged script, making the avoidance of #includes not a thing anymore. And yes, the $g_ thing, ... I have a hard time reading my old code because I always thought that the code is it's own comment. Wrong. I don't understand why I did this or that. Same boat here I guess. But am getting better !, by age 99 ( give or take a decade ) I'll be a mindful programmer2 points -
The hidden AutoIt window
SOLVE-SMART and one other reacted to pixelsearch for a topic
Thanks for your point of view. I did it because I am always curious and wanted to try something I never did until now (i.e. working with AutoItWinSetTitle), also it was "to reduce the number of global variables" I always smile when talking about "reducing the number of global variables" because it makes me think of mikell, each time. If you could read what he wrote to me on May 20, 2023 (I just re-read his long PM right now). He was a bit angry, since years, with this question of global variables that should be avoided etc... As mikell is not with us any more (and I truly miss him, it's a pity he lefts us so soon because he was a great person) then I'll share a part of what he wrote to me concerning this point (the less vehement part) first in French (his [our] native language, at least Melba23, Nine and jchd will understand ) then I'll use a translator to indicate it in English : [...] When you add '#include' at the head of the script, it amounts to adding a bunch of global variables (which are not always constants) so frankly, you really think that you are going to seriously penalize the performance of your code by adding a few? Personally I have some doubts [...] imho he was right. Who cares if we add a couple of global variables to our scripts, if it makes them more readable ? We shouldn't frown when a user adds a few global variables, when #include adds dozen & hundreds of them... When I use Global variables, I like to prefix them with g_ so they're easily recognizable when reading the script later. Unfortunately I don't do it each time, that's a big mistake.2 points -
Yes. I also come to the conclusion that it is better to work through arrays. It seems that it is not very convenient to work with Win API functions. Isn't it?1 point
-
Close _ArrayDisplay using timeout
argumentum reacted to NassauSky for a topic
@argumentum very interesting. OK so I didn't see it that way as far as modifying the original UDF ArrayDisplayInternals.au3 until you clarified it. So OK now that's another option but then if I'm going that far I'd add another button on the _Array_Display for "Hold" in cases that I'm inspecting the array for a bit longer. If I opt for that option, I'll have to share my new UDF with my other endpoints and make sure I update it if there are any more updates to the Autoit core code down the road. Thanks again!1 point -
WebDriver UDF (W3C compliant version) - 2024/09/21
SOLVE-SMART reacted to HJL for a topic
You are right, the info of the missing --port=9515 helped. I had another Func _SetupMsEdge() that I used and the changes I made in an old Func _SetupEdge(). Thanks a lot for your help.1 point -
If I'm not mistaken, that's just what the code does... If you replace the line Local $Result = ShellExecuteWait('REG', 'EXPORT " ' & $_sRegKey[$i] & '" ' & $_RegFile[$i] & '') with my code, you'll get: ; ------------------------------------------------ #include <FileConstants.au3> ; ------------------------------------------------ Opt("MustDeclareVars", 1) ; ------------------------------------------------- _ExportRegKeys() ; ------------------------------------------------- Func _ExportRegKeys() ; Source data Local $_sRegKey[3] = [2] $_sRegKey[1] = "HKEY_CURRENT_USER\Software\Native Instruments" $_sRegKey[2] = "HKEY_LOCAL_MACHINE\Software\Native Instruments" ; ----------------- ; Destination data Local $_RegFile[3] = [2] $_RegFile[1] = "D:\Install\App_Config\Digital_Audio\2_GR5\Data\Reg_Keys\hkcu.reg" $_RegFile[2] = "D:\Install\App_Config\Digital_Audio\2_GR5\Data\Reg_Keys\hklm.reg" ; ------------------------------------------------- Local $sMessage = "Export Registry Keys data..." & @CRLF & @CRLF ; ------------------------------------------------- For $i = 1 To $_RegFile[0] Local $tmp = 'EXPORT "' & $_sRegKey[$i] & '" "' & $_RegFile[$i] & '" /Y' Local $Result = ShellExecuteWait('REG', $tmp) ConsoleWrite($tmp & @CRLF) Switch $Result Case 0 $Result = "The Registry Keys data...[" & $_RegFile[$i] & "]...was exported sucessfully!" Case 1 $Result = "The Registry Keys data...[" & $_RegFile[$i] & "]...was not exported sucessfully!" EndSwitch ; ----------------- $sMessage &= $Result & @CRLF Next ; ----------------------------------------------- $sMessage &= @CRLF & "Export Registry Keys completed..." & @CRLF ; ----------------------------------------------- SplashTextOn("NOTICE!!", $sMessage, 1050, 170, -1, -1, 4, "FuturaBQ-DemiBold", 14) Sleep(3000) SplashOff() EndFunc ;==>_ExportRegKeys ; ------------------------------------------------- and it seems to work fine. It displays the "successfully" message and two .reg files are created at the given location. And it uses the /y because it overwrites the files without asking if they are already there. ¯\_(ツ)_/¯ best regards, Marc1 point
-
Maybe a mouse hook will work so you can get the info about what window is clicked from MOUSEHOOKSTRUCT structure. In order to find if it's a simple click or a double click you can use a timer and GetDoubleClickTime() function.1 point
-
You dont need the struct if you use _WinAPI_GetMousePos() instead of MouseGetPos(). Func _VideoClicked() If WinGetTitle(_WinAPI_WindowFromPoint(_WinAPI_GetMousePos())) = "ActiveMovie Window" Then If _IsPressed("01") Then _Pause() Sleep(200) EndIf EndIf EndFunc1 point
-
I went this way and it worked but it felt klooji.☝️ I wracked my brain over it and eventually thought to scour the documentation for UDFs for both arrays and buttons and there it was: _GUICtrlButton_GetText I didn't need the original name except to extract the number... I scrapped the array of names and switched the event mode so I didn't need to do more that 'write' the number on the button at creation, then retrieve it when clicked. 😀1 point
-
Latest update just released. See below for change log.1 point