Jump to content

Leaderboard

Popular Content

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

  1. Hi McLEMUR, A decent starting point with lots of simple examples is http://www.cplusplus.com/doc/tutorial/, or try https://www.learncpp.com/ Two other reference sites I've found useful in the past are http://en.cppreference.com/w/cpp and http://www.java2s.com/Tutorial/Cpp/CatalogCpp.htm But coming from AutoIt, diving into C++ will be an uphill struggle (if you'll forgive me the metaphor mixing ). There is a lot of basic functionality that you'd expect any sophisticated language to have (*cough* garbage collection *cough*), that you'll either have to add yourself or find a good library for. An immense help for me has been the (free!) Boost libraries, see http://www.boost.org/, (and tutorials I found here, although I didn't use these much myself). Boost has really saved me acres of time, and it's quite intuitive to use. You'll need plenty of perseverance though, and think of your C++ compiler as simultaneously retarded and autistic. Every typo will likely crash your code, and the error messages you get may have nothing whatsoever to do with what actually went wrong, or be so generic that they don't help you. Of course, there's always http://stackoverflow.com/ if when you get stuck, but in my experience, some C++ forum members take on some of the same attributes as C++ compilers, i.e., being unforgiving towards beginners. Just google "I hate C++" to get an idea of what people run up against in your position. On second thought, maybe you'd better not, to remain motivated. Personally, I use C++ only for tasks that require speed and a reasonably high-level of complexity (CUDA interfacing in parallel computing, matrix computing with Eigen), but user-friendly it ain't, nor will it ever be. Can't really tell you much about the transition from AutoIt, because I started from the other end (Assembly), so it was more a question of mapping the concepts used there onto the C++ framework. I fear that coming from AutoIt, it'll be much harder. As far as compilers are concerned, CodeBlocks is much easier to start with, but at some point you'll run into situations where you'll need the extra control of literally hundreds of compiler/linker settings that MSVC offers. So you either start easy and have the extra pain of switching later, or bite the bullet now (although these newer versions of MSVC are more user-friendly than the earlier stuff). Hope it works out for you (but please do not PM me if you get stuck, okay? )
    2 points
  2. The Eigen C++ template library is a great environment for matrix computing; it is fast, reliable, extensive, and well-documented. It is also completely free, and does not rely on any external dependencies. Unfortunately for AutoIt users, the term “template library” implies that any functions you call are only instantiated upon compilation (in C++). That means there's nothing to hook into. To make Eigen ’s most important functionality directly accessible from within AutoIt scripts (version 3.3.14+, download it here), I developed the Eigen4AutoIt environment. It runs on Windows and under Wine also on Linux and Mac (Ubuntu, Debian, Fedora, and MacOS supported by WineHQ), and SUSE, Slackware, and FreeBSD supported by the distros). >Download the latest version It consists of: 1) Eigen4AutoIt.au3 an AutoIt library of wrapper functions that contain extensive bounds checks, matrix management, file I/O, type conversion, and precision control, and two-way data exchange with files and native AutoIt arrays; 2) Eigen-wrapper dlls (EigenDense.dll, EigenDense_x64.dll) re-maps matrices created in AutoIt as Eigen Matrix objects, then calls Eigen’s powerful core functions; in the spirit of open-source, the full C++ source code I wrote is included in the bundle (see subdirectory "source"). The basic functions consist of a single Eigen call; decompositions and statistics are more involved. 3) Additional materials: the user-interactive, animated Function Selector and MatrixViewer tools the MatrixFileConverter to read/write E4A matrices from/to .csv ASCII, Excel, and Xbase files. three libraries of scientific and mathematical constants online Help, with example code for every function Quickstart Manual (11-page pdf, updated) Test suite Tutorials from Basics to Advanced Please note: none of this is part of Eigen's own distribution you only need this bundle; you do not need to install Eigen. How it works: No matrix content is ever transferred, only memory pointers, meaning computations in AutoIt are virtually as fast as in Eigen’s native environment, with the added advantage of not having to be compiled first. The drawback is that Eigen's native ad-hoc expression templates (and their internal optimisations) cannot be exploited here; you have to construct your operations with the basic building blocks. These provide matrix creation, I/O, cellwise operations, reduction, multiplication, transformation, decomposition (LU, Householder, Choleski, and Jacobi SVD; these include general linear solvers) and a small statistics module by yours truly. IMPORTANT: Posting Rules for this thread: 1) Do not post or PM me any matrix-, maths-, or Eigen-related questions. Eigen has its own User Forum for that (or try math.stackExchange.com). I am not your maths guru! If you post such questions, I will either ignore your post or remind you of this rule. 2) Do not post or PM me your data sets and/or non-working Eigen4AutoIt scripts; I will not analyse your data or fix your scripts for you! There are many reasons why a linear algebra procedure might fail to produce the answer you expect. You are wielding great mathematical power here, so exploit the fantastic internet resources at your fingertips and learn how to use it. To get you started, I've listed a few video tutorials and other helpful materials in the header remarks of Eigen4AutoIt.au3. Also check out the test scripts, the Tutorials, and the Help file. 3) I do warmly welcome all of the following: remarks, advice, suggestions for improvements, encouragement, cash; bug reports re. the Eigen4AutoIt interface (individual functions that don't work the way they should) and/or the associated dll code (ditto); your own working Eigen4AutoIt templates of general use that you'd like to see implemented in a future release. Regarding that last item, have a look at my PCA tutorial. After the step-by-step stage, I summarise the entire procedure in a "mini script" of Eigen4AutoIt calls. Then I introduce the two internal PCA functions I developed, which replace that script with two simple calls. You can do the same thing, and submit your own functional Eigen4AutoIt script in this thread. If I consider it of general use and can implement it, it may become a new Eigen4AutoIt function in the next release (with source acknowledgement, of course). This means that you'd get a precompiled dll version of your script that will likely run faster and be simpler to call. Thereby this thread would become an Eigen4AutoIt Example Scripts mini forum. It's just a thought. >Download the latest version (uncompressed size: 36.1 MB) How to Install You need AutoIt version 3.3.14 or later. Simply run the installer, navigate to the tutorial subdirectory, open the first tutorial ("Basics") in Scite, and start it. This shows basic matrix I/O and mode switching (single versus double precision). If that runs, you're in business. NB to leverage the full power of x64 features, you'll also need to have the full Scite4AutoIt3 package installed. For more info, see sections "Bitness" and "Shared Memory" in the Help, main topic: "Work Environment" page.
    1 point
  3. While developing a data visualisation tool I stumbled across >this awesome script by timmy2 and GDI grandwizard UEZ, and although I'm totally crap at graphics (craphics?), I had a stab at adapting it for more general use, incorporating some additional enhancements developed by more able graphics coders such as Beege, MrCreatoR and Malkey (acknowledgements and references to their relevant forum contributions are detailed in the script). Many thanks to you all! The result looks something like this: So just to be absolutely clear: this is not my work, and I do not claim it to be my work. I've only repackaged it so you can easily create and maintain colourful displays like this with a few simple wrapper calls (see the example in the zip). Basically you create it once like a regular control (parse GUI handle, coordinates, size, and number of digits); that call then returns a display ID (1, 2, 3...). At this point the graphic is not yet visible. Internally, I've created specs storage for up to 100 displays; if you need more, just enlarge the array $DigiDispSpecs in the globals region. Subsequently, once the GUI is itself visible, you can repeatedly update the displayed value (just make sure the value fits within the maximum number of digits specified when you created it; if parsing a value with fewer digits, these will be zero-padded). You can also change foreground colour, background colour, glow colour, and the intensity of that glow (range: 1-10; default 0 = off). You parse colour parameters either with colour strings ("red", "blue", "cyan", etc., easily expanded) or with their 6-digit hex RGB value (0xff0000 for red, for example). Remove individual readouts again by calling _DigitalDisplay_Remove($displayID). When you have removed the last digital display, you should call _DigitalDisplay_CleanUp() to avoid memory leaks. That's all, folks! DigitalDisplay.7z beta version 0.9. If it works, thank UEZ, timmy2, Beege, MrCreatoR and Malkey; if if breaks, blame me. Hope you enjoy using it as much as I did cobbling it together! RT
    1 point
  4. This is basically two functions (plus supporting infrastructure): _Xbase_ReadToArray($filename, Byref $array, [...]) _Xbase_WriteFromArray($filename, Byref $array, [...]) that transfer all data from one container to the other. Various optional formatting parameters are detailed in the Remarks section of the script; a small test script plus dbf test file (the latter from the (free) Harbour distribution, see here) are provided for your entertainment. Note that the $array variable has to exist already, as it's parsed ByRef, but it does not have to have the correct dimensions. This is pure AutoIt (no SQL, no ADO, no dlls, no external dependencies). The Xbase specification was gleaned from here. There is no support (either currently or planned) for a GUI, or additional functionality; it's just a simple data interface I needed for my MatrixFileConverter for Eigen4Autoit (link in signature), that might be of use to others (see MatrixFileConverter.au3 for an implementation example). One thing to keep in mind is AutoIt's array size limitation (16 MB elements); Xbase files can be considerably larger. On the other hand, AutoIt arrays are less restricted in their number of columns than (certain versions of) Xbase (see script for details). Appropriate error messages will inform you when you've hit these buffers. Xbase.v0.8.7z third beta release
    1 point
  5. This version has been discontinued. See the new version here. MANUAL MODE+ ONLY. No longer fully working automatically for price and adding new ebooks. NOTICE - As many of you are probably aware, internal links from the old forum are no longer working in many instances, which is apparently due to how those links were created in the first place. With that in mind, all the broken links here will not be fixed by me just yet, until some time has passed and a Forum rollback is no longer likely. Downloads should be working however, except when Jon may be updating or fixing something. Here's a simple little nifty program ... well it is for me ... and maybe you, if you like to keep tabs on a certain online store's prices for those ebooks you are interested in, but are not in your price range yet. BE AWARE - This is coded using AutoIt version 3.3.0.0, an oldy but goody, so it may need modification to run or compile with later or current AutoIt. Reportedly not at this point, as all seems fine. BE ADVISED - This is not affiliated or supported or likely appreciated or even recommended by them &/or Partners. As always, use my stuff at your own risk, and I seriously suggest you check out my disclaimer on my Toolbox page (see my signature below). Basically, I haven't tested this much yet, as it is hot off the press, and no prices have changed yet for me to give the ultimate definitive test, but it should work ok ... until they change an important element that the program relies on. I've kept it pretty basic and simple, and others are welcome to add improvements, just so long as they respect me, and share here. This program is only allowed to be shared (made available for download) from the AutoIt Examples forum, until I give permission otherwise. What does it do? It is a simple database, that you populate using web page links from a certain store for their ebooks. I just got mine off my Wishlist pages. It keeps a record of up to four prices for each ebook. Title, Author (or Editor), URL, Price (Start, Current, Lowest, Highest), Date (Start, Last Check), are all stored in the program's INI database. Also, what I am presuming is the ISBN, which is used to make each entry unique. If a price has changed since Start, it will be indicated by an asterisk in the number (first) column. Why? Seller, Publishers and even Authors on occasion, like to play games with ebook prices. Hopefully this little tool, will even the odds in our favor, maybe even put us in front. OLDER NEWS (relocated to 2nd post) NEWS (15-06-2015) The program no longer works for price and that element may remain broken. It does however still assist with any current ebooks on the list, and I may add the ability to add more ebooks, and manually paste the current price, etc. Not all is lost. (15-06-2015) I have coded a partial fix, which allows you to manually enter (copy & paste) prices. (16-06-2015) Ebooks can now be added manually. (17-06-2015) More improvements. IMPORTANT - Please update from v1.1 to v1.2 or later, due to a Query bug. WARNING - Before running v1.6 (and later) for first time, you may want to read all notes. IMPORTANT - Before downloading this latest update, or if using it already, please make yourself familiar with some later information here. It may even be better to just wait for the next update, and not use this one. (v3.4) For those who have not kept up with updates since v2.0. KindEbook Price Query.au3 Previously: 113 + 78 downloads KindEbook Price Query v3.4.zip Previously: 151 + 57 downloads (v3.5) For those who have kept up with updates. KindEbook Price Query.au3 KindEbook Price Query v3.5.zip (v3.6) For those who have kept up with updates & First time users. KindEbook Price Query.au3 KindEbook Price Query v3.6.zip (v3.7) For those who have kept up with updates & First time users. KindEbook Price Query.au3 Previously: 30 downloads KindEbook Price Query v3.7.zip Previously: 31 downloads (v3.8) For those who have kept up with updates, but not First time users yet. Sources included in the zip file. PARTIAL FIX KindEbook Price Query v3.8.zip Previously: 32 downloads (v3.9) For those who have kept up with updates, and First time users. Sources included in the zip file. MANUAL MODE KindEbook Price Query v3.9.zip Previously: 26 downloads (v4.0) For those who have kept up with updates, and First time users. Sources included in the zip file. MANUAL MODE+ KindEbook Price Query v4.0.zip Previously: 28 downloads IMPORTANT - See this post for extra INI entries to improve web page read for Summary (prior post explains). RECOMMENDED - Users could maybe benefit from reading various comments in Intercept Right-Click Listview Context Menu topic. CHANGES (17-06-2015) (v4.0) MANUAL MODE, but with some more automation. A Query ALL can now start at the currently selected entry, via a prompt. An option to auto close current browser tab (using Ctrl + W), has been added for when getting price in manual mode. Input Box window widened slightly in ADD Ebook manual process. A delay option has been added, to allow a pause for specified seconds between queries during a Query ALL. This delay may be helpful in preventing erroneous detection as a malicious scraper. Ebook cover can now be a .jpg file, in the Image Data folder, where filename matches ISBN ID. Bugfix for whitespace in Price in manual mode (sorry about that). (16-06-2015) (v3.9) MANUAL MODE only for prices and adding ebooks. Program can now have ebooks added to it manually, when in 'manual' mode. The Timer and Wait labels are now dealt with correctly, by being hidden when not required or wanted. An Input Box is continually presented for user to manually add an Ebook's details (Title, etc). No other fix has been added yet, to deal with broken status in regard to automatic price checking. That last, also includes not automatically getting details when adding ebooks. I may do that next. (15-06-2015) (v3.8) PARTIAL FIX - Manual Price adding only. Program is broken as far as getting prices automatically from Amazon, but a 'manual' mode has been added, and set by default, but can be reset to 'automatic' in program settings. The manual mode allows you to do your usual Query (one or ALL), and presents you with an Input box to manually paste the price you have copied from the ebook webpage that has been executed. You can stop at anytime, by clicking the Cancel button. The usual Report will be displayed and any changes stored. NOTE - You cannot currently ADD any new ebooks to the list with this version, but I will address that issue soon. (13-06-2015) (v3.7) NO LONGER WORKING FOR PRICE AND ADDING NEW EBOOKS. A major update that resolves a bug, and perhaps made v4.0 (as originally planned) redundant. Bugfix for Timer Label causing a miscount of control numbers when swapping users in certain scenario. Prompt when making a Query from relocated bought ebooks user. Private Comments are now queried when copying or moving an ebook to another user, if they exist for that ebook. All Shared Comments are now stored and read from the shared file 'Comments.ini', though they still also exist in each user file for now, if no longer referenced or updated there. Any conflicts during this updating change, between users, meant comments were combined but separated by a pipe '|' character. Still advise you read v1.6 notes. PREVIOUS VERSIONS (relocated to 2nd post) NOTE - See extra comments at Post #13. IMPORTANT This program is based on settings in that store, that are relevant to me as a customer from AUS. It also relies on a leading dollar sign at the start of each price (and other currency entry listed in INI file), which is removed during comparisons. I did not remember to include the pound sign, so if you need to, modify the source code. That last will definitely be necessary for others from other countries. I'll add any currencies advised of, in the next update. It is simple enough to change, and I may just make an INI entry, that can be modified by whoever, to suit. ADDENDUM - Relocated to Chat topic. NOTE - This program was initially considered and talked about in this Chat topic. SCREENSHOTS v3.5+ Earlier OLDER (v3.4)
    1 point
  6. llewxam

    Find in File

    This app has been designed to help search for text within files, and has the following features: The phrase searched for can be case sensitive or not The file search can be recursive through subdirectories or not File masks for included or excluded file types are available I posted this in another thread as it was when I last worked on it last June, and got a very helpful tip from Melba23 regarding how to make .docx and .xlsx files searchable (though I did it in a very different way ). I now also use UEZ's File to Base64 String Code Generator to bundle the 7-Zip dll and exe in to the script for use on the new Office files, so the script is rather large. The other major change from the earlier version I posted is that if the file being searched is over 32MB then the file is searched in chunks to avoid the horrible memory allocation errors I got during testing when _WinAPI_ReadFile tried reading a 3GB video file in one piece. If there are any file types that need special attention to open properly or other feature requests please let me know. Ian Updated code 3/9/15, previous version downloaded 89 times Updated code 3/11/15, bug fix and added topmost option Find In File.7z
    1 point
  7. Another way to delete multiple comas within multiple double quotes. $string = '"this,is,a,test",3/1/15 11:49:11 AM,COMPUTER01,10.0.0.6,User-defined Rules:test .10,deny read,"\Device\HarddiskVolumeShadowCopy3455\Applications\APPS\Test\shared\driving\predrivingscreening\AArchive\Shiller,Ron,09\INSTRUCTION.TXT",,_,10.110.69.16,C:\Program Files\Veritas\NetBackup\bin\bpbkar32.exe,",",' & "'File' class or access,Notice,OAS,My Organization\Servers\Servers\,1092" ; Result= "thisisatest",3/1/15 11:49:11 AM,COMPUTER01,10.0.0.6,User-defined Rules:test .10,deny read,"\Device\HarddiskVolumeShadowCopy3455\Applications\APPS\Test\shared\driving\predrivingscreening\AArchive\ShillerRon09\INSTRUCTION.TXT",,_,10.110.69.16,C:\Program Files\Veritas\NetBackup\bin\bpbkar32.exe,"",'File' class or access,Notice,OAS,My Organization\Servers\Servers\,1092 $string = Execute('"' & StringRegExpReplace($string, '(".+?")', '" & StringReplace(""\1"",",","") & "') & '"') ConsoleWrite($string & @LF)
    1 point
  8. Thanks $string = '"this,is,a,test",3/1/15 11:49:11 AM,COMPUTER01,10.0.0.6,User-defined Rules:test .10,deny read,"\Device\HarddiskVolumeShadowCopy3455\Applications\APPS\Test\shared\driving\predrivingscreening\AArchive\Shiller,Ron,09\INSTRUCTION.TXT",,_,10.110.69.16,C:\Program Files\Veritas\NetBackup\bin\bpbkar32.exe,",",' & "'File' class or access,Notice,OAS,My Organization\Servers\Servers\,1092" Do $string = stringregexpreplace($string, '((?:^|,)"[^,"]*),(?=[^"]*")', "$1") Until @extended = 0 msgbox(0, "", $string)
    1 point
  9. Check out _WinAPI_GetBinaryType Br, UEZ
    1 point
  10. thats just a simple regular expression (the part in front of REGEXPTITLE:) You can check the help file of Regular Expressions here: stringRegExp()
    1 point
  11. You can just declare an array at the begining and redim it each time a Window is found. Look, I do it for you now, try to understand the Redim role : #Include <Array.au3> #Include <WinAPI.au3> #Include <WindowsConstants.au3> Local $aWinInTaskBar[1][2] $iCount = 0 $aList = WinList() For $i = 1 To $aList[0][0] $iExStyle = _WinAPI_GetWindowLong($aList[$i][1], $GWL_EXSTYLE) ; get the extended style of each Window If NOT BitAND($iExStyle, $WS_EX_TOOLWINDOW) AND _ ; Search for windows without $WS_EX_TOOLWINDOW extended style BitAND(WinGetState($aList[$i][1]), 2 ) Then ; And only visible windows $iCount += 1 Redim $aWinInTaskBar[ $iCount + 1][2] $aWinInTaskBar[ $iCount][0] = $aList[$i][0] $aWinInTaskBar[ $iCount][1] = $aList[$i][1] EndIf Next $aWinInTaskBar[0][0] = UBound($aWinInTaskBar) - 1 _ArrayDisplay($aWinInTaskBar)
    1 point
  12. Did you copy the whole code ? (with includes) I do not have this error
    1 point
  13. A beginning, but not perfect: #Include <WinAPI.au3> #Include <WindowsConstants.au3> $aList = WinList() For $i = 1 To $aList[0][0] $iExStyle = _WinAPI_GetWindowLong($aList[$i][1], $GWL_EXSTYLE) ; get the extended style of each Window If NOT BitAND($iExStyle, $WS_EX_TOOLWINDOW) AND _ ; Search for windows without $WS_EX_TOOLWINDOW extended style BitAND(WinGetState($aList[$i][1]), 2 ) Then ; And only visible windows ConsoleWrite($aList[$i][0] & @CRLF) EndIf Next
    1 point
  14. I went from C and derivatives to VB then to AutoIt, and saw it, and still do, as an advance in programming. P.S. No need for anyone to point out the value of C etc, I already know, so I'm just saying. We are empowered by what we can efficiently use, not by what is a powerful tool alone. Understanding is all!
    1 point
  15. mikell

    Regex / SRE conditional

    $rex=StringRegExp($sHTML,'(?i)href="(?(?!#)([^"]+)|mikell_was_here).+?ValuesLst', 3) A little overcomplicated
    1 point
  16. #include <Array.au3> [code=autoit:0]Local $lst = WinList() Local $i=1 Do If $lst[$i][0] = "" And Not BitAND(WinGetState($lst[$i][1]), 1) Then _ArrayDelete($lst,$i) $i+=1 Until $i>UBound($lst)-1 _ArrayDisplay($lst) Exit Maybe you can only use _arraydelete for 1D arrays EDIT:Nope, is all fine, _arraydelete supports up to 2D arrays EDIT2: Solved: Local $lst = WinList('[REGEXPTITLE:(.+)]') _ArrayDisplay($lst) Exit
    1 point
  17. Most ways to accomplish this include communicating with a server and connect something relatively unique (like an encoded hardware ID) to a license key. Then your script would challenge a server with that key and get a response back that says whether authorization was successful. Make sure the communication with your authentication server is encrypted securely. Of course this is relatively easy to circumvent if someone really wants, but it's a start.
    1 point
  18. Malkey

    Regex / SRE conditional

    Try this RE pattern '(?i)href="([^#"]+).+?class="ValuesLst"'
    1 point
  19. I used google to translate bracket to latin which is ancon. So Anconophobia?
    1 point
  20. Is there any name for the fear of "{" ? If so i have that fear. It's not curely braces, it is cursed braces. C++.. Oh..such a horrible language. Is that language made for humans.. I think it is for aliens.
    1 point
  21. JohnOne

    imagesearch

    >He knows
    1 point
  22. I don't know if you're asking me a question, if something is wrong, or if it solved the issue. If the path is incorrect or not what you expected, look at the second parameter of my function. _ProcessGetPathEx($sNotepad) Gives a different result on the path than: _ProcessGetPathEx($sNotepad, True)
    1 point
  23. knucklesCZ, My fault. As explained in the Help file, you need to use the $bConvert parameter in _ArrayColDelete to force the array back to 1D when there is only a single column: ; Delete the column _ArrayColDelete($array, 1, True) And to think that I wrote the function too! :blush: M23
    1 point
  24. That's not a good way to get the process path, but anyway... what is your error (number). Edit: Here's a processgetpath i wrote that should work with everything. #include <WinAPI.au3> #include <WinAPIProc.au3> ; @param1 = process name or pid ; @param2 = default 0 = drive\etc format ; true = native system path format Func _ProcessGetPathEx($vProcess, $bNative = 0) Local $iPID = ProcessExists($vProcess) If Not $iPID Then ; process does not exist Return SetError(1, 0, "") EndIf Local $szFilePath = "" ; are we working with anything less than vista? Local Static $nWVers = ($__WINVER <> "") ? $__WINVER : __WINVER() If $nWVers < 0x0600 Then ; _WinAPI_GetProcessFileName seems misleading $szFilePath = _WinAPI_GetProcessFileName($iPID) Return SetError(@error, @extended, $szFilePath) EndIf ; vista and above, should help with possible 64bit issues as well Local $hK32 = DllOpen("Kernel32.dll") If @error Or Not $hK32 Then ; could not open kernel32.dll Return SetError(2, 0, 0) EndIf Local Const $pgp_PROCESS_QUERY_LIMITED_INFORMATION = 0x1000 Local Const $pgp_PROCESS_QUERY_INFORMATION = 0x0400 Local Const $pgp_PROCESS_NAME_NATIVE = 0x00000001 ; open process with query info only Local $aOpenProcess = DllCall($hK32, "handle", "OpenProcess", _ "long", BitOR($pgp_PROCESS_QUERY_INFORMATION, _ $pgp_PROCESS_QUERY_LIMITED_INFORMATION), _ "int", 0, "long", $iPID) Local $iErr = @error If $iErr Or Not IsArray($aOpenProcess) Then DllClose($hK32) ; error code from dllcall sent as extended Return SetError(3, $iErr, 0) EndIf Local $hOpenProc = $aOpenProcess[0] Local $nNative = $bNative ? $pgp_PROCESS_NAME_NATIVE : 0 Local $aQuery = DllCall($hK32, "bool", "QueryFullProcessImageNameW", _ "handle", $hOpenProc, "dword", $nNative, "wstr", "", "int*", 4096) $iErr = @error If $iErr Or Not IsArray($aQuery) Then _WinAPI_CloseHandle($hOpenProc) DllClose($hK32) ; error code from dllcall sent as extended Return SetError(4, $iErr, 0) EndIf _WinAPI_CloseHandle($hOpenProc) DllClose($hK32) ; return string length as extended Return SetError(0, $aQuery[4], $aQuery[3]) EndFunc ;==>_ProcessGetPathEx And as always, if it's not working, show the error number you've debugged and received.
    1 point
  25. RTFC

    Wiki Challenge Part 2

    Errrm, sorry to rain on this jolly parade, but the winning Example #6 is factually wrong. In the Gregorian calendar most of us have been using since the late 16th/early 17th century (yes, I'm that old ), a year is a leap year when it is divisible by four, UNLESS it is also divisible by 100 (not a leap year), UNLESS it is also divisible by 400 (leap year).
    1 point
  26. You can turn the screen off and on with AutoIt, you can also detect idle time and decide when to do so. There are tons of options, even starting your screensaver.
    1 point
  27. RTFC

    Multi-processing discussion

    @kinch: If you can wait a a few more weeks (once preliminary LAN testing is completed), I'm about to release the first test version of my Pool environment, which gives you almost total control over all your AutoIt processes (that contain the Pool #include) running anywhere on a LAN; this includes exchanging predefined and user-defined messages, LANchat, file/data transfers, shared structs, arrays, and variables, remote execution (single line, batch/separate script, Run/Shellexecute), and HTC synchronisation. I wrote it primarily for grid multiprocessing with my Eigen4AutoIt matrix computing environment (see signature), but it's become more generic and is still growing. It's not superfast and only partially event-driven. I think it'll be worth the wait, but then, I'm probably biased...
    1 point
  28. RTFC

    WSA API errors

    Here's some more, straight from MSDN: ; by RTFC, see https://msdn.microsoft.com/en-us/library/windows/desktop/ms740668%28v=vs.85%29.aspx #include-once #include <Array.au3> Global $WSAerrorlist[1][4] _ArrayAdd($WSAerrorlist, "6|WSA_INVALID_HANDLE|Specified event object handle is invalid.|An application attempts to use an event object, but the specified handle is not valid. Note that this error is returned by the operating system, so the error number may change in future releases of Windows.") _ArrayAdd($WSAerrorlist, "8|WSA_NOT_ENOUGH_MEMORY|Insufficient memory available.|An application used a Windows Sockets function that directly maps to a Windows function. The Windows function is indicating a lack of required memory resources. Note that this error is returned by the operating system, so the error number may change in future releases of Windows.") _ArrayAdd($WSAerrorlist, "87|WSA_INVALID_PARAMETER|One or more parameters are invalid.|An application used a Windows Sockets function which directly maps to a Windows function. The Windows function is indicating a problem with one or more parameters. Note that this error is returned by the operating system, so the error number may change in future releases of Windows.") _ArrayAdd($WSAerrorlist, "995|WSA_OPERATION_ABORTED|Overlapped operation aborted.|An overlapped operation was canceled due to the closure of the socket, or the execution of the SIO_FLUSH command in WSAIoctl. Note that this error is returned by the operating system, so the error number may change in future releases of Windows.") _ArrayAdd($WSAerrorlist, "996|WSA_IO_INCOMPLETE|Overlapped I/O event object not in signaled state.|The application has tried to determine the status of an overlapped operation which is not yet completed. Applications that use WSAGetOverlappedResult (with the fWait flag set to FALSE) in a polling mode to determine when an overlapped operation has completed, get this error code until the operation is complete. Note that this error is returned by the operating system, so the error number may change in future releases of Windows.") _ArrayAdd($WSAerrorlist, "997|WSA_IO_PENDING|Overlapped operations will complete later.|The application has initiated an overlapped operation that cannot be completed immediately. A completion indication will be given later when the operation has been completed. Note that this error is returned by the operating system, so the error number may change in future releases of Windows.") _ArrayAdd($WSAerrorlist, "10004|WSAEINTR|Interrupted function call.|A blocking operation was interrupted by a call to WSACancelBlockingCall.") _ArrayAdd($WSAerrorlist, "10009|WSAEBADF|File handle is not valid.|The file handle supplied is not valid.") _ArrayAdd($WSAerrorlist, "10013|WSAEACCES|Permission denied.|An attempt was made to access a socket in a way forbidden by its access permissions. An example is using a broadcast address for sendto without broadcast permission being set using setsockopt(SO_BROADCAST).Another possible reason for the WSAEACCES error is that when the bind function is called (on Windows NT 4.0 with SP4 and later), another application, service, or kernel mode driver is bound to the same address with exclusive access. Such exclusive access is a new feature of Windows NT 4.0 with SP4 and later, and is implemented by using the SO_EXCLUSIVEADDRUSE option.") _ArrayAdd($WSAerrorlist, "10014|WSAEFAULT|Bad address.|The system detected an invalid pointer address in attempting to use a pointer argument of a call. This error occurs if an application passes an invalid pointer value, or if the length of the buffer is too small. For instance, if the length of an argument, which is a sockaddr structure, is smaller than the sizeof(sockaddr).") _ArrayAdd($WSAerrorlist, "10022|WSAEINVAL|Invalid argument.|Some invalid argument was supplied (for example, specifying an invalid level to the setsockopt function). In some instances, it also refers to the current state of the socket—for instance, calling accept on a socket that is not listening.") _ArrayAdd($WSAerrorlist, "10024|WSAEMFILE|Too many open files.|Too many open sockets. Each implementation may have a maximum number of socket handles available, either globally, per process, or per thread.") _ArrayAdd($WSAerrorlist, "10035|WSAEWOULDBLOCK|Resource temporarily unavailable.|This error is returned from operations on nonblocking sockets that cannot be completed immediately, for example recv when no data is queued to be read from the socket. It is a nonfatal error, and the operation should be retried later. It is normal for WSAEWOULDBLOCK to be reported as the result from calling connect on a nonblocking SOCK_STREAM socket, since some time must elapse for the connection to be established.") _ArrayAdd($WSAerrorlist, "10036|WSAEINPROGRESS|Operation now in progress.|A blocking operation is currently executing. Windows Sockets only allows a single blocking operation—per- task or thread—to be outstanding, and if any other function call is made (whether or not it references that or any other socket) the function fails with the WSAEINPROGRESS error.") _ArrayAdd($WSAerrorlist, "10037|WSAEALREADY|Operation already in progress.|An operation was attempted on a nonblocking socket with an operation already in progress—that is, calling connect a second time on a nonblocking socket that is already connecting, or canceling an asynchronous request (WSAAsyncGetXbyY) that has already been canceled or completed.") _ArrayAdd($WSAerrorlist, "10038|WSAENOTSOCK|Socket operation on nonsocket.|An operation was attempted on something that is not a socket. Either the socket handle parameter did not reference a valid socket, or for select, a member of an fd_set was not valid.") _ArrayAdd($WSAerrorlist, "10039|WSAEDESTADDRREQ|Destination address required.|A required address was omitted from an operation on a socket. For example, this error is returned if sendto is called with the remote address of ADDR_ANY.") _ArrayAdd($WSAerrorlist, "10040|WSAEMSGSIZE|Message too long.|A message sent on a datagram socket was larger than the internal message buffer or some other network limit, or the buffer used to receive a datagram was smaller than the datagram itself.") _ArrayAdd($WSAerrorlist, "10041|WSAEPROTOTYPE|Protocol wrong type for socket.|A protocol was specified in the socket function call that does not support the semantics of the socket type requested. For example, the ARPA Internet UDP protocol cannot be specified with a socket type of SOCK_STREAM.") _ArrayAdd($WSAerrorlist, "10042|WSAENOPROTOOPT|Bad protocol option.|An unknown, invalid or unsupported option or level was specified in a getsockopt or setsockopt call.") _ArrayAdd($WSAerrorlist, "10043|WSAEPROTONOSUPPORT|Protocol not supported.|The requested protocol has not been configured into the system, or no implementation for it exists. For example, a socket call requests a SOCK_DGRAM socket, but specifies a stream protocol.") _ArrayAdd($WSAerrorlist, "10044|WSAESOCKTNOSUPPORT|Socket type not supported.|The support for the specified socket type does not exist in this address family. For example, the optional type SOCK_RAW might be selected in a socket call, and the implementation does not support SOCK_RAW sockets at all.") _ArrayAdd($WSAerrorlist, "10045|WSAEOPNOTSUPP|Operation not supported.|The attempted operation is not supported for the type of object referenced. Usually this occurs when a socket descriptor to a socket that cannot support this operation is trying to accept a connection on a datagram socket.") _ArrayAdd($WSAerrorlist, "10046|WSAEPFNOSUPPORT|Protocol family not supported.|The protocol family has not been configured into the system or no implementation for it exists. This message has a slightly different meaning from WSAEAFNOSUPPORT. However, it is interchangeable in most cases, and all Windows Sockets functions that return one of these messages also specify WSAEAFNOSUPPORT.") _ArrayAdd($WSAerrorlist, "10047|WSAEAFNOSUPPORT|Address family not supported by protocol family.|An address incompatible with the requested protocol was used. All sockets are created with an associated address family (that is, AF_INET for Internet Protocols) and a generic protocol type (that is, SOCK_STREAM). This error is returned if an incorrect protocol is explicitly requested in the socket call, or if an address of the wrong family is used for a socket, for example, in sendto.") _ArrayAdd($WSAerrorlist, "10048|WSAEADDRINUSE|Address already in use.|Typically, only one usage of each socket address (protocol/IP address/port) is permitted. This error occurs if an application attempts to bind a socket to an IP address/port that has already been used for an existing socket, or a socket that was not closed properly, or one that is still in the process of closing. For server applications that need to bind multiple sockets to the same port number, consider using setsockopt (SO_REUSEADDR). Client applications usually need not call bind at all—connect chooses an unused port automatically. When bind is called with a wildcard address (involving ADDR_ANY), a WSAEADDRINUSE error could be delayed until the specific address is committed. This could happen with a call to another function later, including connect, listen, WSAConnect, or WSAJoinLeaf.") _ArrayAdd($WSAerrorlist, "10049|WSAEADDRNOTAVAIL|Cannot assign requested address.|The requested address is not valid in its context. This normally results from an attempt to bind to an address that is not valid for the local computer. This can also result from connect, sendto, WSAConnect, WSAJoinLeaf, or WSASendTo when the remote address or port is not valid for a remote computer (for example, address or port 0).") _ArrayAdd($WSAerrorlist, "10050|WSAENETDOWN|Network is down.|A socket operation encountered a dead network. This could indicate a serious failure of the network system (that is, the protocol stack that the Windows Sockets DLL runs over), the network interface, or the local network itself.") _ArrayAdd($WSAerrorlist, "10051|WSAENETUNREACH|Network is unreachable.|A socket operation was attempted to an unreachable network. This usually means the local software knows no route to reach the remote host.") _ArrayAdd($WSAerrorlist, "10052|WSAENETRESET|Network dropped connection on reset.|The connection has been broken due to keep-alive activity detecting a failure while the operation was in progress. It can also be returned by setsockopt if an attempt is made to set SO_KEEPALIVE on a connection that has already failed.") _ArrayAdd($WSAerrorlist, "10053|WSAECONNABORTED|Software caused connection abort.|An established connection was aborted by the software in your host computer, possibly due to a data transmission time-out or protocol error.") _ArrayAdd($WSAerrorlist, "10054|WSAECONNRESET|Connection reset by peer.|An existing connection was forcibly closed by the remote host. This normally results if the peer application on the remote host is suddenly stopped, the host is rebooted, the host or remote network interface is disabled, or the remote host uses a hard close (see setsockopt for more information on the SO_LINGER option on the remote socket). This error may also result if a connection was broken due to keep-alive activity detecting a failure while one or more operations are in progress. Operations that were in progress fail with WSAENETRESET. Subsequent operations fail with WSAECONNRESET.") _ArrayAdd($WSAerrorlist, "10055|WSAENOBUFS|No buffer space available.|An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full.") _ArrayAdd($WSAerrorlist, "10056|WSAEISCONN|Socket is already connected.|A connect request was made on an already-connected socket. Some implementations also return this error if sendto is called on a connected SOCK_DGRAM socket (for SOCK_STREAM sockets, the to parameter in sendto is ignored) although other implementations treat this as a legal occurrence.") _ArrayAdd($WSAerrorlist, "10057|WSAENOTCONN|Socket is not connected.|A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using sendto) no address was supplied. Any other type of operation might also return this error—for example, setsockopt setting SO_KEEPALIVE if the connection has been reset.") _ArrayAdd($WSAerrorlist, "10058|WSAESHUTDOWN|Cannot send after socket shutdown.|A request to send or receive data was disallowed because the socket had already been shut down in that direction with a previous shutdown call. By calling shutdown a partial close of a socket is requested, which is a signal that sending or receiving, or both have been discontinued.") _ArrayAdd($WSAerrorlist, "10059|WSAETOOMANYREFS|Too many references.|Too many references to some kernel object.") _ArrayAdd($WSAerrorlist, "10060|WSAETIMEDOUT|Connection timed out.|A connection attempt failed because the connected party did not properly respond after a period of time, or the established connection failed because the connected host has failed to respond.") _ArrayAdd($WSAerrorlist, "10061|WSAECONNREFUSED|Connection refused.|No connection could be made because the target computer actively refused it. This usually results from trying to connect to a service that is inactive on the foreign host—that is, one with no server application running.") _ArrayAdd($WSAerrorlist, "10062|WSAELOOP|Cannot translate name.|Cannot translate a name.") _ArrayAdd($WSAerrorlist, "10063|WSAENAMETOOLONG|Name too long.|A name component or a name was too long.") _ArrayAdd($WSAerrorlist, "10064|WSAEHOSTDOWN|Host is down.|A socket operation failed because the destination host is down. A socket operation encountered a dead host. Networking activity on the local host has not been initiated. These conditions are more likely to be indicated by the error WSAETIMEDOUT.") _ArrayAdd($WSAerrorlist, "10065|WSAEHOSTUNREACH|No route to host.|A socket operation was attempted to an unreachable host. See WSAENETUNREACH.") _ArrayAdd($WSAerrorlist, "10066|WSAENOTEMPTY|Directory not empty.|Cannot remove a directory that is not empty.") _ArrayAdd($WSAerrorlist, "10067|WSAEPROCLIM|Too many processes.|A Windows Sockets implementation may have a limit on the number of applications that can use it simultaneously. WSAStartup may fail with this error if the limit has been reached.") _ArrayAdd($WSAerrorlist, "10068|WSAEUSERS|User quota exceeded.|Ran out of user quota.") _ArrayAdd($WSAerrorlist, "10069|WSAEDQUOT|Disk quota exceeded.|Ran out of disk quota.") _ArrayAdd($WSAerrorlist, "10070|WSAESTALE|Stale file handle reference.|The file handle reference is no longer available.") _ArrayAdd($WSAerrorlist, "10071|WSAEREMOTE|Item is remote.|The item is not available locally.") _ArrayAdd($WSAerrorlist, "10091|WSASYSNOTREADY|Network subsystem is unavailable.|This error is returned by WSAStartup if the Windows Sockets implementation cannot function at this time because the underlying system it uses to provide network services is currently unavailable. Users should check:That the appropriate Windows Sockets DLL file is in the current path.That they are not trying to use more than one Windows Sockets implementation simultaneously. If there is more than one Winsock DLL on your system, be sure the first one in the path is appropriate for the network subsystem currently loaded.The Windows Sockets implementation documentation to be sure all necessary components are currently installed and configured correctly.") _ArrayAdd($WSAerrorlist, "10092|WSAVERNOTSUPPORTED|Winsock.dll version out of range.|The current Windows Sockets implementation does not support the Windows Sockets specification version requested by the application. Check that no old Windows Sockets DLL files are being accessed.") _ArrayAdd($WSAerrorlist, "10093|WSANOTINITIALISED|Successful WSAStartup not yet performed.|Either the application has not called WSAStartup or WSAStartup failed. The application may be accessing a socket that the current active task does not own (that is, trying to share a socket between tasks), or WSACleanup has been called too many times.") _ArrayAdd($WSAerrorlist, "10101|WSAEDISCON|Graceful shutdown in progress.|Returned by WSARecv and WSARecvFrom to indicate that the remote party has initiated a graceful shutdown sequence.") _ArrayAdd($WSAerrorlist, "10102|WSAENOMORE|No more results.|No more results can be returned by the WSALookupServiceNext function.") _ArrayAdd($WSAerrorlist, "10103|WSAECANCELLED|Call has been canceled.|A call to the WSALookupServiceEnd function was made while this call was still processing. The call has been canceled.") _ArrayAdd($WSAerrorlist, "10104|WSAEINVALIDPROCTABLE|Procedure call table is invalid.|The service provider procedure call table is invalid. A service provider returned a bogus procedure table to Ws2_32.dll. This is usually caused by one or more of the function pointers being NULL.") _ArrayAdd($WSAerrorlist, "10105|WSAEINVALIDPROVIDER|Service provider is invalid.|The requested service provider is invalid. This error is returned by the WSCGetProviderInfo and WSCGetProviderInfo32 functions if the protocol entry specified could not be found. This error is also returned if the service provider returned a version number other than 2.0.") _ArrayAdd($WSAerrorlist, "10106|WSAEPROVIDERFAILEDINIT|Service provider failed to initialize.|The requested service provider could not be loaded or initialized. This error is returned if either a service provider's DLL could not be loaded (LoadLibrary failed) or the provider's WSPStartup or NSPStartup function failed.") _ArrayAdd($WSAerrorlist, "10107|WSASYSCALLFAILURE|System call failure.|A system call that should never fail has failed. This is a generic error code, returned under various conditions.Returned when a system call that should never fail does fail. For example, if a call to WaitForMultipleEvents fails or one of the registry functions fails trying to manipulate the protocol/namespace catalogs.Returned when a provider does not return SUCCESS and does not provide an extended error code. Can indicate a service provider implementation error.") _ArrayAdd($WSAerrorlist, "10108|WSASERVICE_NOT_FOUND|Service not found.|No such service is known. The service cannot be found in the specified name space.") _ArrayAdd($WSAerrorlist, "10109|WSATYPE_NOT_FOUND|Class type not found.|The specified class was not found.") _ArrayAdd($WSAerrorlist, "10110|WSA_E_NO_MORE|No more results.|No more results can be returned by the WSALookupServiceNext function.") _ArrayAdd($WSAerrorlist, "10111|WSA_E_CANCELLED|Call was canceled.|A call to the WSALookupServiceEnd function was made while this call was still processing. The call has been canceled.") _ArrayAdd($WSAerrorlist, "10112|WSAEREFUSED|Database query was refused.|A database query failed because it was actively refused.") _ArrayAdd($WSAerrorlist, "11001|WSAHOST_NOT_FOUND|Host not found.|No such host is known. The name is not an official host name or alias, or it cannot be found in the database(s) being queried. This error may also be returned for protocol and service queries, and means that the specified name could not be found in the relevant database.") _ArrayAdd($WSAerrorlist, "11002|WSATRY_AGAIN|Nonauthoritative host not found.|This is usually a temporary error during host name resolution and means that the local server did not receive a response from an authoritative server. A retry at some time later may be successful.") _ArrayAdd($WSAerrorlist, "11003|WSANO_RECOVERY|This is a nonrecoverable error.|This indicates that some sort of nonrecoverable error occurred during a database lookup. This may be because the database files (for example, BSD-compatible HOSTS, SERVICES, or PROTOCOLS files) could not be found, or a DNS request was returned by the server with a severe error.") _ArrayAdd($WSAerrorlist, "11004|WSANO_DATA|Valid name, no data record of requested type.|The requested name is valid and was found in the database, but it does not have the correct associated data being resolved for. The usual example for this is a host name-to-address translation attempt (using gethostbyname or WSAAsyncGetHostByName) which uses the DNS (Domain Name Server). An MX record is returned but no A record—indicating the host itself exists, but is not directly reachable.") _ArrayAdd($WSAerrorlist, "11005|WSA_QOS_RECEIVERS|QoS receivers.|At least one QoS reserve has arrived.") _ArrayAdd($WSAerrorlist, "11006|WSA_QOS_SENDERS|QoS senders.|At least one QoS send path has arrived.") _ArrayAdd($WSAerrorlist, "11007|WSA_QOS_NO_SENDERS|No QoS senders.|There are no QoS senders.") _ArrayAdd($WSAerrorlist, "11008|WSA_QOS_NO_RECEIVERS|QoS no receivers.|There are no QoS receivers.") _ArrayAdd($WSAerrorlist, "11009|WSA_QOS_REQUEST_CONFIRMED|QoS request confirmed.|The QoS reserve request has been confirmed.") _ArrayAdd($WSAerrorlist, "11010|WSA_QOS_ADMISSION_FAILURE|QoS admission error.|A QoS error occurred due to lack of resources.") _ArrayAdd($WSAerrorlist, "11011|WSA_QOS_POLICY_FAILURE|QoS policy failure.|The QoS request was rejected because the policy system couldn't allocate the requested resource within the existing policy.") _ArrayAdd($WSAerrorlist, "11012|WSA_QOS_BAD_STYLE|QoS bad style.|An unknown or conflicting QoS style was encountered.") _ArrayAdd($WSAerrorlist, "11013|WSA_QOS_BAD_OBJECT|QoS bad object.|A problem was encountered with some part of the filterspec or the provider-specific buffer in general.") _ArrayAdd($WSAerrorlist, "11014|WSA_QOS_TRAFFIC_CTRL_ERROR|QoS traffic control error.|An error with the underlying traffic control (TC) API as the generic QoS request was converted for local enforcement by the TC API. This could be due to an out of memory error or to an internal QoS provider error.") _ArrayAdd($WSAerrorlist, "11015|WSA_QOS_GENERIC_ERROR|QoS generic error.|A general QoS error.") _ArrayAdd($WSAerrorlist, "11016|WSA_QOS_ESERVICETYPE|QoS service type error.|An invalid or unrecognized service type was found in the QoS flowspec.") _ArrayAdd($WSAerrorlist, "11017|WSA_QOS_EFLOWSPEC|QoS flowspec error.|An invalid or inconsistent flowspec was found in the QOS structure.") _ArrayAdd($WSAerrorlist, "11018|WSA_QOS_EPROVSPECBUF|Invalid QoS provider buffer.|An invalid QoS provider-specific buffer.") _ArrayAdd($WSAerrorlist, "11019|WSA_QOS_EFILTERSTYLE|Invalid QoS filter style.|An invalid QoS filter style was used.") _ArrayAdd($WSAerrorlist, "11020|WSA_QOS_EFILTERTYPE|Invalid QoS filter type.|An invalid QoS filter type was used.") _ArrayAdd($WSAerrorlist, "11021|WSA_QOS_EFILTERCOUNT|Incorrect QoS filter count.|An incorrect number of QoS FILTERSPECs were specified in the FLOWDESCRIPTOR.") _ArrayAdd($WSAerrorlist, "11022|WSA_QOS_EOBJLENGTH|Invalid QoS object length.|An object with an invalid ObjectLength field was specified in the QoS provider-specific buffer.") _ArrayAdd($WSAerrorlist, "11023|WSA_QOS_EFLOWCOUNT|Incorrect QoS flow count.|An incorrect number of flow descriptors was specified in the QoS structure.") _ArrayAdd($WSAerrorlist, "11024|WSA_QOS_EUNKOWNPSOBJ|Unrecognized QoS object.|An unrecognized object was found in the QoS provider-specific buffer.") _ArrayAdd($WSAerrorlist, "11025|WSA_QOS_EPOLICYOBJ|Invalid QoS policy object.|An invalid policy object was found in the QoS provider-specific buffer.") _ArrayAdd($WSAerrorlist, "11026|WSA_QOS_EFLOWDESC|Invalid QoS flow descriptor.|An invalid QoS flow descriptor was found in the flow descriptor list.") _ArrayAdd($WSAerrorlist, "11027|WSA_QOS_EPSFLOWSPEC|Invalid QoS provider-specific flowspec.|An invalid or inconsistent flowspec was found in the QoS provider-specific buffer.") _ArrayAdd($WSAerrorlist, "11028|WSA_QOS_EPSFILTERSPEC|Invalid QoS provider-specific filterspec.|An invalid FILTERSPEC was found in the QoS provider-specific buffer.") _ArrayAdd($WSAerrorlist, "11029|WSA_QOS_ESDMODEOBJ|Invalid QoS shape discard mode object.|An invalid shape discard mode object was found in the QoS provider-specific buffer.") _ArrayAdd($WSAerrorlist, "11030|WSA_QOS_ESHAPERATEOBJ|Invalid QoS shaping rate object.|An invalid shaping rate object was found in the QoS provider-specific buffer.") _ArrayAdd($WSAerrorlist, "11031|WSA_QOS_RESERVED_PETYPE|Reserved policy QoS element type.|A reserved policy element was found in the QoS provider-specific buffer.") $WSAerrorlist[0][0]=Ubound($WSAerrorlist,1) Func _WSAerror($WSAerror, $returnType=3) Local $index Switch IsInt($WSAerror) Case True $index=_ArraySearch($WSAerrorlist,$WSAerror,1,0,0,0,1,0) Case Else $index=_ArraySearch($WSAerrorlist,$WSAerror,1,0,0,0,1,1) EndSwitch If @error Then Return SetError(1,@error,"WSA error reference not found: " & $WSAerror) Switch $returnType Case 1,2,3,4 Return $WSAerrorlist[$index][$returnType-1] Case Else Return SetError(2,0,"_WSAerror returnType ("&$returnType&") unsupported (accepts only values 1-4)") EndSwitch EndFunc Enjoy.
    1 point
  29. Melba23

    Forum behaviour

    A recent thread degenerated into personal abuse because some members posted rather sarcasticly in response to the initial question and the OP then responded with rather more venom than was probably warranted. Can I take this opportunity to remind people that we try to run a civilised and polite forum and we would appreciate it if you could act accordingly. If you do not have a sensible comment to make in response to a question, please refrain from posting at all. And, as is explained in the Forum rules, if you do get flamed just report the offending post to the moderating team so that we can deal with it. Certainly do not expect us to take sides if you engage in a flame war - all participants will be treated as equally guilty. Basically, please help us keep the forum running in the way the majority of members would like to see. Thanks in advance for your cooperation. M23
    1 point
  30. Hello lovev1, and thanks for your question. I tested your script; Codescanner has no problems with it, and CodeCrypter has no trouble encrypting it. Since your script changes attributes of various files, runs/closes processes, moves/deletes files and directories, and otherwise interacts with your specific environment, I am not going to test its functionality (it's potentially far too destructive to let it run outside of a virtual machine, and I'm not going to set one up just for this, sorry). You'll have to test that on your own machine. I'm sorry I cannot provide translations of the instructions/code annotations in other languages. You could try copy/pasting the contents of MCFQA.pdf in Google Translate, but I can't guarantee that what comes out in Vietnamese will make any sense. You should start, however, by adding this line below your other includes: #include "MCFinclude.au3" then place that script in the CodeScannerCrypter subdirectory, run CodeScanner with setting WriteMetaCode on, close CodeScanner whne it's done, start CodeCrypter, load the script, select the options you want, and press Run. With default settings, it will use macro @username as encryption key, so won't run for users with a different @username. As far as I can tell, your script does not contain any complications that might cause problems for encryption. Best of luck.
    1 point
  31. Being sufficiently ancient to recall CP/M, monochrome CRTs, and woolly mammoths, I thought I'd share something from the bad old days: FAT filesystems (FAT12, FAT16, FAT32). Still widely used in USB flashRAM, SD cards, RAMdisks, and microcontroller-based embedded systems, (F)ile (A)llocation (T)able filesystems are simple and robust, providing a great environment for learning how filesystems work. Moreover, many operating systems other than Windows can handle them, enabling data exchange between different platforms. That's the good part. I've often wondered why nobody had yet written a FAT UDF library for AutoIt. Now I know why. When a normally bone-dry tech page introduces FAT with the words "Welcome to Hell" you know you're in for a rough ride. It took me almost a year of grief and many, many wrecked (virtual) volumes to get to this first beta release. That's the bad part. Why was it so painful to develop, you rhetorically ask? The I/O itself is fairly straightforward, but backward compatibility, poor design choices and some blatant mistakes have produced a convoluted mess of rules with exceptions, exceptions to the exceptions, and exceptions to the exceptions to the exceptions (and in case you're wondering, no, I'm not talking about my own scripts here). It's like the Gregorian calendar, which has 365 days per year, unless the year is divisible by 4 (366), unless the year is also divisible by 100 (365), unless the year is also divisible by 400 (366). Add to that non-standard address-widths (paired 12-bit in FAT12, 28-bit in FAT32), file fragmentation, lost clusters, cross-, open-, and self-linked chaining errors, and the train wreck that is VFAT Long File Names support , and you've got yourself a challenge. The result is a main library called the FAT Suite (FATsuite.au3), to which I've added a large demo GUI called FAT Manager (FATman.au3, not to be confused with the famous superhero), plus my trusty MBR handler (BuildPartitionTable.au3), and a few sample image files with different types of FAT. If running older versions of AutoIt, you'll additionally need Yashied's outstanding WinAPIEx.au3. I've also gratefully incorporated two excellent UDFs by Ascend4nt and trancexx respectively (with acknowledgement, of course). Many thanks to you all! When you start FATman and load a volume, you'll see a pretty lame directory/file tree above a small log-window (ripped from my CodeScanner). Bog-standard menus allow you to copy, rename, remove files and dirs, etcetera. No big deal, right? You're not impressed. But please consider this: When FATman loads a volume (either from an image file or a physical drive) it is unmounted. As far as Windows is concerned, the volume is inaccessible to you. But your actions are not handled by the OS, but by the FATsuite UDFs. If you don't appreciate the significance of unmounted full access, then this library probably isn't for you. For my fellow codehounds, however, check out the main features below. And yes, it can be slow for large filled volumes with a small cluster size (especially the demo GUI tree refresh). But it also offers you full access to your files and other data, that is, more than Windows usually offers you. Main Features: FAT volume creation and (re)formatting (18 KB - 2 TB; slow for large volumes) visualising FAT architecture, with interactive tool (manipulate total size, cluster size, number of FAT copies) two-way file transfer between FAT volume and memory (UDF only, no GUI support) two-way file transfer between FAT volume and other, mounted (FAT/NTFS) volumes internal volume-, directory-, and file I/O (create/copy/move/truncate/remove/rename/filefind/edit filespecs) *physical* directory sorting by any criterion (unlike MicroSoft's "sorted" view of physically unsorted data) wiping files and physical removal of "deleted" files/subdirs in dir table and zeroing DataRegion clusters retrieving lost/deleted/damaged data clusters (with or without FAT reference) detecting/patching FAT chaining errors (cross-linked, open-ended, and circular chains) raw FAT I/O, including flipping CleanShutdown and Hard R/W-error bits manipulating bad clusters (single creation/single removal/bulk removal) with file chain rerouting determining cluster ownership for any defined FAT entry extracting all filesystem parameters, and editing some rawcopy image-to-volume and volume-to-image (imagefile or physical device) optional comparison/synchronisation of multiple FAT copies (the table, not the entire volume) File Find utility (UDF only, no GUI support) heavily annotated code for learning about FAT filesystem mechanics But beware, you can do enormous damage to your FAT volumes. For example, there's no soft-delete with recycle bin retrieval, and confirmation checks are few. Once you remove/wipe/truncate a file, it's gone forever, period. So please, please, please, read the FATsuite Remarks section before calling its UDFs; also read the annotations in the UDFs; study FATman's many examples; always work with imagefiles of which you keep multiple backup copies. Remember, it's a beta release ( glitches possible!); you may accidentally parse a wrong parameter at some point; and Murphy's Law always applies. FATsuite.v1.1.7z (AutoIt 3.3.12 compliant version 1.1; likely won't run in legacy AutoIt environments) FATimageExamples.7z Sample FAT image files (reduced in size) I hope this contribution helps to clarify how FAT filesystems work, and that you have fun playing with it, or find some other use(s) for it. RT PS Okay, I admit the mammoth was already slightly dead when I saw it, and had been for quite a while.
    1 point
  32. RTFC

    Execute(error macro)

    Greetings y'all, While tracing an issue flagged by user MagicSpark here: I came across this puzzling AutoIt behaviour: Seterror(1) If @error Then Beep(1111,100) ; this works Seterror(1) If Execute('@error') Then Beep(1111,100) ; this fails Now I'm not sure whether this should be considered a bug or a feature. I presume Execute starts by resetting @error (and @extended) and updates it with a non-zero error code when something fails along the way. Trouble is, this makes evaluation of @error's origiinal content within an Execute envelope impossible, thereby breaking my decryption (see my CodeCrypter thread). The example above is of course just for illustration, but in Codecrypter any line containing @error no longer works (always returns zero for successful Execute). In the absence of "onError' or some form of previous-error logging facilities, would it be possible to preserve the state of @error and @extended (for example, through internal tempvars) inside the Execute handling itself just sufficiently long for actual evaluation to be possible? I realise this is a bit of a chicken-and-egg situation, but before I code up an elaborate work-around in CodeCrypter, I'd like to check with you devs whether a simple fix would resolve this. Thanks for looking into this, RT
    1 point
×
×
  • Create New...