Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 03/02/2017 in all areas

  1. First post updated to v1.00 Had some time to work on this project. The graphics look much better. Tested AutoIt Versions: 3.3.8.1 3.3.12.0 3.3.14.0 3.3.15.0
    2 points
  2. mesale0077 asked me whether I could code some CSS loading animations from different web sites. These are the results using GDI+ (AutoIt v3.3.12.0+ required!): _GDIPlus_MonochromaticBlinker.au3 / _GDIPlus_RotatingBokeh.au3 _GDIPlus_SpinningCandy.au3 / _GDIPlus_SteamPunkLoading.au3 _GDIPlus_IncreasingBalls.au3 / _GDIPlus_PacmanProgressbar.au3 _GDIPlus_StripProgressbar.au3 / _GDIPlus_RingProgressbar.au3 _GDIPlus_LineProgressbar.au3 / _GDIPlus_SimpleLoadingAnim.au3 _GDIPlus_TextFillingWithWater.au3 / _GDIPlus_MultiColorLoader.au3 _GDIPlus_LoadingSpinner.au3 / _GDIPlus_SpinningAndPulsing.au3 _GDIPlus_TogglingSphere.au3 / _GDIPlus_CloudySpiral.au3 _GDIPlus_GlowingText.au3 (thanks to Eukalyptus) / _GDIPlus_HypnoticLoader.au3 _GDIPlus_RotatingRectangles.au3 / _GDIPlus_TRONSpinner.au3 _GDIPlus_RotatingBars.au3 / _GDIPlus_AnotherText.au3 (thanks to Eukalyptus) _GDIPlus_CogWheels.au3 (thanks to Eukalyptus) / _GDIPlus_DrawingText.au3 (thanks to Eukalyptus) _GDIPlus_GearsAnim.au3 / _GDIPlus_LEDAnim.au3 _GDIPlus_LoadingTextAnim.au3 / _GDIPlus_MovingRectangles.au3 _GDIPlus_SpinningAndGlowing.au3 (thanks to Eukalyptus) / _GDIPlus_YetAnotherLoadingAnim.au3 _GDIPlus_AnimatedTypeLoader.au3 / _GDIPlus_Carousel.au3 Each animation function has a built-in example how it can be used. AiO download: GDI+ Animated Wait Loading Screens.7z (previous downloads: 1757) Big thanks to Eukalyptus for providing several examples. Maybe useful for some of you Br, UEZ PS: I don't understand CSS - everything is made out of my mind, so it might be different from original CSS examples
    1 point
  3. Obsolete. Use Data display functions based on virtual listviews. I'm working on some code related to virtual ListViews. In this regard, I need to be able to show the contents of large arrays with the same ease as _ArrayDisplay can show the contents of smaller arrays. The arrays have to be shown as fast as possible. _ArrayDisplayEx is the answer. The most fundamental difference between _ArrayDisplayEx based on a virtual ListView and the official version of _ArrayDisplay is, that a virtual ListView is depending on WM_NOTIFY messages and needs a function to handle these messages. Advantages and disadvantages of _ArrayDisplayEx: Advantages No limitation on the number of rows as the ListView can display. The array itself is the limitation. The ListView shows up immediately. Because a virtual ListView is fed with data directly from the array, no time is spent on inserting rows in the ListView. Disadvantages _ArrayDisplayEx is depending on WM_NOTIFY message handlers registered with GUIRegisterMsg. Because you can't use two different WM_NOTIFY message handlers registered with GUIRegisterMsg at the same time, this makes it difficult to use a WM_NOTIFY message handler in your own code. This also makes it impossible to display two _ArrayDisplayEx windows side by side at the same time. Significantly more work is carried out by _ArrayDisplayEx than _ArrayDisplay. _ArrayDisplayEx must constantly feed the ListView with data for example when you scroll up or down. This is done in the WM_NOTIFY message handlers. Column widths are calculated based on the rows at the first page in the list view. This will not necessarily lead to correct column widths for all rows. Don't use _ArrayDisplayEx if the array contains less than 10,000 rows. The GUI Most of the GUI code is copied directly from the official version of _ArrayDisplay. Credit goes to ; #FUNCTION# =================================================================== ; Author ........: randallc, Ultima ; Modified.......: Gary Frost (gafrost), Ultima, Zedna, jpm, Melba23, AZJIO, UEZ ; ============================================================================== and especially Melba23, who has done most of the coding in the recent versions of the function. Changes compared to _ArrayDisplay (3.3.14) Changes in functionality and changes for parameters in function definition. A new "Goto row" control is added to the left of "Copy" buttons. If there are many rows in the array, it can be difficult to navigate to a specific row with the scroll bar. It's much easier to enter the row number. The dimensions label below the ListView that shows array dimensions is always shown. If a user function is specified the "Run User Func" button is always shown whether "Goto row" control or "Copy" buttons are shown or not. "Run User Func" button appears to the right of the dimensions label. $iFlags parameter (new/modified in bold): 0 = Left aligned text (default) 1 = Transposes the array 2 = Right aligned text 4 = Centered text 8 = Verbose: MsgBox on error, splash screen on lengthy commands 16 = No "Copy" buttons displayed (page 2 in Examples.au3) 32 = No "Exit Script" button displayed (page 2 in Examples.au3) 64 = No "Goto row" control displayed (page 2 in Examples.au3) 128 = No "Row" column displayed in ListView (header / page 5) 256 = Pass array and selection to user function (page 2) 512 = Show types of special data (page 3) 1024 = Half-height ListView (page 5) Flag values to hide controls and "Row" column. The meaning of the values 16, 32 and 64 is changed compared to the official version. 128 is a new value. When I specify a user function, it's rare that I need the array and selection. The default in _ArrayDisplayEx is not to pass array and selection to user function. If the array contains 100,000 rows the calculation of selected rows takes time. Set $iFlags = 256 to pass array and selection to user function. When array and selection is passed to user function ($iFlags = 256), "Run User Func" button works in the same way as "Copy" buttons according to the selection. If no rows are selected, all rows are passed to the user function. Else selected rows are passed to the function. If only rows 5 - 17 are visible in the ListView ($sArrayRange = "5:17"), you might only want to execute the user function for rows 5 - 17. For this purpose _ArrayDisplayEx settings can be passed to user function. Call _ArrayDisplayEx_LocalStorage (see below) to get the settings. Set $iFlags = 512 to show types of special data. Special data includes arrays, functions, objects and structures (DllStructCreate). When the flag is set, the corresponding cells in the ListView are shown with the following text strings: {Array}, {Function}, {Object} and {Struct}. Without this flag data is shown as empty cells. The flag is not set as default. For large arrays the control of special data types is time consuming. Because a lot of work is carried out in WM_NOTIFY functions to feed the ListView with data, you can set $iFlags = 1024 to use a half-height ListView. Then the ListView only have to be fed with half as many data. When you drag the scrollbar with the mouse, it's easier for the scrollbar to follow the mouse. A new parameter $hWM_NOTIFY_Function = 0 is added as the last parameter. Because _ArrayDisplayEx is based on a virtual ListView it's depending on WM_NOTIFY messages and functions. If you are using a WM_NOTIFY function in your own script, you can use the $hWM_NOTIFY_Function parameter to restore your function when the code returns from _ArrayDisplayEx. See page 4 in Examples.au3. Optimized for speed In this version the code is optimized for speed and nothing else. This means that as many control statements as possible are calculated before the repetitive and fast call of WM_NOTIFY functions in response to LVN_GETDISPINFO notifications to feed the ListView with data. The disadvantage is, that there is a fairly large number of WM_NOTIFY functions. The reason for the size of the script. Avoiding global variables To avoid globals a function _ArrayDisplayEx_LocalStorage and static locals are used to transfer information from _ArrayDisplayEx to WM_NOTIFY functions. _ArrayDisplayEx_LocalStorage can be called e.g. in a user function to get the same information. See page 2 in Examples.au3. Because of this usage of _ArrayDisplayEx_LocalStorage the keywords Const and ByRef can't be used in definition of _ArrayDisplayEx. Since _ArrayDisplayEx does not change the array this is not a problem. On the other hand it means that you can call the function in this way: _ArrayDisplayEx( StringSplit( "string", "delimiters" ) ) Examples Examples.au3 contains a bunch of small examples: Page 1 demonstrates the usage of the $sArrayRange parameter Page 2 shows the changes in relation to controls and user function Page 3 demonstrates how to show types of special data Page 4 shows how to restore a WM_NOTIFY function Page 5 is a summary of parameters and flags For the examples at page 1 (only page 1) you can click the "Run User Func" button to compare with the official version. To avoid influence of the WM_NOTIFY function (which would decrease performance significantly) _ArrayDisplay is executed in it's own process. The array is transferred to the new process through an object registered with AutoItObject (you can find a step-by-step demonstration of the technique here, and you can find a description in the AutoItObject thread). Run this code to test _ArrayDisplayEx with a large array: #include "ArrayDisplayEx.au3" ; One million rows, ten columns Global $iRows = 1000000, $iCols = 10 Global $aArray[$iRows][$iCols] ; This takes some seconds ; It'll use some memory For $i = 0 To $iRows - 1 For $j = 0 To $iCols - 1 $aArray[$i][$j] = $i & "/" & $j Next Next ConsoleWrite( "Array done ..." & @CRLF ) _ArrayDisplayEx( $aArray, "", "", 16, "", "", Default, 0xCCFFFF ) ; 16 => remove "Copy" buttons ; 0xCCFFFF => alternating row color Notice the "Array done ..." message in the console. The delay from the message shows up till you see the rows in the ListView, is the time it takes to create the GUI. Zip The zip contains four files: ArrayDisplayEx.au3 - contains the _ArrayDisplayEx UDF Examples.au3 - a bunch of small examples spread over five pages Examples\AutoItObject.au3 by the AutoItObject team - used in examples at page 1 Examples\Original.au3 - used in examples at page 1 You need AutoIt 3.3.10 or later. Tested on Windows 7 64 bit and Windows XP 32 bit. Comments are welcome. Let me know if there are any issues. Updated zip at bottom of post #4.
    1 point
  4. Hi all, I was pondering over a question with regards to the speeds of reading something and did not see this kind of question in a forum search. The question: What is (technically) faster? Multiple reads from the same 3d array cell, or only once make a 'temp' variable from that cell and read the value from this? I don't know if either has any real impact at all anyway, but just wanted to ask anyway. :-) There may be a difference if the value holds an integer or a string (or something else) but in my case, is a simple integer. To hopefully clarify with a small bit of code: $process = $start - 15 If $xy[$process][3] <> "x" Then If _ArraySearch($open, $process, 1, $open[0][0], 0, 0, 1, 1) <> -1 Then UpdateOpen($xy[$process][5], $closed[0][0]) ElseIf $start > 0 And _ArraySearch($closed, $process, 1, $closed[0][0], 0, 0, 1, 0) = -1 Then Add_open($start, $closed[0][0], $counter, $process) EndIf EndIf You can read from this, that the array $closed[0][0] is being read 3 times. And this goes on further in the code I did not show. My question boils down to this, should I make a 'temp' variable to hold that $closed[0][0] value until the function is done? It may not have a real impact on my small script, but I really am interested in the answer at least. Regards, Tri.
    1 point
  5. Transpose flag Transposing a 2D array means to swap rows and columns. Transposing a 1D array seems not to make much sense. In a 1D array it makes not much sense to talk about rows or columns. It makes more sense to talk about elements. In this version the transpose flag is always set to zero (false) if the array is a 1D array. The array is always shown in the listview as one column with many rows. In previous versions the transpose flag for a 1D array meant that the array was shown in the listview as one row with many columns. But this was merely a visual effect in the listview. It was not really a transposed array. The reason for this change is that a listview is much better to display many rows than many columns. And a lot of code in WM_NOTIFY message handlers for the virtual listview can be avoided. For a 2D array the transpose flag is especially useful if the source array for one reason or another is transposed in itself (rows and columns are swapped directly in the source). Divided UDF UDFs with a lot of functionality usually also contains a lot of code. In most cases there is only need for a minor part of the functionality. It would be nice if it was enough to include a minor part of the code. The solution is a divided UDF: The UDF is divided into a main include file and a number of sub-includes. Because names and functionality of the includes are known, it's possible to add a few lines of code to the top of each file to check if a needed file is included. In the main include, ArrayDisplayEx.au3, it's checked whether needed files are included. The check is performed by examining parameters and flags for requested functionality. A missing include file will not result in any AU3Check, Compile or Runtime errors. If verbose mode is enabled (flag 0x0008) a MsgBox will show the names of missing includes. Else @error is set to 3 and @extended contains the indices (see top of ArrayDisplayEx.au3 or ArrayDisplayEx_AllFuncs.au3) of missing files. The include files are completely independent and can be included in any order and in any number. The main file is included in top of all sub-includes just below the #include-once keyword. A missing include file is checked. An unused include file is not checked. ArrayDisplayEx_Basic1D2Dfuncs.au3 (5 KB) is as the only file included in ArrayDisplayEx.au3. If you only need basic functionality for 1D/2D arrays it's enough to include ArrayDisplayEx.au3. Or ArrayDisplayEx_Basic1D2Dfuncs.au3 because ArrayDisplayEx.au3 is also included in the very top of the former. Include ArrayDisplayEx_AllFuncs.au3 to use all functionality. This file also contains information about the include files. Column alignment _ArrayDisplayEx can be used for development, troubleshooting and debugging. But it can also be used as a simple GUI to display a 1D/2D array for end users. This section and the next two sections is about improvements that are helpful when _ArrayDisplayEx is used to display arrays for end users. $aAlignment is a new parameter to pass a 2D array of column index/alignment pairs to _ArrayDisplayEx to specify alignment for individual columns. This example from the zip file below shows how to use the $aAlignment parameter: #include "..\..\Includes\ArrayDisplayEx.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() Local $iRows = 10000 Local $aArray[$iRows][10] For $i = 0 To $iRows - 1 For $j = 0 To 9 $aArray[$i][$j] = $i & "/" & $j Next Next Local $aAlignment = [ _ [ -1, 2 ], _ ; Unspecified columns: Right aligned [ 2, 0 ], _ ; Column 2: Left aligned [ 3, 4 ] ] ; Column 3: Centered text _ArrayDisplayEx( $aArray, "Column alignment: Array", "", 0x0010, $aAlignment, "", "", 75 ) ; 0x0010 = No "Copy" buttons EndFunc Minimum column widths In a virtual ListView column widths are calculated based on the rows at the first page in the ListView. This will not necessarily lead to correct column widths for all rows. $aMin_ColWidth is a new parameter to specify minimum column widths. Supply a number to set a minimum width for all columns. Use a 2D array of column index/width pairs to specify widths for individual columns. This example from the zip file shows how to use the $aMin_ColWidth parameter: #include "..\..\Includes\ArrayDisplayEx.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() Local $iRows = 10000 Local $aArray[$iRows][10] For $i = 0 To $iRows - 1 For $j = 0 To 9 $aArray[$i][$j] = $i & "/" & $j Next Next Local $aColWidths = [ _ [ -2, 65 ], _ ; Width for row-number column [ -1, 75 ], _ ; Width for unspecified columns [ 0, 55 ], _ ; Column 0, first col in array [ 1, 100 ], _ [ 2, 150 ], _ [ 3, 55 ] ] _ArrayDisplayEx( $aArray, "Minimum column widths: Array", "", 0x0012, "", "", "", $aColWidths ) ; 0x0012 = Right aligned text + No "Copy" buttons EndFunc Localized texts When _ArrayDisplayEx is used to display arrays for end users it's usually appreciated to display texts in the local language. $aLocal_Texts is used to pass to the function a translation of the english texts (error messages, control texts, listview header, tooltip and splash texts) into the local language. See top of ArrayDisplayEx.au3 for the format of $aLocal_Texts array. Internally $aLocal_Texts is stored as a static variable. This means that you can call _ArrayDisplayEx several times in the same script and only pass $aLocal_Texts to the function once. $aLocal_Texts also accepts a single string as parameter value. In this case the name of "Run User Func" button is replaced. The ability to specify a meaningful name makes the button more useful. Other updates Dokumentation in top of ArrayDisplayEx.au3 Among other things a list of parameters and flags Information about include files in ArrayDisplayEx_AllFuncs.au3 A number of smaller and a few bigger updates and bug fixes Examples The examples are grouped in folders by subject. 1) Functionality\ contains the GUI with 4 pages which demonstrates general functionality. This example has been included in all previous zip files. The other folders contains examples to demonstrate the new features. It's very small examples as the examples above. 3) Divided UDF\ contains scripts that shows how it's checked if a needed file is included or missing. There are three scripts. This is the first: #include "..\..\Includes\ArrayDisplayEx.au3" ;#include "..\..\Includes\ArrayDisplayEx_CopyFuncs.au3" ;#include "..\..\Includes\ArrayDisplayEx_UserFuncs.au3" ;#include "..\..\Includes\ArrayDisplayEx_ColorBasic.au3" Opt( "MustDeclareVars", 1 ) Global $aArray Example() Func Example() Local $iRows = 10000 Dim $aArray[$iRows][10] For $i = 0 To $iRows - 1 For $j = 0 To 9 $aArray[$i][$j] = $i & "/" & $j Next Next _ArrayDisplayEx( $aArray, "Missing includes", "", 0x0008, "", "", "", 55, 350, 0x000000, UserFunc ) ; 0x0008 = Verbose mode ConsoleWrite( "@error = " & @error & @CRLF & _ ; Don't exit script if you want to "@extended = " & BitsToStr( @extended ) & @CRLF ) ; see these lines in SciTE console. EndFunc Func UserFunc( $p1, $p2 ) ; 0x1818 = Verbose mode + No "Copy" buttons + No grid lines + Three alternating rows _ArrayDisplayEx( $aArray, "Click here button", "", 0x1818, "", "", "", 55, 350, 0xCCFFFF ) #forceref $p1, $p2 EndFunc Func BitsToStr( $iInt ) Local $sBits = "" For $i = 7 To 0 Step -1 $sBits &= BitAND( $iInt, 2^$i ) ? "1" : "0" Next Return $sBits EndFunc ArrayDisplayEx_CopyFuncs.au3 and ArrayDisplayEx_UserFuncs.au3 are needed to support Copy buttons and "Run User Func" button. Because the files are commented out, an error is generated when the script is run. Since Verbose mode is enabled the error will be shown in a MsgBox. In next script the comment symbol in front of these two files is deleted. There is still a comment in front of the third include to support alternating row colors. Now the script runs without errors, but clicking "Run User Func" button (renamed to "Click here" in example) will generate an error. In third script the last comment symbol is also deleted and the script runs completely without errors. Updated zip at bottom of next post.
    1 point
  6. Really?! You couldn't have looked too hard...
    1 point
  7. Here is an optional example of using StringRegExp with flag 3, with data put into a 2D array. In the RE pattern, the first opening bracket pairs with the last closing bracket, so the first captured group is the entire GUID. #include <Array.au3> #include <StringConstants.au3> Local $s_Code = '{90140000-001C-0000-1000-0000000FF1CE};{90140000-0016-081A-1000-0000000FF1CE};{90140000-0016-0402-1000-0000000FF1CE}' Local $aRes = StringRegExp($s_Code, '(' & _ ; Start of 1st capture group. '([[:xdigit:]])([[:xdigit:]])([[:xdigit:]]{2})([[:xdigit:]]{4})-' & _ ; 2nd (1-xdigit), 3rd (1-xdigit), 4th (2-xdigits), 5th (4-xdigits) capture groups. '([[:xdigit:]]{4})-' & _ ; 6th (4-xdigits) capture group. '([[:xdigit:]]{4})-' & _ ; 7th (4-xdigits) capture group. '([[:xdigit:]])([[:xdigit:]]{3})-' & _ ; 8th (1-xdigit), 9th (3-xdigits) capture groups. '([[:xdigit:]])([[:xdigit:]]{11})' & _ ; 10th (1-xdigit), 11th (11-xdigits) capture groups. ')', _ ; End of 1st capture group. $STR_REGEXPARRAYGLOBALMATCH) ; flag 3 ;_ArrayDisplay($aRes) ; Put data from 1D array, $aRes, into 2D array, $aRes2D, with 11 columns. Local $iNum = UBound($aRes) / 11 ; Number of GUID's in code string, $s_Code. ($iNum will be number of lines in 2D array.) Local $aRes2D[$iNum][11] For $i = 0 To UBound($aRes) - 1 $aRes2D[Int($i / 11)][Mod($i, 11)] = $aRes[$i] Next _ArrayDisplay($aRes2D) MsgBox(0, "", "Product Id in 2nd GUID is : 0x" & $aRes2D[1][5])
    1 point
  8. Here are my contribs. 1. Improved _FFClick so now it's able to click based on the CSS selector and on the text Func _FFClick($sElement, $sMode = "elements", $iIndex = 0, $bLoadWait = True) Local Const $sFuncName = "_FFClick" If Not IsInt($iIndex) Then SetError(__FFError($sFuncName, $_FF_ERROR_InvalidDataType, "(int) $iIndex: " & $iIndex)) Return 0 EndIf If $sMode = Default Then $sMode = "elements" If $iIndex = Default Then $iIndex = 0 Switch StringLower($sMode) Case "elements" If StringLeft($sElement, 7) = "OBJECT|" Then $sElement = StringMid($sElement, 8) Case "id" $sElement = ".getElementById('" & $sElement & "')" Case "name" $sElement = ".getElementsByName('" & $sElement & "')[" & $iIndex & "]" Case "class" $sElement = ".getElementsByClassName('" & $sElement & "')[" & $iIndex & "]" Case "tag" $sElement = ".getElementsByTagName('" & $sElement & "')[" & $iIndex & "]" Case "selector" $sElement = ".querySelectorAll('" & $sElement & "')[" & $iIndex & "]" Case "text" $sElement = ".evaluate(""//*[contains(text(), '" & $sElement & "')]"", document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue;" Case Else SetError(__FFError($sFuncName, $_FF_ERROR_InvalidValue, "(elements|id|name|class|tag) $sMode: " & $sMode)) Return 0 EndSwitch If StringLeft($sElement, 1) = "." Then $sElement = "FFau3.WCD" & $sElement Local $RetVal = _FFCmd("FFau3.simulateEvent(" & $sElement & ",'MouseEvents','click');") If Not @error And $RetVal <> "_FFCmd_Err" And $RetVal = 1 Then Sleep(25) If $bLoadWait Then Return _FFLoadWait() __FFSetTopDocument() Return 1 Else SetError(__FFError($sFuncName, $_FF_ERROR_NoMatch, "$sElement: " & $sElement)) Return 0 EndIf EndFunc Examples: _FFClick(".menu a.menuitem", "selector", 0) _FFClick("Search", "text") 2. Added proxy changing support Func _FFSetProxy($host, $port, $type) _FFUnSetProxy() _FFPrefSet("network.proxy.type",1) If $type = "http" Then _FFPrefSet("network.proxy.http", $host) ; http proxy _FFPrefSet("network.proxy.http_port", Int($port)) ; http proxy port ElseIf $type = "socks5" Then _FFPrefSet("network.proxy.socks" ,$host) ; socks _FFPrefSet("network.proxy.socks_port", Int($port)) ; socks port _FFPrefSet("network.proxy.socks_version", 5) ; socks version ElseIf $type = "socks4" Then _FFPrefSet("network.proxy.socks" ,$host) ; socks _FFPrefSet("network.proxy.socks_port", Int($port)) ; socks port _FFPrefSet("network.proxy.socks_version", 4) ; socks version EndIf EndFunc Func _FFUnSetProxy() _FFPrefReset("network.proxy.type") _FFPrefReset("network.proxy.http") _FFPrefReset("network.proxy.http_port") _FFPrefReset("network.proxy.socks") _FFPrefReset("network.proxy.socks_port") _FFPrefReset("network.proxy.socks_version") EndFunc Example: _FFSetProxy("localhost", 8080, "socks5") ; socks5 proxy (i.e.: Tor and Putty/SSH) _FFSetProxy("localhost", 8080, "socks4") ; socks4 proxy _FFSetProxy("localhost", 8080, "http") ; http proxy _FFUnSetProxy() ; reset to defaults 3. Fixed _FFStart() not finding Firefox executable in some machines The UDF was not findind Firefox if the user installed a x86 version on a x64 OS. This function will take care on this: Func __FFStartProcess($sURL = "about:blank", $bNewWin = False, $sProfile = "default", $bNoRemote = False, $bHide = False, $iPort = 4242, $iTimeOut = 30000) Local Const $sFuncName = "__FFStartProcess" Local $PID = -1 Local $sNoRemote = "", $sNewWin Local $sProcName = $_FF_PROC_NAME If $sProfile = "default" Then $sProfile = '' Else $sProfile = ' -P "' & $sProfile & '"' EndIf If $bNoRemote Then $sNoRemote = "-no-remote" If $bNewWin Then $sNewWin = "-new-window" $sURL = '"' & $sURL & '"' If $iTimeOut < 2000 Then $iTimeOut = 2000 ;Local $sHKLM = 'HKEY_LOCAL_MACHINE\SOFTWARE\' ;If @OSArch <> 'X86' Then $sHKLM &= 'Wow6432Node\' ;$sHKLM &= 'Mozilla\Mozilla Firefox' ;Local $sFFExe = RegRead($sHKLM & "\" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe") #Region detect FF exe ; try to read x32 first Local $sHKLM = 'HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox' Local $sFFExe = RegRead($sHKLM & "\" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe") If @error Then ; try to read amd64 Local $sHKLM = 'HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Mozilla\Mozilla Firefox' Local $sFFExe = RegRead($sHKLM & "\" & RegRead($sHKLM, "CurrentVersion") & "\Main", "PathToExe") EndIf #EndRegion If @error Then SetError(__FFError($sFuncName, $_FF_ERROR_GeneralError, "Error reading registry entry for FireFox." & @CRLF & _ $sHKLM&"\*CurrentVersion*\Main\PathToExe" & @CRLF & _ "Error from RegRead: " & @error)) Return 0 EndIf ; Updated per http://www.autoitscript.com/forum/topic/95595-ffau3-v0600b/page__st__380#entry958812 ;Local $sCommand = StringFormat('"%s" %s %s %s "-repl %i %s"', $sFFExe, $sNewWin, $sURL, $sNoRemote, $iPort, $sProfile) ;$sCommand = StringFormat('"%s" %s %s %s -repl %i %s', $sFFExe, $sNewWin, $sURL, $sNoRemote, $iPort, $sProfile) ; UpdTED per http://www.kohberg.net/cms/pages/posts/autoit-ff.au3-oeffnet-immer-4242.com-beim-aufrufen-111.php Local $sCommand = StringFormat('"%s" %s %s %s -repl %s', $sFFExe, $sNewWin, $sURL, $sNoRemote, $sProfile) $PID = Run($sCommand) If $bHide Then BlockInput(1) Local $iTimeOutTimer = TimerInit() While 1 Sleep(2000) If ProcessExists($sProcName) Then ExitLoop If (TimerDiff($iTimeOutTimer) > $iTimeOut) Then SetError(__FFError($sFuncName, $_FF_ERROR_Timeout, "Browser process not exists: " & $sProcName)) BlockInput(0) Return 0 EndIf WEnd If $bHide Then Local $WINTITLE_MATCH_MODE = AutoItSetOption("WinTitleMatchMode", 4) WinWaitActive("[CLASS:MozillaWindowClass]") Sleep(500) WinSetState("[CLASS:MozillaWindowClass]", "", @SW_MINIMIZE) BlockInput(0) AutoItSetOption("WinTitleMatchMode", $WINTITLE_MATCH_MODE) Else Sleep(1000) EndIf If $_FF_COM_TRACE Then _consolewrite('__FFStartProcess: "' & $sCommand & @CRLF) SetExtended($PID) Return 1 EndFunc ;==>__FFStartProcess Perhaps we should go to Github
    1 point
  9. I suggest the use of the not well-known flag 4 Here is a rough example #include <Array.au3> #include <StringConstants.au3> Local $s_Code = '{90140000-001C-0000-1000-0000000FF1CE};{90140000-0016-081A-1000-0000000FF1CE};{90140000-0016-0402-1000-0000000FF1CE}' ;$res = StringRegExp($s_Code, '(.)(.)(..)(....)-(....)-(....)-(.)(...)-(.)(.{11})', $STR_REGEXPARRAYGLOBALFULLMATCH) ; flag 4 $res = StringRegExp($s_Code, '([[:xdigit:]])([[:xdigit:]])([[:xdigit:]]{2})([[:xdigit:]]{4})-([[:xdigit:]]{4})-([[:xdigit:]]{4})-([[:xdigit:]])([[:xdigit:]]{3})-([[:xdigit:]])([[:xdigit:]]{11})', $STR_REGEXPARRAYGLOBALFULLMATCH) Local $list[UBound($res)] For $i = 0 to UBound($res)-1 $list[$i] = ($res[$i])[0] ; get first element of each sub-array _ArrayDisplay($res[$i], "splitted result " & $i+1) Next _ArrayDisplay($list, "GUID list") Msgbox(0,"", "Product Id in 2nd GUID is : " & ($res[1])[5] ) ; etc Edit The purpose is to get an array of arrays. Each sub-array contains in element [0] the GUID (full match), and in other elements [1] to [10] (capturing groups) the wanted parts splitted as described in the link provided in post#1 All-in-one, sort of
    1 point
  10. Thanks that was exactly what I needed. For future reference here's the function I used: HotKeySet("^\", "Toggletop"); toggles window from being set to top Global $topstatus = 0; determins if a window has been set on top while true wend Func Toggletop() if $topstatus== 0 Then;No window is on top $hWnd = WinGetHandle("[ACTIVE]") $topstatus=1 WinSetOnTop($tWnd,"",$topstatus) Else;A window is on top $topstatus=0 $allwind = WinList() For $i=0 to UBound($allwind)-1 step 1 WinSetOnTop($allwind[$i][0],"",$topstatus) Next EndIf ;WinSetOnTop($window,"",1);My GUI that I permanently want on top EndFunc
    1 point
  11. Danyfirex

    DllCall & datatypes

    Yes I have but not sure if it's magical. I destroy everything I touch (This is my gift, My curse) lol It it not so hard. the unicode version you return a Pointer to string (wString Ptr Export) for that you can use wstr as return in the dllcall. The other one you return a string only for that you get a pointer to a pointer that points to a string lol. that's how I see it. maybe if you use something like String Ptr Export it works. I'm not sure because I dont know freebasic. But it should be something like that I think. Saludos
    1 point
×
×
  • Create New...