-
Posts
701 -
Joined
-
Last visited
Everything posted by IanN1990
-
Hi All, After more research i came to understand each pixel was an object within the graphic. I thought if i reduced the number of total objects this would fix the issue. Instead of a dotted grid, I would created a line-grid (see below) which ended up having 72 objects and a big improvement but a noticeable delay remained. GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_COLOR, 0xCACACA) For $iW = 1 To $iWidth GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_MOVE, $GridSize * $iW, 0) GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_LINE, $GridSize * $iW, $iDiagramHeight) Next For $iH = 1 To $iHeight GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_MOVE, 0, $GridSize * $iH) GUICtrlSetGraphic($hGraphicDiagram, $GUI_GR_LINE, $iDiagramWidth, $GridSize * $iH) Next Unlimitedly the solution came from using GUISetState(@SW_LOCK) and GUISetState(@SW_UNLOCK) while updating the controls.
-
Hi All, I have discovered something odd and am unsure how to counter it. I am using labels (for BkColor) to act as coloured borders for richedit controls (for coloured text). When loading a number of items (50 for example) there is a noticeable delay, after troubleshooting this is down to GUICtrlSetBkColor. Normally GUICtrlSetBkColor() is really fast <0.5-0.7 MS but when i load my grid (using graphics) this slows down to 5-5.5MS. In the above case this is adds a 250ms delay vs 25ms without the grid. Example Code. #NoTrayIcon #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> local $iDiagramWidth = 664, $iDiagramHeight = 498 local $iDiagramPadding = 8, $GridSize = 16 GUICreate("Example", $iDiagramWidth, $iDiagramHeight+$GridSize, -1, -1, -1, $WS_EX_COMPOSITED) $hGraphic = GUICtrlCreateGraphic(0, $GridSize, $iDiagramWidth, $iDiagramHeight, BitOR($GUI_SS_DEFAULT_PIC,$WS_BORDER)) $hLabel = GUICtrlCreateLabel("Example", 0, 0, $iDiagramWidth,$GridSize) GUISetState() MsgBox(0, "Msg", "Click Ok to start") AvgBckColorChange() CreateGrid() AvgBckColorChange() MsgBox(0, "Msg", "End of Demo") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd Func AvgBckColorChange() ;Timer to change BCKColor of Label 10 times $Test = TimerInit() For $i = 1 to 10 GUICtrlSetBkColor($hLabel, 0x00000 & $i) Next MsgBox(0, "Msg", "Avg time to change color 10 times " & TimerDiff($Test)/10) EndFunc Func CreateGrid() ;Create Grid $iWidth = Floor(($iDiagramWidth - ($iDiagramPadding * 2)) / $GridSize) $iHeight = Floor(($iDiagramHeight - ($iDiagramPadding * 2)) / $GridSize) GUICtrlSetGraphic($hGraphic, $GUI_GR_COLOR, 0x000000) $icount = 0 For $iH = 0 To $iHeight For $iW = 0 To $iWidth GUICtrlSetGraphic($hGraphic, $GUI_GR_PIXEL, $iDiagramPadding + ($iW * $GridSize) - 1, $iDiagramPadding + ($iH * $GridSize) - 1) $icount += 1 Next Next ConsoleWrite($icount & @CRLF) GUICtrlSetGraphic($hGraphic, $GUI_GR_REFRESH) EndFunc I have a bloated workaround (see below) but wondered if the orginal issue can be fixed or if i am using graphics* incorrectly. Load the grid in a separate $WS_POPUP GUI Screencapture the GUI in memory (as the script will not have write permissions) Apply the $hBitmap to a PIC control Delete the $hBitmap, graphic & GUI *I am aware the more added to a graphic can slow it down but this should be around the 50k mark, My grid is only 1,250.
-
CryptoNG UDF - Cryptography API: Next Gen
IanN1990 replied to TheXman's topic in AutoIt Example Scripts
Hi, i have had a read through the posts and the UDFs. Am i correct that atm it is unable to encrypt / decrypt data (using RSA) using the public / private blobs it can create? #include "CryptoNG.au3" _CryptoNG_CreateRSAKeyPair(512, ".\Keys\publickey.blob", ".\Keys\privatekey.blob") $sEncryptedData = _CryptoNG_EncryptData($CNG_BCRYPT_RSA_ALGORITHM, "Test", FileRead(".\Keys\privatekey.blob")) ;$sEncryptedData = _CryptoNG_EncryptData($CNG_BCRYPT_RSAPRIVATE_BLOB, "Test", FileRead(".\Keys\privatekey.blob")) ConsoleWrite($sEncryptedData & @CRLF) ;Returns blank -
*Update after hours of troubleshooting, i think i am barking up the wrong tree. So not to waste anyone time, i am closing this for now. Hi All, I was wondering if there is a programmatic way to get the current x of a scrolled GUI? In my code below, an example made from a larger script, every function of _GUIScrollBars_Get* returns 0. _GUIScrollBars_GetScrollPos _GUIScrollBars_GetScrollInfoTrackPos _GUIScrollBars_GetScrollInfoPos #NoTrayIcon $DLLUser32 = DllOpen("user32.dll") $iScrollTotal = 875 $iScrollCurrent = 0 $hGUI = GUICreate("Example", 500, 250, -1, -1) GUICtrlCreateButton("Button 1", -125, 0, 125, 250) GUICtrlCreateButton("Button 2", -375, 0, 125, 250) GUISetState() AdlibRegister("Idle", 10) while 1 Switch GUIGetMsg() Case -3 Exit EndSwitch WEnd Func Idle() Scroll(1) EndFunc Func Scroll($iAmount) If $iScrollCurrent + $iAmount > $iScrollTotal Then $iAmount -= $iScrollTotal $iScrollCurrent += $iAmount DllCall($DLLUser32, "bool", "ScrollWindow", "hwnd", $hGUI, "int", $iAmount, "int", 0, "ptr", 0, "ptr", 0) EndFunc My current workaround is to store the info in a variable but now i need to branch this function between exes. It would be much easier to be able to just retrieve the info from the GUI itself, rather then storing it in registry / writing to a file / sharing memory / creating a dummy GUI to hold the info / sending messages back & forth etc Kind Regards, Ian P.S The reason i am moving the scroll animation to a separate exe is i want greater control over the animation speed. AdlibRegister has a minimum delay of 15ms and fluctuates between 10ms-20ms (which can look a little jittery). Using $hDll=DllOpen("winmm.dll") $hDll1=DllOpen("kernel32.dll") DllCall( $hDll, "dword", "timeBeginPeriod", "int", 1 ) ; Steps = 1 ms DllCall( $hDll1, "none", "Sleep", "int", 1) ; Steps = 1 ms DllCall( $hDll, "dword", "timeEndPeriod", "int", 1 ) ; Steps = 1 ms I can get much shorter timings in regular intervals.
-
StringRegExp but replace non-matching lines
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@Malkey After a month of reliable work, i have discovered an unique trait! $CSVString = '1,Enabled,"Mr,Test",Test,Location' & @CRLF & '2,Enabled,"Mr,Test",Location,Test' & @CRLF $Result1 = StringRegExpReplace($CSVString, '(?m)^(("[^"]+",)|([^,]*,)){4}(Location).*(*SKIP)(*F)|^.*\R?', "") ConsoleWrite($Result1 & @CRLF & @CRLF) $Result2 = StringRegExpReplace($CSVString, '(?m)^(?!(("[^"]+",)|([^,]*,)){4}(Location).*)^.*\R?', "") ConsoleWrite($Result2 & @CRLF & @CRLF) It is returning both lines when only one has "Location" in column four? -
StringRegExp but replace non-matching lines
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@Malkey Hi, both of your examples work perfectly. I am very jealous of the wizardry others have in RegExp, it is a hard art! -
StringRegExp but replace non-matching lines
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@mikell Your code has served me faithfully but has recently run into a slight issue. The lastest CSV sent by management can now have dual-roles. Where each role is separated by a , Is there a way the Regex could be changed to ignore , inside of quotes? The example below shows when i am looking match column 4 but an item is missed. $CSVString = '1,Enabled,"Mr,Test",Location' & @CRLF & '2,Enabled,"Mr Test",Location' & @CRLF $Result1 = StringRegExpReplace($CSVString, '(?m)^([^,]*,){' & 3 & '}(' & 'Location' & ').*(*SKIP)(*F)|^.*\R?', "") ConsoleWrite($Result1 & @CRLF & @CRLF) $Result2 = StringRegExpReplace($CSVString, '(?m)^([^,]*,){' & 4 & '}(' & 'Location' & ').*(*SKIP)(*F)|^.*\R?', "") ConsoleWrite($Result2 & @CRLF) -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 You are legend. Thank you. Your code works perfectly. -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 _WD_Option('DriverParams', '--log trace --marionette-port 2828') You were correct. Adding the above brought everything to life. $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:\\Users\\IanN1990\\Desktop\\09-02-2020b\\Firefox"]}}}}' $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none"}}' Individually they both work flawlessly, but no matter what combination i try i am unable to merge them together. Looking at your combined attempt, i tried to work backwards by removing the firefoxoptions but i get the error below; $sDesiredCapabilities = '{"capabilities":{"alwaysMatch":{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none"}}}}' __WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"capabilities":{"alwaysMatch":{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none"}}}} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"desiredCapabilities is not the name of a known capability or extension capability","stacktrace":""}} _WD_CreateSession: {"value":{"error":"invalid argument","message":"desiredCapabilities is not the name of a known capability or extension capability","stacktrace":""}} _WD_CreateSession ==> Webdriver Exception: desiredCapabilities is not the name of a known capability or extension capability -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
Same issue Version i had previously was 1.6.4.1 (the one you linked is 1.6.4.2) -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 Apologies for the delay. I was trying to troubleshoot #NoTrayIcon #AutoIt3Wrapper_Run_AU3Check=n #include ".\Includes\wd_core.au3" #include ".\Includes\wd_helper.au3" $_WD_DEBUG = $_WD_DEBUG_Info _WD_Option('Driver', @ScriptDir & '\Includes\geckodriver-v0.26.0.exe') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-profile", "C:/Users/Vocalink/Desktop/Firefox"]}}}}' _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to load") $sSession = _WD_CreateSession($sDesiredCapabilities) If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to create a session") _WD_Navigate($sSession, "https://www.bbc.com") The other two args ("-kiosk", "-private") work without issue. It is -profile which is causing the problem which is odd as Firefox is loading my profile. Here is the output though it is a little sparce. _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.2.0.5 _WDStartup: WinHTTP: 1.6.4.1 _WDStartup: Driver: C:\Users\Vocalink\Desktop\09-02-2020\Includes\geckodriver-v0.26.0.exe _WDStartup: Params: _WDStartup: Port: 4444 __WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-profile", "C:/Users/Vocalink/Desktop/Firefox"]}}}} __WD_Post: StatusCode=0; ResponseText=0 __WD_Post ==> Send / Recv error _WD_CreateSession: 0 _WD_CreateSession ==> Webdriver Exception: HTTP status = 0 -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 Implementing your recommendations produces the following output. #NoTrayIcon #AutoIt3Wrapper_Run_AU3Check=n #include ".\Includes\wd_core.au3" #include ".\Includes\wd_helper.au3" $_WD_DEBUG = $_WD_DEBUG_Info _WD_Option('Driver', @ScriptDir & '\Includes\geckodriver-v0.26.0.exe') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none", "moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:/Users/Ian/Desktop/Firefox"]}}}}' _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to load") $sSession = _WD_CreateSession($sDesiredCapabilities) If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to create a session") _WD_Navigate($sSession, "https://www.bbc.com") _WDStartup: OS: WIN_10 WIN32_NT 18363 _WDStartup: AutoIt: 3.3.14.5 _WDStartup: WD.au3: 0.2.0.5 _WDStartup: WinHTTP: 1.6.4.1 _WDStartup: Driver: C:\Users\Vocalink\Desktop\09-02-2020\Includes\geckodriver-v0.26.0.exe _WDStartup: Params: _WDStartup: Port: 4444 __WD_Post: URL=HTTP://127.0.0.1:4444/session; $sData={"capabilities":{"alwaysMatch": {{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none", "moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:/Users/Ian/Desktop/Firefox"]}}}} __WD_Post: StatusCode=400; ResponseText={"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"capabilities\":{\"alwaysMatch\": {{\"desiredCapabilities\":{\"javascriptEnabled\":true,\"nativeEvents\":true,\"acceptInsecureCerts\":true, \"pageLoadStrategy\":\"none\", \"moz:firefoxOptions\": {\"args\": [\"-kiosk\", \"-private\", \"-profile\", \"C:/Users/Ian/Desktop/Firefox\"]}}}}","stacktrace":"Syntax error at :1:34"}} _WD_CreateSession: {"value":{"error":"invalid argument","message":"Failed to decode request as JSON: {\"capabilities\":{\"alwaysMatch\": {{\"desiredCapabilities\":{\"javascriptEnabled\":true,\"nativeEvents\":true,\"acceptInsecureCerts\":true, \"pageLoadStrategy\":\"none\", \"moz:firefoxOptions\": {\"args\": [\"-kiosk\", \"-private\", \"-profile\", \"C:/Users/Ian/Desktop/Firefox\"]}}}}","stacktrace":"Syntax error at :1:34"}} _WD_CreateSession ==> Webdriver Exception: Failed to decode request as JSON: {"capabilities":{"alwaysMatch": {{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none", "moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:/Users/Ian/Desktop/Firefox"]}}}} **A small note, i noticed the forum is adding hidden characters. I had to copy it to notepad first to remove them. -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
@Danp2 Following your advice; #NoTrayIcon #AutoIt3Wrapper_Run_AU3Check=n #include ".\Includes\wd_core.au3" #include ".\Includes\wd_helper.au3" ProcessClose("geckodriver-v0.26.0.exe") $_WD_DEBUG = 0 _WD_Option('Driver', @ScriptDir & '\Includes\geckodriver-v0.26.0.exe') _WD_Option('Port', 4444) ;$sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none"}}' $sDesiredCapabilities = '{"capabilities":{"alwaysMatch": {"moz:firefoxOptions": {"args": ["-kiosk", "-private", "-profile", "C:/Users/Ian/Desktop/Firefox"]}}}}' _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to load") $sSession = _WD_CreateSession($sDesiredCapabilities) If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to create a session") _WD_Navigate($sSession, "https://www.google.com") Firefox now starts in Kiosk mode, with my profile and in private window but it now hangs at _WD_CreateSession($sDesiredCapabilities) I am also unsure how to merge the desiredCapabilities with the capabilities -
WebDriver UDF - Help & Support (II)
IanN1990 replied to Danp2's topic in AutoIt General Help and Support
Hi, #NoTrayIcon #AutoIt3Wrapper_Run_AU3Check=n #include ".\Includes\wd_core.au3" #include ".\Includes\wd_helper.au3" $_WD_DEBUG = 0 _WD_Option('Driver', @ScriptDir & '\Includes\geckodriver-v0.26.0.exe') _WD_Option('Port', 4444) $sDesiredCapabilities = '{"desiredCapabilities":{"javascriptEnabled":true,"nativeEvents":true,"acceptInsecureCerts":true, "pageLoadStrategy":"none", "args":["-kiosk"], "args":["-p Automation"] }}' _WD_Startup() If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to load") $sSession = _WD_CreateSession($sDesiredCapabilities) If @error <> $_WD_ERROR_Success Then Exit MsgBox(0, "Error", "Firefox Driver failed to create a session") _WD_Navigate($sSession, "https://www.google.com") Are you about to spot where i have gone wrong? Firefox loads and navigates to google but my two args ("-kiosk") and ("-p Automation") are not having an effect. I have tested them outside of Webdriver and confirmed they work. -
[Solved] AutoIT Project Mode
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@argumentum Sent me on the right track. Was what i remembered I just thought it was part of the offical release for some reason -
Hi All, Unless old age is playing tricks one me, I swear SciTE / Autoit had a project mode feature. Instead of loading a single .au3 you would load a folder of .au3s and easily switch between them. Am I missing something obvious or day-dreaming again ^^ Ian
-
Sods law after creating a large post i end up making some headway! Seems the child-window needs to be moved into frame to be displayed correctly #NoTrayIcon #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> Example4() Func Example4() $hMainGUI = GUICreate("Main Background - Example 4", 500, 500, 0, 0, -1) GUISetBkColor(0x000000) GUISetState() $hGUIOverlay = GUICreate("Test 4", 500, 500, 0, 0, -1, $WS_EX_LAYERED) GUISetBkColor(0x0000F4) GUICtrlCreateButton("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 50, 255, 40) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 100, 255, 40) _WinAPI_SetLayeredWindowAttributes($hGUIOverlay, 0x0000F4) GUISetState() _WinAPI_SetParent($hGUIOverlay, $hMainGUI) _WinAPI_MoveWindow($hGUIOverlay, 0, 0, 500, 500) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUIOverlay) GUIDelete($hMainGUI) EndFunc
-
Hi All, I am working on a new UI design to allow greater flexibility. Below is a my core concept but GUICtrlCreatePic causes it to fail and i am unsure why. #NoTrayIcon #include <WindowsConstants.au3> #include <GUIConstantsEx.au3> #include <WinAPI.au3> Example1() Example2() Example3() ;Working - The second GUI is now within the first GUI and they are linked. Func Example1() $hMainGUI = GUICreate("Main Background - Example 1", 500, 500, 0, 0) GUISetBkColor(0x000000) GUISetState() $hGUIOverlay = GUICreate("Test 1", 500, 475, 0, 0) GUISetBkColor(0x0000F4) GUICtrlCreateButton("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 50, 255, 40) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 100, 255, 40) GUISetState() _WinAPI_SetParent($hGUIOverlay, $hMainGUI) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUIOverlay) GUIDelete($hMainGUI) EndFunc ;Working - The second GUI is now transparent ;GUICtrlCreatePic commented out. Func Example2() $hMainGUI = GUICreate("Main Background - Example 2", 500, 500, 0, 0) GUISetBkColor(0x000000) GUISetState() $hGUIOverlay = GUICreate("Test 2", 500, 500, 0, 0, -1, $WS_EX_LAYERED) GUISetBkColor(0x0000F4) GUICtrlCreateButton("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 50, 255, 40) ;GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 100, 255, 40) _WinAPI_SetParent($hGUIOverlay, $hMainGUI) _WinAPI_SetLayeredWindowAttributes($hGUIOverlay, 0x0000F4) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUIOverlay) GUIDelete($hMainGUI) EndFunc ;Failed - Same code as above but GUICtrlCreatePic is now uncommented. ;Now nothing is shown Func Example3() $hMainGUI = GUICreate("Main Background - Example 3", 500, 500, 0, 0) GUISetBkColor(0x000000) GUISetState() $hGUIOverlay = GUICreate("Test 3", 500, 500, 0, 0, -1, $WS_EX_LAYERED) GUISetBkColor(0x0000F4) GUICtrlCreateButton("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 50, 255, 40) GUICtrlCreatePic("C:\Program Files (x86)\AutoIt3\Examples\GUI\mslogo.jpg", 50, 100, 255, 40) _WinAPI_SetParent($hGUIOverlay, $hMainGUI) _WinAPI_SetLayeredWindowAttributes($hGUIOverlay, 0x0000F4) GUISetState() Do Until GUIGetMsg() = $GUI_EVENT_CLOSE GUIDelete($hGUIOverlay) GUIDelete($hMainGUI) EndFunc Does anyone have any idea why it is failing and / or how to correct it? **The code Example 1 & 2 will only work on Windows 10 and anything less does not support layering of child windows. Why i am going down this route 1. This design would allow me to have videos playing in $MainGUI while not impacting / blocking other GUI elements layered over it. 2. Would allow me to create self-contained designed GUIs to be shown / hidden easily while having transparency. 3. The reason i need it working with pictures instead of just buttons is because of the graphic options it provides. I tired a button with $BS_BMP but it had the same outcome. 4. The reason for _WinAPI_SetParent instead WS_EX_MDICHILD and Parent handle is because these are not truly "linked". If i did GUISetState(@SW_Hide, $MainGUI) or winsettrans($MainGUI, "", 125) then $hGUIOverlay is unaffected. Though i could run the command on $hGUIOverlay this is twice the handle management and slows down ading animations. For $i = 240 to 0 step -15 winsettrans($MainGUI, "", $i) Next vs For $i = 240 to 0 step -15 winsettrans($MainGUI, "", $i) winsettrans($hGUIOverlay, "", $i) Next
-
StringRegExp but replace non-matching lines
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
@mikell Your code works perfectly! and it completes all 15k rows in 500ms! Having the power of RegEx is like being a wizard! @jchd You are correct in everything you said, in this example i am quite lucky where the first four columns are generated pragmatically . So there wouldn't be a risk of the issues you mentioned. Thank you all for your help on this issue! It's much appricated -
StringRegExp but replace non-matching lines
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
Always amazes me how people come up with these regular expressions! I wish a had a mind for it @FrancescoDiMuro Unfortunately i couldn't get yours to work @jchd and @mikell both worked though jcdh was slightly faster, processing 150k lines in <4 seconds vs 4.5! a photo finish Though i noticed it was picking up some false positives. 08/01/2019 17:08:54,"Test","IanN.1990","File Location","C:\temp\121312.log","File Location" <-- Correct 08/01/2019 17:08:54,"Test","IanN.1990","Date Reviewed","C:\temp\121312.log","File Location" <-- Incorrect as column 4 = Date Reviewed I attempted to correct this by adding in my earlier code .*,.*, with my logic being; Match anything until , then match anything until , then look for my phase but that would en-scope the false positive. I am guessing i need a way for it only to look between the second and third , ? Ian -
Hi all, I am trying to read a csv and remove any line that does not contain "File Location" or "Date Submitted" in column 4 Using the helpfile I was about to produce this; $string = StringRegExpReplace($String, '\r\n.*,.*,.*,("File Location"|Date Submitted").*', "") Irony is, it works perfectly in the opposite way i need and removes any line with "File Location" / "Date Submitted" in colum 4. I can't figure out how to invert it. Reading the helpfile it mentions ?! but no matter of combination I try the outcome is the same. Any help is appreciated! Ian
-
Listview + $LVS_EX_GRIDLINES with no border (Solved)
IanN1990 replied to IanN1990's topic in AutoIt General Help and Support
Hi Belini, Your code was perfect and solved my issue I never thought of adding the style separately was the answer! -
Hi All, I am unable to remove the border when using the extended style "$LVS_EX_GRIDLINES". The issue only appears when running code, it is not shown within Koda. #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 215, 206, 344, 147) $ListView1 = GUICtrlCreateListView("test|test2", 16, 24, 162, 126, BitOR($LVS_REPORT,$LVS_SINGLESEL), BitOR($LVS_EX_GRIDLINES,$LVS_EX_FULLROWSELECT)) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Ian
-
Hi All, I have run into a small problem on my latest project. My GUI has a large number of dynamically generated labels, to help with performance i use @SW_Lock / @SW_UNLOCK but i am finding if the GUI loses focus it resumes it repainting / updating. I tired using GUIRegisterMsg($WM_PAINT, "WM_Paint") but my code is causing an endless loop. Is there like a "skip this paint" i can return? Func WM_Paint($hWnd, $iMsg, $wParam, $lParam) If $Paint = 1 Then Return $GUI_RUNDEFMSG Else Return 0 EndIf EndFunc ;==>WM_Paint Update 2. Just found the following; _SendMessage($hMainGUI, $WM_SETREDRAW, False, 0) ;Disables _SendMessage($hMainGUI, $WM_SETREDRAW, True, 0) ;Enables _WinAPI_RedrawWindow($hMainGUI, 0, 0, BitOR( $RDW_FRAME, $RDW_INVALIDATE, $RDW_ALLCHILDREN)) ;Repaints Though this correctly prevents any repainting, the taskbar icon disappears and makes the GUI becomes click-throughable? Ian
-
Update. After more troubleshooting i found a combo-box items only generate it's list after it has been opened. A workaround for this is the code below which opens / closes the combo but doesn't take focus. ; --- Find window/control --- ConsoleWrite( "--- Find window/control ---" & @CRLF ) Local $pCondition0 $oUIAutomation.CreatePropertyCondition( $UIA_AutomationIdPropertyId, "cmbAddressType", $pCondition0 ) If Not $pCondition0 Then Return ConsoleWrite( "$pCondition0 ERR" & @CRLF ) ConsoleWrite( "$pCondition0 OK" & @CRLF ) Local $pComboBox1, $oComboBox1 $oWindow1.FindFirst( $TreeScope_Descendants, $pCondition0, $pComboBox1 ) $oComboBox1 = ObjCreateInterface( $pComboBox1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oComboBox1 ) Then Return ConsoleWrite( "$oComboBox1 ERR" & @CRLF ) ConsoleWrite( "$oComboBox1 OK" & @CRLF ) Local $pInvoke, $oInvoke $oComboBox1.GetCurrentPattern( $UIA_LegacyIAccessiblePatternId, $pInvoke) $oInvoke = ObjCreateInterface( $pInvoke, $sIID_IUIAutomationLegacyIAccessiblePattern, $dtagIUIAutomationLegacyIAccessiblePattern ) If Not IsObj( $oInvoke ) Then Return ConsoleWrite( "$oInvoke ERR" & @CRLF ) ConsoleWrite( "$oInvoke OK" & @CRLF ) $oInvoke.DoDefaultAction() $oInvoke.DoDefaultAction() I also found using the Legacy Select lets me select my item without taking focus. I don't know why it needed the number 3 but without it didn't work ^^. ;Find List Item Local $pCondition4 $oUIAutomation.CreatePropertyCondition( $UIA_NamePropertyId, "Do it later", $pCondition4 ) If Not $pCondition4 Then Return ConsoleWrite( "$pCondition4 ERR" & @CRLF ) ConsoleWrite( "$pCondition4 OK" & @CRLF ) Local $pListItem1, $oListItem1 $oComboBox1.FindFirst( $TreeScope_Children, $pCondition4, $pListItem1 ) $oListItem1 = ObjCreateInterface( $pListItem1, $sIID_IUIAutomationElement, $dtagIUIAutomationElement ) If Not IsObj( $oListItem1 ) Then Return ConsoleWrite( "$oListItem1 ERR" & @CRLF ) ConsoleWrite( "$oListItem1 OK" & @CRLF ) Local $pInvoke, $oInvoke $oListItem1.GetCurrentPattern( $UIA_LegacyIAccessiblePatternId, $pInvoke) $oInvoke = ObjCreateInterface( $pInvoke, $sIID_IUIAutomationLegacyIAccessiblePattern, $dtagIUIAutomationLegacyIAccessiblePattern ) If Not IsObj( $oInvoke ) Then Return ConsoleWrite( "$oInvoke ERR" & @CRLF ) ConsoleWrite( "$oInvoke OK" & @CRLF ) $oInvoke.Select(3) One random question! Can IUI enable/disable controls similar to ControlEnable/ControlDisable?