Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation since 09/01/2011 in all areas

  1. Version 1.6.2.0

    16,521 downloads

    Extensive library to control and manipulate Microsoft Active Directory. Threads: Development - General Help & Support - Example Scripts - Wiki Previous downloads: 30467 Known Bugs: (last changed: 2020-10-05) None Things to come: (last changed: 2020-07-21) None BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort
    69 points
  2. Hi! Today I want to show you my current AutoIt project: The ISN AutoIt Studio. The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt! It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system, trophies and a lot more features!! Here are some screenshots: Here some higlights: -> easy to create/manage/public your AutoIt-projects! ->integrated GUI-Editor (ISN Form Studio 2) ->integrated - file & projectmanager ->auto backupfunction for your Projects ->extendable with plugins! ->available in several languages ->trophies ->Syntax highlighting /Autocomplete / Intelisense ->Dynamic Script ->detailed overview of the project (total working hours, total size...) And much more!!! -> -> Click here to download ISN AutoIt Studio <- <- Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: http://autoit.de/index.php?page=Thread&threadID=29742&pageNo=1 For more information visit my Homepage: https://www.isnetwork.at So….have fun with ISN AutoIt Studio! PS: Sorry for my bad English! ^^
    64 points
  3. water

    OutlookEX

    Version 1.7.0.1

    9,456 downloads

    Extensive library to control and manipulate Microsoft Outlook. This UDF holds the functions to automate items (folders, mails, contacts ...) in the background. Can be seen like an API. There are other UDFs available to automate Outlook: OutlookEX_GUI: This UDF holds the functions to automate the Outlook GUI. OutlookTools: Allows to import/export contacts and events to VCF/ICS files and much more. Threads: Development - General Help & Support - Example Scripts - Wiki BTW: If you like this UDF please click the "I like this" button. This tells me where to next put my development effort KNOWN BUGS (last changed: 2020-02-09) None
    50 points
  4. Automate all windows and browser applications with one UDF function library. Based on the microsoft automation API this library high level supports Recognition of conttrols from EDGE, Chrome, FF, Opera, Safari and Windows native apps Small testing framework to split object repository from coding away Introduction Quickstart - Getting started quickly Simple scripts With this module you can automate all applications/programs that support ui automation and/or accesibility api from microsoft you can recognize more controls than AutoIT can recognize "out of the box" you can use concepts from other testing frameworks like http://download.freedesktop.org/ldtp/doc/ldtp-tutorial.pdf http://safsdev.sourceforge.net/Default.htm coded ui testing from microsoft Some of those controls / applications are chrome browser (partly mainwindow has to be done with MSAA for navigating) chrome://accessibility in the adress bar of chrome or start with "--force-renderer-accessibility" silverlight controls Ribbon control controlbars of Excel/Word IE and FF browsers Windows Media Player Windows clock AFX .. controls (partly) .... Based on the initial AIO Object I now have made the interface file to work with objCreateInterface function which is in the latest beta's automate clicking and querying basic information It gives you a lot of basic information to be able to automate clicking, querying basic information where it goes further in certain situations than AutoIt is identifying Starting threads for background on the ui automation api of microsoft (not for starters) http://en.wikipedia.org/wiki/Microsoft_UI_Automation http://msdn.microsoft.com/en-us/library/ms747327.aspx Previous threads in general help/support Interface AutoItObject IUIAutomation ObjCreateInterface and struct tagPoint in method ElementFromPoint Be aware that API is not allways installed under XP/Vista see http://support.microsoft.com/kb/971513 Within Windows 7 and Windows 8 it should be preinstalled by default. Be aware on 32 and 64 bits way of running your script #AutoIt3Wrapper_UseX64=Y or N Basic example of usage / showing and retrieving the default information, will post multiple examples later Hover your mouse to an area of interest and press ctrl+w and information will be shown in the edit box of the form Simple spy demo (see simplespy.au3 or use latest ZIP attachment for latest version) Main features Recognize windows and html controls for the major browsers Logical and physical description for controls (UI mapping, Application map) Simple repository logic to abstract logical and physical descriptions Store Runtime Type Information in RTI. variables Rubberbanding/highlighting of objects Simple spy to help in making / identifying the physical description Support of regular expression(s) in identifying objects recognize objects on multiple properties supported properties: name ,title, automationid, classname, class, iaccessiblevalue, iaccessiblechildId, controltype, processid, acceleratorkey The actions provided so far "leftclick", "left", "click", "leftdoubleclick", "leftdouble", "doubleclick", _ "rightclick", "right", "rightdoubleclick", "rightdouble", _ "middleclick", "middle", "middledoubleclick", "middledouble", "mousemove", "movemouse" "setvalue","settextvalue" "setvalue using keys" "setValue using clipboard" "getvalue" "sendkeys", "enterstring", "type", "typetext" "invoke" "focus", "setfocus", "activate" "close" "move","setposition" "resize" "minimize", "maximize", "normal", "close", "exist", "exists" "searchcontext", "context" "highlight" "getobject","object" "attach" "capture","screenshot", "takescreenshot" "dump", "dumpthemall" "propertyvalue", "property" match on multiple properties like: name:=((Zoeken.*)|(Find.*)); ControlType:=Button; acceleratorkey:=Ctrl+F Support for 117 different properties see $UIA_propertiesSupportedArray in uiawrappers like for example title, regexptitle, class, regexpclass, iaccessiblevalue, iaccessiblechildid, name, accesskey, automationid, classname IAccessible, IAccessible2, ISimpleDom interfaces debuglogging to a file log.txt (no output in scitewindow) Examples Example 1 Iterating thru the different ways of representing the objects in the tree (#comment-1105548) Example 2 Finding the taskbar and clicking on the start menu button (#comment-1105680) Example 3 Clicking a litlle more and in the end displaying all items from the clock (thats not directly possible with AU3Info) (#comment-1108849) Example 4 that demonstrates the calculator Example 5 Automating chrome Example 6 Demonstrates all stuff within chrome to navigate html pages, find hyperlink, click hyperlink, find picture, click picture, enter data in inputbox Example 7 The chrome example modified to a firefox example Example 8 The other major browser Internet Explorer automated (made on Example 6 and 7) Example 9 Windows media player Example 10 Automating mach 3 (AFX windows and other hard to get recognized by AutoIT) Lot of links are broken due to forum upgrade just search for the text like "Example 11 Demonstrate Word, Notepad and Calculator actions" Example 11 Demonstrate Word, Notepad and Calculator actions ... Example 13 Details 1 about the right pane of the windows explorer Example 14 Details 2 about the right pane of the windows explorer Example 15 Details 3 about the right pane of the windows explorer Example 16 Details 4 about the right pane of the windows explorer Example 17 Details 5 about the right pane of the windows explorer WITH CACHING Example 18 Details 6 about the right pane of the windows explorer WITH VIRTUAL ITEMS Example 19 Eventhandling examples Example 20 Eventhandling examples Example 21a Eventhandling examples Internet Explorer Example 21b Eventhandling examples Internet Explorer Example 22 Eventhandling examples Follow focus Example 23 Eventhandling examples structure changed Example 24 Eventhandling examples IUIAutomationEventHandler Example 25 SAFEARRAYS Example 26 IACCESSIBLE / MSAA Example 27 IACCESSIBLE2 / MSAA Example 28 IACCESSIBLE / MSAA events Example 29 IACCESSIBLE2 events Example 30 ISimpleDOM Example 31 Notepad window move, maximize, minimize Example 32 Three browsers doing the same stuff with small differences in scripting only .. TODO Build recorder Enhance the spy with a nicer UI UI for the repository (now in the script with dot notation) Enhance mapping / identifying on multiple properties instead of 1 combined with index If speed becomes an issue use the caching logic of the MS UIA framework Add the other patterns later Generalize the concept of System Under Test of starting the SUT (for testing framework purposes) Remote running of scripts Fix issue on finding within dynamic context ... edit august 18th 2013 initial post Only zip files are needed to download , just unzip in 1 directory edit july 2016 Made V0_63 and examples works with AutoIt v3.3.14 Windows 10 tested Simple spy gives some basic code as a present Chrome latest versions seems to be having issues with IUIAutomation on tabs/buttons of mainwindow use MSAA for accessing tabsheets / buttons more cleanup to be in UDF style More comments in the source see changelog.txt for previous changes edit september 2017 All examples fixed for the IE, Firefox and Chrome browser Some small but essential fixes in UIAWrappers edit april 2018 Enhanced logic on fallback / dynamic search, still not perfect, to slow Retested with latest Chrome, FF, Edge and IE11 and some extensions to show how to get text from the webpage (examples 5,6,7) Some small bugfixes Some comments as given in forum incorporated edit may 2019 Speed enhancements on especially fallback searching UIA.CFG works now in a better way to turn on/off debug, highlighting, debug2file More stable and consistent behavior Internal cleanup and refactoring of bigger functions Checked with W10 (not tested on W7) Added some W10 properties Run with 3.3.14.5 on W10 UIA_V0_51.zip EXAMPLES_V0_5.zip UIA_V0_63.zip EXAMPLES_V0_63.zip UIA_V0_64.zip EXAMPLES_V0_64.zip EXAMPLES_V0_66.zip UIA_V0_66.zip EXAMPLES_V0_70.zip UIA_V0_70.zip
    49 points
  5. 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
    45 points
  6. Jon

    AutoIt v.3.3.16.0 Released

    AutoIt v3.3.16.0 has been released. Thanks to @jpm and the MVPs who were responsible for the majority of code in this version. Download it here. Complete list of changes: History
    37 points
  7. As the WebDriver UDF - Help & Support thread has grown too big, I started a new one. The prior thread can be found here.
    34 points
  8. [BUGFIX VERSION] - 6 Apr 24 Fixed: UDF failed if header colours were initialised but not specifically set. New UDF in the zip below. -------------------------------------------------------------------------------------- Note: This is a new recoded and expanded version of my earlier UDF of the same name. If you move to this new version there might well be several script-breaking changes, particularly when setting which columns are to be editable. Please read the "Beginner's Guide" and look at the included example scripts to see where things have changed. -------------------------------------------------------------------------------------- This UDF allows you to do much more with ListView controls (either native or UDF created): Edit the content with plain text, combos or date-time pickers - and edit the headers too Move rows within the ListView Drag rows both within the ListView and to other ListViews in the same GUI (or not as required) Insert and delete columns and rows Sort columns by simply clicking the header Colour individual ListView items and headers Only select a single cell rather then the entire row Save and load entire ListViews For the advanced user: If you use certain Windows message handlers (In particular WM_NOTIFY) in your script, please read the function headers for the equivalent handlers within the UDF. Here is the UDF, with 6 examples and the guide, in zip format: GUIListViewEx.zip Credit to: martin (basic drag code), Array.au3 authors (array functions), KaFu and ProgAndy (font function), LarsJ (colouring code) Happy to take compliments or criticism - preferably the former! M23
    32 points
  9. Introduction JSON (Javascript Object Notation) is a popular data-interchange format and supported by a lot of script languages. On AutoIt, there is already a >JSON UDF written by Gabriel Boehme. It is good but too slow, and not supports unicode and control characters very well. So I write a new one (and of course, fast one as usual). I use a machine code version of JSON parser called "jsmn". jsmn not only supports standard JSON, but also accepts some non-strict JSON string. See below for example. Important Update!! I rename the library from jsmn.au3 to json.au3. All function names are changed, too. Decoding Function Json_Decode($Json) $Json can be a standard or non-standard JSON string. For example, it accepts: { server: example.com port: 80 message: "this looks like a config file" } The most JSON data type will be decoded into corresponding AutoIt variable, including 1D array, string, number, true, false, and null. JSON object will be decoded into "Windows Scripting Dictionary Object" retuned from ObjCreate("Scripting.Dictionary"). AutoIt build-in functions like IsArray, IsBool, etc. can be used to check the returned data type. But for Object and Null, Json_IsObject() and Json_IsNull() should be used. If the input JSON string is invalid, @Error will be set to $JSMN_ERROR_INVAL. And if the input JSON string is not finish (maybe read from stream?), @Error will be set to $JSMN_ERROR_PART. Encoding Function Json_Encode($Data, $Option = 0, $Indent = "\t", $ArraySep = ",\r\n", $ObjectSep = ",\r\n", $ColonSep = ": ") $Data can be a string, number, bool, keyword(default or null), 1D arrry, or "Scripting.Dictionary" COM object. Ptr will be converted to number, Binary will be converted to string in UTF8 encoding. Other unsupported types like 2D array, dllstruct or object will be encoded into null. $Option is bitmask consisting following constant: $JSON_UNESCAPED_ASCII ; Don't escape ascii charcters between chr(1) ~ chr(0x1f) $JSON_UNESCAPED_UNICODE ; Encode multibyte Unicode characters literally $JSON_UNESCAPED_SLASHES ; Don't escape / $JSON_HEX_TAG ; All < and > are converted to \u003C and \u003E $JSON_HEX_AMP ; All &amp;amp;amp;amp;s are converted to \u0026 $JSON_HEX_APOS ; All ' are converted to \u0027 $JSON_HEX_QUOT ; All " are converted to \u0022 $JSON_PRETTY_PRINT ; Use whitespace in returned data to format it $JSON_STRICT_PRINT ; Make sure returned JSON string is RFC4627 compliant $JSON_UNQUOTED_STRING ; Output unquoted string if possible (conflicting with $JSMN_STRICT_PRINT) Most encoding option have the same means like PHP's json_enocde() function. When $JSON_PRETTY_PRINT is set, output format can be change by other 4 parameters ($Indent, $ArraySep, $ObjectSep, and $ColonSep). Because these 4 output format parameters will be checked inside Jsmn_Encode() function, returned string will be always accepted by Jsmn_Decode(). $JSON_UNQUOTED_STRING can be used to output unquoted string that also accetped by Jsmn_Decode(). $JSON_STRICT_PRINT is used to check output format setting and avoid non-standard JSON output. So this option is conflicting with $JSON_UNQUOTED_STRING. Get and Put Functions Json_Put(ByRef $Var, $Notation, $Data, $CheckExists = False) Json_Get(ByRef $Var, $Notation) These functions helps user to access object or array more easily. Both dot notation and square bracket notation can be supported. Json_Put() by default will create non-exists objects and arrays. For example: Local $Obj Json_Put($Obj, ".foo", "foo") Json_Put($Obj, ".bar[0]", "bar") Json_Put($Obj, ".test[1].foo.bar[2].foo.bar", "Test") Local $Test = Json_Get($Obj, '["test"][1]["foo"]["bar"][2]["foo"]["bar"]') ; "Test" Object Help Functions Json_ObjCreate() Json_ObjPut(ByRef $Object, $Key, $Value) Json_ObjGet(ByRef $Object, $Key) Json_ObjDelete(ByRef $Object, $Key) Json_ObjExists(ByRef $Object, $Key) Json_ObjGetCount(ByRef $Object) Json_ObjGetKeys(ByRef $Object) Json_ObjClear(ByRef $Object) These functions are just warps of "Scripting.Dictionary" COM object. You can use these functions if you are not already familiar with it. == Update 2013/05/19 == * Add Jsmn_Encode() option "$JSMN_UNESCAPED_ASCII". Now the default output of Json_Encode() is exactly the same as PHP's json_encode() function (for example, chr(1) will be encoded into u0001). $JSON_UNESCAPED_ASCII ; Don't escape ascii charcters between chr(1) ~ chr(0x1f) == Update 2015/01/08 == * Rename the library from jsmn.au3 to json.au3. All function names are changed, too. * Add Json_Put() and Json_Get() * Add Null support * Using BinaryCall.au3 to loading the machine code. == Update 2018/01/13== (Jos) * Add JsonDump() to list all Json Keys and their values to easily figure out what they are. == Update 2018/10/01== (Jos) * Fixed JsonDump() some fields and values were not showing as discussed here - tnx @TheXman . == Update 2018/10/01b== (Jos) * Added Json_ObjGetItems, Tidied source and fixed au3check warnings - tnx @TheXman . == Update 2018/10/28== (Jos) * Added declaration for $value to avoid au3check warning - tnx @DerPensionist == Update 2018/12/16== (Jos) * Added another declaration for $value to avoid au3check warning and updated the version at the top - tnx @maniootek == Update 2018/12/29== (Jos) * Changed Json_ObjGet() and Json_ObjExists() to allow for multilevel object in string. == Update 2019/01/17== (Jos) * Added support for DOT notation in JSON functions. == Update 2019/07/15== (Jos) * Added support for reading keys with a dot inside when using a dot as separator (updated) == Update 2021/11/18== (TheXman) * Update details in below post: == Update 2021/11/20== (TheXman) * Minor RegEx update, no change to the functionality or result._Json(2021.11.20).zip
    32 points
  10. LAST VERSION - 1.1 18-May-12 Control Viewer (CV) is a replacement of AutoIt Window Info with a number of advantages. I tried to stick to the interface of the last, so you almost do not have to be retrained. During testing, I never managed to find any controls that could not be identified by CV (on the contrary, shows a lot of hidden controls, especially for the system windows). The all program settings are stored in the following registry key: HKEY_CURRENT_USERSoftwareY'sControl Viewer The main differences CV from AWI Shows the complete list of all existing controls for the window that are interested (visible, hidden and deleted controls are displayed with different colors that can be changed to any other).Dynamically changing information during search for the windows and their controls.Ability to quickly switch between controls in the list.Ability to show/hide any controls from the list (useful for the overlaping controls).Information for the Style and ExStyle parameters shown in the form of hexadecimal values​​, and as its flags.Added the PID and Path parameters in the Window tab and ability to quickly open a folder that containing the process file.Added the coordinate system relative to the selected control.Shows a color of the selected pixel in RGB and BGR formats.Shows an example fill of the selected color.Ability to select the text encoding (affects the Text parameter in the Control tab).The complete change the appearance of pop-up frame for the selected controls.Simple and convenient tool to get a screenshot of the part screen of interest for publication on the forum (Capture tab).Create a report in the clipboard or a text file for subsequent publication on the forum.Search all running AutoIt scripts and their windows in the system (AutoIt tab).User-friendly interface. Used shortcuts Ctrl+Alt+T - Enable/Disable "Always On Top" mode (also available from the menu). Ctrl+Alt+H - Enable/Disable highlight selected controls (also available from the menu). Ctrl+A - Select all text (works in any input field). Ctrl - Hold down when moving the mouse to scroll the screenshot (Capture tab). Shift - Hold down when stretching/compression of the contour frame for an equilateral resizing screenshots (Capture tab). DoubleClick (on the screenshot) - Save the image to a file (Capture tab). DoubleClick (on any list item) - Open a folder with the file of the process or AutoIt script (AutoIt tab). Del (on any list item) - Close process (AutoIt tab). F5 - Updating the list (AutoIt tab). If anyone have any questions or comments about CV, please post it in this thread. I will be glad to any feedback and suggestions. Files to download Binary (x86 and x64) Redirection to CV_bin.zip, 1.14 MB CV_bin.html Source Redirection to CV_source.zip, 691 KB CV_source.html
    31 points
  11. BuckMaster

    Form Builder beta

    Update v1.0.6 Major script overhaul, I literally started over from scratch only adding parts of code from the old script that were solid. I don’t have a help file made as of now so I am going to explain all of the functionality in this post - Form Builder is no longer bi-directional, you now toggle between script mode and GUI mode using a button in the top right or F4 - The script no longer recompiles on every change but instead inserts changes into the script - Form Builder no longer cares about Event mode or GuiGetMsg mode - No more .gui files, you now edit .au3 scripts directly - Script edit is now a SciLexer control, includes syntax highlighting, folding, call tips, keywords, and inline error annotations. - Script output console is now at the bottom in script mode - Main GUI menu redone, most functions from SciTe have been added along with their hotkeys - All restrictions to editing the script have been removed - GDI+ and Graphic editors removed - Cleanup of script, stability greatly increased - Hotkeys no longer use _IsPressed they now use GUIAccelerator keys (with exception to a few) - Multiple scripts can be open - Form Builder buffers the open scripts and adds an asterisk * to scripts that have been modified - Rich Edit, GUIScrollbars, Dummy, and Updown are disabled for now until I can add them - GUI Menu controls cannot be created as of now but will be rendered in the editor - Undo and Redo actions in script mode and GUI mode added, the GUI undo and redo buffer is cleared switching between modes - The Undo and Redo buffers do not have a limit but are cleared when switching between modes or scripts - Undo and Redo actions do not work for controls that have no control handle - The Treeview now works as a Go to function for controls and functions in script mode - Form Builder now tries to preserve as much of the original content as possible, it will save whitespace in-between parameters and comments on controls - Treeview context menu reworked, much more responsive - Unicode support added File -> Encoding -> UTF-8 - Language support added, I added a couple of language files and used Google translate just so I could size my GUI's for different languages, I do not support what those language files say - Selecting a GUI in the Treeview in GUI mode will allow you to change the GUI's Handle, Position, Background Color, State, Cursor, Font, Font Size and Font Attributes - Auto Declare is no longer hiding in the settings, it is now on the top right and is a toggle between Off, Global and Local - Help File Lookup added (Ctrl + H), allows you to search selected text in the help file, Any variable will be searched and the first result will be displayed, any string will be searched as a keyword in the index - Added current script line, column, and selection length in the bottom left - Standard undeclared style constants are checked before script execution and the script will prompt if an undefined style constant is found - You can now toggle script whitespace, EOL characters, line numbers, margins and output in the View menu - View -> Toggle All Folds works as it does in SciTe, only base level folds are changed and the first fold found determines whether to expand or contract - Form Builder Settings redone - Bugs with submitting data and control selection have been fixed - Fixed problems with frequently called repetitive functions causing issues with large scripts - Fixed bugs with B, I, U and S font attribute buttons getting stuck and called when enter was pressed Update v1.0.7 - Help File Look-up hotkey changed to Ctrl+B - Replace hotkey changed to Ctrl+H - Changes to $SCN_MODIFIED so only text events are notified - Bookmarks added, Ctrl+M to add or delete a Bookmark from the current line - Edit -> Bookmarks -> Set Bookmark changes the currently selected Bookmark - Edit -> Clear Current Bookmarks deletes only the currently selected Bookmark - Allows you to change foreground and background colors of Bookmarks - Added F2 hotkey for Next Bookmark - Added Shift+F2 hotkey for Previous Bookmark - Fixed a bug that made it so script annotation did not show up for some people - Script errors and warnings now add a Bookmark on each line - Ctrl+E hotkey added to clear all Bookmarks and Annotations - Minor GUI tweaks - Fixed a bug with the GUI Style undo action - Undo and Redo actions for GUI windows will now update the window properties if the GUI is selected - F4 Hotkey no longer switches modes, switching modes is now F10 - F4 is to toggle next error or warning message, works like it does in SciTe, bookmarks the line and highlights the error in the console - Shift+F4 Hotkey added to toggle previous error or warning message - Shift+F5 Hotkey added to clear script output - Ctrl+F5 Hotkey added as SyntaxCheck Prod - Form Builder now performs a SyntaxCheck before entering GUI Mode and prompts on Error or Warning - Language Select Menu Added Settings -> Lanugage - Icons added to main menu - Languages added to all new menu items and msgbox's - Language Files updated for new data - Language Support added for Arabic, Chinese, Dutch, French, German, Hebrew, Japanese, Swedish, Thai, and Vietnamese [ Google Translate ] - Fixed bug with updating a language that made it look like ANSI and UTF-8 were both selected - Added redo button next to undo button - Font attribute buttons Bold, Italic, Underline and Strike-Out changed to labels Update v1.0.8 - Somehow a main function got deleted causing the script to crash on some changes - Fixed some issues with updating Languages Hotkeys Ctrl + N - New Blank Script Ctrl + G - New GUI Script Ctrl + O - Open Script Ctrl + Shift + S - Save As Ctrl + S - Save Esc - Close Open Script Alt + F4 - Exit Ctrl + Z - Undo Ctrl + Y - Redo Ctrl + X - Cut Ctrl + C - Copy Ctrl + V - Paste Ctrl + A - Select All Ctrl + W - Clear inline script annotation Ctrl + E - Clear inline script annotation and bookmarks Ctrl + F - Find Ctrl + F3 - Find Next Shift + F3 - Find Previous (doesn’t work yet) Ctrl + B - Help File Lookup F5 - Go Alt + F5 - Beta Run F7 - Build Ctrl + F7 - Compile F11 - Full screen F8 - Toggle Show/Hide Script Output Ctrl + I - Open Include Ctrl + H - Replace F1 - AutoIt Help File Ctrl + D - Duplicate Control Delete - Delete Control Ctrl + Shift + 8 - Toggle Show/Hide Script Whitespace Ctrl + Shift + 9 - Toggle Show/Hide Script EOL characters Ctrl - GUI Mode multicontrol selection F10 - Switch Modes F4 - Next Message Shift+F4 - Previous Message Shift+F5 - Clear Output Ctrl+M - Add Bookmark F2 - Next Bookmark Shift+F2 - Previous Bookmark Basic GUI Mode How To Create a Control - click a control on the left - click in the GUI you wish to add the control Left Click: Click and drag to auto resize the control Right Click: Creates the control at a standard size Select a Control - click inside the control or select it in the treeview Change a controls Data - First select the control - modify the controls data on the right, press enter to submit changes state, cursor, font and resizing update when you change the data - when modifying the data parameter the script recognizes if there is a variable in the data and will add quotes accordingly ex. data parameter = $data, End result in script: GUICtrlCreateButton($data, 50, 50, 100, 20) ex. data parameter = data, End result in script: GUICtrlCreateButton("data", 50, 50, 100, 20) ex. data parameter = "data"&$data, End result in script: GUICtrlCreateButton("data"&$data, 50, 50, 100, 20) Applying an Image to a control - select a control - control styles must be applied to some controls before adding an image - click the ... button next to the Image input in the Control Properties area in the bottom right - select the image you want to display, allows jpg, bmp, gif, ico and dll files - selecting a dll will open another prompt to choose which resource to display Control Grouping - multiple controls must be selected - press the group controls button - control grouping allows you to resize and move multiple controls at the same time, as of now groups are deleted when leaving GUI mode I only have a couple odds and ends to finish up before everything should be complete, I need to add Undo and Redo actions for copying and duplicating controls and a couple other minor things, eventually I want to try to add all of the UDF controls as well. If people are willing to translate the language file I would be very grateful, the ones I have right now are from Google translate, I only used them for testing and have no idea what they say. I want to thank Kip, Prog@ndy, Isi360 and all of the other contributors on this forum, without you guys i don't think i could have written this script. Please post any comments, problems or suggestions, BuckMaster * I only used one "magic number" on my main close case statement, only for faster locating, and i don't care. Form Builder Source.zip Form Builder.zip
    31 points
  12. Jon

    Forum Rules

    We want the forum to be a pleasant place for everyone to discuss AutoIt scripting, and we also want to protect the reputation of AutoIt. So we ask you to respect these simple rules while you are here: Forum Posting 1. Do not ask for help with AutoIt scripts, post links to, or start discussion topics on the following subjects: Malware of any form - trojan, virus, keylogger, spam tool, "joke/spoof" script, etc. Bypassing of security measures - log-in and security dialogs, CAPTCHAs, anti-bot agents, software activation, etc. Automation of software/sites contrary to their EULA (see Reporting bullet below). Launching, automation or script interaction with games or game servers, regardless of the game. Running or injecting any code (in any form) intended to alter the original functionality of another process. Decompilation of AutoIt scripts or details of decompiler software. This list is non-exhaustive - the Moderating team reserve the right to close any thread that they feel is contrary to the ethos of the forum. 2. Do not post material that could be considered pornographic, violent or explicit - or express personal opinions that would not be acceptable in a civilized society. Do not post any copyrighted material unless the copyright is owned by you or by this site. 3. To protect this community, any files posted by you are subject to checks to ensure that they do not contain malware. This includes, but is not limited to, decompilation and reverse engineering. 4. Do not flame or insult other members - and just report the thread to a Moderator (see below) if you are so attacked. 5. Do not PM other users asking for support - that is why the forum exists, so post there instead. 6. Do not create multiple accounts - if you inadvertently created multiple accounts then contact a Moderator to close the unwanted ones. 7. Do not repost the same question if the previous thread has been locked - particularly if you merely reword the question to get around one of the prohibitions listed above. 8. Do not delete your posts, nor completely remove their content, if doing so will interrupt the flow of the thread. 9. Do not post in a thread while the Moderating team are actively trying to determine whether it is legal. The Moderation team will do their best to act in fair and reasonable manner. Sanctions will only be applied as a last resort and any action taken will be explained in the relevant thread. If moderation action is taken, you will need to acknowledge this through a dialog or you will be unable to post further in the forum. Please note that this dialog is not an agreement that the warning was justified - it is only there so that members are aware that moderation action has been taken and that they may have certain restrictions applied to their account. If you feel that you have been unfairly moderated then contact the Moderator concerned - using a PM or the "Report" button is preferable to opening a new thread (although new members may have to do this). But do be aware that the Moderation team has the final word - the rules are set out by the site owner and you are only welcome here if you respect his wishes. Signatures and Avatars There is no formal policy for the use of signatures but if a moderator thinks it is too big and/or distracting then you may be asked to tone it down. No-one likes wading through signatures that are a page high. Similarly for avatars, expect distracting flashing and animated gifs to be removed. Reporting If you feel a post needs Moderator attention, please use the "Report" button next to the post date at the top. You can then enter details of why you have reported the post - but there is no need to include the content of the post as that is done automatically. The Moderating team will be alerted to the post and will deal with it as soon as they can. If you suspect a EULA violation, do not expect the Moderating team to do all the work - please provide some evidence in the report such as a copy of (or link to) the EULA in question, as well as the section you believe has been violated. Finally, please do not enter into an argument with the original poster - that is why we have Moderators. Spam Please do not react to spam in any way other than reporting it. Multiple reports are combined by the forum software, so there is no need to announce that you have reported the spam - in fact doing so only increases the work for the Moderator who deals with it. Interacting with this website Anyone found abusing the website is subject to harsh punishment without warning. A non-exhaustive list of potential abuses include: Automated forum registration or login. Automated posting or sending messages on the forum. Automated manipulation of polls, user reputation or other forum features. Automated creation or comments on issue tracker tickets. Automated creation or editing of wiki pages. Other abuses which are either examples of excessive bandwidth usage or automation of the site. Use common sense. If you do not have common sense, don't do anything. Do not automate the forum, wiki or issue tracker in any way at all. Scripts which automatically update AutoIt such as AutoUpdateIt are acceptable as long as they are not abused and do not generate excessive bandwidth usage.
    31 points
  13. Features: Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 3 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left. Windows 10 style right click menu Credits: @UEZ, for the function to create buttons with text using GDIPlus. @binhnx for his SSCtrlHover UDF Changelog: Download UDF with example:
    30 points
  14. ; ;################################## ; Include ;################################## #Include<file.au3> ;################################## ; Variables ;################################## $SmtpServer = "MailServer" ; address for the smtp-server to use - REQUIRED $FromName = "Name" ; name from who the email was sent $FromAddress = "your@Email.Address.com" ; address from where the mail should come $ToAddress = "your@Email.Address.com" ; destination address of the email - REQUIRED $Subject = "Userinfo" ; subject from the email - can be anything you want it to be $Body = "" ; the messagebody from the mail - can be left blank but then you get a blank mail $AttachFiles = "" ; the file(s) you want to attach seperated with a ; (Semicolon) - leave blank if not needed $CcAddress = "CCadress1@test.com" ; address for cc - leave blank if not needed $BccAddress = "BCCadress1@test.com" ; address for bcc - leave blank if not needed $Importance = "Normal" ; Send message priority: "High", "Normal", "Low" $Username = "******" ; username for the account used from where the mail gets sent - REQUIRED $Password = "********" ; password for the account used from where the mail gets sent - REQUIRED $IPPort = 25 ; port used for sending the mail $ssl = 0 ; enables/disables secure socket layer sending - put to 1 if using httpS $tls = 0 ; enables/disables TLS when required ;~ $IPPort=465 ; GMAIL port used for sending the mail ;~ $ssl=1 ; GMAILenables/disables secure socket layer sending - put to 1 if using httpS ;################################## ; Script ;################################## Global $oMyRet[2] Global $oMyError = ObjEvent("AutoIt.Error", "MyErrFunc") $rc = _INetSmtpMailCom($SmtpServer, $FromName, $FromAddress, $ToAddress, $Subject, $Body, $AttachFiles, $CcAddress, $BccAddress, $Importance, $Username, $Password, $IPPort, $ssl, $tls) If @error Then MsgBox(0, "Error sending message", "Error code:" & @error & " Description:" & $rc) EndIf ; ; The UDF Func _INetSmtpMailCom($s_SmtpServer, $s_FromName, $s_FromAddress, $s_ToAddress, $s_Subject = "", $as_Body = "", $s_AttachFiles = "", $s_CcAddress = "", $s_BccAddress = "", $s_Importance="Normal", $s_Username = "", $s_Password = "", $IPPort = 25, $ssl = 0, $tls = 0) Local $objEmail = ObjCreate("CDO.Message") $objEmail.From = '"' & $s_FromName & '" <' & $s_FromAddress & '>' $objEmail.To = $s_ToAddress Local $i_Error = 0 Local $i_Error_desciption = "" If $s_CcAddress <> "" Then $objEmail.Cc = $s_CcAddress If $s_BccAddress <> "" Then $objEmail.Bcc = $s_BccAddress $objEmail.Subject = $s_Subject If StringInStr($as_Body, "<") And StringInStr($as_Body, ">") Then $objEmail.HTMLBody = $as_Body Else $objEmail.Textbody = $as_Body & @CRLF EndIf If $s_AttachFiles <> "" Then Local $S_Files2Attach = StringSplit($s_AttachFiles, ";") For $x = 1 To $S_Files2Attach[0] $S_Files2Attach[$x] = _PathFull($S_Files2Attach[$x]) ;~ ConsoleWrite('@@ Debug : $S_Files2Attach[$x] = ' & $S_Files2Attach[$x] & @LF & '>Error code: ' & @error & @LF) ;### Debug Console If FileExists($S_Files2Attach[$x]) Then ConsoleWrite('+> File attachment added: ' & $S_Files2Attach[$x] & @LF) $objEmail.AddAttachment($S_Files2Attach[$x]) Else ConsoleWrite('!> File not found to attach: ' & $S_Files2Attach[$x] & @LF) SetError(1) Return 0 EndIf Next EndIf $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusing") = 2 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserver") = $s_SmtpServer If Number($IPPort) = 0 then $IPPort = 25 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpserverport") = $IPPort ;Authenticated SMTP If $s_Username <> "" Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpauthenticate") = 1 $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendusername") = $s_Username $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendpassword") = $s_Password EndIf ; Set security params If $ssl Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/smtpusessl") = True If $tls Then $objEmail.Configuration.Fields.Item ("http://schemas.microsoft.com/cdo/configuration/sendtls") = True ;Update settings $objEmail.Configuration.Fields.Update ; Set Email Importance Switch $s_Importance Case "High" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "High" Case "Normal" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Normal" Case "Low" $objEmail.Fields.Item ("urn:schemas:mailheader:Importance") = "Low" EndSwitch $objEmail.Fields.Update ; Sent the Message $objEmail.Send If @error Then SetError(2) Return $oMyRet[1] EndIf $objEmail="" EndFunc ;==>_INetSmtpMailCom ; ; ; Com Error Handler Func MyErrFunc() $HexNumber = Hex($oMyError.number, 8) $oMyRet[0] = $HexNumber $oMyRet[1] = StringStripWS($oMyError.description, 3) ConsoleWrite("### COM Error ! Number: " & $HexNumber & " ScriptLine: " & $oMyError.scriptline & " Description:" & $oMyRet[1] & @LF) SetError(1); something to check for when this function returns Return EndFunc ;==>MyErrFunc Edit: Fixed Bcc ... Edit: Added support for different port and SLL which are used by GMail (Port 465) Edit: Added Importance support (10/2008) EDIT: Added $TLS option (07/2020 Some interesting Info from the thread:
    28 points
  15. I'm using very often binary strings to read images, sounds, etc. directly for memory to avoid any file installation. Here a small tool to convert any file to a base64 string incl. compression option to use it within your script to avoid usage of local disk (file install)! It will also created the needed functions! Code is too long now for the code box -> Pastebin.com Download: File to Base64 String Code Generator v1.20 Build 2020-06-05.7z (6238 downloads previously) Code will run on 3.3.11.4 or higher versions only ! Thanks to: Ward for the _Base64Encode() / LZMAT / MsgBoxEx() functions. trancexx for the LZNTCompress / LZNTDecompress and _Base64Decode() functions! wraithdu for bug fixing and advancing the code! Just load any file(s), convert it and use it in your code! Checkout tooltips when hovering some controls... 😉 Example using some images from ..\AutoIt3\Examples\GUI folder. Display images from memory in controls: ;coded by UEZ 2011 #include <buttonconstants.au3> #include <guiconstantsex.au3> #include <GDIPlus.au3> #include <SendMessage.au3> #include <WinAPISysWin.au3> _GDIPlus_Startup() ;~ Global Const $IMAGE_BITMAP = 0 Global Const $STM_SETIMAGE = 0x0172 Global $msg Global Const $hGUI = GUICreate("Example", 600, 250) Global Const $idLogo = GUICtrlCreatePic("", 215, 20, 169, 68) Global Const $idButton = GUICtrlCreateButton("", 266, 150, 78, 81, $BS_FLAT + $BS_BITMAP) Global Const $hButton = GUICtrlGetHandle($idButton) Global Const $Bmp_Logo = _GDIPlus_BitmapCreateFromMemory(AutoIt_Logo(), True) _WinAPI_DeleteObject(GUICtrlSendMsg($idLogo, $STM_SETIMAGE, $IMAGE_BITMAP, $Bmp_Logo)) Global Const $Bmp_Button = _GDIPlus_BitmapCreateFromMemory(Merlin(), True) _WinAPI_DeleteObject(_SendMessage($hButton, $BM_SETIMAGE, $IMAGE_BITMAP, $Bmp_Button)) _WinAPI_UpdateWindow($hButton) GUISetState() While True $msg = GUIGetMsg() Switch $msg Case $idLogo MsgBox(0, "Information", "The picture has been clicked!") Case $idButton MsgBox(0, "Information", "the button has been clicked!") Case $GUI_EVENT_CLOSE _WinAPI_DeleteObject($Bmp_Logo) _WinAPI_DeleteOb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sACto0AxstwATeARW0A/wANsiAL0PAA3WiABDzwDZ0A0AKTzQI+EL4AILDURifd3SEARA8gALTNAuwAkN8vMAEemg4Av9AFQ9AFZ/AACzywDVbQwy8AwA4sAAAZAAwAARAIWR3d8p0AMplgDWAALgAAwAL4PdnOIAwAy0AEII4ANMAAnwmu4AxuAkAA8NznU9gT/iYAslMNpAAEJoAAAT6Q4Rue3zgAnt8aDgAzLAAAKa7O89LYLS4AIlGdCdUQCAEAIAMmsA4Z4AMANQ4AUM7jPpAAAetgApv83C4AdAXsPOTAUuQAV6AKpPCsQLAAA8AgAGb+yZMA3GiBAORaLuQAXI4pi50JV/AA5aqgCk8KAqQAAAKBoArqfD4Ac66+Ev7mmNIA1HI+5+syRHMAIO4rgC7ojF4AEIp92IxddIoA3eiUXumWfukAmJ7pmr7pnB4AEAA7' $AutoIt_Logo = _Base64Decode($AutoIt_Logo) Local $tSource = DllStructCreate('byte[' & BinaryLen($AutoIt_Logo) & ']') DllStructSetData($tSource, 1, $AutoIt_Logo) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress) $tSource = 0 Return Binary(DllStructGetData($tDecompress, 1)) EndFunc ;==>AutoIt_Logo Func Merlin() Local $Merlin $Merlin &= 'R0lGODlhRABHAPcAAP///xgxcRw1fRgtbRw5ghgtaRw1eRw5hsrKyhgxdRw9lhQkYRgxbRQoaRQ1fRg1eRw5ihg1dSBBkhQtZcLCwr6SlhQkWSA9kq6qrsaamrKytrq2tsrKzr6qQRQtdSA5ijldlhg1hhQxfaKenhAodRw9igwkVXl5eaJ9eRgxaUFpns6ioj1JVRAcSVVZWWFlYQAEHIaCghQ1jhgoYbaiPevr676+vhQtceeysiBBnrKOjhAkbS05Wd+mqhAkXY6KjqKWQWlpacqyQSAtSQggZcbGygwcUWFlVWl5kn1hYWGGshgxeaqqqsbGwpaSltvb3yQ9cYpxcSAxWRw1gt+uro59hqKmpjFFeYZpaaqCghQoXSAxaRAkZZKSjhAxhgQQNT1dkvPz8yh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RDDWu0I1uTKEADGCALWjhEUawBS9EsQYy9BEliDhFIVCAAmV8oQD6KEADFAkJVSgiBJKkJCTdKII9uIALjyDDKNsAh6y0hgp0gEMDBnCNRNwgFLmYxSweKUsB5AN9odCDC4iQDnLg4DiKIgoSspCBFWQgDvIgphkSUYoOzCIZv3OjLEUQDEWAAhQdWAcR4ODNFVSAHKgaChLekf+BDNThFqMYwASkwYYOdEAIwRCBOilJSXsoQhUdoAEQhtGINERhBbdAgVOQgALWkCEDUBhAA1hAAyEIQRiQZChDH2AARUSUBtJoRBTYsYI4oGA5Q7GGP7LzhSTgogAzWMAiPOEJA6T0AUhl6BKEIQSJSmEP7BhCGvxRCKdQog47hQY0GABULTTAAyJg6UojgNQHiOAFQtCDHtjAg058oQ7kSII3skKJRtAiCZxApBa0UIAEkHWsESArS9vxggSMQg9wSActCqGLuc7FDsDgxDV24AO+BuCvcoxAAjYb2Ah4wAMJ8EAlYjEEdXDiHogIzDDigYw+mIEFPkikX8u62QD/bPa2tdVHA4aADH54ZC6IYEE/+vAJcLghtgywLVKXkIAAONe5t3UuV4fAiXT8di6XQMYnzrEFNPA1uZu9Ai48EAB93OC5zyViAaSgjk5cNytg4IcdzDAIHlR2iLb1QB4wUQkSVGIR50UvA8iohXLkMjAqSAcXCmAGO6DBAmVMrn5pkIsjAMETAZYuVwtQYGc8IjDGMMEEGpACalgAwikYgD5G4QkgsIEGpbgBEZMbAPVy2AgWSAeIRVyACczAAnwtgDxKAYQOsOHIeZDxjGes13RYAFdzMYQFJkDlGfghyAyoxB7McGQagKMS+mBAmJkM1HQYQQsI3usMZqCFKyNyacCyWAQbznEEM7hAyWSeQJuvoALNwAIKUNBCC6b85hvAgQ2J2MEO5LFkG0/AAipILXNOAQYLxBaRN1hEOxqgygWseQYNaEBQfZCCFHxIBW8otTwYPYAUGGITIIi1rGP9BplB6da4TkhAAAA7' Return Binary(_Base64Decode($Merlin)) EndFunc ;==>Merlin Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize = 0x800000) Local $tBuffer, $Ret $tOutput = 0 $tBuffer = DllStructCreate('byte[' & $iBufferSize & ']') If @error Then Return SetError(1, 0, 0) $Ret = DllCall('ntdll.dll', 'uint', 'RtlDecompressBuffer', 'ushort', 0x0002, 'ptr', DllStructGetPtr($tBuffer), 'ulong', $iBufferSize, 'ptr', DllStructGetPtr($tInput), 'ulong', DllStructGetSize($tInput), 'ulong*', 0) If @error Then Return SetError(2, 0, 0) If $Ret[0] Then Return SetError(3, $Ret[0], 0) $tOutput = DllStructCreate('byte[' & $Ret[6] & ']') If Not _WinAPI_MoveMemory(DllStructGetPtr($tOutput), DllStructGetPtr($tBuffer), $Ret[6]) Then $tOutput = 0 Return SetError(4, 0, 0) EndIf Return $Ret[6] EndFunc ;==>_WinAPI_LZNTDecompress Func _Base64Decode($input_string) Local $struct = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(2, 0, "") Return DllStructGetData($a, 1) EndFunc ;==>_Base64Decode Play a wave file from memory: ;coded by UEZ #AutoIt3Wrapper_UseX64=n #include <apiconstants.au3> $binWave = Wave() $tWave = DllStructCreate('byte[' & BinaryLen($binWave) & ']') $pWave = DllStructGetPtr($tWave) DllStructSetData($tWave, 1, $binWave) _WinAPI_PlaySound($pWave, BitOR($SND_ASYNC, $SND_MEMORY, $SND_NOWAIT)) $tWave = 0 Sleep(2000) ; #FUNCTION# ==================================================================================================================== ; Name...........: _WinAPI_PlaySound ; Description....: Plays a sound specified by the given file name, resource, or system event. ; Syntax.........: _WinAPI_PlaySound ( $sSound [, $iFlags [, $hInstance]] ) ; Parameters.....: $sSound - The string that specifies the sound to play. The maximum length is 255 characters. If $sSound is ; empty, any currently playing waveform sound is stopped. ; $iFlags - The flags for sound playing. This parameter can be one or more of the following values. ; ; $SND_APPLICATION ; $SND_ALIAS ; $SND_ALIAS_ID ; $SND_ASYNC ; $SND_FILENAME ; $SND_LOOP ; $SND_MEMORY ; $SND_NODEFAULT ; $SND_NOSTOP ; $SND_NOWAIT ; $SND_PURGE ; $SND_RESOURCE ; $SND_SYNC ; ; Windows Vista or later ; ; $SND_SENTRY ; $SND_SYSTEM ; ; Three flags ($SND_ALIAS, $SND_FILENAME, and $SND_RESOURCE) determine whether the name is interpreted ; as an alias for a system event, a file name, or a resource identifier. If none of these flags are ; specified, _WinAPI_PlaySound() searches the registry or the WIN.INI file for an association with ; the specified sound name. If an association is found, the sound event is played. If no association ; is found in the registry, the name is interpreted as a file name. ; ; If the $SND_ALIAS_ID flag is specified in $iFlags, the $sSound parameter must be one of the ; $SND_ALIAS_* values. ; ; (See MSDN for more information) ; ; $hInstance - Handle to the executable file that contains the resource to be loaded. If $iFlags does not ; contain the $SND_RESOURCE, this parameter will be ignored. ; Return values..: Success - 1. ; Failure - 0 and sets the @error flag to non-zero. ; Author.........: Yashied ; Modified.......: ; Remarks........: None ; Related........: ; Link...........: @@MsdnLink@@ PlaySound ; Example........: Yes ; =============================================================================================================================== Func _WinAPI_PlaySound($sSound, $iFlags = 0x00020010, $hInstance = 0) Local $TypeOfSound = 'ptr' If $sSound Then If IsString($sSound) Then $TypeOfSound = 'wstr' Else $sSound = 0 $iFlags = 0 EndIf Local $Ret = DllCall('winmm.dll', 'int', 'PlaySoundW', $TypeOfSound, $sSound, 'ptr', $hInstance, 'dword', $iFlags) If (@error) Or (Not $Ret[0]) Then Return SetError(1, 0, 0) Return 1 EndFunc ;==>_WinAPI_PlaySound Func Wave()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GF/xv/TAF//3L/zADm/1P/mgBRANr+6ABXAI7+TAEAAMX+SAHC/zb/2AD1/1b/dwBtAPr+iQCwAIz+6gB7AI7+HAEbAPr+2wAPAE3/ZgB1ACb/NwDjALT+dwDjAIL+zACBAMr+xQA+ADj/XAB2AE3//v/wAPf+BwAoAaL+YADjALP+kwCAABv/UgB+AGb/3P/kAEb/q/9CAej+7f8tAcT+QgDJAAr/OACRAHL/zf/KAI3/bv80AUb/gv9UAfn+4v8LAQz/' $Wave &= 'CwCyAHX/w/+xAMX/T/8JAar/MP9SAU7/fP83AS3/y//YAHn/tv+hAOf/TP/PAAAAA/8pAbb/Iv9DAWz/ff/5AIv/nf+cAPv/V/+UAEIA+f7kABwA5/4oAcX/Lv8IAbH/d/+hAAQAaP9kAGgADv+SAHMA0P7rACcA8f77AO3/SP+mABEAb/9GAHcANP9DALAA3P6WAIYA0P7OADgAHP+fACoAa/83AHUAYP8EAMsACv82ANIA0f6EAIsA/f6FAFIAXf8vAHAAg//d/8kAR//h//4A9f4pANYA9/5TAIUAT/8kAHAAm//I/7UAif+d/wgBN//M/wcBEP8NALsASP8OAHwApf/C/5kAwv91//IAiP95/w==' Return Binary(_Base64Decode($Wave)) EndFunc ;==>Wave Func _Base64Decode($input_string) Local $struct = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(2, 0, "") Return DllStructGetData($a, 1) EndFunc ;==>_Base64Decode Display Font from Memory: ;coded by UEZ #include <GDIPlus.au3> Global Const $bFont = _bFont() $sFontname = "Jellyka - Estrya's Handwriting" $hGui = GUICreate("Example 1", 400, 320) $tFont = DllStructCreate('byte[' & BinaryLen($bFont) & ']') DllStructSetData($tFont, 1, $bFont) $hFont = _WinAPI_AddFontMemResourceEx(DllStructGetPtr($tFont), DllStructGetSize($tFont)) GUICtrlCreateLabel("AutoIt Memory Font Example", 25, 10, 380, 100) GUICtrlSetFont(-1, 100, 400, 0, $sFontname, 4) GUISetState(@SW_SHOW) _GDIPlus_Startup() $hGfx = _GDIPlus_GraphicsCreateFromHWND($hGui) $hCollection = _GDIPlus_FontPrivateCreateCollection() _GDIPlus_FontPrivateAddMemoryFont($hCollection, $tFont) $hFamily = _GDIPlus_FontFamilyCreate($sFontname, $hCollection) $hFont = _GDIPlus_FontCreate($hFamily, 80) $hFormat = _GDIPlus_StringFormatCreate() $tLayout = _GDIPlus_RectFCreate(60, 230, 400, 80) $hBrush = _GDIPlus_BrushCreateSolid(0xFF404040) _GDIPlus_GraphicsFillRect($hGfx, 0, 200, 400, 200, $hBrush) _GDIPlus_BrushSetSolidColor($hBrush, 0xFFF0F0AF) _GDIPlus_GraphicsDrawStringEx($hGfx, "GDI+ Schrift", $hFont, $tLayout, $hFormat, $hBrush) While GUIGetMsg() <> -3 Sleep(10) WEnd GUIDelete($hGui) _WinAPI_RemoveFontMemResourceEx($hFont) _GDIPlus_FontDispose($hFont) _GDIPlus_FontFamilyDispose($hFamily) _GDIPlus_StringFormatDispose($hFormat) _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfx) _GDIPlus_Shutdown() $tLayout = 0 GUIDelete() Exit #region ;Code was generated by: File to Base64 String Code Generator Func _bFont() Local $bFont $bFont &= 'KLsAAAEAAAALAIAAAAMAME9TLzIAuAGE+wAAATgBAKhWY21hcNB+BD7mAIDEAAAF0kBnYXNw//8ApAAEirAAfAhnbHlmAKKy+GkAABa0AQBchGhlYWTxuZTdbgA2vAAGNmgAIFANAQaQABb0A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OuAD0N0YTQF50ADUAAgAB//8AAAI=' $bFont = _Base64Decode($bFont) Local $tSource = DllStructCreate('byte[' & BinaryLen($bFont) & ']') DllStructSetData($tSource, 1, $bFont) Local $tDecompress _WinAPI_LZNTDecompress($tSource, $tDecompress) $tSource = 0 Return Binary(DllStructGetData($tDecompress, 1)) EndFunc ;==>_bFont Func _Base64Decode($input_string) Local $struct = DllStructCreate("int") Local $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", 0, "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(1, 0, "") Local $a = DllStructCreate("byte[" & DllStructGetData($struct, 1) & "]") $a_Call = DllCall("Crypt32.dll", "int", "CryptStringToBinary", "str", $input_string, "int", 0, "int", 1, "ptr", DllStructGetPtr($a), "ptr", DllStructGetPtr($struct, 1), "ptr", 0, "ptr", 0) If @error Or Not $a_Call[0] Then Return SetError(2, 0, "") Return DllStructGetData($a, 1) EndFunc ;==>_Base64Decode Func _WinAPI_LZNTDecompress(ByRef $tInput, ByRef $tOutput, $iBufferSize = 0x800000) Local $tBuffer, $Ret $tOutput = 0 $tBuffer = DllStructCreate('byte[' & $iBufferSize & ']') If @error Then Return SetError(1, 0, 0) $Ret = DllCall('ntdll.dll', 'uint', 'RtlDecompressBuffer', 'ushort', 0x0002, 'ptr', DllStructGetPtr($tBuffer), 'ulong', $iBufferSize, 'ptr', DllStructGetPtr($tInput), 'ulong', DllStructGetSize($tInput), 'ulong*', 0) If @error Then Return SetError(2, 0, 0) If $Ret[0] Then Return SetError(3, $Ret[0], 0) $tOutput = DllStructCreate('byte[' & $Ret[6] & ']') If Not _WinAPI_MoveMemory(DllStructGetPtr($tOutput), DllStructGetPtr($tBuffer), $Ret[6]) Then $tOutput = 0 Return SetError(4, 0, 0) EndIf Return $Ret[6] EndFunc ;==>_WinAPI_LZNTDecompress #endregion Display embedded ico file in system tray: #include <GDIPlus.au3> #include <WindowsConstants.au3> _GDIPlus_Startup() Global $hBmp = _GDIPlus_BitmapCreateFromMemory(_AutoIt_Icon()) ;load ico and convert it to a GDI+ bitmap ;convert bitmap to HIcon Global $hIcon = _GDIPlus_HICONCreateFromBitmap($hBmp) _WinAPI_TraySetHIcon($hIcon) Global $hGUI = GUICreate("Display embedded ico file in tray", 320, 50) GUICtrlCreateLabel("Look at tray icon", 0, 0, 300, 200) GUICtrlSetFont(-1, 30) GUISetState() Do Until GUIGetMsg() = -3 _GDIPlus_BitmapDispose($hBmp) _WinAPI_DestroyIcon($hIcon) _GDIPlus_Shutdown() Exit Func _WinAPI_TraySetHIcon($hIcon) ;function by Mat Local Const $tagNOTIFYICONDATA = _ "dword Size;" & _ "hwnd Wnd;" & _ "uint ID;" & _ "uint Flags;" & _ "uint CallbackMessage;" & _ "ptr Icon;" & _ "wchar Tip[128];" & _ "dword State;" & _ "dword StateMask;" & _ "wchar Info[256];" & _ "uint Timeout;" & _ "wchar InfoTitle[64];" & _ "dword InfoFlags;" & _ "dword Data1;word Data2;word Data3;byte Data4[8];" & _ "ptr BalloonIcon" Local Const $TRAY_ICON_GUI = WinGetHandle(AutoItWinGetTitle()), $NIM_ADD = 0, $NIM_MODIFY = 1, $NIF_MESSAGE = 1, $NIF_ICON = 2, $AUT_WM_NOTIFYICON = $WM_USER + 1, $AUT_NOTIFY_ICON_ID = 1 Local $tNOTIFY = DllStructCreate($tagNOTIFYICONDATA) DllStructSetData($tNOTIFY, "Size", DllStructGetSize($tNOTIFY)) DllStructSetData($tNOTIFY, "Wnd", $TRAY_ICON_GUI) DllStructSetData($tNOTIFY, "ID", $AUT_NOTIFY_ICON_ID) DllStructSetData($tNOTIFY, "Icon", $hIcon) DllStructSetData($tNOTIFY, "Flags", BitOR($NIF_ICON, $NIF_MESSAGE)) DllStructSetData($tNOTIFY, "CallbackMessage", $AUT_WM_NOTIFYICON) Local $aRet = DllCall("shell32.dll", "int", "Shell_NotifyIconW", "dword", $NIM_MODIFY, "ptr", DllStructGetPtr($tNOTIFY)) If (@error) Then Return SetError(1, 0, 0) Return $aRet[0] <> 0 EndFunc ;==>_Tray_SetHIcon ;Code below was generated by: 'File to Base64 String' Code Generator v1.12 Build 2013-05-17 Func _AutoIt_Icon($bSaveBinary = False, $sSavePath = @ScriptDir) Local $AutoIt_Icon $AutoIt_Icon &= 'AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAd3Z1rU1NTLubm5saAAAAAFZOSClTTkuPa2lotnNycrlgXFmwQjs1dUtDPjkAAAAAAAAAAAAAAAAAAAAAAAAAAJyamdiurq7/Pj08wDUuKW5/f3/snJiU/5WGdv+WgGv/fndx/25raP+Tk5P5ODErfQAAAAAAAAAAAAAAAAAAAADAv749ubm57ZaWl/9qamr/jXpp/45kPP+vekj/uoBI/6qVgf9dWFT/i3Nd/62trf85Mix+AAAAAAAAAAAAAAAAAAAAAKGdm4e9vr//eHh5/4BWL//YnGH/1Jpj/9aXW//Oqof/kpSX/4NYLv+YfWT/np+g/UpCPEMAAAAAAAAAAAAAAABfWFJ8yszN/7zBxf98b2P/t39I/9iZXf/amVr/z6R6/6autv+eelf/nWo5/6qimv9aV1SgAAAAAAAAAAAAAAACbGhlpqGXjf/Fwr//ub7D/4Z+d/+Td1v/oXVL/7CSdf+4wMj/nH5g/7uBSP+Xgm3/c3JxywAAAA0AAAAAJBoRE5OTk8+Jc17/tJFw/9bZ2//O0dX/wsfL/7a7wP+5urz/ys7S/5eCb/+9gkj/l3xi/4SDguB5cm0UAAAAAAAAAAKGhYS7k4Z4/6hvOf/Zupv/19zh/4iEgP+qk33/19TS/9nc4P+jmpH/p3I+/5uEbv+BgH/XAAAADAAAAAAAAAAAa2ZjiaWhnf+NZ0P/3rCE/+POuf+vsbT/lo6I/93c3P/i5ef/tK2m/5RrQ/+onZP/XVhVoAAAAAAAAAAAAAAAAFpTTByWlZTtkIJ0/8Wniv/jvpr/6N3S/+zw9P/n5+f/5ejq/66gk/+PeWT/2drb/25oY61nYFsXAAAAAAAAAAAAAAAATUU/ZMbHyP+nnZP/xK6Z/9zDrP/o497/8PHy/724sv+dj4L/ycjG/83Oz//g4eH/c25prAAAAAQAAAAAAAAAAAAAAABGPjl+q6qq8cPAvv+7sqr/vLGn/7u1r/+9uLT/29vc//L09f+urq7/x8jI/7y6uOEAAAAbAAAAAAAAAAAAAAAAAAAAAEQ9NzlpZGCemJaU25WSj92dmpfhcmxooUpCPH/c29r/zs/Q/93e3/+DfXmxAAAABgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAHx2cRB+eHMSenNuFgAAAAAAAAAAWVJMYZmUkcJnYFuiZV5ZKAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAA//+sQRAfrEEAD6xBAAesQYADrEGAA6xBAAGsQQABrEEAAaxBgAOsQYABrEHAAKxB4ACsQfAArEH8YaxB//esQQ==' Local $bString = Binary(_Base64Decode($AutoIt_Icon)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\AutoIt.ico", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_AutoIt_Icon Func _Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_Base64Decode Display a transparent image in GUI: #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <WinAPIConstants.au3> #include <WinAPISysWin.au3> _GDIPlus_Startup() Global $iW, $iH, $hImage, $hBitmap, $hGUI $hImage = _GDIPlus_BitmapCreateFromMemory(_Torus()) $hBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hImage) $iW = _GDIPlus_ImageGetWidth($hImage) $iH = _GDIPlus_ImageGetHeight($hImage) $hGUI = GUICreate("", $iW, $iH, -1, -1, $WS_POPUP, $WS_EX_LAYERED) GUISetState() _WinAPI_DisplayTransparentBitmapInGUI($hBitmap, $hGUI) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_BitmapDispose($hImage) _GDIPlus_Shutdown() GUIDelete() Func _WinAPI_DisplayTransparentBitmapInGUI($hHBitmap, $hGUI, $iOpacity = 0xFF) If Not BitAND(GUIGetStyle($hGUI)[1], $WS_EX_LAYERED) = $WS_EX_LAYERED Then Return SetError(1, 0, 0) Local Const $hScrDC = _WinAPI_GetDC(0), $hMemDC = _WinAPI_CreateCompatibleDC($hScrDC), $hOld = _WinAPI_SelectObject($hMemDC, $hHBitmap) Local $tSize = DllStructCreate($tagSIZE) $tSize.X = $iW $tSize.Y = $iH Local $tSource = DllStructCreate($tagPOINT) Local $tBlend = DllStructCreate($tagBLENDFUNCTION) $tBlend.Alpha = $iOpacity $tBlend.Format = 1 _WinAPI_UpdateLayeredWindow($hGUI, $hScrDC, 0, DllStructGetPtr($tSize), $hMemDC, DllStructGetPtr($tSource), 0, DllStructGetPtr($tBlend), $ULW_ALPHA) _WinAPI_ReleaseDC(0, $hScrDC) _WinAPI_SelectObject($hMemDC, $hOld) _WinAPI_DeleteObject($hHBitmap) _WinAPI_DeleteDC($hMemDC) Return True EndFunc ;Code below was generated by: 'File to Base64 String' Code Generator v1.19 Build 2014-11-14 Func _Torus($bSaveBinary = False, $sSavePath = @ScriptDir) Local $Torus $Torus &= 'iVBORw0KGgoAAAANSUhEUgAAAMEAAAC4CAYAAABab4iVAAAAD3RFWHRUaXRsZQAzRCBTaGFwZXOyEsx3AAAAH3RFWHREZXNjcmlwdGlvbgBKYXNjIHNoYXBlcyBsaWJyYXJ5YCDaygAAABF0RVh0QXV0aG9yAEJlbiBGZW5za2Vly0TQAAAAN3RFWHRDb3B5cmlnaHQAMjAwMCBKYXNjIFNvZnR3YXJlIEluYy4gIEFsbCByaWdodHMgcmVzZXJ2ZWQuELV9fAAAACx0RVh0Q3JlYXRpb24gVGltZQB0ZXIgMjcgSnVuIDIwMDAgMjI6NTk6MzIgLTAwMDBddm5oAAAAB3RJTUUH0gIMDSQEXWlNsAAAAAlwSFlzAAALEgAACxIB0t1+/AAAAARnQU1BAACxjwv8YQUAAEpISURBVHja7X0JuGVXVeY6w31VlUplqIwkZABCBjIxyRAkCLaJBkQEQWm1RZuP/roVsbVp2qFBP21t6W6UFtsGQYI4IK2MMgQQyJyQOSFJVaZKqpJKqiqVmuu9e+85e/dae++1zzr77nPuvW+8r+qtr06d8d177jn/v9e/1p4AVmzFVmzFVmzFVmzFVmzFVuxwtmSpb2DS7RF8RtcAHEvb+LCOxuWUUf5OmX/wKC7dDKD8eYA9S/1bVixuKyRwRmC/AWA9Ivc5uFxQAjy3ALgQH9A6XJ+Jl6S4HIHnjhrl8/DvNC478Y/wz2EG14/i/j4kxF24vRGPbcDtx1fIsfR22JLgSgS8BngePoDzEaUX0YIAPxOPnYjrIxCoWfiQ5vKwtFjj5/Tx8/fh5rYc4EHcvhOXu3F/A5579BcADiz18zmc7LAhwZcAOs8AnI0AvwQBf3kfS3sE5ClaAD4RDyQVfyu3Z/PAtNhWkW133hADP/8xvJk7kBxfxe3bX42keG79I1Zsnu2QJgFJnGuxdEfQ/ziC/i2FBf7ReCpLoQI9g5zX8lj4kNKh3zpo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Y9CvBD6XTY2goJBk16BoDhnmCUOoL5IsGodQVNGaLDVvK02QoJmq0N9G0eYLE9Aa/b2hGtlPottkKC0SyWGeL9SfIEfExBPJZYsYitkGB2NumeYMXGsBUSzJ8tpSdYsTnYCgkWx+aLBCu2Yiu2Yiu2Yiu2Yiu2Yiu2Yiu2Yiu2Yiu2Yiu2Yiu2Yiu2Yiu2Yiu2YvNn/x8H6goDo7OU7wAAAABJRU5ErkJggg==' Local $bString = Binary(_WinAPI_Base64Decode($Torus)) If $bSaveBinary Then Local $hFile = FileOpen($sSavePath & "\Torus.png", 18) FileWrite($hFile, $bString) FileClose($hFile) EndIf Return $bString EndFunc ;==>_Torus Func _WinAPI_Base64Decode($sB64String) Local $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "ptr", 0, "dword*", 0, "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(1, 0, "") Local $bBuffer = DllStructCreate("byte[" & $aCrypt[5] & "]") $aCrypt = DllCall("Crypt32.dll", "bool", "CryptStringToBinaryA", "str", $sB64String, "dword", 0, "dword", 1, "struct*", $bBuffer, "dword*", $aCrypt[5], "ptr", 0, "ptr", 0) If @error Or Not $aCrypt[0] Then Return SetError(2, 0, "") Return DllStructGetData($bBuffer, 1) EndFunc ;==>_WinAPI_Base64Decode More examples: Playing SWF file (source code is too large for codebox) AutoIt Windows Screenshooter Play MP3 from mem using FMOD Toolbar from mem Play a GIF anim from mem Load animated cursor (.ani) from memory Br, UEZ History:
    28 points
  16. Yashied

    WinAPIEx UDF

    LAST VERSION - 3.8 03-Jul-12 This library contains the WinAPI functions are not included for unknown reasons to the native AutoIt WinAPI library. I use this UDF in nearly all of my programs, and decided to share it with the AutoIt community. I agree that over time some of these functions will be part of the native AutoIt library, but still... The library includes some undocumented, but useful functions (eg _WinAPI_GetFontResourceInfo()). The library also contains all the necessary constants to work with the appropriate functions. Most functions from this UDF intended for experienced users, but beginners will find the same lot of useful information for yourself. I will be to periodically add new functions to the library. The archive contains WinAPIEx library, and as usual an excellent examples from me. Some examples I took from this forum and to simplify them for better understanding. For those who use SciTE (full version) I have prepared the au3.userudfs.properties and au3.user.calltips.api files to highlight functions from this UDF in your scripts. Just copy this files to ...SciTEProperties and ...SciTEAPI, respectively. I hope this UDF will be useful for many as for me. I look forward to any feedback and suggestions. Maybe somebody wants to add new WinAPI functions? Credits Available functions Files to download WinAPIEx UDF v3.8 for AutoIt 3.3.6.1 Previous downloads: 27953 WinAPIEx UDF v3.8 for AutoIt 3.3.8.x Previous downloads: 14850
    25 points
  17. trancexx

    WinHTTP functions

    The other day mikeytown2 posted one post in HTTP UDF's thread that got me thinking if there is better (different) method to send requests through the HTTP protocol to HTTP servers. There is Winhttp.dll that ships with windows and that is its main purpose. I couldn't find any examples of using this dll in AutoIt, so I came up with this. Microsoft about Windows HTTP Services: Microsoft Windows HTTP Services (WinHTTP) provides developers with an HTTP client application programming interface (API) to send requests through the HTTP protocol to other HTTP servers... .. blah, blah, and so on... This is an example of getting page header: #include "WinHttp.au3" Opt("MustDeclareVars", 1) ; Open needed handles Local $hOpen = _WinHttpOpen() Local $hConnect = _WinHttpConnect($hOpen, "msdn.microsoft.com") ; Specify the reguest: Local $hRequest = _WinHttpOpenRequest($hConnect, Default, "en-us/library/aa384101(VS.85).aspx") ; Send request _WinHttpSendRequest($hRequest) ; Wait for the response _WinHttpReceiveResponse($hRequest) Local $sHeader = _WinHttpQueryHeaders($hRequest) ; ...get full header ; Clean _WinHttpCloseHandle($hRequest) _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; Display retrieved header MsgBox(0, "Header", $sHeader)Everything you need to be able to use this UDF can be found at WinHttp site. Remember, basic understanding of the HTTP protocol is important to use this interface. ProgAndy, trancexx WinHttp.au3 is completely free and no one has right to charge you for it. That's very important. If you feel WinHttp.au3 was helpful to you and you wish to support my further work you can donate to my personal account via PayPal address: trancexx at yahoo dot com I will appreciate that very much. Thank you in advance! :kiss:
    24 points
  18. Hello guys. I recently saw some posts that Windows 10 provides OCR API. So I decided to create a UDF. What's UWPOCR? UWPOCR UDF is a simple library to use Universal Windows Platform Optical character recognition API. Features. Get Text From Image File. Get Text From GDI+ Bitmap. Easy to use. Usage: #include "..\UWPOCR.au3" _Example() Func _Example() Local $sOCRTextResult = _UWPOCR_GetText(FileOpenDialog("Select Image", @ScriptDir & "\", "Images (*.jpg;*.bmp;*.png;*.tif;*.gif)")) MsgBox(0,"",$sOCRTextResult) EndFunc Get Words Rect(Example): More examples here. Check UWPOCR UDF on GitHub. Saludos
    24 points
  19. Jon

    AutoIt v3.3.14.3 Released

    AutoIt v3.3.14.3 has been released. Thanks to everyone involved, both visible and behind the scenes. Download it here. Complete list of changes: History
    23 points
  20. Melba23

    New MVPs

    I am sure all members will wish to join me in welcoming our new MVPs: argumentum and gianni. It has been a while since the last promotions, but it goes to show that helping out around here does get noticed! M23
    22 points
  21. The GUI looks like shown in the picture: It contains a main menu, a treeview in left pane that lists UI Automation elements, a listview in right pane that displays detail information for the selected element, and a splitterbar to adjust the width of the two panes. Detect element The "Detect element" main menu is used to detect elements under the mouse with function keys F1 - F4. See How to topics number 2. Left pane The left pane is a treeview that initially lists open programs and windows. Generally, the left pane shows UI Automation elements represented as treeview items. Right pane The right pane is a listview that displays detail information for the selected treeview element. The information is grouped into different types of information. Only the relevant information for each type is displayed. Invalid elements When a window is closed the elements in UIASpy becomes invalid. But the elements are not deleted in UIASpy and can still be handled and selected in the treeview. Detail information for an element that was calculated before the window was closed can still be seen in the listview. In this way it's possible for UIASpy to show information for eg. a context menu that is closed as soon as it loses focus. Listview features Listview features Help system With completion of the Help system, a lot of information has been moved from this post and other posts into the Help system. Sample code creation Sample code creation is implemented through the UI element Detail info listview page and through the Sample code main menu. Sample code creates code snippets based on data in one or more selected rows in the Detail info listview page or based on the clicked Sample code menu item. UI Automation code is largely based on COM interface objects and thus on the function ObjCreateInterface(), which is one of the advanced functions in AutoIt. The main purpose of Sample code functionality is to eliminate the complexity of ObjCreateInterface(). Sample code creation either through the Detail info listview page or through the Sample code main menu can create all the interface objects required in UI Automation code. Another purpose is of course to make it easier and faster to implement code for simple automation tasks. Through Sample code creation, you can more or less create all code in a simple automation task: Create UI Automation initial code Create condition and find application window Create condition and find control in window Get information about windows and controls Create pattern objects to perform actions Get information related to pattern objects Perform actions with pattern object methods Add a Sleep() statement if necessary Note that the UI element used in sample code is named after the selected element in the treeview. Also note that both the Sample code menu items and the sections in the Detail info listview page are placed in approximately the order they are used in a simple automation task. Sample code creation through Detail info listview page Sample code creation through Sample code main menu Supported applications Most browsers including Google Chrome To be able to spy on web content in Google Chrome it's necessary to enable accessibility by entering chrome://accessibility/ in the address bar of a new tab item, and then check the five check boxes that are located in a column in upper left corner down along the left edge. Then the accessibility tab can be closed again. It's a global setting that applies to all open and new tabs until Chrome is closed. Without accessibility enabled you are only able to investigate the outer elements of Chrome but not web content. Internet Explorer Microsoft Edge Mozilla Firefox Most Microsoft applications and applications developed with Microsoft software including Classic Windows applications based on the standard control library Modern Universal Windows Platform apps like the Windows 10 Calculator Programs implemented through .NET Framework eg. Windows Forms applications Most applications provided by major development companies Automation issues Automation issues How to topics If UI Automation or the UIASpy tool is new to you, then you should read the How to topics. Examples Examples that demonstrates the features of UIASpy: Automating Notepad. Very detailed example. Automating Notepad - Windows XP Examples about Sample code creation: Automating Notepad with Sample code - step by step Automating Notepad with Sample code - all at once Chrome - Clicking an extension. Compact summary example. Click Save As... issue in Notepad examples: Using Expand() instead of Invoke() Updates Windows 8, Windows 8.1 and Windows 10 updates Threads UI Automation UDFs contains all include files. In Using UI Automation Code in AutoIt you can find and download examples and read information about using UIA code. UI Automation Events is about implementing event handlers and includes GUIs to detect events. IUIAutomation MS framework automate chrome, FF, IE, .... created by junkew August 2013 is the first AutoIt thread on UIA code. Zip-file The zip contains source files for UIASpy GUI. Note that UI Automation UDFs must be installed in the Includes folder. You need AutoIt 3.3.12 or later. Tested on Windows XP, Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. UIASpy.7z
    22 points
  22. Hi everyone, Some good news for you among all the gloom of these virus-ridden times: Nine, Subz and Danyfirex have accepted the invitation to become MVPs. Please join me in congratulating them on their new status in our community. Keep safe out there, M23
    22 points
  23. The dedicated server that runs the autoitscript.com / autoitconsulting.com site had a severe outage for the last couple of days. The main problem was that one of the disk drives failed. The server has two drives in RAID 1 so normally this isn't a problem, in fact there have been two disk outages over the past few years that many people won't have even noticed. Usually the server runs as normal with one drive down and there is only a brief 5 minute outage required when the disk is replaced and the server is rebooted. However in this case the server hard crashed and wouldn't boot into the OS on the remaining disk. I'm guessing that the drive was actually failing...working...failing and causing issues because it wouldn't just die. I logged a support call and asked to get the disk replaced, but some of the communications were lost and it took 12 hours for them to acknowledge that the drive was dead and that they had the authorisation to go ahead and open the box and replace the drive (they only touch the hardware, I'm responsible for all the software/OS config). During this time the server was sitting in a recovery/linux boot disk mode used for troubleshooting. When the disk was finally replaced (8pm UK time 25th of Feb) the the technician only emailed my hostmaster / autoitscript email address to say that it was complete but I didn't receive it because of course that email address is hosted by the server...which is in recovery mode - they forgot to email the temporary gmail address I was using during the outage. So I only found out the work had actually been completed when I chased them up this morning on the phone. I've started the RAID rebuild onto the new drive which will take a few hours to complete so the site may be sluggish until then. I also had to repair a few mysql tables that had crashed - but it didn't look to be a problem.
    21 points
  24. Are you annoyed by the limitations of the standard Windows message dialog created by MsgBox? Would you like to have coloured backgrounds and text? To choose the justification and font? Do you want to be able to place the message box other than in the centre of the screen? Centred on your GUI, for example, or at a particular location on screen? What about having user-defined text on as many buttons as you need? And user-defined icons? Or a visible countdown of the timeout? Finally, would you like to choose whether the message box has a button on your already too-crowded taskbar? If the answer to any of these questions is "YES" then the ExtMsgBox UDF is for you! [NEW VERSION] 16 Feb 24 Changed: Some additional functionality added to the "TimeOut" parameter of _ExtMsgBox: - A positive integer sets the EMB timeout as before. - A negative integer will double the size of the countdown timer if it is used. - A colon-delimited string (eg: "10:5") will set the normal EMB timeout (first integer) and will also initially disable the EMB buttons for the required period (second integer). New UDF and examples in the zip. Older version changes: ChangeLog.txt As always, I realise nearly all of the DLL calls in these UDFs could be made by using commands in other UDFs like WinAPI.au3 - but as with all my UDFs (which you can find in my sig below) I am trying to prevent the need for any other include files. The UDF and examples (plus StringSize) in zip format: ExtMsgBox.zip Courteous comments and constructive criticisms welcome - guess which I prefer! M23
    20 points
  25. Trong

    Image Search UDF

    Version 2021.8.30.2

    9,391 downloads

    Use MouseClick() need: #RequireAdmin Dll is already integrated in UDF ! ; #INDEX# =============================================================== ; Title .........: ImageSearch ; AutoIt Version : 3.x ; Language ......: English ; Description ...: Check image Appears or Not and Return the position of an image on the desktop ; Author(s) .....: Dao Van Trong - TRONG.LIVE ; ======================================================================= ; #CURRENT# ============================================================= ; _ImageSearch ; _ImageSearch_Area ; _ImageSearch_Wait ; _ImageSearch_WaitArea ; ======================================================================== ;========================================================================= ; ; Author:...........: AutoIT VietNam : Dao Van Trong - TRONG.LIVE ; Description:......: Check image Appears or Not ; Find and return the position of an image on the desktop ; Syntax:........... _ImageSearch_Area, _ImageSearch ; Parameter(s):..... $_ImagePath: The image to locate on the desktop ; May be a list of image by delimited by "|" ; i.e: $_ImagePath = "image1.bmp|image2.bmp|image3.bmp" ; $P_x1 $P_y1: Position of 1st point ; $P_x2 $P_y2: Position of 2nd point - Default is last botton right of desktop ; $_Tolerance: 0 for no tolerance (0-255). Needed when colors of image differ from desktop. e.g GIF ; $_CenterPos: boolen. True will return $array[1] x $array[2] is center of image found. ; False will return top-left position ; Return Value(s):.. Return an array has 3 item ; On Success: $array[0] 1 ; On Failure: $array[0] 0 ; DLL not found or other error: $array[0] -1 ; $array[1] x $array[2]: position of image what found on desktop ; ; Note:............. Use _ImageSearch to search the entire desktop ; _ImageSearch_Area to specify a desktop region to search ; $_ImagePath with more item need more time appear on screen before function can detect. ; Decrease sleep time in the loop to detect faster. But less performance. I.e CPULoad increased ; ;======================================================================== EG 1: ;~ Opt("MustDeclareVars", 1) ;~ #AutoIt3Wrapper_UseX64=y ;~ #AutoIt3Wrapper_Change2CUI=y #RequireAdmin #include "_ImageSearch_UDF.au3" HotKeySet("{Esc}", "_Exit") ; Press ESC for exit Func _Exit() Exit 0 EndFunc ;==>_Exit Global Const $Ask_On_Found = 0 Global Const $Mouse_Move_On_Found = 1 Global Const $Mouse_Click_On_Found = 0 Global Const $iSleep_Time=500 Global $sCount = 0, $_Image_1 = @ScriptDir & "\example.bmp" ; First, use this function to create a file bmp, maybe a desktop icon for example') MsgBox(64 + 262144, 'ImageSearch', 'At first, create a file bmp,' & @CRLF & 'photos that will search on the screen!') _ImageSearch_Create_BMP($_Image_1) ConsoleWrite("! Search for images: " & $_Image_1 & @CRLF & '! Searching on the screen ...' & @CRLF) While 1 ToolTip('(Press ESC for EXIT) Searching ...', 1, 1) Sleep($iSleep_Time) $sCount += 1 Local $return = _ImageSearch($_Image_1) If $return[0] = 1 Then ConsoleWrite('- [' & $sCount & '] Image found:' & " X=" & $return[1] & " Y=" & $return[2] & @CRLF) If $Mouse_Move_On_Found Then MouseMove($return[1], $return[2]) Sleep($iSleep_Time) EndIf If $Mouse_Click_On_Found Then MouseClick("left", $return[1], $return[2]) ToolTip('(Press ESC for EXIT) - [' & $sCount & "] Image found:" & " X=" & $return[1] & " Y=" & $return[2], 1, 1) If $Ask_On_Found Then Local $ask = MsgBox(6 + 262144, 'Success [' & $sCount & ']', 'Image found:' & " X=" & $return[1] & " Y=" & $return[2]) If $ask = 2 Or $ask = 3 Or $ask = 5 Or $ask = 7 Then Exit ;No, Abort, Cancel, and Ignore If $ask = 10 Then _ImageSearch_Create_BMP($_Image_1) ; Continue ;Try Again EndIf EndIf Sleep(200) WEnd Video demo: [+] When any problem or error occurs, please make sure that:- Downloaded and used the latest version.- Set screen Screen Scale and layout = 100%- Installed display driver.- Tried turning off the antivirus- Full installation: Microsoft Visual C++ Redistributable 2005->2022 [+] You can download the AIO version of the Visual C++ Redistributable here: -> https://www.mediafire.com/file/0ak8dcj9mdn7nyq/VisualCppRedist_AIO_2005-2022_x86_x64_%5Btrong.live%5D.zip/file -> FOR Windows XP: https://www.mediafire.com/file/5m5lnr1kfg73tc9/VisualCppRedist_AIO_2005-2019_x86_XP_%5Btrong.live%5D.zip/file <!> Password for Extract: trong.live [+] The last full version of SCITE4AutoIT supports windows XP: https://www.autoitscript.com/autoit3/scite/download/archive/v19.1127.1402.0-SciTE4AutoIt3.exe
    20 points
  26. AutoIt v3.3.16.1 has been released. Thanks to @jpm and the MVPs who were responsible for the majority of code in this version. Download it here. Complete list of changes: History
    19 points
  27. czardas

    mus++

    mus++ is a new scripting language written in ASCII which can be typed on most computer keyboards. The whole concept is based on the rules and syntax of written music, so the code can be directly transfered to a standard score without having to calculate the milisecond duration of some complicated binary variant, or having to deal with any other non-musical code elements. The language itself is much better than the interpreter, but that's hopefully going to change in the future. There are some problems which I have not yet managed to solve. Even so, this current interpreter is just about good enough for my own purposes. The deficiencies in the interpreter have no bearing whatsoever on the dynamic flexibility of mus++. #include-once #include <Array.au3> ; Example 1 - Happy Birthday Local $source = "<pno> ;=125 (G -G) Q | ;A G 1, C' | +'B' :| 2, D' | +C DC | Q ;G' E C | 'B' A (F' -F) | ;E C D | +C " _MusPlusPlus($source) Sleep(600) ; Example 2 - Mozart $source = @CRLF & "<fl> ;=146 3/4 |: G | C' E C | G B G | +.C'' | +B' ;G | G -G G ;G |" $source &= @CRLF & "<fl> ;=146 3/4 |: ; | E +G | ;B D' 'B' | -C' 'B' C' D E F# | ;G 'G' B | C' -C 'B' ;C'' |" $source &= @CRLF & "<cl> ;=146 3/4 |: ; | +. | +G ; | +. | +. | ;E' -E D ;E |" $source &= @CRLF & "<tpt> ;=146 3/4 |: 'G | 'C' E C | ;'G ; 'G' | C ; C' | 'G' + | ;G -G G ;G |" $source &= @CRLF & "<timp> ;=146 3/4 |: ''G | +'C ;C | +''G ;G | A A A | G -G G G G | +.G |" $source &= @CRLF ; Line Breaks are represented by empty lines $source &= @CRLF & " ;G -G G ;G | G A B | C'' ; fin :| D' | +'B' ;C' | -D G F# G F G | +'B' ;C' | D ; DC " $source &= @CRLF & " D -D C ;D | 'B' C' D | C ; fin :| 'B' | +G ;A | +. | +G ;A | B ; DC " $source &= @CRLF & " F -F E ;F | 'G' A B | G ; fin :| ; | +.G' | _;G + | +.G' | _;G 'G' DC " $source &= @CRLF & " ;G -G G ;G | 'G G G |'C' ; fin :| ; | 'G G G | +.'G' | ;'G G G | G ; DC " $source &= @CRLF & " G | ;G G G | +''C fin :| ; | +.''G | ;G G G | +.G | ;G G DC " _MusPlusPlus($source) Func _MusPlusPlus($sSource) ; Parse mus++ $sSource = _InitialTidySource($sSource) If @error Then Return SetError(1, 0, 0) Local $iParts = 8, $aSystems = StringSplit($sSource, @LF & @LF, 1) Local $aVoices[$iParts] = ["","","","","","","",""], $aStaves For $i = 1 To $aSystems[0] $aStaves = StringSplit($aSystems[$i], @LF) If $i = 1 And $aStaves[0] <= 8 Then $iParts = $aStaves[0] ReDim $aVoices [$iParts] ElseIf $iParts <> $aStaves[0] Then Return SetError (2, 0, 0) ; Inconsistant number of voices EndIf For $j = 0 To $iParts -1 $aVoices[$j] &= " " & $aStaves[$j +1] Next Next Local $aTimeLine, $aRepeat[1][11], $iInstance, $vCurrInstrument, $vCurrKey, $sCurrNote, $iCurrOctave, $sLookFor, $sSegnoInstrument, _ $sSegnoKey, $iSegnoOctave, $sSegnoNote, $iLatestInstrument, $iLatestKey, $iCurrRepeat, $iEndings, $iSegno, $iDalSegno, $iDaCapo, _ $aAccidentals[7], $sSegnoAccidentals, $sAtTempo, $vCurrTempo, $aNotePart, $sSkipIndex, $sWarnings = "", $sErrors = "", $iTuplet, _ $bTie, $bRest, $iPitch, $iBound =1, $aInstrument[$iParts], $iHangCheck, $iRepeats, $iCurrTime, $aMessage[$iParts][1][2] ;==> voice|instance|params=time/msg Local Enum $iEntry = 0, $iEntryInstrument, $iEntryKey, $iEntryOctave, $iEntryNote, $iFirstExit, $iFirstExitOctave, _ $iFirstExitNote, $iFinalExit, $iFinalExitInstrument, $iFinalExitKey For $i = 0 To $iParts -1 $aInstrument[$i] = 0xC0 Next ; Parsing begins here For $i = 0 To $iParts -1 _ClearAccidentals($aAccidentals) $aVoices[$i] = StringStripWS($aVoices[$i], 3) StringReplace($aVoices[$i], "|:", "") ; Get loop entry points If @extended Then ReDim $aRepeat[@extended +1][11] $iInstance = 0 ; bar repeat sections encountered $vCurrInstrument = "<pno>" ; piano $vCurrKey = "0#" ; C major / A minor $sCurrNote = ";" ; quarter note $iCurrOctave = 4 $sLookFor = "" ; Look for Q or fin within a DC or DS section repeat ; Bar repeat data $aRepeat[$iInstance][$iEntry] = $iInstance $aRepeat[$iInstance][$iEntryInstrument] = $vCurrInstrument $aRepeat[$iInstance][$iEntryKey] = $vCurrKey $aRepeat[$iInstance][$iEntryOctave] = $iCurrOctave $aRepeat[$iInstance][$iEntryNote] = $sCurrNote $aRepeat[$iInstance][$iFirstExit] = $iInstance $aRepeat[$iInstance][$iFirstExitOctave] = $iCurrOctave $aRepeat[$iInstance][$iFirstExitNote] = $sCurrNote $aRepeat[$iInstance][$iFinalExit] = "" $aRepeat[$iInstance][$iFinalExitInstrument] = $vCurrInstrument $aRepeat[$iInstance][$iFinalExitKey] = $vCurrKey $iCurrRepeat = 1 ; First iteration of a bar repeat sequence $iEndings = 1 ; no separate bar repeat endings encountered yet $aTimeLine = StringRegExp($aVoices[$i], "[^\h]+", 3) $aVoices[$i] = "" $sSegnoInstrument = $vCurrInstrument ; Section repeat data $sSegnoKey = $vCurrKey ; Section repeat data => $iSegnoOctave = $iCurrOctave $sSegnoNote = $sCurrNote $sSegnoAccidentals = ",,,,,," ; array is needed when $ occurs after an accidental $iLatestInstrument = 0 ; position in timeline $iLatestKey = 0 ; position in timeline $iSegno = -1 ; position of $ $iDalSegno = -1 ; position of DS $iDaCapo = -1 ; position of DC $sAtTempo = -1 $vCurrTempo = ";=100" $sSkipIndex = "|" For $j = 0 To UBound($aTimeLine) -1 If StringInStr($sSkipIndex, "|" & $j & "|") Then ContinueLoop $iHangCheck = $j -1 Select Case _IsInstrument($aTimeLine[$j]) If $j > $iLatestInstrument Then $iLatestInstrument = $j _UpdateCurrentAttrib($vCurrInstrument, $aVoices, $aTimeLine[$j], $i) $aRepeat[$iInstance][$iEntryInstrument] = $vCurrInstrument ; Temporary Patch Case _IsKeySig($aTimeLine[$j]) If $j > $iLatestKey Then $iLatestKey = $j _UpdateCurrentAttrib($vCurrKey, $aVoices, $aTimeLine[$j], $i) Case _IsTempoMark($aTimeLine[$j]) If Not StringRegExp($aVoices[$i], "[A-Go\+;\-~\\\?]") Then $sAtTempo = $aTimeLine[$j] EndIf _UpdateCurrentAttrib($vCurrTempo, $aVoices, $aTimeLine[$j], $i) Case _IsAtTempo($aTimeLine[$j]) _UpdateCurrentAttrib($vCurrTempo, $aVoices, $sAtTempo, $i) Case _IsSegno($aTimeLine[$j]) $sSegnoKey = $vCurrKey $sSegnoInstrument = $vCurrInstrument $iSegnoOctave = $iCurrOctave $sSegnoNote = $sCurrNote $iSegno = $j $sSegnoAccidentals = "" For $k = 0 To 5 $sSegnoAccidentals &= $aAccidentals[$k] & "," Next $sSegnoAccidentals &= $aAccidentals[6] Case _IsBarLine($aTimeLine[$j]) _ClearAccidentals($aAccidentals) Case _IsStartRepeat($aTimeLine[$j]) _ClearAccidentals($aAccidentals) $iInstance += 1 If $j > $iDaCapo And $j > $iDalSegno Then $aRepeat[$iInstance][$iEntry] = $j $aRepeat[$iInstance][$iEntryInstrument] = $vCurrInstrument $aRepeat[$iInstance][$iEntryKey] = $vCurrKey $aRepeat[$iInstance][$iEntryOctave] = $iCurrOctave $aRepeat[$iInstance][$iEntryNote] = $sCurrNote $iCurrRepeat = 1 $iEndings = 1 EndIf Case _Is2ndTimeRound($aTimeLine[$j]) If $j > $iDaCapo And $j > $iDalSegno Then If $aRepeat[$iInstance][$iFinalExit] = "" Then $aRepeat[$iInstance][$iFirstExit] = $j $aRepeat[$iInstance][$iFirstExitOctave] = $iCurrOctave $aRepeat[$iInstance][$iFirstExitNote] = $sCurrNote EndIf $iRepeats = StringTrimRight($aTimeLine[$j], 1) ; string to number If $iEndings < $iRepeats Then $iEndings = $iRepeats If $iCurrRepeat > $iRepeats Then If $vCurrKey <> $aTimeLine[$iLatestKey] Then If _IsKeySig($aTimeLine[$iLatestKey]) Then $vCurrKey = $aTimeLine[$iLatestKey] $aVoices[$i] &= $vCurrKey & " " EndIf EndIf _UpdateCurrentAttrib($vCurrInstrument, $aVoices, $aTimeLine[$iLatestInstrument], $i) _ClearAccidentals($aAccidentals) $j = $aRepeat[$iInstance][$iFinalExit] ; Go to the next end repeat mark EndIf Else $j = $aRepeat[$iInstance][$iFinalExit] ; Go directly to the last end section _ClearAccidentals($aAccidentals) _UpdateCurrentAttrib($vCurrKey, $aVoices, $aRepeat[$iInstance][$iFinalExitKey], $i) _UpdateCurrentAttrib($vCurrInstrument, $aVoices, $aRepeat[$iInstance][$iFinalExitInstrument], $i) EndIf Case _IsTie($aTimeLine[$j]) Or _IsStartTuplet($aTimeLine[$j]) Or _IsEndTuplet($aTimeLine[$j]) $aVoices[$i] &= $aTimeLine[$j] & " " Case _IsNote($aTimeLine[$j]) $aNotePart = _NoteSplit($aTimeLine[$j]) If $aNotePart[0] <> "" Then $sCurrNote = _GetCurrNote($aNotePart[0]) EndIf If $aNotePart[1] <> "" Then If StringInStr($aNotePart[1], "'") Then $iCurrOctave = _GetOctave($aNotePart[1]) EndIf If StringRegExp($aNotePart[1], "[#bxz]") Then _UpdateAccidentals($aAccidentals, $aNotePart[1]) Else _GetAccidental($aAccidentals, $aNotePart[1]) EndIf EndIf $aVoices[$i] &= $aNotePart[0] & $aNotePart[1] & " " If $sAtTempo = -1 Then $sAtTempo = $vCurrTempo Case _IsEndRepeat($aTimeLine[$j]) If $j > $iDaCapo And $j > $iDalSegno Then _ClearAccidentals($aAccidentals) If $iCurrRepeat = $iEndings Then $aRepeat[$iInstance][$iFinalExit] = $j $aRepeat[$iInstance][$iFinalExitInstrument] = $vCurrInstrument $aRepeat[$iInstance][$iFinalExitKey] = $vCurrKey EndIf If $iCurrRepeat <= $iEndings Then ; Go back to the start of the loop $j = $aRepeat[$iInstance][$iEntry] ; $j will be incremented on the next pass ^^ $iCurrRepeat += 1 _UpdateCurrentAttrib($vCurrKey, $aVoices, $aRepeat[$iInstance][$iEntryKey], $i) _UpdateCurrentAttrib($vCurrInstrument, $aVoices, $aRepeat[$iInstance][$iEntryInstrument], $i) _UpdateCurrentAttrib($iCurrOctave, $aVoices, $aRepeat[$iInstance][$iEntryOctave], $i, "{", "} ") _UpdateCurrentAttrib($sCurrNote, $aVoices, $aRepeat[$iInstance][$iEntryNote], $i, "{", "} ") EndIf EndIf Case _IsDalSegno($aTimeLine[$j]) If $iDalSegno < $j Then If $iSegno = -1 Then $sWarnings &= "Voice " & $i +1 & " Warning => Expected $ sign before DS " & @CRLF ConsoleWrite($sWarnings) ; deal with this later ExitLoop ; further parsing of this voice is meaningless EndIf $iDalSegno = $j $j = $iSegno $sLookFor = "DS" _UpdateCurrentAttrib($vCurrKey, $aVoices, $sSegnoKey, $i) _UpdateCurrentAttrib($vCurrInstrument, $aVoices, $sSegnoInstrument, $i) _UpdateCurrentAttrib($iCurrOctave, $aVoices, $iSegnoOctave, $i, "{", "} ") _UpdateCurrentAttrib($sCurrNote, $aVoices, $sSegnoNote, $i, "{", "} ") $aAccidentals = StringSplit($sSegnoAccidentals, ",", 2) For $iInstance = $iInstance To 0 Step -1 If $iSegno > $aRepeat[$iInstance][$iEntry] Then ExitLoop Next EndIf Case _IsDaCapo($aTimeLine[$j]) If $iDaCapo < $j Then _ClearAccidentals($aAccidentals) $iDaCapo = $j $j = -1 $sLookFor = "DC" $iInstance = 0 _UpdateCurrentAttrib($vCurrKey, $aVoices, $aRepeat[$iInstance][$iEntryKey], $i) _UpdateCurrentAttrib($vCurrInstrument, $aVoices, $aRepeat[$iInstance][$iEntryInstrument], $i) _UpdateCurrentAttrib($iCurrOctave, $aVoices, $aRepeat[$iInstance][$iEntryOctave], $i, "{", "} ") _UpdateCurrentAttrib($sCurrNote, $aVoices, $aRepeat[$iInstance][$iEntryNote], $i, "{", "} ") EndIf Case _IsCoda($aTimeLine[$j]) If ($sLookFor = "DS" And $j < $iDalSegno) Or ($sLookFor = "DC" And $j < $iDaCapo) Then If $iDalSegno > $iDaCapo Then $j = $iDalSegno Else $j = $iDaCapo EndIf _UpdateCurrentAttrib($vCurrKey, $aVoices, $aTimeLine[$iLatestKey], $i) _UpdateCurrentAttrib($vCurrInstrument, $aVoices, $aTimeLine[$iLatestInstrument], $i) EndIf Case _IsFin($aTimeLine[$j]) If ($sLookFor = "DS" And $j < $iDalSegno) Or ($sLookFor = "DC" And $j < $iDaCapo) Then ExitLoop Case Else If _IsTimeSig($aTimeLine[$j]) Or _IsTechnique($aTimeLine[$j]) Or _IsBarRepeat($aTimeLine[$j]) Or _IsAccel($aTimeLine[$j]) Or _IsDynamicMark($aTimeLine[$j]) Then ContinueLoop ; Currently unsupported performance instructions or features Else $sErrors &= "Voice " & $i +1 & " Syntax Error => " & $aTimeLine[$j] & @CRLF $sSkipIndex &= $j & "|" ConsoleWrite("Voice " & $i +1 & " Syntax Error => " & $aTimeLine[$j] & @LF) EndIf EndSelect If $j = $iHangCheck Then $j += 1 ; Recursion correction Next ;ConsoleWrite($aVoices[$i] & @LF) $aTimeLine = StringRegExp($aVoices[$i], "[^\h]+", 3) $iInstance = UBound($aTimeLine)*2 ; upper limit... variable re-usage If $iInstance > UBound($aMessage, 2) Then ReDim $aMessage [$iParts][$iInstance][2] $vCurrInstrument = 0 $iLatestInstrument = 0 $vCurrKey = 0 ; C major / A minor $iLatestKey = 0 ; C major / A minor $vCurrTempo = 100 $iCurrOctave = 4 $sCurrNote = ";" $sLookFor = -1 ; variable re-usage $bTie = False ; variable re-usage $bRest = True $iInstance = 0 ; message count $iCurrTime = 0 $iTuplet = 1 Local $iDuration For $j = 0 To UBound($aTimeLine) -1 Select Case _IsInstrument($aTimeLine[$j]) $aTimeLine[$j] = StringRegExpReplace($aTimeLine[$j], "(_)(pno|box|org|acc|gtr|bass|tpt|sax|hn|drum|bl)", " " & "$2") $iLatestInstrument = _GetInstrument($aTimeLine[$j]) If @error And Not StringInStr($sErrors, $aTimeLine[$j]) Then $sErrors &= "Voice " & $i +1 & " Instrument not recognized => " & $aTimeLine[$j] & @CRLF ConsoleWrite("Voice " & $i +1 & " Instrument not recognized => " & $aTimeLine[$j] & @LF) ElseIf $vCurrInstrument <> $iLatestInstrument Then $vCurrInstrument = $iLatestInstrument $aMessage[$i][$iInstance][0] = $iCurrTime $aMessage[$i][$iInstance][1] = $vCurrInstrument*256 + 0xC0 $iInstance += 1 EndIf $aInstrument[$i] = $vCurrInstrument*256 + 0xC0 Case _IsKeySig($aTimeLine[$j]) $vCurrKey = _GetKey($aTimeLine[$j]) Case _IsTempoMark($aTimeLine[$j]) $vCurrTempo = _GetQuartNoteBPM($aTimeLine[$j]) Case _IsTie($aTimeLine[$j]) $bTie = True Case _IsStartTuplet($aTimeLine[$j]) $iTuplet = StringReplace($aTimeLine[$j], "(", "") If $iTuplet = "" Then $iTuplet = 3 Case _IsOctave($aTimeLine[$j]) $iCurrOctave = StringRegExpReplace($aTimeLine[$j], "[\{\}]", "") Case _IsCurrentNote($aTimeLine[$j]) $sCurrNote = StringRegExpReplace($aTimeLine[$j], "[\{\}]", "") Case _IsNote($aTimeLine[$j]) $aNotePart = _NoteSplit($aTimeLine[$j]) If $aNotePart[0] <> "" Then $sCurrNote = _GetCurrNote($aNotePart[0]) Else $aNotePart[0] = $sCurrNote EndIf $iDuration = _GetDuration($aNotePart[0], $vCurrTempo, $iTuplet) If $aNotePart[1] <> "" Then If StringInStr($aNotePart[1], "'") Then $iCurrOctave = _GetOctave($aNotePart[1]) EndIf If Not $bTie Then $aMessage[$i][$iInstance][0] = $iCurrTime $iPitch = _GetPitch($aNotePart[1], $vCurrKey, $iCurrOctave) $aMessage[$i][$iInstance][1] = BitOr(($iPitch+0x15)*256, 0x90, 0x400000) ; Midi note on $iInstance += 1 Else If Not $bRest And $sLookFor > -1 Then $aMessage[$i][$sLookFor][0] += $iDuration EndIf EndIf $bRest = False Else $bRest = True EndIf $iCurrTime += $iDuration If Not $bRest And Not $bTie Then ; Now turn note off $aMessage[$i][$iInstance][0] = $iCurrTime $aMessage[$i][$iInstance][1] = BitXOR($aMessage[$i][$iInstance -1][1], 0x400000) ; Midi note off $sLookFor = $iInstance $iInstance += 1 EndIf $bTie = False Case _IsEndTuplet($aTimeLine[$j]) $iTuplet = 1 EndSelect Next If $iInstance > $iBound Then $iBound = $iInstance Next ReDim $aMessage[$iParts][$iBound][2] ;_WalkThrough3D($aMessage) ; Debugging - Requires arratf.au3 $sLookFor = "" For $i = 0 To $iParts -1 For $j = 0 To UBound($aMessage, 2) -1 If $aMessage[$i][$j][0] == "" Then ExitLoop If Not StringInStr($sLookFor, "," & $aMessage[$i][$j][0] & ",") Then $sLookFor &= $aMessage[$i][$j][0] & "," EndIf Next Next $aTimeLine = StringSplit(StringTrimRight($sLookFor, 1), ",", 2) _ArraySortByNumber($aTimeLine) If $aTimeLine[1] = 0 Then _ArrayDelete($aTimeLine, 0) Local $aGrid[UBound($aTimeLine)][$iParts*8 +3] For $i = 0 To UBound($aTimeLine) -1 $aGrid[$i][0] = 1 $aGrid[$i][1] = $aTimeLine[$i] Next For $i = $iParts -1 To 0 Step -1 $iInstance = 0 For $j = 0 To UBound($aMessage, 2) -1 If $aMessage[$i][$j][0] == "" Then ExitLoop If $aMessage[$i][$j][0] == $aTimeLine[$iInstance] Then If BitAND($aMessage[$i][$j][1], 0x400000) = 0x400000 Then If $aGrid[$iInstance][$aGrid[$iInstance][0]] <> $aInstrument[$i] Then $aGrid[$iInstance][0] += 1 $aGrid[$iInstance][$aGrid[$iInstance][0]] = $aInstrument[$i] EndIf EndIf $aGrid[$iInstance][0] += 1 $aGrid[$iInstance][$aGrid[$iInstance][0]] = $aMessage[$i][$j][1] ElseIf $aMessage[$i][$j][0] > $aTimeLine[$iInstance] Then $iInstance += 1 If $iInstance > UBound($aTimeLine) -1 Then ExitLoop $j -= 1 EndIf Next Next ;_ArrayDisplay($aGrid) Local $iTimer, $dOpen = _MidiOutOpen() $iInstance = 0 $iTimer = TimerInit() While 1 If TimerDiff($iTimer) >= $aGrid[$iInstance][1] Then For $i = 2 To $aGrid[$iInstance][0] _MidiOutShortMsg($dOpen, $aGrid[$iInstance][$i]) Next $iInstance += 1 Else Sleep(10) EndIf If $iInstance > UBound($aTimeLine) -1 Then ExitLoop WEnd Sleep(600) _MidiOutClose($dOpen) EndFunc ;==> _MusPlusPlus #region ; conditionals Func _IsInstrument($sInstruction) Return StringRegExp($sInstruction, "(?i)(\A<[a-z \-_0-9]+>\z)") EndFunc ;==> _IsInstrument Func _IsKeySig($sInstruction) Return StringRegExp($sInstruction, "(\A[0-7][#b]\z)") EndFunc ;==> _IsKeySig Func _IsTimeSig($sInstruction) ; Requires accentuation / dynamics Return StringRegExp($sInstruction, "(\A\d+/(1|2|4|8|16|32|64)\z)") EndFunc ;==> _IsTimeSig Func _IsTempoMark($sInstruction) Return StringRegExp($sInstruction, "(\A[o\+;\-~\\\?]\.?=\d*\.?\d+\z)") EndFunc ;==> _IsTempoMark Func _IsAtTempo($sInstruction) Return $sInstruction = "@Tempo" ; not case sensitive EndFunc ;==> _IsAtTempo Func _IsSegno($sInstruction) Return $sInstruction = "$" EndFunc ;==> _IsSegno Func _IsBarLine($sInstruction) Return $sInstruction = "|" EndFunc ;==> _IsBarLine Func _IsStartRepeat($sInstruction) Return $sInstruction = "|:" EndFunc ;==> _IsStartRepeat Func _Is2ndTimeRound($sInstruction) Return StringRegExp($sInstruction, "(\A\d+,\z)") EndFunc ;==> _Is2ndTimeRound Func _IsTie($sInstruction) Return $sInstruction = "_" EndFunc ;==> _IsTie Func _IsStartTuplet($sInstruction) Return StringRegExp($sInstruction, "(\A\d*\(\z)") EndFunc ;==> _IsStartTuplet Func _IsNote($sNote) If StringRegExp($sNote, "(\A'*[A-G](#|b|bb|x|z)?'*\z)") Then Return 1 Return StringRegExp($sNote, "(\A[o\+;\-~\\\?\.]+('*[A-G](#|b|bb|x|z)?'*)?\z)") EndFunc ;==> _IsNote Func _IsEndTuplet($sInstruction) Return $sInstruction == ")" EndFunc ;==> _IsEndTuplet Func _IsEndRepeat($sInstruction) Return $sInstruction = ":|" EndFunc ;==> _IsEndRepeat Func _IsCoda($sInstruction) Return $sInstruction == "Q" EndFunc ;==> _IsCoda Func _IsDalSegno($sInstruction) Return $sInstruction == "DS" EndFunc ;==> _IsDalSegno Func _IsDaCapo($sInstruction) Return $sInstruction == "DC" EndFunc ;==> _IsDaCapo Func _IsFin($sInstruction) Return $sInstruction == "fin" EndFunc ;==> _IsFin Func _IsOctave($sInstruction) Return StringRegExp($sInstruction, "\A\{[0-8]\}\z") EndFunc ;==> _IsOctave Func _IsCurrentNote($sInstruction) Return StringRegExp($sInstruction, "\A\{[o+;=~\?]\.*\}\z") EndFunc ;==> _IsCurrentNote #endregion ;==> conditionals #region ; currently unsupported features Func _IsTechnique($sInstruction) ; Returns an integer - gliss is currently not supported Return StringInStr(" gliss pizz ", " " & $sInstruction & " ", 1) EndFunc ;==> _IsTechnique Func _IsBarRepeat($sInstruction) ; currently unsupported Return StringRegExp($sInstruction, "(\A%\d*\z)") EndFunc ;==> _IsBarRepeat Func _IsAccel($sInstruction) ; currently unsupported Return StringInStr(" accel rit ", " " & $sInstruction & " ", 1) EndFunc ;==> _IsAccel Func _IsDynamicMark($sInstruction) ; Returns an integer - currently unsupported Return StringInStr(" cres dim ppp pp /p mp mf /f ff fff ", " " & $sInstruction & " ", 1) EndFunc ;==> _IsDynamicMark #endregion ;==> currently unsupported features #region ; data requests Func _GetAccidental($aAccidentals, ByRef $sNote) Local $sAlpha = StringReplace($sNote, "'", "") $sNote = StringReplace($sNote, $sAlpha, $sAlpha & $aAccidentals[Asc($sAlpha) - 65], 0, 1) EndFunc ;==> _GetAccidental Func _GetKey($sKey) Local $iSign = 1 If StringInStr($sKey, "b", 1) Then $iSign = -1 Return StringRegExpReplace($sKey, "[#b]", "")*$iSign EndFunc ;==> _GetKey Func _GetQuartNoteBPM($sTempo) Local $aTempo = StringSplit($sTempo, "=", 2) Local $iNote = StringInStr("?\~-;+o", $aTempo[0]) -5 Return $aTempo[1]*2^$iNote EndFunc ;==> _GetQuartNoteBPM Func _GetCurrNote($sNote) Local $sCurrChr, $sRhythm = "" For $i = StringLen($sNote) To 1 Step -1 $sCurrChr = StringMid($sNote, $i, 1) $sRhythm = $sCurrChr & $sRhythm If StringInStr("o+;-~\?", $sCurrChr, 1) Then ExitLoop Next Return $sRhythm EndFunc ;==> _GetCurrNote Func _GetOctave($sNote) Local $iPos, $iOctave = 4 For $i = 65 To 71 $iPos = StringInStr($sNote, Chr($i), 1) If $iPos Then ExitLoop EndIf Next For $i = 1 To $iPos -1 If StringMid($sNote, $i, 1) = "'" Then $iOctave -= 1 Next For $i = $iPos +1 To StringLen($sNote) If StringMid($sNote, $i, 1) = "'" Then $iOctave += 1 Next Return $iOctave EndFunc ;==> _GetOctave Func _GetPitch($sName, $iKey = 0, $iOctave = 4) Local $iPitch, $sAlpha Select Case StringInStr($sName, "C", 1) $sAlpha = "C" $iPitch = 39 Case StringInStr($sName, "D", 1) $sAlpha = "D" $iPitch = 41 Case StringInStr($sName, "E", 1) $sAlpha = "E" $iPitch = 43 Case StringInStr($sName, "F", 1) $sAlpha = "F" $iPitch = 44 Case StringInStr($sName, "G", 1) $sAlpha = "G" $iPitch = 46 Case StringInStr($sName, "A", 1) $sAlpha = "A" $iPitch = 48 Case StringInStr($sName, "B", 1) $sAlpha = "B" $iPitch = 50 EndSelect Select Case StringInStr($sName, "bb", 1) $iPitch -= 2 Case StringInStr($sName, "b", 1) $iPitch -= 1 Case StringInStr($sName, "z", 1) $iPitch += 0 Case StringInStr($sName, "#", 1) $iPitch += 1 Case StringInStr($sName, "x", 1) $iPitch += 2 Case $iKey If $iKey > 0 Then If StringInStr(StringLeft("FCGDAEB", $iKey), $sAlpha) Then $iPitch += 1 Else If StringInStr(StringRight("FCGDAEB", -$iKey), $sAlpha) Then $iPitch -= 1 EndIf EndSelect $iOctave -= 4 $iPitch += $iOctave*12 If $iPitch < 0 Or $iPitch > 87 Then Return SetError (2, 0, "") ; Out of range pitch Return $iPitch ; values range from 0 to 87 EndFunc ;==> _GetPitch Func _GetDuration($sNote, $iTempo = 100, $iTuplet = 1) Local $sLen = StringLen($sNote) If Not $sLen Then Return Default If StringLeft($sNote, 1) = "." Then Return SetError(1, 0, 0) ; Syntax error - Dot not preceeded by a note value Local $iDuration = 0, $iDots = 0, $sCurrChr = "", $iID, $iNote = 0 For $i = 1 To $sLen $sCurrChr = StringMid($sNote, $i, 1) $iID = StringInStr("?\~-;+o.", $sCurrChr) -1 Switch $iID Case 0 To 6 $iDuration += $iNote $iNote = 6930 * 2^$iID Case 7 While $sCurrChr = "." $iDots += 1 $i += 1 $sCurrChr = StringMid($sNote, $i, 1) WEnd $iNote *= (2^($iDots +1) -1)/2^$iDots $i -= 1 $iDots = 0 EndSwitch Next $iDuration += $iNote If $iTuplet > 1 Then Switch $iTuplet Case 2, 4, 8, 16, 32, 64 ; In mus - only 2 and 4 appear, and then only in compound time $iDuration *= 3/2 ; it's the same result in all cases Case 3 ; triplets are the most common tuplet division $iDuration *= 2/3 Case 5 To 7 $iDuration *= 4/$iTuplet Case 9 To 15 ; In mus - tuplets greater than 12 almost never appear $iDuration *= 8/$iTuplet Case 17 To 31 $iDuration *= 16/$iTuplet Case 33 To 63 $iDuration *= 32/$iTuplet Case 65 To 127 $iDuration *= 64/$iTuplet Case Else Return SetError (2, 0, 0) ; Unsupported out of range tuplet value EndSwitch EndIf Return $iDuration*125/(231*$iTempo) EndFunc ;==> _GetDuration Func _GetInstrument($vInstrument) $vInstrument = StringRegExpReplace($vInstrument, "[<>]", "") Local $aMIDIInst[72][4] _ ; A selection of available MIDI imstruments = _ ; Name , ##,Mn,Mx [["pno" , 0, 0,87], _ ; Acoustic Grand Piano ... KEYBOARDS ["br pno" , 1, 0,87], _ ; Bright Piano ["e pno" , 2, 0,87], _ ; Electric Grand Piano ["h-t pno" , 3, 0,87], _ ; Honky-tonk piano ["hpsd" , 6, 0,87], _ ; Harpsichord ["clav" , 7, 0,87], _ ; Clavichord ["cel" , 8, 0,87], _ ; Celesta ["glock" , 9, 0,87], _ ; Glockenspiel ... PITCHED PERCUSSION ["mus box" , 10, 0,87], _ ; Music Box ["vib" , 11, 0,87], _ ; Vibraphone ["marim" , 12, 0,87], _ ; Marimba ["xyl" , 13, 0,87], _ ; Xylophone ["chimes" , 14, 0,87], _ ; Tubular Bells ["dulc" , 15, 0,87], _ ; Dulcimer ["ham org" , 16, 0,87], _ ; Drawbar Organ ... ORGAN ["perc org" , 17, 0,87], _ ; Percussive Organ ["org" , 19, 0,87], _ ; Church Organ ["harm" , 20, 0,87], _ ; Harmonium Reed Organ ["accord" , 21, 0,87], _ ; Accordion ["mouth org", 22, 0,87], _ ; Harmonica ["tango acc", 23, 0,87], _ ; Bandoneon ["gtr" , 24, 0,87], _ ; Classical Guitar ... GUITAR ["a gtr" , 25, 0,87], _ ; Accoustic Guitar ["jazz gtr" , 26, 0,87], _ ; Jazz Guitar ["e gtr" , 27, 0,87], _ ; Electric Guitar ["mut gtr" , 28, 0,87], _ ; Muted Electric Guitar ["fuzz gtr" , 30, 0,87], _ ; Distortion Guitar ["a bass" , 32, 0,87], _ ; Acoustic Bass ... BASS ["e bass" , 33, 0,87], _ ; Electric Bass ["bass" , 34, 0,87], _ ; Upright Bass ["f bass" , 35, 0,87], _ ; Fretless Bass ["sl bass" , 36, 0,87], _ ; Slap Bass ["vln" , 40, 0,87], _ ; Violin ... STRINGS ["vla" , 41, 0,87], _ ; Viola ["vc" , 42, 0,87], _ ; Cello ["db" , 43, 0,87], _ ; Double Bass ["hp" , 46, 0,87], _ ; Harp ["timp" , 47, 0,87], _ ; Timpani (perc) ["tpt" , 56, 0,87], _ ; Trumpet ... BRASS ["tbn" , 57, 0,87], _ ; Trombone ["tba" , 58, 0,87], _ ; Tuba ["mut tpt" , 59, 0,87], _ ; Muted Trumpet ["hn" , 60, 0,87], _ ; French Horn ["s sax" , 64, 0,87], _ ; Soprano Sax ... REED ["a sax" , 65, 0,87], _ ; Alto Sax ["sax" , 66, 0,87], _ ; Tenor Sax ["b sax" , 67, 0,87], _ ; Baritone Sax ["ob" , 68, 0,87], _ ; Oboe ["eng hn" , 69, 0,87], _ ; English Horn ["bsn" , 70, 0,87], _ ; Bassoon ["cl" , 71, 0,87], _ ; Clarinet ["picc" , 72, 0,87], _ ; Piccolo ... PIPE ["fl" , 73, 0,87], _ ; Flute ["rec" , 74, 0,87], _ ; Recorder ["pan" , 75, 0,87], _ ; Panpipes ["bottle" , 76, 0,87], _ ; Bottle ["shaku" , 77, 0,87], _ ; Shakuhachi ["whistle" , 78, 0,87], _ ; Whistle ["oc" , 79, 0,87], _ ; Ocarina ["sitar" ,104, 0,87], _ ; Sitar ... OTHER ["banjo" ,105, 0,87], _ ; Banjo ["shamisen" ,106, 0,87], _ ; Shamisen ["koto" ,107, 0,87], _ ; Koto ["kalimba" ,108, 0,87], _ ; Kalimba (perc) ["bagp" ,109, 0,87], _ ; Bagpipe ["fiddle" ,110, 0,87], _ ; Fiddle ["shanai" ,111, 0,87], _ ; Shanai (woodwind) ["bell" ,112, 0,87], _ ; Tinkle Bell ["st drum" ,114, 0,87], _ ; Steel Drums ["w bl" ,115, 0,87], _ ; Woodblock ["taiko" ,116, 0,87], _ ; Taiko Drum ["tom-t" ,117, 0,87]] ; Tom-tom For $i = 0 To 71 If $aMIDIInst[$i][0] = $vInstrument Then $vInstrument = $aMIDIInst[$i][1] ExitLoop EndIf Next $vInstrument = StringRegExpReplace($vInstrument, "[<>]", "") If StringRegExp($vInstrument, "[^\d]") Or $vInstrument < 0 Or $vInstrument > 127 Then Return SetError(1, 0, 0) ; returns Grand Piano Return $vInstrument ; values range from 0 to 117 EndFunc ;==> _GetInstrument #endregion ;==> data requests #region ; miscellaneous functions Func _InitialTidySource($sSource) If _IllegalDotCheck($sSource) Then Return SetError(1, 0, 0) $sSource = StringReplace($sSource, '"', "''") ; Helmholtz-Wilkinson octaves $sSource = StringReplace($sSource, '(', "( ") ; Add spaces after ( $sSource = StringReplace($sSource, ')', " ) ") ; Add spaces before and after ) $sSource = StringRegExpReplace($sSource, "(<\h+)", " <") ; Remove spaces after < $sSource = StringRegExpReplace($sSource, "(\h+>)", "> ") ; Remove spaces before > $sSource = StringReplace($sSource, '_', " _ ") ; Add spaces before and after underscore $sSource = StringReplace($sSource, '|:', "|: ") ; Add spaces after start repeats $sSource = StringReplace($sSource, ':|', " :|") ; Add spaces before end repeats $sSource = StringReplace($sSource, ':|:', ":||:") ; Convert double repeat marks _ $sSource = StringReplace($sSource, '|', " | ") ; Add spaces before and after bar lines $sSource = StringReplace($sSource, '| :', "|:") ; Restore start repeat marks $sSource = StringReplace($sSource, ': |', ":|") ; Restore end repeat marks $sSource = StringReplace($sSource, ' | | ', " || ") ; Restore double bar lines $sSource = StringRegExpReplace($sSource, "(<[\-\w]+)(\h+)(pno|box|org|acc|gtr|bass|tpt|sax|hn|drum|bl)", "$1" & "_" & "$3") $sSource = StringReplace(StringReplace($sSource, @CRLF, @LF), @CR, @LF) ; Replace all breaks with @LF $sSource = StringRegExpReplace($sSource, "(\n\h*)", @LF) ; Remove spaces after breaks $sSource = StringRegExpReplace($sSource, "[\n]{2,}", @LF & @LF) ; Remove duplicate empty lines $sSource = StringRegExpReplace($sSource, "(\A\n*)", "") ; Remove Preceeding breaks $sSource = StringRegExpReplace($sSource, "(\n*\z)", "") ; Remove Trailing breaks Return $sSource EndFunc ;==> _InitialTidySource Func _UpdateCurrentAttrib(ByRef $vCurrAttrib, ByRef $aVoices, $vNewAttrib, $iIndex, $sPadLeft = "", $sPadRight = " ") If $vCurrAttrib <> $vNewAttrib Then $vCurrAttrib = $vNewAttrib $aVoices[$iIndex] &= $sPadLeft & $vCurrAttrib & $sPadRight EndIf EndFunc ;==> _UpdateCurrentAttrib Func _ClearAccidentals(ByRef $aAccidentals) For $i = 0 To 6 $aAccidentals[$i] = "" Next EndFunc ;==> _ClearAccidentals Func _UpdateAccidentals(ByRef $aAccidentals, $sNote) $sNote = StringReplace($sNote, "'", "") Local $sAlpha = StringLeft($sNote, 1) $aAccidentals[Asc($sAlpha) - 65] = StringTrimLeft($sNote, 1) EndFunc ;==> _UpdateAccidentals Func _NoteSplit($sNote) Local $aNotePart[2] = ["", ""] $aNotePart[1] = StringRegExpReplace($sNote, "[o\+;\-~\\\?\.]+", "") ; Remove rhthmic values $aNotePart[0] = StringLeft($sNote, StringLen($sNote) - StringLen($aNotePart[1])) Return $aNotePart EndFunc ;==> _NoteSplit Func _IllegalDotCheck($sVoo) Return StringRegExp($sVoo, "(o\.{7}|\+\.{6}|;\.{5}|\-\.{4}|~\.{3}|\\\.\.|\?\.)") ; Warning - detected an unsupported number of dots after a note EndFunc ;==> _IllegalDotCheck #endregion ;==> miscellaneous functions #region ; MIDI functions ;======================================================= ;Retrieves a MIDI handle and Opens the Device ;Parameters(Optional) - Device ID, Window Callback, ; instance, flags ;Author : Eynstyne ;Library : Microsoft winmm.dll ;======================================================= Func _MidiOutOpen($devid = 0, $callback = 0, $instance = 0, $flags = 0) Local $ret = DllCall("winmm.dll", "long", "midiOutOpen", "handle*", 0, "int", $devid, "dword_ptr", $callback, "dword_ptr", $instance, "long", $flags) If @error Then Return SetError(@error,0,0) If $ret[0] Then Return SetError(-1,$ret[0],0) Return $ret[1] EndFunc ;==>_MidiOutOpen ;======================================================= ;Closes Midi Output/Input devices ;Parameters - MidiHandle ;Author : Eynstyne ;Library : Microsoft winmm.dll ;======================================================= Func _MidiOutClose ($hmidiout) Local $ret = DllCall("winmm.dll", "long", "midiOutClose", "handle", $hmidiout) If @error Then Return SetError(@error,0,0) If $ret[0] Then Return SetError(-1,$ret[0],0) Return $ret[0] EndFunc ;==> _MidiOutClose ;======================================================= ;Gets the Mixer Volume for MIDI ;Parameters - None ;Author : Eynstyne ;Library : Microsoft winmm.dll ;======================================================= Func _MidiOutGetVolume ($devid = 0) Local $ret = DllCall("winmm.dll", "long", "midiOutGetVolume", "handle", $devid, "dword*",0) If @error Then Return SetError(@error,0,0) If $ret[0] Then Return SetError(-1,$ret[0],0) Return $ret[2] EndFunc ;==> _MidiOutGetVolume ;======================================================= ;Sets the Mixer Volume for MIDI ;Parameters - Volume (0 - 65535) ;Author : Eynstyne ;Library : Microsoft winmm.dll ;======================================================= Func _MidiOutSetVolume($iVolume = 65535, $devid = 0) Local $iMixVolume=BitAND($iVolume,0xFFFF)+BitShift(BitAND($iVolume,0xFFFF),-16) ; From Ascend4nt Local $ret = DllCall("winmm.dll", "long", "midiOutSetVolume", "handle", $devid, "int", $iMixVolume) If @error Then Return SetError(@error,0,0) If $ret[0] Then Return SetError(-1,$ret[0],0) Return $ret[0] EndFunc ;==> _MidiOutSetVolume ;======================================================= ;MIDI Message Send Function ;Parameters - Message as Hexcode or Constant ;Author : Eynstyne ;Library : Microsoft winmm.dll ;======================================================= Func _MidiOutShortMsg($hmidiout, $msg) Local $ret = DllCall("winmm.dll", "long", "midiOutShortMsg", "handle", $hmidiout, "long", $msg) If @error Then Return SetError(@error,0,0) If $ret[0] Then Return SetError(-1,$ret[0],0) Return $ret[0] EndFunc ;==> _MidiOutShortMsg #endregion ;==> MIDI functions #region ; functions ripped from arrayf.au3 and stringf.au3 ; #FUNCTION# ==================================================================================================================== ; Name...........: _ArraySortByNumber ; Description ...: Sorts a 1D array numerically ascending. ; Syntax.........: _ArraySortByNumber(ByRef $avArray [, $bVulgarFrac = False]) ; Parameters ....: $avArray - [ByRef] The array to sort ; $bVulgarFrac - [Optional] If set to True, vulgar fractions will be also be sorted numerically ; Return values .: Success - Returns 1 ; Failure - Returns zero and sets @error to the following values: ; |@error = 1 : $avArray is not a one dimensional array ; Author ........: czardas ; Modified.......: ; Remarks .......: The array is sorted first by numbers and then by strings. ; Related .......: _ArraySort, _ArraySortByLen ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _ArraySortByNumber(ByRef $avArray, $bVulgarFrac = False) If Not IsArray($avArray) Or UBound($avArray, 0) > 1 Then Return SetError(1, 0, 0) Local $iBound = UBound($avArray) -1 Local $aTemp[$iBound +1][2] For $i = 0 To $iBound $aTemp[$i][0] = $avArray[$i] If _StringIsNumber($avArray[$i], $bVulgarFrac) Then $aTemp[$i][1] = Execute($avArray[$i]) Else $aTemp[$i][1] = "z" & $avArray[$i] EndIf Next _ArraySort($aTemp, 0, 0, 0, 1) For $i = 0 To $iBound $avArray[$i] = $aTemp[$i][0] Next Return 1 EndFunc ;==> _ArraySortByNumber ; #FUNCTION# ==================================================================================================================== ; Name...........: _StringIsNumber ; Description ...: Checks whether a string is a number as recognised by the AutoIt interpreter ; Syntax.........: _StringIsNumber($sString [, $bVulgarFrac]) ; Parameters ....: $sString - The string to test ; $bVulgarFrac - [Optional] if set to True, vulgar fractions will also return True ; Return values .: True or False ; Author ........: czardas ; Remarks .......: Returns True for integers, floats, hexadecimal and scientific notation. ; Related .......: StringIsDigit, StringIsFloat, StringIsInt, StringIsXDigit ; Link ..........: ; Example .......: MsgBox(0, "1.2e-300 is a number", _StringIsNumber("1.2e-300")) ; =============================================================================================================================== Func _StringIsNumber($sString, $bVulgarFrac = False) Local $bReturn = False If StringIsInt($sString) Or StringIsFloat($sString) Then $bReturn = True ; string is integer or float ElseIf StringRegExp($sString, "(?i)(\A[\+\-]?0x[A-F\d]+\z)") Then $bReturn = True ; string is hexadecimal integer ElseIf StringRegExp($sString, "(?i)(\A[\+\-]?\d*\.?\d+e[\+\-]?\d+\z)") Then $bReturn = True ; exponential (or scientific notation) ElseIf $bVulgarFrac And StringRegExp($sString, "(\A[\+\-]?\d+/\d+\z)") Then $bReturn = True ; string is a vulgar fraction EndIf Return $bReturn EndFunc ; _StringIsNumber #endregion ;==> functions ripped from arrayf.au3 and stringf.au3 #cs ; incomplete and unorganized comments note attributes ==> all new notes inherit attributes from the previous note played with the exception of repeats staff attributes ==> affecting all subsequent new notes (mus) ... key, instrument, time signature performance attributes ==> affecting all subsequent notes played including repeats (mus) tempo settings short lived attributes ==> affecting remaining notes within the bar ... accidentals section repeats ==> DC and DS multiple bar repeats ==> |: and :| o ==> Lower case o ..... Whole note ......... open note + ==> Plus symbol ...... Half note .......... open note with a stem ; ==> Apostrophe ....... Quarter note ....... closed note with a stem - ==> Minus sign ....... Eighth note ........ single flag ~ ==> Tilde ............ Sixteenth note ····· double flag \ ==> Back slash ....... Thirty-second note . tripple flag ? ==> Question mark .... Sixty-fourth note .. quadruple flag (very rare) ' ==> 1 octave (above or below) " ==> 2 octaves (above or below) "' ==> 3 octaves (above or below) "" ==> 4 octaves (above or below) Accidentals # ==> sharp b ==> flat x ==> double sharp bb ==> double flat z ==> natural Other symbols _ ==> tie . ==> dot ( ==> start triplet 5( ==> start quintuplet ) ==> end tuplet | ==> bar line |: ==> start repeat :| ==> end repeat 1, ==> first time round 2, ==> second time round DC ==> da capo $ ==> segno DS ==> dal segno fin ==> fine Q ==> coda @Tempo ==> a tempo <instrument name> ==> instrument time signatutes n/2^n 2/4, 3/4, 6/8 etc... tempo markings ;=100 ==> 100 quarter note beats ber minute Key Signatures with sharps 0# ==> C major ==> C D E F G A B C 1# ==> G major ==> G A B C D E F# G 2# ==> D major ==> D E F# G A B C# D 3# ==> A major ==> A B C# D E F# G# A 4# ==> E major ==> E F# G# A B C# D# E 5# ==> B major ==> B C# D# E F# G# A# B 6# ==> F# major ==> F# G# A# B C# D# E# F# 7# ==> C# major ==> C# D# E# F# G# A# B# C# Key Signatures with flats 0b ··· C major ···· C D E F G A B C 1b ··· F major ···· F G A Bb C D E F 2b ··· Bb major ··· Bb C D Eb F G A Bb 3b ··· Eb major ··· Eb F G Ab Bb C D Eb 4b ··· Ab major ··· Ab Bb C Db Eb F G Ab 5b ··· Db major ··· Db Eb F Gb Ab Bb C Db 6b ··· Gb major ··· Gb Ab Bb C Db Eb Fb G 7b ··· Cb major ··· Cb Db Eb Fb Gb Ab Bb Cb Supported tuplet divisions Note Divisions ····································· 3 5to7 9to15 17to31 33to63 65to127 \ ? ~ \ ? - ~ \ ? ; - ~ \ ? + ; - ~ \ ? o + ; - ~ \ ? Supported tuplets for compound time Note Divisions ································ 2 4 8 16 32 64 \. ? ~. \ ? -. ~ \ ? ;. - ~ \ ? +. ; - ~ \ ? o. + ; - ~ \ ? Dotted notes o. == o+ , o.. == o+; +. == +; , +.. == +;- ;. == ;- , ;.. == ;-~ -. == -~ , -.. == -~\ ~. == ~\ , ~.. == ~\? \. == \? o...... == o+;-~\? Illegal sequences o....... +...... ;..... -.... ~... \.. ?. ""C ==> 4th 8va below = sub-contra octave "'C ==> 3rd 8va below "C ==> 2nd 8va below 'C ==> 1st 8va below 'C' ==> Middle C C' ==> 1st 8va above C" ==> 2nd 8va above C"' ==> 3rd 8va above C"" ==> 4th 8va above Full Range = ""A to C"" After DC and DS all repeat marks are ignored on second run. With separate endings the final section is entered immediately. Q or $ do not belong in a separate ending section. Coda occurs in a section which is skipped |: 1, Q :|2, [incorrect] => will miss the coda altogether The continuation from segno is unclear |: 1, $ :|2, [incorrect] => allow rhythmic corruption The following is fine |: $ 1, :|2, Q :| DS |Q Coda should not be placed before segno | Q | $ | DS | Q [incorrect] When entering the coda section repeat marks are reinstated Before DC or DS ignore $, Q and fin After DC go to the start and continue from there After DS look behind for $ and continue from there After DC or DS stop when you see fin or go to final section when you see Q Search for final section Q after DC or DS (whichever is greater) In the final section Q ignore DC DS Q $ - they do not belong in the coda After DC also look for DS and after DS also look for DC After DC or DS repeat marks are ignored within the repeated sequence With repeats that have separate endings, the final ending is entered immediately All other endings are skipped Repeat marks are reinstated after DC (or DS depending which was last encountered) DC DS $ fin may only be used once Q if used must appear twice Illegal characters {}[]&¬` #ce ;==> incomplete and unorganized comments The interpreter contains some unused code sections, some of which may be used in the future. Here's the mus++ source for the second example: <fl> ;=146 3/4 |: G | C' E C | G B G | +.C'' | +B' ;G | G -G G ;G | <fl> ;=146 3/4 |: ; | E +G | ;B D' 'B' | -C' 'B' C' D E F# | ;G 'G' B | C' -C 'B' ;C'' | <cl> ;=146 3/4 |: ; | +. | +G ; | +. | +. | ;E' -E D ;E | <tpt> ;=146 3/4 |: 'G | 'C' E C | ;'G ; 'G' | C ; C' | 'G' + | ;G -G G ;G | <timp> ;=146 3/4 |: ''G | +'C ;C | +''G ;G | A A A | G -G G G G | +.G | ;G -G G ;G | G A B | C'' ; fin :| D' | +'B' ;C' | -D G F# G F G | +'B' ;C' | D ; DC D -D C ;D | 'B' C' D | C ; fin :| 'B' | +G ;A | +. | +G ;A | B ; DC F -F E ;F | 'G' A B | G ; fin :| ; | +.G' | _;G + | +.G' | _;G 'G' DC ;G -G G ;G | 'G G G |'C' ; fin :| ; | 'G G G | +.'G' | ;'G G G | G ; DC G | ;G G G | +''C fin :| ; | +.''G | ;G G G | +.G | ;G G DC All the features of mus++ will be documented in due course. For now just feed it anything you like and if it doesn't produce any sound it's an error. Other kinds of errors also need work - you'll just have to trust your ear. Multiple voices can sometimes interfere with each other, which is one of the problems with the interpreter I mentioned earlier. I know why this happens.
    19 points
  28. ISI360

    ISN AutoIt Studio

    Note: This is the continuation thread from the original one of 2012. The old one growed over 50 pages...so to make the overview better i created a new main thread for the ISN AutoIt Studio. You can find the old original thread here. The ISN AutoIt Studio is a complete IDE made with AutoIt, for AutoIt! It includes a GUI designer, a code editor (with syntax highlighting, auto complete & intelisense), a file viewer, a backup system and a lot more features!! Here are some screenshots: Here are some higlights: Easy to create/manage/public your AutoIt projects! Integrated GUI-Editor (ISN Form Studio 2) Integrated file & projectmanager Auto backupfunction for your Projects Extendable with plugins! Available in several languages Trophies Syntax highlighting /Autocomplete / Intelisense Macros Changelog manager for your project Detailed overview of the project (total working hours, total size...) Am integrated To-Do List for your project Open Source (You can download the source code from my website) And much much more!!! -> -> Click here to download ISN AutoIt Studio <- <- Here is the link to the german autoit forum where I posted ISN AutoIt Studio the first time: Link For more information visit my Homepage: https://www.isnetwork.at So, have fun with the ISN AutoIt Studio! And feel free to post your feedback, bugreports or ideas for this project here in this thread!
    18 points
  29. WHAT : is .NET Common Language Runtime (CLR) Framework The Common Language Runtime (CLR) is a an Execution Environment . Common Language Runtime (CLR)'s main tasks are to convert the .NET Managed Code to native code, manage running code like a Virtual Machine, and also controls the interaction with the Operating System. As part of Microsoft's .NET Framework, the Common Language Runtime (CLR) is managing the execution of programs written in any of several supported languages. Allowing them to share common object-oriented classes written in any of the languages. HOW : To access the CLR environment you need to create an Appdomain Object - _CLR_GetDefaultDomain() An AppDomain provides an isolated region in which code runs inside of an existing process. Application domains provide an isolation boundary for security, reliability, and versioning, and for unloading assemblies. Application domains are typically created by runtime hosts, which are responsible for bootstrapping the common language runtime before an application is run. WHEN : Would you use CLR Runtime Hosts 1. To access .NET Class Libraries : System System.Collections System.Data System.Drawing System.IO System.Text System.Threading System.Timers System.Web System.Web.Services System.Windows.Forms System.Xml 2. Accessing custom build .Net Assemblies : Some Examples (but there are a ton out there) AutoItX3 - The .NET Assembly for using AutoItX JSonToXML libr. XMLRPC Libr. .NETPDF libr. .NETOCR Libr WInSCP Libr. ... 3. To Compile .Net Code into an Assembly 4. To Run C# or VB.net Code 5. To Mix AU3 and .Net functionality in your Application WHERE : To find documentation about CLR First of all you can find a lot on MSDN and here : Post 4 & Post 6 EXAMPLES : Multiple examples included in Zip !! Example : “System.Text.UTF8Encoding” Example : “System.IO.FileInfo” Example : “System.Windows.Forms” Example : AutoItX3 Custom .NET Assembly AutoItX Example : Compile Code C# and Code VB Example : Compile Code C# at Runtime WHO : Created the CLR.au3 UDF All credits go to : Danyfirex / Larsj / Trancexx / Junkew TO DO : The library is still Work in Process … (Some of the GUI Controls are not yet working as expected...) Anyone is free to participate in contributing to get the bugs resolved and to expand the CLR.au3 functionality ... Enjoy !! DOWNLOADS : (Last updated) - added CLR Constants.au3 - Danyfirex - Global Constants added (Magic numbers) - added .NET CLR CreateObject vs ObjCreate Example.au3 - Junkew • 2 approaches give the same result (only valid for COM Visible Assembly) • Includes a function that shows you which Assembly Classes are COM Visible - added .Net Conventional COM Objects Examples - ptrex - added .NET CLR CreateComInstanceFrom Example - Danyfirex - You can use it for Regfree COM Assembly Access - System.Activator has 4 methods : • CreateComInstanceFrom : Used to create instances of COM objects. • CreateInstanceFrom : Used to create a reference to an object from a particular assembly and type name. • GetObject : Used when marshaling objects. • CreateInstance : Used to create local or remote instances of an object. - added .NET Access SafeArrays Using AccVarsUtilities Example - LarsJ - added SafeArray Utilities functions in Includes - LarsJ - added .NET Access Native MSCorLib Classes - System - ptrex Multiple System Class Examples : • System.Random • System.DateTime • System.Diagnostics.PerformanceCounter • System.IO.FileInfo • System.Int32 • System.Double • System.Speech • System.Web - added Third Party Assembly Access - ptrex • WinSCP : https://winscp.net/eng/download.php • IonicZip : http://dotnetzip.codeplex.com/ - added more Examples using PowerShell GUI Assembly Access - ptrex • GUI Ribbon .NET Assembly using &nbsp;CLR Library • GUI Report Designer .NET Assembly using &nbsp;CLR Library • GUI SSRS Reporting .NET Assembly using &nbsp;CLR Library CLRv3a.zip .NET CLR Framework for AutoIT.pdf
    18 points
  30. In this post I take the opportunity to show the awesome capabilities of AutoIt and its libraries. My open source project Peace is a long running AutoIt based app located on SourceForge. It provides users with a system-wide equalizer and effects machine. It's an interface using the power of Equalizer APO, an audio processing object software. Peace has been download over 2,600,000 times by various kind of users. Amongst others it gives them possibilities like these: Hearing impaired - Amplify the gain of frequencies which are impaired. Home Theatre - Create Equalizer presets for watching movies and listening to music. Music lovers & audiophiles - Create presets for listening to music on their high quality speakers and headphones. Gamers - Enhance frequencies to get an edge over other gamers. Headphones - Improve the sound quality of cheap headphones and get the max out of expensive ones. Bass lovers - Boost low frequencies for extra bass. Voice - Make a microphone sound better and improve the voice, for instance for YouTube usage. Low audio - Boost low audio of an input source to a comfortable level. This list covers the main needs of the Peace user. Many people have contacted me over the years asking for new features and telling me how they use Peace for their (sometimes specific) needs. I was able to use AutoIt and its libraries for all of their needs. So what are the main features of Peace? Equalize your computer audio by using up to 31 sliders. Support of equalizing 9 speakers : left/right, center, subwoofer, left/right rear, left/right side. Per slider a filter can be chosen such as peak, low/high pass, shelving. The graph windows shows your equalization so you see exactly what you're doing. Apply an effect such as crossfeed simple/Jan Meier/Chu Moy, stereo balance, bass/treble, upmix/downmix, channel routing. Save presets (called configurations) and activate by mouse click, hotkey, desktop shortcut or Peace system tray. Select a target device to equalize, microphone as input can also be equalized. Automate: you can let Peace automatically activate presets on a switch to another device and another process. Peace is available in these languages: English, Czech, Deutsch, Français, Italiano, Nederlands, Pусский, Українська So who am I? I'm a Dutch programmer who happens the stumble upon AutoIt 5 years ago and created a small Equalizer interface app of less than 400 program lines with it. Nowadays Peace has grown to more than 18,000 lines as many features were added. Although Peace is open source, the program code isn't of the best possible quality. The reason being that I didn't expect it to become so popular. It caught me by supprise. I've created a Library of functions called Pal (link to forum post) which quality is up to the AutoIt community standard as counterpart to the Peace program code. I want to state here that AutoIt is a mature program language as Peace obviously shows. I wish it to be used more extensively for professional or semi-professional apps. In my view AutoIt deserves a place amongst the major programming languages for Windows computers. Regards, Peter Verbeek
    18 points
  31. In a Windows GUI like an AutoIt GUI, functionality and user actions are largely controlled through Windows messages. Therefore, it's interesting to monitor Windows messages. That's the purpose of this example. How does it work? This is a simple example (Examples\1) Native controls\GUICtrlCreateButton.au3): #include <GUIConstantsEx.au3> #include "..\..\Includes\WinMsgMon_Button.au3" ; <<<<<<<<<<<<<<<<<<<< WinMsgMon_InitMsgs( "..\..\Includes" ) ; <<<<<<<<<<<<<<<<<<<< Example() Func Example() ; Create a GUI with various controls. Local $hGUI = GUICreate("Example", 300, 200) WinMsgMon_GetMsgs( $hGUI, "$hGUI" ) ; <<<<<<<<<<<<<<<<<<<< ; Create button controls. Local $idMsgBox = GUICtrlCreateButton("Open MsgBox", 120, 170, 85, 25) WinMsgMon_GetMsgs( $idMsgBox, "$idMsgBox" ) ; <<<<<<<<<<<<<<<<<<<< Local $idClose = GUICtrlCreateButton("Close", 210, 170, 85, 25) WinMsgMon_GetMsgs( $idClose, "$idClose" ) ; <<<<<<<<<<<<<<<<<<<< ; Display the GUI. GUISetState(@SW_SHOW, $hGUI) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $idMsgBox WinMsgMon_UserMsg( $idMsgBox, $WM_USER0, _ ; <<<<<<<<<<<<<<<<<<<< "Before MsgBox" ) MsgBox( 0, "Title", "One second timeout", 1 ) WinMsgMon_UserMsg( $idMsgBox, $WM_USER1, _ ; <<<<<<<<<<<<<<<<<<<< "After MsgBox" ) Case $GUI_EVENT_CLOSE, $idClose WinMsgMon_UserMsg( $idClose, $WM_USER0, _ ; <<<<<<<<<<<<<<<<<<<< "Before ExitLoop" ) ExitLoop EndSwitch WEnd ; Delete GUI and all controls. GUIDelete($hGUI) WinMsgMon_ViewMsgs( Example ) ; <<<<<<<<<<<<<<<<<<<< EndFunc ;==>Example Include UDF In this example WinMsgMon UDF is included as WinMsgMon_Button.au3 and not just WinMsgMon.au3. Because this is a button example, WinMsgMon_Button.au3 is included to be able to get detail information about button messages. WinMsgMon_InitMsgs() WinMsgMon_InitMsgs() is called immediately after inclusion of the UDF. The function sets up the path used to find text files with message information. In addition to the path, WinMsgMon_InitMsgs() can take an optional $iFlags parameter as input. See WinMsgMon.au3 and Rerun in Toolbar buttons section for more information. WinMsgMon_GetMsgs() WinMsgMon_GetMsgs() is the central function that collects messages. It takes two parameters: A window or control and optionally the name of the window or control. In the example above the function is called three times to be able to collect messages sent to the main GUI and two buttons. While messages are collected and stored, info is simultaneously written to SciTE console. The specified window or control names are used in console output and in WinMsgMon GUI. If no names are specified, the names Window1, Button1 and Button2 are used instead. WinMsgMon_UserMsg() WinMsgMon_UserMsg() sends user messages to the two buttons. 16 user messages are defined: $WM_USER0 - $WM_USERF. In the example $WM_USER0 and $WM_USER1 are send to $idMsgBox button before and after the MsgBox is opened and closed. And $WM_USER0 is send to $idClose button immediately before ExitLoop. This way it's easy to recognize the button clicks among the messages. WinMsgMon_ViewMsgs() WinMsgMon_ViewMsgs() is the central function that displays the messages in WinMsgMon GUI. In the example WinMsgMon_ViewMsgs() is called with Example function as parameter. The function parameter is optional and is used in relation to the Rerun button to be able to run Example once more. See Rerun in Toolbar buttons section. WinMsgMon_ViewMsgs() is called as the last line in Example() function. It does not necessarily have to be the last line. But it must definitely be after GUIDelete(). WinMsgMon_ViewMsgs() may well be called before a final long term calculation or file update. In simple situations you may have sufficient information in SciTE console output. In such cases you can omit the WinMsgMon_ViewMsgs() function. GUI window This is a small part of the messages generated by the example above as shown in WinMsgMon GUI: First column in main listview is message number. Note that the message number in first and second row is 220 and 225. This is because some messages eg. WM_MOUSEMOVE are unchecked in WM_MESSAGEs toolbar listview and therefore not displayed in main listview. Second column shows the window or control that receives the message. Name of idMsgBox button, of interest here, is written on a wheat colored background. Message column shows WM_MESSAGEs and control messages. Some messages are particularly interesting. They are written on a colored background. Notification column displays notifications contained in WM_NOTIFY and WM_COMMAND messages. The info columns shows information provided along with the messages. Console output The same messages as shown in SciTE console (long lines shortened): [ 220] idMsgBox WM_PAINT [ 221] idMsgBox WM_NCHITTEST [ 222] idMsgBox WM_SETCURSOR [ 223] hGUI WM_SETCURSOR [ 224] idMsgBox WM_MOUSEMOVE [ 225] hGUI WM_NOTIFY BCN_HOTITEMCHANGE From = idMsgBox HICF_ENTERING [ 226] idMsgBox WM_PAINT [ 227] idMsgBox WM_ERASEBKGND [ 228] hGUI WM_ERASEBKGND [ 229] hGUI WM_CTLCOLORDLG [ 230] hGUI WM_PRINTCLIENT [ 231] hGUI WM_CTLCOLORBTN [ 232] hGUI WM_NOTIFY NM_CUSTOMDRAW From = idMsgBox CDDS_PREERASE [ 233] hGUI WM_NOTIFY NM_CUSTOMDRAW From = idMsgBox CDDS_PREPAINT [ 234] idMsgBox WM_GETTEXTLENGTH [ 235] idMsgBox WM_GETTEXT [ 236] idMsgBox WM_USER1 [ 237] idMsgBox WM_PAINT Toolbar listviews The five toolbar buttons before the first separator opens five listviews. The buttons are hot-track enabled with the technique used in this example. Wins/Ctrls In Wins/Ctrls listview you check the window or control where from you want to see messages. Here messages from all windows and controls are shown: Because some messages eg. WM_MOUSEMOVE are unchecked only 742 of 1315 messages are shown. Click the checkmark or select the row and press Space key to show all messages. When a row is checked, main listview is updated instantly. Unchecked messages in other toolbar listviews are reset. See Set in Toolbar buttons section for an easy way to uncheck messages. Click the color cell or select the row and press Enter key to set background color. The combo control is implemented with the technique demonstrated in this example. The background color for all windows and controls (first row) cannot be set. Note that only single selection is enabled in this toolbar listview. In the other four listviews multiple selections are enabled. To close a toolbar listview click in main listview, click the toolbar button, move mouse pointer above titlebar or press Esc. WM_MESSAGEs In WM_MESSAGEs listview you uncheck messages that you don't want to see. WM_MOUSEMOVE and WM_NCHITTEST messages are already unchecked. WM_NOTIFY messages are written on an aquamarine background: To uncheck or set background color for all WM_NC-messages select the six rows and press Space or Enter key. When a message is un- or in-checked nothing happens until the listview is closed. Then the Refresh button is enabled. Before you click the Refresh button you can un- or in-check messages in other listviews. Click Refresh button to update main listview. When a color is set main listview is updated instantly. Control Msgs The Control Msgs listview is used to manage control messages: WM_0xC09B is an application defined and unregistered message and is shown as the message code. The two user messages are written on a tomato red background. WM_NOTIFYs and WM_COMMANDs WM_NOTIFYs and WM_COMMANDs listviews are used to manage notifications contained in WM_NOTIFY and WM_COMMAND messages. Toolbar listviews 2 - 5 Messages and notifications in toolbar listviews 2 - 5 are grouped by checked/unchecked items. Unchecked items in bottom of listviews. Update 2018-08-15. A Search can be initiated by double-clicking a message or notification in toolbar listviews 2 - 5. Update 2018-08-04. Toolbar buttons Click Refresh to update main listview after messages and notifications are un- or in-checked in toolbar listviews. Click Rerun to run the script and perform message collection once more. A submenu shows up with "Rerun script", "Write messages to console" and "Detail message information" items. The two last items are the same options as can be set through flag values in WinMsgMon_InitMsgs(). In the example in top of post WinMsgMon_ViewMsgs() takes Example as an input parameter. This is the function that will be executed when you click "Rerun script". The function parameter is optional. If not specified, Rerun button is disabled. The Search group is used to search for messages and notifications. When you click the Search button the Search listview shows up. Double click or press Enter key on an item in the listview to start a search. A search for WM_USER1 messages looks this way in main listview: Use Reset button to reset a search. A search can also be initiated by double-clicking a message or notification in toolbar listviews 2 - 5. Update 2018-08-04. Copy button copies text in selected rows to clipboard. Set button applies settings defined in WinMsgMon.ini. See below. A submenu shows up with Uncheck and Colors items. Click Uncheck to uncheck messages defined in ini-file. Colors are already set through GUI creation. Reset shows a submenu with Uncheck, Colors and Search items. Click an item to reset the feature. Use Set button to apply the feature again. Code info A few notes about the code in relation to toolbar listviews and buttons. All listviews are virtual listviews. Through message collection, indexes are created to display data in main listview and to perform searches. Several set of indexes are created. A set for all windows and controls at once. And a set for each single window and control. When a row in Wins/Ctrls toolbar listview (the leftmost listview) is checked, messages are displayed in main listview through one of these precalculated indexes. That's the reason why it's possible to display the messages in the same moment as the row is checked. Search indexes are created for each single message and notification in the Search listview. A set for all windows and controls at once. And a set for each single window and control. That's a lot of search indexes. In the example above, there are around 100 - 150 search indexes. Calculation of indexes is performed through dictionary objects. When you perform a search the matching rows in main listview are instantly drawn with the yellow background color through a precalculated search index. Next and Prev buttons also takes advantage of the indexes. As soon as a message or notification is unchecked in toolbar listviews 2 - 5 none of these precalculated indexes can be used any more. When you click Refresh a new index is calculated to be able to display the messages in main listview. When you start a search a new index is calculated to be able to display matching messages with the yellow background color, and to be able to use Next and Prev buttons. Up to 10,000 messages, performance should not be a problem. So far, no more messages have been tested. Arrays are dimensioned to a maximum of 100,000 messages. The number of windows and controls in leftmost toolbar listview is limited to 20. When you check an item in leftmost toolbar listview all unchecked messages and notifications are reset and the precalculated indexes can be used again. Functions Most functions have already been described through review of the example in top of post. There are only a few left: WinMsgMon_LoadMsgs() When the message flow from an application is monitored, usually only messages for a single control and main GUI is monitored at a time. However, there will nevertheless often be messages from eg. buttons that are very common controls. If button messages are not registered with WinMsgMon_GetMsgs( $idButton ), messages will appear with the code instead of the name. It's actually the notifications that will appear with the code instead of the name. Use WinMsgMon_LoadMsgs() to load notification names this way: #include "..\..\Includes\WinMsgMon.au3" WinMsgMon_InitMsgs( "..\..\Includes" ) WinMsgMon_LoadMsgs( "BCN_Notifications.txt" ) ; Button control notifications WinMsgMon_LoadMsgs( "EN_Notifications.txt" ) ; Edit control notifications WinMsgMon_RemMsgs() WinMsgMon_RemMsgs() removes all message monitors registered with WinMsgMon_GetMsgs(). WinMsgMon_RemMsgs() is called as the first command in WinMsgMon_ViewMsgs(). It's only necessary to call WinMsgMon_RemMsgs() if WinMsgMon_ViewMsg() isn't called. Ie. if the messages are written to SciTE console only. And only if code is executed after GUIDelete(). Detail info Detail info is information in columns named Info 1 - 4 in WinMsgMon GUI. This is information that can be extracted through wParam and lParam parameters in a message handler function. Detail info for WM_NOTIFY and WM_COMMAND messages is always extracted. Detail info for other window and control messages is depending on specific message handlers (script files). In this version only a few message handlers are implemented and only for a limited number of messages. To be able to collect detail info the message handler must be included in the script. In the example in top of post WinMsgMon_Button.au3 is included instead of WinMsgMon.au3 to be able to collect detail info for buttons. WinMsgMon.ini Includes\WinMsgMon.ini is included in the zip-file. If a copy of this file is placed in the same folder as the running script, the copy will be used instead. You can edit the copy to your own needs. An empty file disables all settings in Includes\WinMsgMon.ini. Includes\WinMsgMon.ini: [Apply Settings] Uncheck=True Colors=True [WM_MESSAGEs Uncheck] WM_ERASEBKGND=1 WM_IME_NOTIFY=1 WM_MOUSEMOVE=1 WM_MOVE=1 WM_MOVING=1 WM_NCHITTEST=1 WM_NCMOUSEMOVE=1 WM_PAINT=1 WM_PRINTCLIENT=1 WM_SETCURSOR=1 WM_TIMER=1 WM_WINDOWPOSCHANGED=1 WM_WINDOWPOSCHANGING=1 [WM_MESSAGEs Colors] WM_NOTIFY=Aquamarine WM_COMMAND=Aquamarine WM_KEYDOWN=Bisque WM_KEYUP=Bisque WM_CHAR=Bisque WM_DEADCHAR=Bisque WM_SYSKEYDOWN=Bisque WM_SYSKEYUP=Bisque WM_SYSCHAR=Bisque WM_SYSDEADCHAR=Bisque WM_LBUTTONDOWN=Khaki WM_LBUTTONUP=Khaki WM_LBUTTONDBLCLK=Khaki WM_RBUTTONDOWN=Khaki WM_RBUTTONUP=Khaki WM_RBUTTONDBLCLK=Khaki WM_MBUTTONDOWN=Khaki WM_MBUTTONUP=Khaki WM_MBUTTONDBLCLK=Khaki WM_MOUSEWHEEL=Khaki WM_XBUTTONDOWN=Khaki WM_XBUTTONUP=Khaki WM_XBUTTONDBLCLK=Khaki WM_CONTEXTMENU=LightPink WM_INITMENU=LightPink WM_INITMENUPOPUP=LightPink WM_MENUSELECT=LightPink WM_MENUCHAR=LightPink WM_MENURBUTTONUP=LightPink WM_MENUGETOBJECT=LightPink WM_UNINITMENUPOPUP=LightPink WM_MENUCOMMAND=LightPink WM_ENTERMENULOOP=LightPink WM_EXITMENULOOP=LightPink WM_NEXTMENU=LightPink [Control Messages Uncheck] [Control Messages Colors] WM_USER0=Tomato WM_USER1=Tomato WM_USER2=Tomato WM_USER3=Tomato WM_USER4=Tomato WM_USER5=Tomato WM_USER6=Tomato WM_USER7=Tomato WM_USER8=Tomato WM_USER9=Tomato WM_USERA=Tomato WM_USERB=Tomato WM_USERC=Tomato WM_USERD=Tomato WM_USERE=Tomato WM_USERF=Tomato [WM_NOTIFY Notifications Uncheck] [WM_NOTIFY Notifications Colors] [WM_COMMAND Notifications Uncheck] [WM_COMMAND Notifications Colors] "Uncheck=True" in "Apply Settings" section in WinMsgMon.ini means that unchecked messages are removed from main listview through GUI creation. As soon as an item in Wins/Ctrls toolbar listview (leftmost) is checked the removed messages are redisplayed. Click Set | Uncheck to remove the messages again. "Colors=True" in "Apply Settings" section means that colors are set through GUI creation. Examples Examples\ 1) Native controls - GUICtrlCreate<Control> examples supplied with message monitor code 2) UDF controls - _GUICtrl<Control>_Create examples (not included above) supplied with message monitor code 3) Miscellaneous Combo\ - ComboBox example including the corresponding Edit and ListBox controls. ListView\ - Four ListView examples with a standard ListView, a custom drawn ListView, a virtual ListView and a virtual and custom drawn ListView. Window\ - An example that shows how mouse clicks generates AutoIt messages ($GUI_EVENT_MESSAGEs). Two examples regarding blocked and paused GUIs. Includes Includes\ WinMsgMon.au3 - Main include file, collects messages WinMsgMon_Button.au3 - Button controls, detail information WinMsgMon_ComboBoxEx.au3 - ComboBoxEx controls, detail information WinMsgMon_ListBox.au3 - ListBox controls, detail information WinMsgMon_ListView.au3 - ListView controls, detail information WinMsgMon.ini - ini-file, colors and unchecked messages Internal\ - Internal files, implements the GUI Messages\ - Message info files CTRL_Information.txt - Info file for AutoIt window and 23 controls WM_Messages.txt - Common Windows messages CCM_Messages.txt - Common control messages <???>_Messages.txt - Messages for specific controls WM_NOTIFY\ NM_Notifications.txt - Common Windows notifications <???>_Notifications.txt - WM_NOTIFY notifications for specific controls WM_COMMAND\ <???>_Notifications.txt - WM_COMMAND notifications for specific controls 7z-file The 7z contains source code and message data. You need AutoIt 3.3.12 or later. Tested on Windows 7 and Windows 10. Comments are welcome. Let me know if there are any issues. WinMsgMon.7z
    18 points
  32. So I think it's time to publish this little tutorial I have made on using DllCall() and DllStructs. It's not near completion but I think it's a good start at least This tutorial is mostly aimed for people who have never used DllCall() before or have very limited knowledge about it. In the future I will update it with more advanced topics so more advanced users can make use of it too. Well here goes. Dealing_with_Dll.pdf Previous downloads: 31 Suggestions, language corrections and errors in the tutorial is of course welcome.
    18 points
  33. GuiBuilderPlus GuiBuilderPlus is a small, easy to use GUI designer for AutoIt. Originally created long ago as AutoBuilder by the user CyberSlug, enhanced as GuiBuilder by TheSaint, and further enhanced and expanded as GuiBuilderNxt by jaberwacky, GuiBuilderPlus is a continuation of their great work, with a focus on increased stability and usability followed by new features. ------ Yes, I have decided to bring back our old friend the GuiBuilder. This utility has a long history, which you can read about in TheSaint's Gui Creators topic, starting all the back back with CyberSlug's AutoBuilder. Even though I've hacked the original code to pieces in order to document and better understand what is going on, the essence of GuiBuilder still lives on! I am using the awesome updates from GuiBuilderNxt by jaberwacky as a starting point since he already did a lot of the hard work of parsing and updating the original code, plus I really like the layout that came about from that update. Unfortunately development seems to have stopped in 2016. Not sure how much interest there is in this, but suggestions and bug reports are welcome. See Full Changelog: Download the latest version: v1.3.0 (2024-03-24) GuiBuilderPlus v1.3.0 - 2024-03-24.zip FIXED: Wrong line endings when copying from code preview window FIXED: Issue changing properties when Obect Explorer window is not open FIXED: Issue when selecting controls under certain other conditions FIXED: SaveAs keyboard shortcut FIXED: Undo/Redo for Global property ADDED: Auto-size property for Labels, Buttons, and Inputs GitHub Repository: https://github.com/KurtisLiggett/GuiBuilderPlus
    17 points
  34. GuiFlatButton is a UDF to easily create regular buttons with different colors for background, foreground, border, hover, focus, etc.. This started as an effort to change the background color of a button and eventually grew into a full UDF. If you've looked around forums for changing button background colors, you have probably noticed that each proposed workaround has its own set of issues/side-effects. The answers usually circle back to 'use ownerdrawn buttons' and 'not worth it'. Well, now it is possible for anyone to easily create ownerdrawn buttons - totally worth it! Some issues with other workarounds such as drawing with GDI+ or using a colored label as a 'button': Not 'real' buttons so you lose built-in functionality that windows gives to buttons Messy / inefficient code in the main while loop to check for mouse position Slow to respond to click, paint, etc... Having to deal with GUIRegisterMsg messages Not straight-forward to implement GuiFlatButton is not a workaround; it is a technique to respond to Windows' built-in owner-drawn button events. With minimal effort, we can now create true simple colored buttons. The idea is to create an owner-drawn button using GUICtrlCreateButton then subclass the GUI and controls to handle the button-specific events to paint it however we want. This UDF magically does all of this for us! No need to worry about event handling or main while loop logic. How to use It couldn't be any easier! Simply create a new button using the familiar syntax. This creates an ownerdrawn button with default colors. $mybutton1 = GuiFlatButton_Create("Button 1", 78, 20, 120, 40) If you want to change the background and text colors: GuiFlatButton_SetBkColor(-1, 0x5555FF) GuiFlatButton_SetColor(-1, 0xFFFFFF) Advanced Usage Set background/text/border all at once GuiFlatButton_SetColors(-1, 0x0000FF, 0xFFFFFF, 0x9999FF) Set ALL colors for ALL button states! (normal, focus, hover, selected) Local $aColorsEx = [0x0000FF, 0xFFFFFF, -2, 0x4444FF, 0xFFFFFF, 0xAAAAFF, 0x6666FF, 0xFFFFFF, 0xCCCCFF, 0x0000EE, 0xFFFFFF, 0x7777EE] GuiFlatButton_SetColorsEx(-1, $aColorsEx) Set default colors to apply to any future buttons ;set colors GuiFlatButton_SetDefaultColors(0x0000FF, 0xFFFFFF, 0x9999FF) ;create buttons $mybutton1 = GuiFlatButton_Create("Button 1", 12, 20, 120, 40) $mybutton2 = GuiFlatButton_Create("Button 2", 143, 20, 120, 40) Set ALL color defaults ;set colors Local $aColorsEx = [0x0000FF, 0xFFFFFF, -2, 0x4444FF, 0xFFFFFF, 0xAAAAFF, 0x6666FF, 0xFFFFFF, 0xCCCCFF, 0x0000EE, 0xFFFFFF, 0x7777EE] GuiFlatButton_SetDefaultColorsEx($aColorsEx) ;create buttons $mybutton1 = GuiFlatButton_Create("Button 1", 12, 20, 120, 40) $mybutton2 = GuiFlatButton_Create("Button 2", 143, 20, 120, 40) Available Functions Simple Example #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include "GuiFlatButton.au3" Example() ;GUI with one button Func Example() Local $hGUI, $mybutton1 $hGUI = GUICreate("GuiFlatButton Ex0", 275, 120) GUISetBkColor(0x333333) Local $idLabel = GUICtrlCreateLabel("Click the button", 10, 100, 150, 30) GUICtrlSetColor(-1, 0xFFFFFF) ;create new button then set the background and foreground colors $mybutton1 = GuiFlatButton_Create("Button 1" & @CRLF & "Line 2", 78, 20, 120, 40, $BS_MULTILINE) GuiFlatButton_SetBkColor(-1, 0x5555FF) GuiFlatButton_SetColor(-1, 0xFFFFFF) GUISetState(@SW_SHOW, $hGUI) Local $i = 0 Local $iMsg While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $mybutton1 $i += 1 GUICtrlSetData($idLabel, $i) ConsoleWrite($i & @CRLF) EndSwitch Sleep(10) WEnd GUIDelete() EndFunc ;==>Example Menu/Toolbar Example #include <GUIConstantsEx.au3> #include <MsgBoxConstants.au3> #include "GuiFlatButton.au3" Example() ;Example GUI with toolbar Func Example() Local $hGUI, $idLabel, $aButtons, $iTbSize $hGUI = GUICreate("GuiFlatButton Ex2", 300, 200) GUISetBkColor(0x444444) $idLabel = GUICtrlCreateLabel("Click a button", 10, 180, 150, 30) GUICtrlSetColor(-1, 0xFFFFFF) $aButtons = createToolbar() $iTbSize = UBound($aButtons) GUISetState(@SW_SHOW, $hGUI) Local $i = 0 Local $iMsg While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop Case $aButtons[0] To $aButtons[$iTbSize - 1] ConsoleWrite("1") GUICtrlSetData($idLabel, GuiFlatButton_Read($iMsg)) EndSwitch Sleep(10) WEnd GUIDelete() EndFunc ;==>Example Func createToolbar() Local $aButtons[6] Local $bkColor = 0x777777 Local $textColor = 0xFFFFFF Local $borderColor = 0x999999 Local $aBtnClrs[12] = [0x777777, 0xFFFFFF, $GUI_BKCOLOR_TRANSPARENT, 0x888888, 0xFFFFFF, $GUI_BKCOLOR_TRANSPARENT, 0x999999, 0xFFFFFF, $GUI_BKCOLOR_TRANSPARENT, 0x666666, 0xFFFFFF, $GUI_BKCOLOR_TRANSPARENT] For $i = 0 To UBound($aButtons) - 1 $aButtons[$i] = GuiFlatButton_Create("B" & $i, $i * 50, 0, 50, 17) GuiFlatButton_SetColorsEx($aButtons[$i], $aBtnClrs) Next Return $aButtons EndFunc ;==>createToolbar Icon Example You can even easily add icons to your buttons -- just create a new button and send it an icon! #include <GDIPlus.au3> #include "GuiFlatButton.au3" Example() ;buttons with Icon images Func Example() ;get images for demonstration _GDIPlus_Startup() ;initialize GDI+ Local $hIcon = _WinAPI_ShellExtractIcon(@SystemDir & '\shell32.dll', 258, 24, 24) ;extract the 'Save' icon Local $hBitmap = _GDIPlus_BitmapCreateFromHICON($hIcon) ;Create Bitmap from Icon (for demonstration) Local $hHBitmap = _GDIPlus_BitmapCreateHBITMAPFromBitmap($hBitmap) ;Create HBitmap from Bitmap _GDIPlus_BitmapDispose($hBitmap) ;dispose the bitmap _GDIPlus_Shutdown() ;done with GDI+ Local $hGUI = GUICreate("GuiFlatButton Ex5", 255, 400) GUISetBkColor(0xEEEEEE) ;set default colors of future buttons Local $aColorsEx = _ [0xE2E5E8, 0X000000, 0x888888, _ ; normal : Background, Text, Border 0xE2E5E8, 0X000000, 0x333333, _ ; focus : Background, Text, Border 0xE8E8E8, 0X000000, 0x666666, _ ; hover : Background, Text, Border 0xDDDDDD, 0X000000, 0xAAAAAA] ; selected : Background, Text, Border GuiFlatButton_SetDefaultColorsEx($aColorsEx) ;normal button with icon $label1 = GUICtrlCreateLabel( "$BS_TOOLBUTTON -->", 5, 10) GUICtrlSetBkColor(-1, $GUI_BKCOLOR_TRANSPARENT) Local $mybutton1 = GuiFlatButton_Create("Save", 130, 5, 50, 48, $BS_TOOLBUTTON) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybutton1), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align top Local $mybuttonT = GuiFlatButton_Create("Top", 5, 65, 120, 55, $BS_TOP) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonT), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align top-left Local $mybuttonTL = GuiFlatButton_Create("Top-Left", 5, 125, 120, 55, BITOR($BS_TOP, $BS_LEFT)) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonTL), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align top-right Local $mybuttonTR = GuiFlatButton_Create("Top-Right", 5, 185, 120, 55, BITOR($BS_TOP, $BS_RIGHT)) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonTR), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align left Local $mybuttonL = GuiFlatButton_Create("Left", 5, 245, 120, 55, $BS_LEFT) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonL), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align bottom Local $mybuttonB = GuiFlatButton_Create("Bottom", 130, 65, 120, 55, $BS_BOTTOM) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonB), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align bottom-left Local $mybuttonBL = GuiFlatButton_Create("Bottom-Left", 130, 125, 120, 55, BITOR($BS_BOTTOM, $BS_LEFT)) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonBL), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align bottom-right Local $mybuttonBR = GuiFlatButton_Create("Bottom-Right", 130, 185, 120, 55, BITOR($BS_BOTTOM, $BS_RIGHT)) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonBR), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) ;align right Local $mybuttonR = GuiFlatButton_Create("Right", 130, 245, 120, 55, $BS_RIGHT) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonR), $BM_SETIMAGE, $IMAGE_ICON, $hIcon)) GuiFlatButton_SetState($mybuttonR, $GUI_DISABLE ) ;disabled Local $mybuttonDisable = GuiFlatButton_Create("Disabled", 130, 310, 120, 55, $BS_TOOLBUTTON) _WinAPI_DeleteObject(_SendMessage(GUICtrlGetHandle($mybuttonDisable), $BM_SETIMAGE, $IMAGE_BITMAP, $hHBitmap)) GuiFlatButton_SetState($mybuttonDisable, $GUI_DISABLE ) ;clean up! _WinAPI_DestroyIcon( $hIcon ) _WinAPI_DeleteObject( $hHBitmap ) GUISetState(@SW_SHOW, $hGUI) Local $iMsg While 1 $iMsg = GUIGetMsg() Switch $iMsg Case $GUI_EVENT_CLOSE ExitLoop EndSwitch Sleep(10) WEnd GUIDelete() EndFunc ;==>Example I'm sure there are some use-cases I've forgotten, so feedback is welcome! Download the latest UDF and several more examples: GuiFlatButton_20220919.zip (1,121) Update 2022-09-19 Added update from 05/25 back in after it was accidentally removed Update 2022-09-01 Added $BS_MULTILINE button style Added ellipses when text is longer than the button Fixed compatibility with Opt("MustDeclareVars", 1) Update 2022-05-25 Fixed issue, buttons disappear when a GUI containing a child window with WS_EX_MDICHILD extended style is moved Update 2022-05-24 Fixed issue releasing subclassing when GUI is deleted but program is not closed Fixed occasional white background flicker Added function GuiFlatButton_GetPos Update 2021-01-02 Fixed bug, not drawing correctly after deleting GUI with GUIDelete() Fixed bug, changing default colors changed all buttons, even previously created buttons Made some internal functions more efficient Update 2019-04-14 Fixed bug, not showing pressed down state when clicking rapidly Added Icon/Bitmap support! Added function GuiFlatButton_SetPos to change the position and/or size of a button Update 2019-02-09 Added 2 new functions to set the button colors globally for all future buttons. GuiFlatButton_SetDefaultColors GuiFlatButton_SetDefaultColorsEx Credits to: Melba23 (UDF template) LarsJ (general subclassing code) 4ggr35510n (TrackMouseEvent example) binhnx (disable dragging with $WS_EX_CONTROLPARENT) GUIRegisterMsg in AutoIt Help (owner-draw button example) funkey (_WinAPI_DrawState example)
    17 points
  35. CodeCrypter enables you to encrypt scripts without placing the key inside the script. This is because this key is extracted from the user environment at runtime by, for example: password user query any macro (e.g., @username) any AutoIt function call any UDF call some permanent environment variable on a specific machine (and not created by your script) a server response a device response anything else you can think of, as long as it's not stored in the script any combination of the above You need several scripts to get this to work, and they are scattered over several threads, so here's a single bundle that contains them all (including a patched version of Ward's AES.au3; with many thanks to Ward for allowing me to include this script here): Latest version: 3.4 (3 Dec 2021): please follow this link. Note: if you experience issues under Win8/8.1 (as some users have reported), please upgrade to Win10 (or use Win7) if you can; as far as I can tell, the scripts in the bundle all work under Win7 & Win10 (and XP). Moreover, I have no access to a Win8 box, so these issues will not be fixed, at least not by yours truly. How the bits and pieces fit together: CodeCrypter is a front-end for the MCF UDF library (you need version 1.3 or later). Its thread is here: '?do=embed' frameborder='0' data-embedContent>> The MCF package (also contained in the CodeScannerCrypter bundle) contains MCF.au3 (the library itself) plus a little include file called MCFinclude.au3. The latter you have to include in any script you wish to encrypt. Any code preceding it will not be encrypted, any code following it will be encrypted. You define the dynamic key inside MCFinclude.au3, in the UDF: _MCFCC_Init(). From the same post you can download an MCF Tutorial which I heartily recommend, because encrypting a script requires a number of steps in the right order, namely: In MCFinclude.au3, define and/or choose your dynamic key(s) (skip this step = use default setting) include MCFinclude.au3 in your target script Run CodeScanner (version 2.3+) on your target script, with setting WriteMetaCode=True (see '?do=embed' frameborder='0' data-embedContent>>), then close CodeScanner. Start CodeCrypter press the Source button to load your target file enable Write MCF0 (tick the first option in Main Settings) Enable "Encrypt" (last option in the Main Settings) Go to the Tab Encrypt and set up the encryption the way you want (skip this = use default settings) Return to Main Tab and press "Run" if all goes well, a new script called MCF0test.au3 is created in the same directory as your target. It has no includes and no redundant parts. Please check that it works as normal. (see Remarks if not) It all sounds far more complicated than it is, really. Not convinced? Check out: a simple HowTo Guide: HowToCodeCrypt.pdf an updated and extended Q & A pdf (FAQ, also included in the bundle) to help you get started:CodeCrypterFAQ.pdf For additional explanations/examples in response to specific questions by forum members (how it works, what it can/cannot do), see elsewhere in this thread, notably: Simple analogy of how it works: post #53, second part General Explanation and HowTo: post #9, 51, 75, 185/187, 196, 207, 270, 280 (this gets a bit repetitive) BackTranslation: post #179 Obfuscation: post #36 (general), 49 (selective obfuscation) Specific features and fixes: post #3 (security), 84 (redefining the expected runtime response), 169 (Curl Enum fix), 185/187 (using license keys), 194 (replacing Ward's AES UDF with different encryption/decryption calls), 251 (AV detection issue), 262 (extract key contents to USB on different target machine prior to encryption) Limitations: post #26 (@error/@extended), 149 (FileInstall), 191 (AES.au3 on x64) Not recommended: post #46/249 (static encryption), 102 (programme logic error), 237 (parsing password via cmdline) Technical notes: BackTranslation is a test to check that the MetaCode translation worked. Skip it at your peril. It also turns your multi-include composite script into a single portable file without redundant parts (you can opt to leave the redundant parts in, if you want). CodeCrypter can also obfuscate (vars and UDF names) and replace strings, variable names and UDF names with anything else you provide, for example, for language translation). After CodeScanner separates your target's structure from its contents, CodeCrypter (actually MCF, under the hood) can change any part, and then generate a new script from whichever pieces you define. See the MCF Tutorial for more explanation and examples. Encryption currently relies on Ward's excellent AES UDF and TheXman's sophisticated CryptoNG bundle. You can replace these with any other algorithm you like (but this is not trivial to do: edit MCFinclude.au3 UDF _MCFCC(), and MCF.au3 UDF _EncryptEntry(), see post #194 in this thread). AES by Ward, and CryptoNG by TheXman are also included in the bundle (with many thanks to Ward and TheXman for graciously allowing me to republish their outstanding work). Going to lie down now... RT
    17 points
  36. https://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.16.1-rc1-setup.zip https://www.autoitscript.com/autoit3/files/beta/autoit/autoit-v3.3.16.1-rc1.zip 3.3.16.1 (xxx, 2022) (Release) AutoIt: - Fixed #3866: REGEXPCLASS broken in 3.3.16.0. - Fixed #3875: GUICtrlSetResizing() performance. - Fixed #3865: Image Control resizing behave as forced $GUI_DOCKWIDTH and $GUI_DOCKHEIGHT. - Fixed #3764: StringRegExp() crash with patterns that cause infinite recursion. - Fixed #3876: Hex Number Arithmetic is incorrect. - Fixed #3879: Dim Map to Array. UDFs: - Fixed #3867: Changes in 'SecurityConstants.au3' to avoid name conflict. THIS IS A SCRIPT BREAKING CHANGE - Added: UBound[2] example. - Added: StringRegExp[5] example. - Added: _GUICtrlEdit_SetPadding() function and example. - Fixed: Regression in 3.3.15.1, _WinAPI_RegCreateKey() and _WinAPI_RegOpenkey(). - Added: _WinAPI_RegDeleteKey() can use $hKey as in RegRead(). - Fixed: Regression of #3835 on _GDIPlus_GraphicsGet*(). - Fixed #3871: _ArrayDisplay() Hang sorted array with Null element. - Fixed: _FTP_FileGetSize() very big size. - Fixed #3872: FTP-Server in AutoIt Help no longer accessible. - Fixed #3877: GUICtrlCreateLabel() overlapping controls doc precision ($WS_CLIPSIBLINGS). - Added #3863: _WinAPI_GetCapture(). - Added: Allows _DebugArrayDisplay() to be used in UserFunc. - Added: _ArrayDisplay() and _DebugArrayDisplay() support Min Column width. - Added: _Array2DCreate() support 1D and/or 2D arrays. - Added: _DebugReportVar() display DllStruct content. - Fixed #3883: _DebugArrayDisplay() produces uncalled console message. - Added: _ArrayDisplay() and _DebugArrayDisplay() display {Array[dims]}, {Map[nentry]} and {Object}.
    17 points
  37. BBs19

    MetroGUI UDF

    Version 5.1

    8,635 downloads

    Features: Create modern looking borderless and resizable GUIs with control buttons (Close,Maximize/Restore,Minimize, Fullscreen, Menu) True borderless, resizeable GUI with full support for aerosnap etc. Many color schemes/themes included. See MetroThemes.au3 for more details. 2 type of Windows 8/10 style buttons. Modern checkboxes, radios, toggles and progressbar. All buttons, checkboxes etc. have hover effects! Windows 10 style modern MsgBox. Windows 10/Android style menu that slides in from left.
    17 points
  38. In the forums you can find several questions about how to edit the text in a ListView cell with a standard control eg. an Edit control or a ComboBox. The zip below contains three examples with an Edit control, a ComboBox and a DateTimePicker. How? A description from MicroSoft of how to edit a ListView cell with a ComboBox can be found here. When you click a cell the position and size is calculated, and the ComboBox is created on top of the cell. The text is shown in the Edit box. You can edit the text or select a value in the Listbox. Press Enter to save the text in the ListView cell and close the ComboBox. The ComboBox exists only while the text is edited. Code issues Especially because the control to edit the ListView cell is created on top of the ListView and is not part of the ListView, there are some issues you should be aware of. To get everything to look as good as possible most actions should be carried out when a mouse button is pressed and not when it's released. You should also be aware that the new code you add, does not conflict with existing functionality for example multiple selections. The examples consists of small but fairly many pieces of code to respond to events and messages. Keyboard support To edit a text value you are more or less forced to use the keyboard to type in the text. It would be nice if you could also select the current cell in the ListView with the keyboard. Cell selection with the keyboard is not too hard to implement with custom draw code. The current cell is drawn with a specific background color. It looks like this. You can select the current cell with the arrow keys. Open the control There must be a way to initiate the creation of the control. This is typically done with a single or double click in the ListView. Or with Enter or Space key in the examples with keyboard support. Default in the examples is double click and Enter key. You can change this in global variables in top of the scripts. A WM_NOTIFY message handler created with GUIRegisterMsg is used to watch for single and double click in the ListView. This message handler is also used to handle custom draw messages for keyboard support. Because the control is created on top of the ListView cell, it's very important that the ListView is set as the parent window. This ensures that mouse clicks and key presses are captured by the control and not by the ListView. Events in the control In a ComboBox and a DateTimePicker an additional control (Listbox and MonthCal, respectively) is opened if you click the Dropdown arrow (or press <Alt+Down arrow> on the keyboard). Click the Dropdown arrow again to close the control (or press <Alt+Up arrow> on the keyboard). The interesting messages (DROPDOWN, SELECTION, CLOSEUP) from such an additional control are usually contained in WM_COMMAND or WM_NOTIFY messages which are sent to the parent window. The parent window is the ListView. To catch the messages the ListView must be subclassed. Messages from the Edit control, the Edit box of the ComboBox, or the client area of the DateTimePicker are catched by subclassing the controls (Edit control, Edit box and DateTimePicker) directly. The interesting information here is dialog codes to accept (Enter) or cancel (Esc) the value and close the control. Dialog codes are sent as $WM_GETDLGCODE messages. In all examples the value in the control can also be accepted and saved with a double click. Close the control A mouse click in the ListView outside the control should close the control and cancel editing of the current cell. Because the control is not part of the ListView in particular mouse clicks on the Scrollbars should close the control immediately. The control will not be repainted properly on scrolling. Mouse clicks in the ListView and on Scrollbars can be identified by WM_LBUTTONDOWN and WM_NCLBUTTONDOWN messages. The area which is filled by Scrollbars in a ListView is non-client area. Mouse clicks in non-client area generates WM_NCLBUTTONDOWN messages. To catch the messages you have to subclass the ListView. A mouse click in the GUI outside the ListView and in non-client GUI area (eg. the Titlebar) should also close the control. Mouse clicks in GUI are catched through GUI_EVENT_PRIMARYDOWN messages. Mouse clicks in non-client GUI area are catched through WM_NCLBUTTONDOWN messages by subclassing the GUI. Finish the code A great part of the code is running in message handlers created with GUIRegisterMsg or created by subclassing a window. Lengthy code to open or close the control should not be executed in these message handlers. Instead of a message is sent to the AutoIt main loop where the control is opened or closed. Some of the message handlers are only needed while the control is open. They are created and deleted as part of the control open and close code. In the context of the updates May 26 the $LVS_EX_HEADERDRAGDROP extended style (rearranging columns by dragging Header items with the mouse) is added to all ListViews. See post 20 and 21. A few lines of code are added to better support usage of the keyboard. See image above. The code provides for horizontal scrolling of the ListView to make sure that a subitem (or column) is fully visible when it's selected with left or right arrow. Among other things, the code takes into account rearranging and resizing of columns as well as resizing of the GUI and ListView. A new example EditControlKeyboardTenCols.au3 demonstrates the features. See post 22. A few lines of code is added to handle multiple selections. Multiple selections is enabled in all examples. Pressing the Tab key in the control closes the control. The image shows a DateTimePicker control. Zip file The zip contains three examples with an Edit control, a ComboBox and a DateTimePicker. For each control there are two scripts with and without keyboard support. In the script with keyboard support you can select the current cell in the ListView with the arrow keys and open the control with the Enter (default) or the Space key. You need AutoIt 3.3.10 or later. Tested on Windows 7 32/64 bit and Windows XP 32 bit. Comments are welcome. Let me know if there are any issues. (Set tab width = 2 in SciTE to line up comments by column.) ListViewEditingCells.7z
    17 points
  39. Is it possible to pass a native AutoIt array as a parameter to a function coded in assembler, C, C++, C# or FreeBasic? And how is this possible? That's what this example is about. If possible, it may increase the performance of array manipulations significantly through fast functions of compiled code. The very, very short answers to the two questions above are: Yes. And through COM objects. Here is a small example that shows what it's all about. You can find the example in zip file in bottom of post (goto top of second post and scroll up a little bit). ;#AutoIt3Wrapper_UseX64=y #include "Includes\AccVarsUtilities.au3" #include "Includes\InspectVariable.au3" #include "Includes\ArrayDisplayEx.au3" #include "Includes\FasmUtils.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; === UDF and flat assembler (fasm) code === Local $hTimer1 = TimerInit() ; --- Create and fill safearray --- ; Create safearray Local $tSafeArrayBound = DllStructCreate( $tagSAFEARRAYBOUND ) DllStructSetData( $tSafeArrayBound, "cElements", 2^24 ) ; Number of elements in array DllStructSetData( $tSafeArrayBound, "lLbound", 0 ) ; Lower bound of array index Local $pSafeArray = SafeArrayCreate( $VT_I4, 1, $tSafeArrayBound ) ConsoleWrite( @CRLF & "--- Inspect safearray ---" & @CRLF ) InspectSafeArray( $pSafeArray ) ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; AutoIt code ;For $i = 0 To 2^24 - 1 ; DllStructSetData( $tSafeArrayData, 1, $i, $i + 1 ) ;Next ; <<<< Execute your assembler, C, C++, C# or FreeBasic code at this point >>>> ; Get fasm code Local $sFasmCode = @AutoItX64 ? "0xB80000000089024883C204FFC0E2F6C3" _ ; Example-x64.asm : "0x5589E58B4D088B550CB800000000890283C20440E2F85DC20800" ; Example-x86.asm Local $pFasmCode = FasmGetBinaryString( $sFasmCode, 64 ) If Not $pFasmCode Then Return ConsoleWrite( "$pFasmCode ERR" & @CRLF ) ; Execute fasm code to fill safearray DllCallAddress( "int", $pFasmCode, "int", 2^24, "ptr", $pSafeArrayData ) SafeArrayUnaccessData( $pSafeArray ) ; --- Convert safearray to native AutoIt array --- Local $aArray1 AccVars_SafeArrayToArray( $pSafeArray, $aArray1 ) ; <<<< The UDF >>>> ConsoleWrite( @CRLF & "Applied time to create and fill array (UDF and fasm): " & TimerDiff( $hTimer1 ) & @CRLF ) ; ------------------------------------------------ _ArrayDisplayEx( $aArray1, Default, "", 0x0010, "", "", "", 75 ) ConsoleWrite( @CRLF & "--- Inspect $aArray1 ---" & @CRLF ) InspectArray( $aArray1 ) $aArray1 = 0 ; === Pure AutoIt code === ConsoleWrite( @CRLF & "Executing pure AutoIt code to create and fill array (~10 seconds) ..." & @CRLF ) Local $hTimer2 = TimerInit() Local $aArray2[2^24] For $i = 0 To 2^24 - 1 $aArray2[$i] = $i Next ConsoleWrite( @CRLF & "Applied time to create and fill array (pure AutoIt): " & TimerDiff( $hTimer2 ) & @CRLF ) _ArrayDisplayEx( $aArray2, Default, "", 0x0010, "", "", "", 75 ) ConsoleWrite( @CRLF & "--- Inspect $aArray2 ---" & @CRLF ) InspectArray( $aArray2 ) $aArray2 = 0 EndFunc Line 53 is the crucial line of code: AccVars_SafeArrayToArray( $pSafeArray, $aArray1 ) ; <<<< The UDF >>>> Output in SciTE console should look like this: --- Inspect safearray --- Number of dimensions = 1 Features flags = 0x00000080 ($FADF_HAVEVARTYPE, array of variant type) Variant type = 0x0003 (VT_I4, 4 bytes signed integer) Size of array element (bytes) = 4 (size of the element structure) Number of locks = 0 Pointer to data = 0x02B80020 (pvData) Dimension 1: Elements in dimension = 16777216 Lower bound of dimension = 0 Applied time to create and fill array (UDF and fasm): 797.855906880413 --- Inspect $aArray1 --- Number of dimensions = 1 Features flags = 0x00000880 ($FADF_VARIANT+$FADF_HAVEVARTYPE, array of variants) Variant type = 0x000C (VT_VARIANT, variant data type) Size of array element (bytes) = 16 (size of the variant structure) Number of locks = 0 Pointer to data = 0x7FFF0020 (pvData) Dimension 1: Elements in dimension = 16777216 Lower bound of dimension = 0 Executing pure AutoIt code to create and fill array (~10 seconds) ... Applied time to create and fill array (pure AutoIt): 8670.46279987079 --- Inspect $aArray2 --- Number of dimensions = 1 Features flags = 0x00000880 ($FADF_VARIANT+$FADF_HAVEVARTYPE, array of variants) Variant type = 0x000C (VT_VARIANT, variant data type) Size of array element (bytes) = 16 (size of the variant structure) Number of locks = 0 Pointer to data = 0x7FFF0020 (pvData) Dimension 1: Elements in dimension = 16777216 Lower bound of dimension = 0 The UDF and fasm code is about 10 times faster than the pure AutoIt code. The code to populate the array is very simple. That's why the AutoIt code is doing relatively well compared to the UDF and fasm code. The technique implemented here can also be used to pass simple AutoIt variables to a function coded in a another language. This makes it possible to test on simple variables, rather than more complex arrays. And simple variables are needed in the final UDF. Post 7 contains a brief description of how the idea for this project arose. You'll find the following sections below: Accessing variables COM objects - COM objects can handle AutoIt arrays. Can this be exploited? AccessingVariablesTest.au3 - Test with UIAutomation::RectToVariant (Examples - Tests\Examples\0) Accessing variables\) Simple variables Variants - Introduction Basic strings - Introduction Examples - Tests\Examples\1) Simple variables\ Numeric variables (post 11) Numeric variants (post 11) Array variables Safearrays - Introduction Examples - Tests\Examples\2) Array variables\ Assembler code SafeArrayDisplay.au3 (post 24) Safearrays of integers (post 24) Internal conversions Exploiting conversions Avoiding conversions (Examples - Tests\Examples\3) Internal conversions\) Limitations (post 13) Final UDF - AccessingVariables.au3 AccessVariablesXY - 30 functions Restrictions - No literal params, no nested funcs Utility funcs - AccVarsUtilities.au3 InspectVariable - InspectVariable.au3 Using the UDF - Examples\Demo examples\4) Other demo examples\6) Using the UDF\ Subclassing (post 21) - Examples\Subclassing\ Examples Demo examples - Examples\Demo examples\ Assembler code - Tools to create fasm code not included Other demo examples - Examples\Demo examples\4) Other demo examples\ Real examples - Examples\Real examples\ sqlite3_get_table (post 25) What's next (post 26) Zip file For tests and for implementing the final UDF I've copied code written by monoceres, I've copied code from AutoItObject.au3 by the AutoItObject-Team: monoceres, trancexx, Kip, ProgAndy, and from CUIAutomation2.au3 by junkew. Lots of credit to these guys. Accessing variables AutoIt is a BASIC-like language. In BASIC-like languages simple variables are internally stored as variants, and arrays are internally stored as safearrays contained in variants. Assuming that an AutoIt variable is internally stored as a variant, is it possible to get a pointer to this variant? Assuming that an AutoIt array is internally stored as a safearray contained in a variant, then it should be possible to get a pointer to the safearray through the pointer to the variant. Why is a pointer to a safearray interesting? Because such a pointer can be passed as a parameter to a function coded in assembler, C, C++, C# or FreeBasic. We can thus access an AutoIt array directly from a function coded in another language, without the need to convert the array to a structure (DllStructCreate) or similar. In this way it's possible to code very fast array manipulation functions in a real compiled language. The crucial step is to get a pointer to the variant that contains the variable or array. COM objects If you have been using COM objects like the Dictionary ("Scripting.Dictionary") object, you know that this object can return AutoIt arrays in this way: $aKeys = $oDict.Keys() $aItems = $oDict.Items() In an example in "Obj/COM Reference" chapter in AutoIt Help file you can find this code line: $oExcel.activesheet.range("A1:O16").value = $aArray ; Fill cells with example numbers The Excel object seems to know how to handle a native AutoIt array. For objects created with ObjCreateInterface it's also easy to find examples where these objects understands how to handle native AutoIt arrays. An example is RectToVariant method of the UIAutomation object. This method converts a rectangle structure to an array: ; Create UIAutomation object Local $oUIAutomation = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $stag_IUIAutomation ) If Not IsObj( $oUIAutomation ) Then Return ConsoleWrite( "$oUIAutomation ERR" & @CRLF ) ConsoleWrite( "$oUIAutomation OK" & @CRLF ) ; Create rectangle structure Local $tRect = DllStructCreate( $tagRECT ) DllStructSetData( $tRect, "Left", 100 ) DllStructSetData( $tRect, "Top", 200 ) DllStructSetData( $tRect, "Right", 3000 ) DllStructSetData( $tRect, "Bottom", 4000 ) Local $aArray $oUIAutomation.RectToVariant( $tRect, $aArray ) ; Variant array: VT_ARRAY + VT_R8 If Not IsArray( $aArray ) Then Return ConsoleWrite( "$aArray ERR" & @CRLF ) ConsoleWrite( "$aArray OK" & @CRLF ) _ArrayDisplay( $aArray ) You can find the example (Tests\Examples\0) Accessing variables\Example1.au3) in the zip below. AccessingVariablesTest.au3 I've been playing with RectToVariant method of the UIAutomation object. And I have studied how the output array ($aArray in the code above) looks like in C++ (see also last code box in post 15). The description for RectToVariant in $stag_IUIAutomation looks like this: "RectToVariant hresult(" & ( @AutoItX64 ? "struct*;" : "struct;" ) & "variant*);" Note the last parameter "variant*". What's that? That's a pointer to a variant. Exactly what we need. You can get a pointer to the variant that contains $aArray in the example above in this way: Replace the RectToVariant method with your own function. Inside the function the pointer to the variant that contains $aArray is simply the last parameter. It's necessary to replace RectToVariant with our own function to be able to add code inside the function. And it's very important that the parameter type in the function (or method) description string is "variant*". Exactly this parameter type ensures that the parameter coming from the AutoIt code is converted to a pointer to a variant. Inside the RectToVariant method or our own function the last parameter is not a native AutoIt array. It's a pointer to a variant. This conversion between different data types is performed by internal AutoIt code. And the conversion is only performed in relation to objects. There is no such conversion in relation to eg. the DllCall function. That's why we have to deal with objects. The technique of replacing an object method with our own function has been seen many times before. Eg. in this old example by monoceres. Now when we have ObjCreateInterface it's much easier. You don't need much code: #include-once #include "..\Includes\Variant.au3" #include "..\Includes\SafeArray.au3" #include "..\Includes\Utilities.au3" Global $hAccessVariableFunction Func AccessVariable( $hAccessVariableFunc, ByRef $vVariable ) Static $oAccessVariable = AccessVariableInit() ; Init $oAccessVariable (only once) $hAccessVariableFunction = $hAccessVariableFunc ; Code to execute in VariableToVariant $oAccessVariable.VariableToVariant( $vVariable ) ; Execute VariableToVariant method EndFunc Func AccessVariableInit() ; Three locals copied from "IUIAutomation MS framework automate chrome, FF, IE, ...." by junkew ; https://www.autoitscript.com/forum/index.php?showtopic=153520 Local $sCLSID_CUIAutomation = "{FF48DBA4-60EF-4201-AA87-54103EEF594E}" Local $sIID_IUIAutomation = "{30CBE57D-D9D0-452A-AB13-7AC5AC4825EE}" Local $stag_IUIAutomation = _ "f01 hresult();f02 hresult();f03 hresult();f04 hresult();f05 hresult();f06 hresult();f07 hresult();" & _ "f08 hresult();f09 hresult();f10 hresult();f11 hresult();f12 hresult();f13 hresult();f14 hresult();" & _ "f15 hresult();f16 hresult();f17 hresult();f18 hresult();f19 hresult();f20 hresult();f21 hresult();" & _ "f22 hresult();f23 hresult();f24 hresult();f25 hresult();f26 hresult();f27 hresult();f28 hresult();" & _ "f29 hresult();f30 hresult();f31 hresult();f32 hresult();f33 hresult();f34 hresult();f35 hresult();" & _ "f36 hresult();f37 hresult();f38 hresult();f39 hresult();f40 hresult();f41 hresult();" & _ "VariableToVariant hresult(variant*);" & _ ; "RectToVariant hresult(" & ( @AutoItX64 ? "struct*;" : "struct;" ) & "variant*);" "f43 hresult();f44 hresult();f45 hresult();f46 hresult();f47 hresult();f48 hresult();f49 hresult();" & _ "f50 hresult();f51 hresult();f52 hresult();f53 hresult();f54 hresult();f55 hresult();" ; Create AccessVariable object (Automation object) Local $oAccessVariable = ObjCreateInterface( $sCLSID_CUIAutomation, $sIID_IUIAutomation, $stag_IUIAutomation ) If Not IsObj( $oAccessVariable ) Then Return SetError(1,0,1) ; Replace RectToVariant method with VariableToVariant method Local $pVariableToVariant = DllCallbackGetPtr( DllCallbackRegister( "VariableToVariant", "long", "ptr;ptr*" ) ) ReplaceVTableFuncPtr( Ptr( $oAccessVariable() ), ( 3 + 42 - 1 ) * ( @AutoItX64 ? 8 : 4 ), $pVariableToVariant ) Return $oAccessVariable EndFunc Func VariableToVariant( $pSelf, $pVariant ) $hAccessVariableFunction( $pVariant ) Return 0 ; $S_OK (COM constant) #forceref $pSelf EndFunc The code is saved in Tests\AccessingVariablesTest.au3 in the zip. To use the UDF you call AccessVariable function in the top. Note the ByRef keyword in the function. The ByRef keyword is very important. The function will not work without this keyword. Note also that the pointer to the variant in VariableToVariant function in bottom of the UDF is created by some internal AutoIt conversion code. And it's a local function parameter. The pointer is only valid within VariableToVariant and in the function you specify as a parameter when you call AccessVariable. As soon as VariableToVariant returns, the pointer is invalid. Let's try some small examples with simple variables and array variables. Simple variables Before we go to the examples let's take a quick look at variants and basic strings (BSTRs). Variants and basic strings are needed in our assembler, C, C++, C# or FreeBasic functions. Variants A variant is defined by this structure: Global Const $tagVARIANT = "word vt;word r1;word r2;word r3;ptr data; ptr" Only vt and data elements are used. The structure takes up 16/24 bytes when you're running 32/64 bit. Space for the data element at the end represents 2 pointers. This is 8/16 bytes when you're running 32/64 bit. If $pVariant is a pointer to a variant you can get vt and data elements in this way: Local $vt = DllStructGetData( DllStructCreate( "word", $pVariant ), 1 ) Local $data = DllStructGetData( DllStructCreate( "<vt>", $pVariant + 8 ), 1 ) The four word (word = 2 bytes) elements before the data element takes up 8 bytes. Common values of vt in AutoIt are: $VT_I4 = 3 ; Integer, "<vt>" = "int" $VT_R8 = 5 ; Double, "<vt>" = "double" $VT_BSTR = 8 ; Basic string, "<vt>" = "ptr" $VT_UI4 = 19 ; Pointer running 32 bit, "<vt>" = "ptr" $VT_UI8 = 21 ; Pointer running 64 bit, "<vt>" = "ptr" If $pVariant is a pointer to a variant which contains an array you'll always get this value for vt: $VT_ARRAY + $VT_VARIANT = 0x200C ; Pointer, "<vt>" = "ptr" A native AutoIt array is stored as a safearray ($VT_ARRAY = 0x2000) contained in a variant ($VT_VARIANT = 0x000C). The pointer to the safearray is stored in the data element of the variant. Variant constants and functions are defined in Includes\Variant.au3. Most of the code is shamelessly copied from AutoItObject.au3 by the AutoItObject-Team: monoceres, trancexx, Kip, ProgAndy. Basic strings Internally AutoIt strings are stored as basic strings or BSTRs. The pointer to the BSTR is stored in a variant. A BSTR is defined by this structure: Global Const $tagBSTR = & _ "dword Length;" & _ ; Length in bytes (2 * $iLen), does not include the Terminator "wchar String[" & $iLen & "];" & _ ; $iLen is wchars, $pBSTR = DllStructGetPtr( $tBSTR, "String" ) "word Terminator;" ; Two null characters Use this code to get the pointer to the BSTR (the pointer which is stored in a variant): Local $pBSTR = DllStructGetPtr( $tBSTR, "String" ) Note that the BSTR pointer is the start of the "String" element and not the start of the structure. Normally you do not handle BSTRs directly through this structure. You use the BSTR functions in Variant.au3. Also copied from AutoItObject.au3. You can find information about variant and BSTR conversion and manipulation functions here. Examples The examples are stored in "Tests\Examples\1) Simple variables\". There are three small examples. These examples are just AutoIt code. This is a part of Example2.au3: Local $sStr = "AutoIt" ConsoleWrite( "$sStr = " & $sStr & @CRLF ) AccessVariable( InspectVariableMtd, $sStr ) ; InspectVariableMtd is coded in Includes\InspectVariable.au3 AccessVariable( SetString, $sStr ) ; Shows how to use the AccessVariable function ConsoleWrite( "$sStr = " & $sStr & @CRLF ) Func SetString( $pVariant ) Local $pData = $pVariant + 8 ; See InspectVariable.au3 Local $tData = DllStructCreate( "ptr", $pData ) Local $pBStr = DllStructGetData( $tData, 1 ) SysFreeString( $pBStr ) ; See Variant.au3 $pBStr = SysAllocString( "Hello world" ) DllStructSetData( $tData, 1, $pBStr ) EndFunc The output i SciTE console should look like this: $sStr = AutoIt ptr = 0x006F9630 ($pVariant) vt = 0x0008 (VT_BSTR, basic string) data = AutoIt $sStr = Hello world Example3.au3 is similar to the example for VarGetType in the Help file. It prints the variant vt-values for the corresponding AutoIt data types. Array variables Before we go to the examples let's take a quick look at safearrays. Safearrays A safearray is defined by these structures: Global Const $tagSAFEARRAYBOUND = _ "ulong cElements;" & _ ; The number of elements in the dimension. "long lLbound;" ; The lower bound of the dimension. Global Const $tagSAFEARRAY = _ "ushort cDims;" & _ ; The number of dimensions. "ushort fFeatures;" & _ ; Flags, see below. "ulong cbElements;" & _ ; The size of an array element. "ulong cLocks;" & _ ; The number of times the array has been locked without a corresponding unlock. "ptr pvData;" & _ ; The data. $tagSAFEARRAYBOUND ; One $tagSAFEARRAYBOUND for each dimension. ; Examples ; 1D, 2D and 3D safearrays: Local $tagSAFEARRAY1D = $tagSAFEARRAY Local $tagSAFEARRAY2D = $tagSAFEARRAY & $tagSAFEARRAYBOUND Local $tagSAFEARRAY3D = $tagSAFEARRAY & $tagSAFEARRAYBOUND & $tagSAFEARRAYBOUND In AutoIt an array is stored as a safearray contained in a variant. The safearray is always an array of variants. That the safearray is contained in a variant means that the pointer to the safearray is stored in the data element of a variant. That the safearray is an array of variants means that the pvData element of the safearray points to a memory area which contains a continuous row of variant structures. If we're running 32 bit a variant takes up 16 bytes. For a 1D-array with three elements: Local $aArray[3] = [ 1, 2, 3 ] The pvData element of the safearray points to a memory area which takes up 48 bytes and consists of three variant structures. Normally you do not handle safearrays directly through these structures. You use the safearray functions in Includes\SafeArray.au3. Copied from AutoItObject.au3. You can find information about safearray conversion and manipulation functions here. Examples The examples are stored in "Tests\Examples\2) Array variables\". The examples are still just AutoIt code. Example1.au3 prints information for 1D-arrays of integers, floats and strings. Information for the integer array should look like this: $aInts = [ 0, 1, 2 ] --- InspectVariable $aInts --- ptr = 0x00990378 ($pVariant) vt = 0x200C (VT_ARRAY+VT_VARIANT, array of variants, safearray) data = 0x009981E8 (pointer to safearray) --- InspectVariable $aInts[0] --- ptr = 0x0098FEC8 ($pVariant) vt = 0x0003 (VT_I4, 4 bytes signed integer) data = 0 --- InspectArray $aInts --- Number of dimensions = 1 Features flags = 0x00000880 ($FADF_VARIANT+$FADF_HAVEVARTYPE, array of variants) Variant type = 0x000C (VT_VARIANT, variant data type) Size of array element (bytes) = 16 (size of the variant structure) Number of locks = 0 Pointer to data = 0x00998710 (pvData) Dimension 1: Elements in dimension = 3 Lower bound of dimension = 0 Example2.au3 prints information for 2D-arrays of integers, floats and strings, and prints the contents of the arrays through the data area of the safearray. pvData element of $tagSAFEARRAY structure is a pointer to the data area. Example3.au3 fills an existing array, $aArray[50000], with integers. Example4.au3 creates and fills an array with 50000 integers and assigns it to an uninitialized variable: $aArray (empty string). Assembler code Example5.au3 is the first small example with fasm code (fasm = flat assembler, more info about fasm in one of the next sections). A 1D-array with 2^24 (16,777,216) elements is filled with integers from zero to 2^24 - 1. The array is first filled through AutoIt code. Then AccessVariable is used to fill the corresponding safearray through fasm code. There are two versions of the fasm code: A 32 bit version and a 64 bit version. AutoIt code (Example5.au3): ;#AutoIt3Wrapper_UseX64=y #include "..\..\AccessingVariablesTest.au3" #include "..\..\..\Includes\ArrayDisplayEx.au3" #include "..\..\..\Includes\FasmUtils.au3" Opt( "MustDeclareVars", 1 ) Example5() Func Example5() ConsoleWrite( "Executing AutoIt code to fill array (~10 seconds) ..." & @CRLF ) Local $aArray1[2^24] ; 2^24 = 16,777,216, maximum number of elements for an array Local $hTimer1 = TimerInit() For $i = 0 To 2^24 - 1 $aArray1[$i] = $i Next ConsoleWrite( "Time for AutoIt code to fill array: " & TimerDiff( $hTimer1 ) & @CRLF & @CRLF ) _ArrayDisplayEx( $aArray1 ) $aArray1 = 0 ConsoleWrite( "Executing FillArray to fill array ..." & @CRLF ) Local $aArray2[2^24] ; 2^24 = 16,777,216, maximum number of elements for an array Local $hTimer4 = TimerInit() AccessVariable( FillArray, $aArray2 ) Local $fTime4 = TimerDiff( $hTimer4 ) ConsoleWrite( "Time for FillArray to fill array (outside FillArray): " & $fTime4 & @CRLF ) ConsoleWrite( "Time for FillArray to fill array: " & $fTime4 & @CRLF ) _ArrayDisplayEx( $aArray2 ) $aArray2 = 0 EndFunc Func FillArray( $pVariant ) Local $hTimer3 = TimerInit() ; Pointer to safearray Local $pData = $pVariant + 8 Local $tData = DllStructCreate( "ptr", $pData ) Local $pSafeArray = DllStructGetData( $tData, 1 ) ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; Get fasm code Static $sFasmCode = @AutoItX64 ? "0xB80000000066C70203008942084883C218FFC0E2F0C3" _ ; Example5-x64.asm : "0x5589E58B4D088B550CB80000000066C702030089420883C21040E2F25DC20800" ; Example5-x86.asm Static $pFasmCode = FasmGetBinaryString( $sFasmCode, 64 ) If Not $pFasmCode Then Exit ConsoleWrite( "$pFasmCode ERR" & @CRLF ) ; Execute fasm code Local $hTimer2 = TimerInit() DllCallAddress( "int", $pFasmCode, "int", 2^24, "ptr", $pSafeArrayData ) ConsoleWrite( "Time for FillArray to fill array (fasm code only): " & TimerDiff( $hTimer2 ) & @CRLF ) SafeArrayUnaccessData( $pSafeArray ) ConsoleWrite( "Time for FillArray to fill array (inside FillArray): " & TimerDiff( $hTimer3 ) & @CRLF ) EndFunc Note that the fasm code is executed inside FillArray function. And FillArray function is executed inside the $oAccessVariable.VariableToVariant method (in AccessingVariablesTest.au3). The pointer to the safearray data ($pSafeArrayData) is valid only inside this method. $pSafeArrayData is a pointer that points to the data area that contains the data of $aArray2. $pSafeArrayData however does not point directly to the same data as contained in $aArray2. Internal AutoIt conversions on function entry copies data from $aArray2 to the data area. Internal AutoIt conversions on function exit copies data from the data area to $aArray2. See next section. 32 bit fasm code (Example5-x86.asm): ; flat assembler code ; Translate AutoIt code to fasm code: ; For $i = 0 To 2^24 - 1 ; $aArray[$i] = $i ; Next ; Parameters: ; [ebp + 08] : iRows ; First parameter ; [ebp + 12] : pSafeArrayData ; Second parameter ; Init directive use32 ; 32 bit code ; Entry code push ebp ; Store base pointer on stack mov ebp, esp ; Use stack pointer as base pointer ; Function code mov ecx, [ebp + 08] ; ecx corresponds to 2^24 in "For $i = 0 To 2^24 - 1" mov edx, [ebp + 12] ; edx is pointer in safearray data area mov eax, 0 ; eax = 0, eax corresponds to $i iLoop: mov [edx], word 3 ; Set vt element in variant to 3 (VT_I4, integer) mov [edx + 08], eax ; Set data element in variant to eax ($i) add edx, 16 ; Add size of variant structure to edx inc eax ; eax += 1, corresponds to $i += 1 loop iLoop ; ecx -= 1, jump to iLoop if not zero ; Exit code pop ebp ; Restore base pointer from stack ret 08 ; Return and cleanup stack 64 bit fasm code (Example5-x64.asm): ; flat assembler code ; Translate AutoIt code to fasm code: ; For $i = 0 To 2^24 - 1 ; $aArray[$i] = $i ; Next ; Parameters: ; rcx : iRows ; First parameter, ecx corresponds to 2^24 in "For $i = 0 To 2^24 - 1" ; rdx : pSafeArrayData ; Second parameter, rdx is pointer in safearray data area ; Init directive use64 ; 64 bit code ; Function code mov eax, 0 ; eax = 0, eax corresponds to $i iLoop: mov [rdx], word 3 ; Set vt element in variant to 3 (VT_I4, integer) mov [rdx + 08], eax ; Set data element in variant to eax ($i) add rdx, 24 ; Add size of variant structure to rdx inc eax ; eax += 1, corresponds to $i += 1 loop iLoop ; ecx -= 1, jump to iLoop if not zero ; Exit code ret ; Return Output in SciTE console: Executing AutoIt code to fill array (~10 seconds) ... Time for AutoIt code to fill array: 9033.87383563625 Executing FillArray to fill array ... Time for FillArray to fill array (fasm code only): 28.5154490311906 Time for FillArray to fill array (inside FillArray): 28.6592369763861 Time for FillArray to fill array (outside FillArray): 2388.37594979003 Time for FillArray to fill array: 2388.37594979003 Why is there such a big difference in the time it takes to execute FillArray when the time is measured inside and outside the function? Internal conversions In "Obj/COM Reference" chapter, "COM Events" section and "Limitations on COM Events in AutoIt" subsection in AutoIt Help file you can find the following sentence: "... AutoIt uses its own variable scheme, which is not compatible to COM variables. This means that all values from Objects need to be converted into AutoIt variables ...". In the AutoIt website you can find small bits of information like this one. These internal conversions takes place between native AutoIt data types and COM data types, when AutoIt variables are passed to object methods as function parameters, and when COM variables are returned to AutoIt. There are two sets of conversions. Conversions on function entry (object method entry), and conversions on function exit. The previous section ended with this question: Why is there such a big difference in the time it takes to execute FillArray when the time is measured inside and outside the function (FillArray is executed inside the object method)? The large time difference is caused by the conversions. The conversions are performed by internal AutoIt code and Windows API functions. Both consists of compiled C++ code. Judging from the time the conversions takes (about 2.5 seconds on my PC), they seem to perform a complete (by value) copy of the entire array. The array with 16,777,216 integers. Even for compiled C++ code it takes time to copy such a large array. Example1.au3 ("Tests\Examples\3) Internal conversions\") shows how long time the conversions takes: ;#AutoIt3Wrapper_UseX64=y #include "..\..\AccessingVariablesTest.au3" #include "..\..\..\Includes\ArrayDisplayEx.au3" Opt( "MustDeclareVars", 1 ) Example1() Func Example1() ConsoleWrite( "Filling array of 16,777,216 integers (~10 seconds) ..." & @CRLF ) Local $aArray1[2^24] ; 2^24 = 16,777,216, maximum number of elements for an array For $i = 0 To 2^24 - 1 $aArray1[$i] = 1234 Next Local $hTimer = TimerInit() AccessVariable( ConversionTime, $aArray1 ) ConsoleWrite( "Time for conversion code to execute: " & TimerDiff( $hTimer ) & @CRLF & @CRLF ) _ArrayDisplayEx( $aArray1 ) $aArray1 = 0 ConsoleWrite( "Filling array of 16,777,216 doubles (~10 seconds) ..." & @CRLF ) Local $aArray2[2^24] ; 2^24 = 16,777,216, maximum number of elements for an array For $i = 0 To 2^24 - 1 $aArray2[$i] = 1234.5678 Next $hTimer = TimerInit() AccessVariable( ConversionTime, $aArray2 ) ConsoleWrite( "Time for conversion code to execute: " & TimerDiff( $hTimer ) & @CRLF & @CRLF ) _ArrayDisplayEx( $aArray2 ) $aArray2 = 0 ConsoleWrite( "Filling array of 1,048,576 100-chars strings (~5 seconds) ..." & @CRLF ) Local $aArray3[2^20] ; 2^20 = 1,048,576 For $i = 0 To 2^20 - 1 $aArray3[$i] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ; 100 chars Next $hTimer = TimerInit() AccessVariable( ConversionTime, $aArray3 ) ConsoleWrite( "Time for conversion code to execute: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray3 ) $aArray3 = 0 EndFunc ; Because this is an empty function the time measured above ; is the total time for all conversions of one array parameter. Func ConversionTime( $pVariant ) EndFunc Output in SciTE console: Filling array of 16,777,216 integers (~10 seconds) ... Time for conversion code to execute: 4303.24786930952 Filling array of 16,777,216 doubles (~10 seconds) ... Time for conversion code to execute: 4341.52716013949 Filling array of 1,048,576 100-chars strings (~5 seconds) ... Time for conversion code to execute: 2416.14925416137 Because 16,777,216 elements is the maximum number of elements in an array, the conversions will never take longer than 4.5 seconds on my PC for an array of integers or doubles. The time is about the same for integers and doubles because they are both stored as variants. A variant takes up 16 bytes when you're running 32 bit whether the variant contains a 4 bytes integer or an 8 bytes double. Why did the conversions in the previous section only take 2.5 seconds on my PC? Only about half as much time. I can only guess that this must be caused by the fact that this was an uninitialized array. And for an uninitialized array the conversions on function entry seems to be much faster. Conversions of an array of strings takes longer time. The variants which contains pointers to the strings has to be copied. And the strings (BSTRs) themselves has to be copied. That's the reason why the number of strings is limited to about 1,000,000. Still a decent number of strings. Although the assembler, C, C++, C# or FreeBasic code is lightning fast, the conversions especially for very large arrays means that the total execution time for the entire function (FillArray in the example in the previous section) will be increased with a few seconds. On the other hand we need the conversions. We don't want the array to be returned as a safearray contained in a variant. We want the array to be returned as a native AutoIt array. Exploiting conversions As I wrote in first section I've been playing with RectToVariant method of the UIAutomation object. In Remarks section in the link you can read this sentence: "The returned VARIANT has a data type of VT_ARRAY | VT_R8." (= VT_ARRAY + VT_R8). But this does not match the internal implementation of an AutoIt array which is VT_ARRAY + VT_VARIANT. Because RectToVariant returns a perfect AutoIt array this must mean that the conversion code also inspects the variant array type and converts it to a VT_ARRAY + VT_VARIANT type if necessary. I've tested that variants of types VT_ARRAY+VT_I4 (integers), VT_ARRAY+VT_R8 (doubles) and VT_ARRAY+VT_BSTR (strings) are properly converted to variants of type VT_ARRAY+VT_VARIANT. Rememeber that a variant of type VT_ARRAY+VT_I4 is a variant which contains a safearray (VT_ARRAY), where the pvData element of the safearray structure points to a memory area which contains a continuous row of integers (VT_I4). What is a continuous row of integers? Well, in AutoIt you create a continuous row of integers with DllStructCreate like this: Local $tIntegers = DllStructCreate( "int[50000]" ) This is a continuous row of 50000 integers. This means that if you are manipulating an array of integers in your assembler, C, C++, C# or FreeBasic code, you don't have to mess around with variant structures containing integers. You can simply use an array of integers. When you've finished the array manipulations you can store the integers as a fairly simple VT_ARRAY+VT_I4 variant (safearray of integers). And then you can leave it to the conversion code on function exit to convert the variant to a VT_ARRAY+VT_VARIANT variant (safearray of variants) which is understandable by AutoIt. And in fact, all these safearray data types are correctly converted to safearrays of variants: $VT_I2, $VT_I4, $VT_R4, $VT_R8, $VT_BSTR, $VT_BOOL, $VT_UI4, $VT_UI8 Example2a/b/c.au3, Example3a/b/c.au3 and Example4a/b/c.au3 demonstrates this technique in three slightly different ways for integers, doubles and strings. These techniques are needed in the assembler, C, C++, C# or FreeBasic code. Note that the examples are based on the final UDF and not the test UDF. See next section. This is Example2a.au3: ;#AutoIt3Wrapper_UseX64=y #include "..\..\..\Includes\AccessingVariables.au3" ; <<<< Final UDF (not test UDF) >>>> #include "..\..\..\Includes\InspectVariable.au3" #include <Array.au3> Opt( "MustDeclareVars", 1 ) Example2() Func Example2() Local $aArray ; Empty string ConsoleWrite( "--- InspectVariable ---" & @CRLF ) InspectVariable( $aArray ) ; $aArray is an empty string AccessVariables01( CreateArray, $aArray ) ConsoleWrite( "--- InspectVariable ---" & @CRLF ) InspectVariable( $aArray ) ; $aArray is an array ConsoleWrite( "--- InspectArray ---" & @CRLF ) InspectArray( $aArray ) _ArrayDisplay( $aArray ) EndFunc Func CreateArray( $pVariant ) ; --- Create and fill structure of integers --- ; Create structure Local $tIntegers = DllStructCreate( "int[50000]" ) Local $pIntegers = DllStructGetPtr( $tIntegers ) ; Fill structure ; Array manipulation For $i = 0 To 50000 - 1 DllStructSetData( $tIntegers, 1, $i, $i + 1 ) Next ; --- Create and fill safearray --- ; Create safearray Local $tSafeArrayBound = DllStructCreate( $tagSAFEARRAYBOUND ) DllStructSetData( $tSafeArrayBound, "cElements", 50000 ) ; Number of elements in array DllStructSetData( $tSafeArrayBound, "lLbound", 0 ) ; Lower bound of array index Local $pSafeArray = SafeArrayCreate( $VT_I4, 1, $tSafeArrayBound ) ; <<<< Not a proper AutoIt safearray >>>> ; This is a safearray of integers and not variants as a usual AutoIt array ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; Create structure from safearray data area Local $tSafeArrayBytes = DllStructCreate( "byte[200000]", $pSafeArrayData ) ; Fill safearray data area with data from $tIntegers DllStructSetData( $tSafeArrayBytes, 1, DllStructGetData( DllStructCreate( "byte[200000]", $pIntegers ), 1 ) ) ; This technique only works with byte's, char's and wchar's SafeArrayUnaccessData( $pSafeArray ) ; --- Set variant to match an array of integers --- ; Set vt element to $VT_ARRAY + $VT_I4 Local $tvt = DllStructCreate( "word", $pVariant ) DllStructSetData( $tvt, 1, $VT_ARRAY + $VT_I4 ) ; <<<< Not a proper AutoIt array >>>> ; This is an array of integers and not variants as a usual AutoIt array ; Set data element to safearray pointer Local $pData = $pVariant + 8 Local $tData = DllStructCreate( "ptr", $pData ) DllStructSetData( $tData, 1, $pSafeArray ) ; <<<< On function exit the safearray contained in a variant is converted to a native AutoIt array >>>> EndFunc This is output in SciTE console. The array is displayed with _ArrayDisplay. --- InspectVariable --- ptr = 0x00D0E698 ($pVariant) vt = 0x0008 (VT_BSTR, basic string) data = --- InspectVariable --- ptr = 0x02B78028 ($pVariant) vt = 0x200C (VT_ARRAY+VT_VARIANT, array of variants, safearray) data = 0x00CAB170 (pointer to safearray) --- InspectArray --- Number of dimensions = 1 Features flags = 0x00000880 ($FADF_VARIANT+$FADF_HAVEVARTYPE, array of variants) Variant type = 0x000C (VT_VARIANT, variant data type) Size of array element (bytes) = 16 (size of the variant structure) Number of locks = 0 Pointer to data = 0x02EF0020 (pvData) Dimension 1: Elements in dimension = 50000 Lower bound of dimension = 0 Avoiding conversions For large arrays conversions may take quite some time. The conversions cannot be avoided, but in some situations they can be limited. Eg. a large array with 10 columns to sort by four columns (like the details view in Windows Explorer can be sorted by name, date, type and size). In this situation four indexes can be used to implement the sorting. And because it's a large array the indexes should be created with compiled code. Instead of converting the large array four times (once for each index), it would be much better to get a pointer to the safearray, and then reuse this pointer for each index. It'll only require one conversion of the large array to get a pointer to the safearray. For this purpose two functions in Includes\AccVarsUtilities.au3 can be used: AccVars_ArrayToSafeArray which creates a pointer to a safearray from a native AutoIt array, and AccVars_SafeArrayToArray which creates a native AutoIt array from a pointer to a safearray. More about these functions i a later section. Example5.au3 shows how long time it takes for the two functions to create a safearray and an array: ;#AutoIt3Wrapper_UseX64=y #include "..\..\..\Includes\AccessingVariables.au3" ; <<<< Final UDF (not test UDF) >>>> #include "..\..\..\Includes\AccVarsUtilities.au3" #include "..\..\..\Includes\ArrayDisplayEx.au3" Opt( "MustDeclareVars", 1 ) Example5() Func Example5() ; --- Array of integers --- ConsoleWrite( "Filling array of 16,777,216 integers (~10 seconds) ..." & @CRLF ) Local $aArray1[2^24] ; 2^24 = 16,777,216, maximum number of elements for an array For $i = 0 To 2^24 - 1 $aArray1[$i] = 1234 Next Local $pSafeArray1 Local $hTimer = TimerInit() AccVars_ArrayToSafeArray( $aArray1, $pSafeArray1 ) ConsoleWrite( "Time for AccVars_ArrayToSafeArray to execute: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray1 ) $aArray1 = 0 Local $aArray2 $hTimer = TimerInit() AccVars_SafeArrayToArray( $pSafeArray1, $aArray2 ) ConsoleWrite( "Time for AccVars_SafeArrayToArray to execute: " & TimerDiff( $hTimer ) & @CRLF & @CRLF ) _ArrayDisplayEx( $aArray2 ) $aArray2 = 0 ; --- Array of doubles --- ConsoleWrite( "Filling array of 16,777,216 doubles (~10 seconds) ..." & @CRLF ) Local $aArray3[2^24] ; 2^24 = 16,777,216, maximum number of elements for an array For $i = 0 To 2^24 - 1 $aArray3[$i] = 1234.5678 Next Local $pSafeArray3 $hTimer = TimerInit() AccVars_ArrayToSafeArray( $aArray3, $pSafeArray3 ) ConsoleWrite( "Time for AccVars_ArrayToSafeArray to execute: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray3 ) $aArray3 = 0 Local $aArray4 $hTimer = TimerInit() AccVars_SafeArrayToArray( $pSafeArray3, $aArray4 ) ConsoleWrite( "Time for AccVars_SafeArrayToArray to execute: " & TimerDiff( $hTimer ) & @CRLF & @CRLF ) _ArrayDisplayEx( $aArray4 ) $aArray4 = 0 ; --- Array of strings --- ConsoleWrite( "Filling array of 1,048,576 100-chars strings (~5 seconds) ..." & @CRLF ) Local $aArray5[2^20] ; 2^20 = 1,048,576 For $i = 0 To 2^20 - 1 $aArray5[$i] = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" ; 100 chars Next Local $pSafeArray5 $hTimer = TimerInit() AccVars_ArrayToSafeArray( $aArray5, $pSafeArray5 ) ConsoleWrite( "Time for AccVars_ArrayToSafeArray to execute: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray5 ) $aArray5 = 0 Local $aArray6 $hTimer = TimerInit() AccVars_SafeArrayToArray( $pSafeArray5, $aArray6 ) ConsoleWrite( "Time for AccVars_SafeArrayToArray to execute: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray6 ) $aArray6 = 0 EndFunc Output in SciTE console: Filling array of 16,777,216 integers (~10 seconds) ... Time for AccVars_ArrayToSafeArray to execute: 4493.62536677101 Time for AccVars_SafeArrayToArray to execute: 1164.59904458766 Filling array of 16,777,216 doubles (~10 seconds) ... Time for AccVars_ArrayToSafeArray to execute: 4549.6914981711 Time for AccVars_SafeArrayToArray to execute: 1159.73609940987 Filling array of 1,048,576 100-chars strings (~5 seconds) ... Time for AccVars_ArrayToSafeArray to execute: 2419.86058615209 Time for AccVars_SafeArrayToArray to execute: 675.048988223156 Note that a consequence of the conversions is that the input safearray for AccVars_SafeArrayToArray is deleted. If you need to use the same safearray several times you must make a copy of the safearray with SafeArrayCopy function in Includes\SafeArray.au3. In the example with fasm code in previous section we got this result: Time for FillArray to fill array: 2388.37594979003 In top of post we got this result for more or less the same code: Applied time to create and fill array (UDF and fasm): 797.855906880413 Three times as fast. This is a consequence of limiting conversions. In a few situations it may be possible to completely avoid conversions. Eg. if the data will be used to fill the rows in a virtual listview. In a virtual listview rows are filled through $LVN_GETDISPINFOW notifications. And for $LVN_GETDISPINFOW notifications it doesn't matter whether the data source is a native AutoIt array or the data structure in a safearray. Final UDF The whole idea of this UDF is to utilize the information we already know: We know that COM objects and methods are working very well in AutoIt. We also know that the only variable type as COM object methods are familiar with is variants (only completely true for IDispatch based objects and objects of Automation compatible types). But how is it possible for an object method to handle variables that are passed to the method as native AutoIt variables, when the only variable type as COM object methods are familiar with is variants? The only explanation is that native AutoIt input parameters must be converted to variants immediately before the method code is executed, and that variant output parameters must be converted to native AutoIt variables immediately after the method code has finished. These conversions must be carried out by internal AutoIt code. The final UDF (Includes\AccessingVariables.au3) makes it possible to pass native AutoIt arrays and simple variables as parameters to a function coded in another language eg. assembler, C, C++, C# or FreeBasic. This is done by executing the function inside an object method and passing the array and variable parameters as variant pointers. Internal AutoIt conversions ensures that AutoIt variables outside the method are properly converted to COM variants inside the method. And the other way around. In the test UDF (Tests\AccessingVariablesTest.au3) only one AutoIt variable is passed to the object method by AccessVariable function. The final UDF contains 30 functions named AccessVariables01 - AccessVariables30 where the number indicates the number of AutoIt variables passed to the object method. Manipulating AutoIt variables in another language (a compiled language) is especially relevant for arrays with a large number of elements, or smaller arrays where complex calculations are performed on the elements. AccessVariablesXY To use the UDF you call one of the AccessVariablesXY functions eg. AccessVariables01. AccessVariables01 is coded in this way: Func AccessVariables01( $hAccVars_Method, ByRef $vVariable01 ) $hAccVars_MethodFunc = $hAccVars_Method $oAccVars_Object.AccVars_VariableToVariant01( $vVariable01 ) EndFunc The first parameter is a function type parameter (the name of an AutoIt function). You must code this function yourself. The function is assigned to the global variable $hAccVars_MethodFunc. The second parameter is an AutoIt variable. Typically an array. This parameter is passed to the AccVars_VariableToVariant01 object method. AccessVariables01 is just a wrapper function to make it easier to call the object method. The description string for the object method looks like this: "AccVars_VariableToVariant01 hresult(variant*);" The AutoIt variable is passed to the method as a variant pointer. And the method is coded in this way: Func AccVars_VariableToVariant01( $pSelf, $pVariant01 ) $hAccVars_MethodFunc( $pVariant01 ) Return 0 ; $S_OK (COM constant) #forceref $pSelf EndFunc The first parameter $pSelf must be a pointer to the object $oAccVars_Object. This is a COM rule. The second parameter is the AutoIt variable you passed to the AccessVariables01 function. But inside AccVars_VariableToVariant01 this is not an AutoIt variable any more. Inside AccVars_VariableToVariant01 it's a pointer to a variant. Inside AccVars_VariableToVariant01 the $hAccVars_MethodFunc is called and the variant pointer is passed as a parameter. $hAccVars_MethodFunc is the function you passed to AccessVariables01. If you passed a native AutoIt array to AccessVariables01, you can extract this array as a pointer to a safearray inside $hAccVars_MethodFunc. And this pointer or a pointer directly to the safearray data area you can pass to a function coded in assembler, C, C++, C# or FreeBasic. When $hAccVars_MethodFunc is finished zero is returned to indicate that everything is OK. Restrictions Because the $vVariableXY parameters in AccessVariablesXY functions are ByRef parameters you cannot pass literal values as parameters. You must store the literal value in a variable and pass the variable. You cannot call an AccessVariablesXY function inside another AccessVariablesXY function. No nested function calls. This also means that you cannot call InspectVariable or InspectArray inside an AccessVariablesXY function. But you can call InspectSafeArray. See InspectVariable section below for info about Inspect-functions. Utility funcs Typically arrays are passed to the object methods. But this does not exclude the need to pass simple variables to the object methods. Eg. the number of rows and columns in the arrays. Simple variables are also passed to object methods as variant pointers. In most cases you probably want to treat simple variables as native AutoIt variables inside object methods and not as variant pointers. AccVars_VariantToVariable (Includes\AccVarsUtilities.au3) converts variant pointers to native AutoIt variables. Arrays are not converted. See "Examples\Demo examples\4) Other demo examples\2) Multiple parameters\Example1.au3". AccVars_VariableToVariant converts native AutoIt variables to variant pointers. Arrays are not converted. See "Examples\Demo examples\4) Other demo examples\6) Using the UDF\Example6.au3" AccVars_ArrayToSafeArray and AccVars_SafeArrayToArray are already mentioned above. AccVars_ArrayToSafeArray creates a pointer to a safearray from a native AutoIt array. AccVars_SafeArrayToArray creates a native AutoIt array from a pointer to a safearray. "Examples\Demo examples\4) Other demo examples\4) ArrayToSafearray\" includes a few examples of AccVars_ArrayToSafeArray. "Examples\Demo examples\4) Other demo examples\5) SafearrayToArray\" includes a few examples of AccVars_SafeArrayToArray. In both folders Example1.au3 shows how everything can be done manually without using the two functions. And Example2.au3 shows how it can be done using the two functions. Note that a consequence of the conversions is that the input safearray for AccVars_SafeArrayToArray is deleted. If you need to use the same safearray several times you must make a copy of the safearray with SafeArrayCopy function in Includes\SafeArray.au3. InspectVariable Includes\InspectVariable.au3 contains three functions: InspectVariable (corresponds to InspectVariableMtd), InspectArray (corresponds to InspectVariableMtd) and InspectSafeArray. The first two are used in many of the test examples. The last is used in the examples for AccVars_ArrayToSafeArray and AccVars_SafeArrayToArray. InspectVariable and InspectArray takes AutoIt variables as input parameters and prints information about the variables in SciTE console after they have been converted to variants. InspectSafeArray prints information about safearrays in SciTE console. Using the UDF Here are six small scripts which shows how to use the UDF. You can use these scripts as templates for your own code. The scripts are saved in "Examples\Demo examples\4) Other demo examples\6) Using the UDF\". The first four scripts is about creating and filling a new array. The array is in all cases a 1D-array with 2^24 (16,777,216) integer elements. In Example1.au3 an AutoIt integer structure is filled with data, the data in the structure is copied into a safearray which is converted to a native AutoIt array: ;#AutoIt3Wrapper_UseX64=y #include "..\..\..\..\Includes\AccVarsUtilities.au3" #include "..\..\..\..\Includes\ArrayDisplayEx.au3" #include "..\..\..\..\Includes\FasmUtils.au3" Opt( "MustDeclareVars", 1 ) Example1() Func Example1() Local $hTimer = TimerInit() ; --- Create and fill structure of integers --- ; Create structure of integers Local $tIntegers = DllStructCreate( "int[" & 2^24 & "]" ) ; 2^24 = 16,777,216 elements Local $pIntegers = DllStructGetPtr( $tIntegers ) ; AutoIt code ;For $i = 0 To 2^24 - 1 ; DllStructSetData( $tIntegers, 1, $i, $i + 1 ) ;Next ; <<<< Execute your assembler, C, C++, C# or FreeBasic code at this point >>>> ; Get fasm code Local $sFasmCode = @AutoItX64 ? "0xB80000000089024883C204FFC0E2F6C3" _ ; Example1-x64.asm : "0x5589E58B4D088B550CB800000000890283C20440E2F85DC20800" ; Example1-x86.asm Local $pFasmCode = FasmGetBinaryString( $sFasmCode, 64 ) If Not $pFasmCode Then Return ConsoleWrite( "$pFasmCode ERR" & @CRLF ) ; Execute fasm code to fill structure DllCallAddress( "int", $pFasmCode, "int", 2^24, "ptr", $pIntegers ) ; --- Create and fill safearray --- ; Create safearray Local $tSafeArrayBound = DllStructCreate( $tagSAFEARRAYBOUND ) DllStructSetData( $tSafeArrayBound, "cElements", 2^24 ) ; Number of elements in array DllStructSetData( $tSafeArrayBound, "lLbound", 0 ) ; Lower bound of array index Local $pSafeArray = SafeArrayCreate( $VT_I4, 1, $tSafeArrayBound ) ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; Create structure from safearray data area Local $tSafeArrayBytes = DllStructCreate( "byte[" & 4 * 2^24 & "]", $pSafeArrayData ) ; Fill safearray data area with data from $tIntegers DllStructSetData( $tSafeArrayBytes, 1, DllStructGetData( DllStructCreate( "byte[" & 4 * 2^24 & "]", $pIntegers ), 1 ) ) ; This technique only works with byte's, char's and wchar's SafeArrayUnaccessData( $pSafeArray ) $tIntegers = 0 ; --- Convert safearray to native AutoIt array --- Local $aArray AccVars_SafeArrayToArray( $pSafeArray, $aArray ) ConsoleWrite( "Time to fill array: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray ) $aArray = 0 EndFunc ; Time to fill array: 939.174260660843 This example is simple because you're not dealing with variants or safearrays at all in your assembler, C, C++, C# or FreeBasic code. In Example2.au3 the data area of a safearray is directly filled with integers and the safearray is converted to a native AutoIt array: ;#AutoIt3Wrapper_UseX64=y #include "..\..\..\..\Includes\AccVarsUtilities.au3" #include "..\..\..\..\Includes\ArrayDisplayEx.au3" #include "..\..\..\..\Includes\FasmUtils.au3" Opt( "MustDeclareVars", 1 ) Example2() Func Example2() Local $hTimer = TimerInit() ; --- Create and fill safearray --- ; Create safearray Local $tSafeArrayBound = DllStructCreate( $tagSAFEARRAYBOUND ) DllStructSetData( $tSafeArrayBound, "cElements", 2^24 ) ; Number of elements in array DllStructSetData( $tSafeArrayBound, "lLbound", 0 ) ; Lower bound of array index Local $pSafeArray = SafeArrayCreate( $VT_I4, 1, $tSafeArrayBound ) ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; AutoIt code ;For $i = 0 To 2^24 - 1 ; DllStructSetData( $tSafeArrayData, 1, $i, $i + 1 ) ;Next ; <<<< Execute your assembler, C, C++, C# or FreeBasic code at this point >>>> ; Get fasm code Local $sFasmCode = @AutoItX64 ? "0xB80000000089024883C204FFC0E2F6C3" _ ; Example1-x64.asm : "0x5589E58B4D088B550CB800000000890283C20440E2F85DC20800" ; Example1-x86.asm Local $pFasmCode = FasmGetBinaryString( $sFasmCode, 64 ) If Not $pFasmCode Then Exit ConsoleWrite( "$pFasmCode ERR" & @CRLF ) ; Execute fasm code to fill safearray DllCallAddress( "int", $pFasmCode, "int", 2^24, "ptr", $pSafeArrayData ) SafeArrayUnaccessData( $pSafeArray ) ; --- Convert safearray to native AutoIt array --- Local $aArray AccVars_SafeArrayToArray( $pSafeArray, $aArray ) ConsoleWrite( "Time to fill array: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray ) $aArray = 0 EndFunc ; Time to fill array: 805.347826773543 Example2 is more efficient than Example1 because you're avoiding the integer structure. The conversion in Example3.au3 is not performed with AccVars_SafeArrayToArray but with your own SafeArrayToArray method function which is executed through AccessVariables02: ;#AutoIt3Wrapper_UseX64=y #include "..\..\..\..\Includes\AccVarsUtilities.au3" #include "..\..\..\..\Includes\ArrayDisplayEx.au3" #include "..\..\..\..\Includes\FasmUtils.au3" Opt( "MustDeclareVars", 1 ) Example3() Func Example3() Local $hTimer = TimerInit() ; --- Create and fill safearray --- ; Create safearray Local $tSafeArrayBound = DllStructCreate( $tagSAFEARRAYBOUND ) DllStructSetData( $tSafeArrayBound, "cElements", 2^24 ) ; Number of elements in array DllStructSetData( $tSafeArrayBound, "lLbound", 0 ) ; Lower bound of array index Local $pSafeArray = SafeArrayCreate( $VT_I4, 1, $tSafeArrayBound ) ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; AutoIt code ;For $i = 0 To 2^24 - 1 ; DllStructSetData( $tSafeArrayData, 1, $i, $i + 1 ) ;Next ; <<<< Execute your assembler, C, C++, C# or FreeBasic code at this point >>>> ; Get fasm code Local $sFasmCode = @AutoItX64 ? "0xB80000000089024883C204FFC0E2F6C3" _ ; Example1-x64.asm : "0x5589E58B4D088B550CB800000000890283C20440E2F85DC20800" ; Example1-x86.asm Local $pFasmCode = FasmGetBinaryString( $sFasmCode, 64 ) If Not $pFasmCode Then Exit ConsoleWrite( "$pFasmCode ERR" & @CRLF ) ; Execute fasm code to fill safearray DllCallAddress( "int", $pFasmCode, "int", 2^24, "ptr", $pSafeArrayData ) SafeArrayUnaccessData( $pSafeArray ) ; --- Convert safearray to native AutoIt array --- Local $aArray AccessVariables02( SafeArrayToArray, $pSafeArray, $aArray ) ConsoleWrite( "Time to fill array: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray ) $aArray = 0 EndFunc Func SafeArrayToArray( $pSafeArray, $pArray ) ; --- Set $pArray to match an AutoIt array --- ; Set vt element to $VT_ARRAY + $VT_VARIANT DllStructSetData( DllStructCreate( "word", $pArray ), 1, $VT_ARRAY + $VT_VARIANT ) ; Set data element to safearray pointer DllStructSetData( DllStructCreate( "ptr", $pArray + 8 ), 1, AccVars_VariantToVariable( $pSafeArray ) ) ; <<<< On function exit $pArray (safearray contained in a variant) is converted to an AutoIt array >>>> EndFunc ; Time to fill array: 800.813455228795 Example3 is a more general example than Example2. Creation of the safearray is moved from AutoIt code to your assembler, C, C++, C# or FreeBasic code in Example4.au3: ;#AutoIt3Wrapper_UseX64=y #include "..\..\..\..\Includes\AccessingVariables.au3" #include "..\..\..\..\Includes\ArrayDisplayEx.au3" #include "..\..\..\..\Includes\FasmUtils.au3" Opt( "MustDeclareVars", 1 ) Example4() Func Example4() ; --- Create and fill array --- Local $aArray Local $hTimer = TimerInit() AccessVariables01( CreateArray, $aArray ) ConsoleWrite( "Time to fill array: " & TimerDiff( $hTimer ) & @CRLF ) _ArrayDisplayEx( $aArray ) $aArray = 0 EndFunc Func CreateArray( $pArray ) ; --- Create and fill safearray --- ; <<<< Execute your assembler, C, C++, C# or FreeBasic code at this point >>>> ; Create safearray Local $tSafeArrayBound = DllStructCreate( $tagSAFEARRAYBOUND ) DllStructSetData( $tSafeArrayBound, "cElements", 2^24 ) ; Number of elements in array DllStructSetData( $tSafeArrayBound, "lLbound", 0 ) ; Lower bound of array index Local $pSafeArray = SafeArrayCreate( $VT_I4, 1, $tSafeArrayBound ) ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; AutoIt code ;For $i = 0 To 2^24 - 1 ; DllStructSetData( $tSafeArrayData, 1, $i, $i + 1 ) ;Next ; Get fasm code Local $sFasmCode = @AutoItX64 ? "0xB80000000089024883C204FFC0E2F6C3" _ ; Example1-x64.asm : "0x5589E58B4D088B550CB800000000890283C20440E2F85DC20800" ; Example1-x86.asm Local $pFasmCode = FasmGetBinaryString( $sFasmCode, 64 ) If Not $pFasmCode Then Exit ConsoleWrite( "$pFasmCode ERR" & @CRLF ) ; Execute fasm code to fill safearray DllCallAddress( "int", $pFasmCode, "int", 2^24, "ptr", $pSafeArrayData ) SafeArrayUnaccessData( $pSafeArray ) ; --- Set $pArray to match an AutoIt array --- ; Set vt element to $VT_ARRAY + $VT_VARIANT DllStructSetData( DllStructCreate( "word", $pArray ), 1, $VT_ARRAY + $VT_VARIANT ) ; Set data element to safearray pointer DllStructSetData( DllStructCreate( "ptr", $pArray + 8 ), 1, $pSafeArray ) ; <<<< On function exit $pArray (safearray contained in a variant) is converted to an AutoIt array >>>> EndFunc ; Time to fill array: 799.20854202792 If you code in assembler it's more advantageous to create the safearray in AutoIt code. The last two scripts is about manipulating an existing array. In both scripts a 1D-array with 2^23 (8,388,608) random integers is searched to find the minimum and maximum value. In Example5.au3 AccVars_ArrayToSafeArray is used to convert the AutoIt array to a safearray: ;#AutoIt3Wrapper_UseX64=y #include "..\..\..\..\Includes\AccVarsUtilities.au3" ;#include "..\..\..\..\Includes\InspectVariable.au3" #include "..\..\..\..\Includes\ArrayDisplayEx.au3" #include "..\..\..\..\Includes\FasmUtils.au3" Opt( "MustDeclareVars", 1 ) Example5() Func Example5() ; --- Create test array of random integers --- ConsoleWrite( "Create test array (~10 seconds) ..." & @CRLF ) Local $aArray[2^23] ; 2^23 = 8,388,608 For $i = 0 To 2^23 - 1 $aArray[$i] = Random( 0, 2^31-1, 1 ) Next _ArrayDisplayEx( $aArray ) ; --- Convert native AutoIt array to safearray --- Local $hTimer = TimerInit() Local $pSafeArray AccVars_ArrayToSafeArray( $aArray, $pSafeArray ) ;InspectSafeArray( $pSafeArray ) ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; --- Test safearray for min/max values --- ; AutoIt code ;Local $iMin1 = 2^31-1, $iMax1 = 0 ;For $i = 0 To 2^23 - 1 ; If $aArray[$i] < $iMin1 Then $iMin1 = $aArray[$i] ; If $aArray[$i] > $iMax1 Then $iMax1 = $aArray[$i] ;Next ; <<<< Execute your assembler, C, C++, C# or FreeBasic code at this point >>>> ; $iMin, $iMax storage for fasm code Local $tMinMax = DllStructCreate( "int iMin;int iMax" ) DllStructSetData( $tMinMax, "iMin", 2^31-1 ) DllStructSetData( $tMinMax, "iMax", 0 ) Local $pMinMax = DllStructGetPtr( $tMinMax ) ; iMin = $pMinMax, iMax = $pMinMax + 4 (int = 4 bytes) ; Get fasm code Static $sFasmCode = @AutoItX64 ? "0x4D8B4804418B003B420876038B4208443B4A087304448B4A084883C218E2E841890045894804C3" _ ; Example5-x64.asm : "0x5589E58B4D088B550C8B45108B58048B003B420876038B42083B5A0873038B5A0883C210E2EB8B55108902895A045DC20C00" ; Example5-x86.asm Static $pFasmCode = FasmGetBinaryString( $sFasmCode, 64 ) If Not $pFasmCode Then Exit ConsoleWrite( "$pFasmCode ERR" & @CRLF ) ; Execute fasm code DllCallAddress( "int", $pFasmCode, "int", 2^23, "ptr", $pSafeArrayData, "ptr", $pMinMax ) ConsoleWrite( "$iMin, $iMax = " & DllStructGetData( $tMinMax, "iMin" ) & ", " & DllStructGetData( $tMinMax, "iMax" ) & @CRLF ) ConsoleWrite( "Time to test array: " & TimerDiff( $hTimer ) & @CRLF ) SafeArrayDestroy( $pSafeArray ) $aArray = 0 EndFunc ; $iMin, $iMax = 262, 2147483599 ; Time to test array: 2293.62874670214 In Example6.au3 the conversion is done in your own TestArray method function which is executed through AccessVariables03: ;#AutoIt3Wrapper_UseX64=y #include "..\..\..\..\Includes\AccVarsUtilities.au3" #include "..\..\..\..\Includes\ArrayDisplayEx.au3" #include "..\..\..\..\Includes\FasmUtils.au3" Opt( "MustDeclareVars", 1 ) Example6() Func Example6() ; --- Create test array of random integers --- ConsoleWrite( "Create test array (~10 seconds) ..." & @CRLF ) Local $aArray[2^23] ; 2^23 = 8,388,608 For $i = 0 To 2^23 - 1 $aArray[$i] = Random( 0, 2^31-1, 1 ) Next _ArrayDisplayEx( $aArray ) ; --- Test array for min/max values --- ; AutoIt code ;Local $iMin1 = 2^31-1, $iMax1 = 0 ;For $i = 0 To 2^23 - 1 ; If $aArray[$i] < $iMin1 Then $iMin1 = $aArray[$i] ; If $aArray[$i] > $iMax1 Then $iMax1 = $aArray[$i] ;Next Local $hTimer = TimerInit() Local $iMin = 2^31-1, $iMax = 0 AccessVariables03( TestArray, $aArray, $iMin, $iMax ) ConsoleWrite( "$iMin, $iMax = " & $iMin & ", " & $iMax & @CRLF ) ConsoleWrite( "Time to test array: " & TimerDiff( $hTimer ) & @CRLF ) $aArray = 0 EndFunc Func TestArray( $pvArray, $pvMin, $pvMax ) ; <<<< On function entry $aArray is converted to $pvArray (safearray contained in a variant) >>>> ; Pointer to safearray Local $pData = $pvArray + 8 Local $tData = DllStructCreate( "ptr", $pData ) Local $pSafeArray = DllStructGetData( $tData, 1 ) ; Pointer to data Local $pSafeArrayData SafeArrayAccessData( $pSafeArray, $pSafeArrayData ) ; <<<< Execute your assembler, C, C++, C# or FreeBasic code at this point >>>> ; $iMin, $iMax storage for fasm code Local $tMinMax = DllStructCreate( "int iMin;int iMax" ) DllStructSetData( $tMinMax, "iMin", AccVars_VariantToVariable( $pvMin ) ) DllStructSetData( $tMinMax, "iMax", AccVars_VariantToVariable( $pvMax ) ) Local $pMinMax = DllStructGetPtr( $tMinMax ) ; iMin = $pMinMax, iMax = $pMinMax + 4 (int = 4 bytes) ; Get fasm code Static $sFasmCode = @AutoItX64 ? "0x4D8B4804418B003B420876038B4208443B4A087304448B4A084883C218E2E841890045894804C3" _ ; Example5-x64.asm : "0x5589E58B4D088B550C8B45108B58048B003B420876038B42083B5A0873038B5A0883C210E2EB8B55108902895A045DC20C00" ; Example5-x86.asm Static $pFasmCode = FasmGetBinaryString( $sFasmCode, 64 ) If Not $pFasmCode Then Exit ConsoleWrite( "$pFasmCode ERR" & @CRLF ) ; Execute fasm code DllCallAddress( "int", $pFasmCode, "int", 2^23, "ptr", $pSafeArrayData, "ptr", $pMinMax ) ; Get $iMin, $iMax AccVars_VariableToVariant( DllStructGetData( $tMinMax, "iMin" ), $pvMin ) AccVars_VariableToVariant( DllStructGetData( $tMinMax, "iMax" ), $pvMax ) SafeArrayUnaccessData( $pSafeArray ) EndFunc ; $iMin, $iMax = 39, 2147483610 ; Time to test array: 2182.54509368366 Examples There are two obvious uses for this: To create and fill a new array. And to manipulate one or more existing arrays. Demo examples "Examples\Demo examples\" contains a few simple demonstration examples. 1) Create and fill new array There are already examples above where a 1D-array is filled with integers. As a demonstration example of creating and filling out an array, a little more complex 2D-array is filled with integers. Example2.au3 is an optimized version of Example1.au3. See post 6. 2) Manipulate existing array As a demonstration example of manipulating a single existing array, minimum and maximum values are determined in a 1D-array of random integers. This is the same as Example5 and Example6 above. See post 6. 3) Concatenate 1D-arrays As a demonstration example of manipulating several existing arrays 2, 8 and 16 1D-arrays of integers with 2^20 (1,048,576) rows are concatenated into a 2D-array with 2, 8 and 16 columns. See post 6. In all three demonstration examples flat assembler (fasm) is used as the fast language to manipulate the arrays. Note that in the three examples the pure AutoIt code is doing relatively well compared to the fasm code. The reason is that the code in the array loops is very simple. For more complex code the AutoIt code will not do so well. Assembler code flat assembler (fasm) is available as a DLL-file. This means that all you need to create fasm code is this DLL and the DllCall command. DllCall is a native AutoIt command. The DLL-file is a 32 bit DLL, but it can generate both 32 and 64 bit fasm code. Furthermore, the assembled code (the executable machine code) is very compact. None of the example programs are larger than 64 bytes. There are several threads in these forums regarding fasm and development of fasm code. And there are threads in the German forums regarding fasm. For the example programs included here I'm just using the DLL-file, DllCall and a few AutoIt functions to make things easier. Nothing of this is included in the zip. Other demo examples These are small examples I used while I developed and tested the UDF. The examples are stored in "Examples\Demo examples\4) Other demo examples\". Create and fill array\ contains the the same examples as "Tests\Examples\3) Internal conversions\". Multiple parameters\ tests all 30 AccessVariablesXY functions. The functions are tested with simple variables where some variables are added and the result is stored in another variable. Example1.au3. Inside the AccessVariablesXY functions the variables are true variants. This is demonstrated by adding the variables with VarAdd API function. Example2.au3. Safearray dimensions\ shows how to handle safearrays of 1, 2 and 3 dimensions. ArrayToSafearray\ and SafearrayToArray\ is about the AccVars_ArrayToSafeArray and AccVars_SafeArrayToArray utility functions. Using the UDF\ contains the six examples in the previous section. Real examples The examples of fasm code that I've used for tests and demonstrations are almost too small to be realistic examples. But so far I've not finalized any more realistic examples. I'll add some examples when they are completed. Zip file At the top level the zip contains the following folders and files: Examples\ - Examples main section Includes\ - Final UDF main section Tests\ - The first four sections Example.au3 - Example in top of post Example-x64.asm - 64 bit fasm code Example-x86.asm - 32 bit fasm code You need AutoIt 3.3.10 or later. Tested on Windows 10/7 32/64 bit and Windows XP 32 bit. If you have less than 4GB of RAM in your PC, you should reduce the number of array rows by a factor of four (change 2^24, 2^23, 2^20 to 2^22, 2^21, 2^18 in .au3-files) in examples with fasm code. Comments are welcome. Let me know if there are any issues. AccessingVariables.7z
    17 points
  40. water

    Active Directory UDF

    I have converted and extended the adfunctions.au3 written by Jonathan Clelland to a full AutoIt UDF including help file, examples, ScITE integration etc. The example scripts should run fine without changes. 2016-08-18: Version: 1.4.6.0 As always: Please test before using in production! KNOWN BUGS: (Last changed: ) None AD 1.4.6.0.zip For AutoIt >= 3.3.12.0 AD 1.4.0.0.zip other versions of AutoIt
    17 points
  41. Jon

    AutoIt v3.3.14.2 Released

    AutoIt v3.3.14.0 has been released. Thanks to everyone involved, both visible and behind the scenes. Download it here. Complete list of changes: History Note The Map functionality was disabled in this release as it was not ready. I will release another beta version later with it re-enabled for continued dev and test.
    17 points
  42. This forum (Au3 Technical) is inhabited by luminaries whose posts frequently demonstrate understanding far beyond my capabilities. For that reason, and at Jon's suggestion, I am reaching out to tap into your wisdom for a project that I have been working on a for a while. I was looking for a way to give back to AutoIt. As a self-taught programmer I have learned an incredible amount from this forum and the help file. It has been very rewarding. Over the course of my personal experiences I have wished, at times, that even though the materials and support are truly incredible - that someone could explain some of the more basic concepts. At the same time, I saw the creation of code.org and I started to think that AutoIt would be a perfect learning tool for people starting out (because of the simplicity, the incredible help file, and the best forum I have ever seen). All of that led to the creation of this text: https://www.autoitscript.com/forum/files/file/351-learn-to-program-using-free-tools-with-autoit/. It is the first draft of a basic introduction to programming using AutoIt. Nobody has reviewed it. Accordingly, I seek the collective constructive feedback of anyone willing to offer opinion as to content, spot any errors, and make any suggestions to improve it. My goal was always to donate it to the AutoIt forum when it was done. I think it could be a good addition to fill the gap for neophytes who may crave to see how everything fits together. The last thought I will leave you with - similar to the first - is that I am not the world's greatest coder (this may be a case of those who can do and those who can't teach). That said, I am hoping that the issues you will undoubtedly spot are not huge or threatening to the overall effort and that you appreciate the fact that this took some time to pull together. I look forward to hearing your thoughts.
    16 points
  43. As many of you may not be aware, of much about AutoIt's humble beginnings, and aspects related to the first GUI version of AutoIt, I thought it might be nice to create a historical reference here for all the many GUI creators that have been created by various people over the years. NOTE - While one could argue, that this topic might be better placed in one of the Chat forums, I would argue, that it links to heaps of good code. While much may be redundant in that code, it is still interesting and forms a great perspective. Many are bound to find useful elements at the very least. Koda, is no doubt the most well-known GUI creator now, but there was a time, when CyberSlug's legendary GUIBuilder (first known as AutoBuilder) ruled the roost, and AutoIt coder's saw it as a Godsend. AutoIt coding was much simpler back then of course. Below, will be a timeline, of any AutoIt GUI creators listed in forum pages. It will be added to by myself as I find them or as others here find them and place a link in a subsequent post ... PLEASE HELP! Comments welcome too. (Also note, that this is also intended to include updates, branches etc by others) Apr 20 2004 - AutoBuilder by CyberSlug. Sep 27 2004 - An interesting topic, where CyberSlug talks about the future of AutoBuilder (etc) and renaming to GUIBuilder and you see the first mentions and links to updates by others (including myself & livewire). Nov 05 2004 - A topic where lookfar is working on a SciTE replacement, talks about starting a Form Designer. Aug 10 2005 - GuiBuilder first update by TheSaint. Sep 26 2005 - GUIBuilder updates by livewire (he also talks about transferring his efforts to Koda). Nov 02 2005 - KODA FormDesigner v1.3 by lookfar Nov 03 2005 - Seemingly interesting topic about forms by tonedeaf Dec 26 2005 - AutoIt Studio(beta) by BillLuvsU Jan 09 2006 - AutoBuilder update (or branch) by _^__darkbytez (livewire also posts). Feb 19 2006 - Koda v1.5 by lookfar Sep 07 2006 - Koda v1.7.3.0 by Lazycat Jan 07 2007 - Form/GUI Builder by FlintBrenick Jun 10 2007 - Gorganizer by _Kurt (more of an assister than actual GUI maker) Jun 27 2007 - Basic GUI Designer by Mast3rpyr0 May 03 2008 - Autoit Programmer's Desktop (APD) by Ealric Jul 11 2008 - Gui Designer by Alek Aug 11 2008 - Gorganizer update by _Kurt Jun 19 2009 - Easy GUI by Mat Aug 13 2009 - GUI Script Creator by Pandemic (not sure this qualifies, but it made me think of templates) Aug 16 2010 - Creation Gui by AZJIO Jan 22 2012 - ISN AutoIt Studio by ISI360 (includes ISN Form Studio 2, a GUI editor) Mar 19 2012 - Arduino GUI Programmer by nikosliapis (creates a specific type of GUI) Aug 01 2012 - GuiBuilder Resurrected update/branch to GUIBuilder by baroquebob Dec 01 2012 - Form Builder beta (v1.0.6) by BuckMaster Jan 12 2015 - GUIBuilderNxt update by jaberwacky of GUIBuilder v0.8 (as a new prototype, modified to work with latest AutoIt) (not a update to the Resurrected version) Aug 12 2016 - The GuiBuilder Return by DFerrato as an update to GUIBuilder, Jan 17 2017 - GUIBuilder Project by TheSaint (a work in progress based on CyberSlug's original ... and later versions, updated by Roy, TheSaint & others). May 29 2019 - The GuiBuilder Return by DFerrato as an update to GUIBuilder, His new and improved version. May 9 2022 - GuiBuilderPlus by kurtykurtyboy as an update to GUIBuilder. A new an improved version with more to come. There are a significant number of creators/designers that have been started and never completed. +++++ STILL UNDER CONSTRUCTION +++++ P.S. Well that's it from me tonight. I know of at least one other major creator, but cannot recall it's name or the name of the coder, though I think it starts with 'L'. Bound to be a few I've missed, and some I cannot seem to find their first appearance here (Koda, Form Builder, etc), but there may be an obvious reason for that. Will probably rely on feedback from others now that I've got the ball rolling. NOTE - If anyone wants to discuss any of these programs above or give some background history, then by all means do so. I will cross-reference (link to) any important comments.
    16 points
  44. Version v3.3.16.1

    48,524 downloads

    This is the current stable version of AutoIt. What's new: Changelog. Main AutoIt download page (for AutoIt and other tools like the script editor).
    16 points
  45. Version 1.2

    28,178 downloads

    I wrote an introductory text for new programmers to learn how to code using AutoIt. It follows along with the help file for the most part – but provides additional context and attempts to connect all the information in a cohesive way for someone without any programming experience. I find the help file to be an AMAZING resource and the text I wrote in no way reflects any opinion to the contrary. Rather, it was created from the perspective of someone who struggled early on with the most basic concepts and thought that a hand-holding guide could be useful. I was also inspired by code.org who is trying to encourage people to learn to code. I thought – what better way than to use free tools that you can download at any time with access to an amazing community? If only there was a guide to walk people through it … Full discussion about the file can be found here: https://www.autoitscript.com/forum/topic/174205-introductory-learn-to-program-text-using-au3/
    16 points
  46. This is a continuation of Custom drawn TreeViews and ListViews. However, only with respect to listviews. The crucial difference between the new and the old code is that the new code is a complete UDF and therefore much easier to use. Because the UDF is about colors and fonts in listview items and subitems, it's only for listviews in Details or Report view. Main features The UDF supports the following main features. Colors and fonts: 1 Single items/subitems Back colors Fore colors Fonts and styles 2 Colors/fonts for entire columns 3 Alternating colors (entire listview) Alternating colors for rows, columns or both Both default and alternating color can be set Number of rows/columns between color change can be set 4 Custom default colors/font instead of standard default colors/font Custom default back and fore colors can be set for Normal listview items (instead of white and black) Selected listview items (instead of dark blue and white) Unfocused selected items (instead of button face and black) 5 Colors for selected listview items Back and fore colors for selected items when listview has focus Back and fore colors for selected items when listview has not focus Features 1, 2 and 3 cannot be mixed together. 4 and 5 can be mixed with the previous features. 5 extends the functionality of the previous features by adding colors to selected items. 5 cannot be used alone. Listviews: Multiple listviews Native and non-native listviews Native and non-native listview items The UDF can be used with existing listviews WM_NOTIFY message handlers: WM_NOTIFY message handlers can be used completely as usual The UDF can be used with existing WM_NOTIFY message handlers Colors and fonts for single listview items/subitems are stored in an array. The index in this array for a given listview item is stored in ItemParam. Except for this usage of ItemParam nothing in the UDF assumes that listviews or items/subitems are created in a certain way, or that any WM_NOTIFY handlers exists or are designed in a certain way. It should be easy to use the UDF with existing listviews with or without a WM_NOTIFY message handler or other message handlers. WM_NOTIFY message handlers Colors and fonts in listviews are implemented through custom draw notifications in the form of WM_NOTIFY messages. A WM_NOTIFY message handler is needed to implement colors/fonts. If a listview is included in a GUI and a little more than just very basic functionality is wanted, another WM_NOTIFY handler is soon needed to implement this functionality. To register a WM_NOTIFY handler you use the function GUIRegisterMsg. This function can register only one message handler at a time for the same message type. The result of code like this is that only WM_NOTIFY2 message handler is working: GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY1" ) ; Register WM_NOTIFY1 GUIRegisterMsg( $WM_NOTIFY, "WM_NOTIFY2" ) ; Register WM_NOTIFY2 (unregisters WM_NOTIFY1) This makes it difficult to implement colors/fonts in a UDF, if you at the same time want to implement advanced functionality in your own code. A solution is to register the WM_NOTIFY message handler, that takes care of custom draw notifications, in a different way. This can be done by a technique called subclassing, which is implemented through the four functions SetWindowSubclass, GetWindowSubclass, RemoveWindowSubclass and DefSubclassProc (coded in WinAPIShellEx.au3). Subclassing Subclassing a window (or control) means to create a message handler for the window, that will receive messages to the window before the original message handler for the window. This section is information on the implementation of a WM_NOTIFY message handler through subclassing: The UDF The UDF is implemented in UDFs\ListViewColorsFonts.au3. This is a list of the most important functions copied from the UDF (around line 200): ; Initiating and exiting ; ---------------------- ; ListViewColorsFonts_Init ; ListViewColorsFonts_Exit ; ; Set colors/fonts for items/subitems ; ----------------------------------- ; ListViewColorsFonts_SetItemColors ; ListViewColorsFonts_SetItemFonts ; ListViewColorsFonts_SetItemColorsFonts ; ; Set colors/fonts for entire listview ; ------------------------------------ ; ListViewColorsFonts_SetColumnColorsFonts ; ListViewColorsFonts_SetAlternatingColors ; ListViewColorsFonts_SetDefaultColorsFonts ; ; Maintenance functions ; --------------------- ; ListViewColorsFonts_Redraw Some of the functions in the complete list in the file are not coded in this version. To use the UDF you first calls ListViewColorsFonts_Init which stores information about the listview and the parent window, and creates the subclass that takes care of the actual drawing of the colors and fonts. Then you call one or more of the ListViewColorsFonts_Set-functions to define the colors and fonts. Depending on the functions you might also need to call ListViewColorsFonts_Redraw. And that's all. Finally you can call ListViewColorsFonts_Exit to remove the subclass before the script exits. If you don't call ListViewColorsFonts_Exit it's called automatically by the UDF. This is the syntax for ListViewColorsFonts_Init and the information about $fColorsFonts flag also copied from ListViewColorsFonts.au3: ; ListViewColorsFonts_Init( $idListView, $fColorsFonts = 7, $iAddRows = 100, $bNative = False ) ; $idListView - Listview control ID or handle ; $fColorsFonts - Specifies options for usage of colors and fonts in the listview. Add required options together. ; 1: Back colors for items/subitems ; Can not be specified separately in this version ; 2: Fore colors for items/subitems ; Can not be specified separately in this version ; 4: Fonts and styles for items/subitems ; Can not be specified separately in this version ; 7: Back and fore colors, fonts and styles ; Flags 1/2/4 are combined in flag 7 in this version ; ; 8: Colors/fonts for entire columns ; ; 16: Alternating row colors (for entire listview) ; 32: Alternating column colors (for entire listview) ; ; 64: Custom default colors and font (for entire listview) ; Custom default back and fore colors can be set for ; - Normal listview items (instead of white and black) ; - Selected listview items (instead of dark blue and white) ; - Unfocused selected listview items (instead of button face and black) ; ; 128: Colors for selected items when listview has focus ; 256: Colors for selected items when listview has not focus The limitations with respect to flags 1, 2 and 4 in this version is only a matter of optimizations. It has nothing to do with features. Drawing of selected items is largely controlled by Windows. A lot of extra code is needed to implement custom colors for selected items through flags 128 and 256. For $fColorsFonts flag is further noted that: ; - Flags 1/2/4 can be combined in a total of seven different ways ; - Flags 1/2/4 (items/subitems), flag 8 (columns) and flags 16/32 (listview) cannot be combined ; - Flag 64 is used to replace the standard default colors/font by custom default colors/font ; Flag 64 can be used alone or in combination with flags 1-32 ; Custom default colors/font must be set before all other colors/fonts ; Flag 64 leads to some restrictions on the features for items/subitems (flags 1/2/4) ; - Flags 128/256 extends the functionality of flags 1-64 by adding colors to selected items ; Flags 128/256 cannot be used alone An array $aListViewColorsFontsInfo is used to store information about the listview, the parent window and the usage of colors/fonts in the listview. For flags 1/2/4 about single items/subitems another array $aListViewColorsFonts is used to store the colors and fonts for the items and subitems. The number of columns in this array depends on whether the flags 128/256 are set or not. The first 160 lines in the UDF contains information about these arrays. For flags 1/2/4 ItemParam field in the listview is used to store the zero based row index in $aListViewColorsFonts for a given listview item. For native listview items created with GUICtrlCreateListViewItem the existing value of ItemParam (control ID) is used as index in an intermediate array $aListViewColorsFonts_Index, and $aListViewColorsFonts_Index holds the index in $aListViewColorsFonts stored as index+1. For non-native listview items the index in $aListViewColorsFonts is stored in ItemParam as -index-20. For non-native listview items an existing value of ItemParam is overwritten. The best way to add colors and fonts to listviews is to put each listview in its own child window. The child window should not contain any other controls, and it should have the same size as the listview. However, this is not a requirement. See the UDF for documentation of the other functions. The implementation of the functions starts in line 230 and onwards. The UDF also contains a group of internal functions. Among other the subclass callback functions to draw the colors and fonts in response to NM_CUSTOMDRAW notifications from the listview. So far the UDF contains seven callback functions which starts around line 2100 and runs over the next 1300 lines nearly to the bottom of the file. The code This section is about some code details related partly to the subclass callback functions and partly to drawing of selected items. Subclass callback functions: Drawing of selected items: In the current version of the UDF the callback function that is implemented to draw single items/subitems ($fColorsFonts = 1/2/4) is the function that can handle all features ($fColorsFonts = 1+2+4 = 7). If only a part of the features is needed, it's possible to create smaller and faster functions, which only implements this part of the features. These functions (six functions in total) are postponed to next version. Features A few comments on the features. The main features in terms of colors and fonts are (a repeat of the list in top of post): 1 Single items/subitems 2 Colors/fonts for entire columns 3 Alternating colors (entire listview) 4 Custom default colors/font instead of standard default colors/font 5 Colors for selected listview items 1, 2 and 3 are features for different kind of elements in the listview and cannot be mixed together. 4 can be used either as an independent feature or mixed with 1, 2 or 3. 5 cannot be used as an independent feature but can only be used together with 1, 2, 3 or 4. 5 extends the functionality of these features by adding colors to selected items. When features 1, 4 and 5 are mixed together, it may look as shown in the following illustrations (screen dumps of examples 3.1 and 4.1 in folder \Examples\5) Selected items\). The first illustration shows how it looks when colors for single items/subitems are mixed with colors for selected items: In the upper picture rows 3-6 are provided with back and fore colors. All subitems in row 3 and 4. Only a few subitems in row 5 and 6. The rows are normal (unselected) rows. In the middle picture rows 2-7 are selected and the listview has focus. Rows 3-6 are also provided with back and fore colors for selected items. In the lower picture rows 2-7 are selected but the listview has not focus. Rows 3-6 are also provided with back and fore colors for selected but unfocused items. In the second illustration the standard default colors are replace with custom default colors. The standard default back and fore colors are: Normal (unselected) items: White and black Selected items in focused listview: Dark blue and white Selected items in unfocused listview: Button face and black These custom default colors are used in the illustration: Normal (unselected) items: Light green and brown Selected items in focused listview: Shiny green (chartreuse) and black Selected items in unfocused listview: Dark green and black Examples Two folders with examples is included in the zip below. The first folder is named Examples and contains examples about the usage of the functions in the UDF. The second folder is named UDF topics and contains examples related to the implementation of the UDF. It's about the use of the subclassing technique as a substitute for a WM_NOTIFY message handler. Particularly about the message flow and performance issues. These examples are addressed in next section. The Examples folder contains these subfolders and files: 0) UDF examples\ - The small examples from the documentation of the functions in the UDF 1) Items-subitems\ - Colors and fonts for single items/subitems 2) Entire columns\ - Colors and fonts for entire columns 3) Alternating colors\ - Alternating row/column colors in an entire listview 4) Custom defaults\ - Replace standard default colors/font with custom defaults 5) Selected items\ - Colors for selected items when listview has focus and has not focus 6) Help file examples\ - Shows how to add colors to a few examples from AutoIt Help file 7) Original examples\ - An implementation of the examples in the old thread with this UDF Listview templates\ - A collection of listview templates ready to add colors/fonts Features demo.au3 - A brief demonstration of all features No colors or fonts.au3 - Reference example All examples runs on Windows XP and later without any performance issues. Folder 1 - 5 demonstrates the five main color/font features listed in top of post. In most of the subfolders you can find a _Readme.txt file with a brief description of the examples. Multiple selections is enabled in most listviews. A few examples will not pass an Au3Check. In particular the examples in subfolder 1 and 2 and the examples in UDF topics folder (see next section) were used to test the subclassing technique as a substitute for a WM_NOTIFY message handler. More information about some of the examples: Examples\0) UDF examples\0) ListViewColorsFonts_Init\Example 1.au3: #include <GUIConstantsEx.au3> #include "..\..\..\UDFs\ListViewColorsFonts.au3" #include "..\..\..\UDFs\GuiListViewEx.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Create GUI Local $hGui = GUICreate( "ListViewColorsFonts_Init\Example 1", 420, 200, -1, -1, $GUI_SS_DEFAULT_GUI-$WS_MINIMIZEBOX ) ; Create ListView Local $idListView = GUICtrlCreateListView( "", 10, 10, 400, 180, $GUI_SS_DEFAULT_LISTVIEW-$LVS_SINGLESEL, $WS_EX_CLIENTEDGE ) _GUICtrlListView_SetExtendedListViewStyle( $idListView, $LVS_EX_DOUBLEBUFFER+$LVS_EX_FULLROWSELECT ) Local $hListView = GUICtrlGetHandle( $idListView ) ; Reduces flicker ; Add columns to ListView _GUICtrlListView_AddColumn( $idListView, "Column 1", 94 ) _GUICtrlListView_AddColumn( $idListView, "Column 2", 94 ) _GUICtrlListView_AddColumn( $idListView, "Column 3", 94 ) _GUICtrlListView_AddColumn( $idListView, "Column 4", 94 ) ; Fill ListView Local $iItems = 100 For $i = 0 To $iItems - 1 GUICtrlCreateListViewItem( $i & "/Column 1|" & $i & "/Column 2|" & $i & "/Column 3|" & $i & "/Column 4", $idListView ) Next ; Perform initializations to add colors/fonts to single items/subitems ListViewColorsFonts_Init( $idListView, 7 ) ; $fColorsFonts = 7, ( $iAddRows = 100, $bNative = False ) ; Set a green back color for an entire item and a yellow back color for a single cell ListViewColorsFonts_SetItemColors( $idListView, 3, -1, 0xCCFFCC ) ; Green back color for entire item ListViewColorsFonts_SetItemColors( $idListView, 3, 2, 0xFFFFCC ) ; Yellow back color for cell 2 in item ; Force an update of local variables in drawing function ListViewColorsFonts_Redraw( $idListView ) ; Adjust height of GUI and ListView to fit ten rows Local $iLvHeight = _GUICtrlListView_GetHeightToFitRows( $hListView, 10 ) WinMove( $hGui, "", Default, Default, Default, WinGetPos( $hGui )[3] - WinGetClientSize( $hGui )[1] + $iLvHeight + 20 ) WinMove( $hListView, "", Default, Default, Default, $iLvHeight ) ; Show GUI GUISetState( @SW_SHOW ) ; Message loop While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd ; Delete color/font info for listview ListViewColorsFonts_Exit( $idListView ) GUIDelete() EndFunc UDF topics The examples in UDF topics folder is about the use of subclassing as a substitute for a WM_NOTIFY message handler. Particularly about the message flow and performance issues. These examples illustrates some of the issues, that was discussed in the Subclassing section above, with code. The UDF topics folder contains these subfolders: 1) Subclassing\ - Creating listviews in GUI or child windows? 2) Performance\ - How many listviews can you create in GUI? More information about the examples: Next version In The code section above is already mentioned a number of subclass callback functions which are postponed to next version. The purpose of these additional functions is merely to optimize the code in terms of speed. A number of ListViewColorsFonts_Get-functions to complement the corresponding ListViewColorsFonts_Set-functions are also deferred to next version. For single items/subitems ($fColorsFonts = 1/2/4) colors and fonts are stored in $aListViewColorsFonts array which again is stored in $aListViewColorsFontsInfo. The three functions ListViewColorsFonts_SetItemColors / SetItemFonts / SetItemColorsFonts are used to update $aListViewColorsFonts item by item or subitem by subitem. It would be much faster to update $aListViewColorsFonts directly. Two functions are needed to get a copy of the array from $aListViewColorsFontsInfo and store the array again after the updates. And there is also a need for a couple of examples to illustrate the technique. Examples to dynamically update colors and fonts are missing in this version. Perhaps there is also a need for a few functions to support dynamically updates. For non-native listviews created with _GUICtrlListView_Create it's not uncommon to use ItemParam to store a user defined value. If index in $aListViewColorsFonts is stored in ItemParam, it's no longer possible to use ItemParam for such purposes. A couple of functions to give the user an opportunity to still be able to store a user defined value would be nice. Several global variables are defined in this version. They will be removed in the next version except for a few variables which probably will need to be global in performance terms. If there will be reported any issues or problems in this version, they of course also need to be addressed. The next version should be ready in 2-3 months, and it should also be the final version. Zip file The zip is structured in this way Examples\ UDF topics\ UDFs\ ListViewColorsFonts.au3 GuiImageListEx.au3 GuiListViewEx.au3 NamedColors.au3 OtherColors.au3 NamedColors.au3 contains global constants of named colors copied from .NET Framework Colors Class. You need AutoIt 3.3.10 or later. Tested on Windows 7 32/64 bit and Windows XP 32 bit. Comments are welcome. Let me know if there are any issues. (Set tab width = 2 in SciTE to line up comments by column.) ListViewColorsFonts.7z
    16 points
  47. [New Version] - 27 Jan 22 New: The GUIScrollbar_Ex UDF now recognises Win-D and taskbar desktop clearance commands and runs the correct minimize/restore code automatically. The previous UDF _Minimize and _Restore commands have been superceded by a single _EventMonitor function which runs in the script idle loop. This is a script-breaking change, but I hope that the additional functionality is worth the small effort it will take to alter your scripts. New UDFs, examples in zip file below. Previous changes: Changelog.txt Are you bemused by scrollbars? > Do you find them too difficult to use? > Then you need the GUIScrollbars_Ex UDF! Just download the zip at the end of the post and run this short script with the UDF in the same folder. No tricky calculations, no complicated functions to master - just easy to use, accurate scrollbars with one command! [size=5]#include <guiconstantsex.au3> #include "GUIScrollbars_Ex.au3" ; Create GUI with red background $hGUI = GUICreate("Test", 500, 500) GUISetBkColor(0xFF0000, $hGUI) ; Create a 1000x1000 green label GUICtrlCreateLabel("", 0, 0, 1000, 1000) GUICtrlSetBkColor(-1, 0x00FF00) GUISetState() ; Generate scrollbars - Yes, this is all you need to do!!!!!!!!!!!!!!!!!!!! _GUIScrollbars_Generate($hGUI, 1000, 1000) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd[/size] Try it today and see how easy it is! I have been trying for some time to understand how scrollbars work and how to get them closely to match the area I want to display. After much research and headscratching I have come up with 2 UDFs which I hope will be of use to others. Apologies for the length of this post, but scrollbars are complex beasts and as I did this mainly for the less experienced user I want to make sure that they understand what is going on. The 2 UDFs are: GUIScrollbars_Ex.au3 - This gives you scrollbars sized to your GUI in one simple command - with no other includes or commands needed. The UDF is designed for those who would not normally use scrollbars because the whole process looks too complicated. It also includes a command to enable you to scroll page by page, thus making it easy to scroll to anywhere on the GUI with only simple calulations based on the values you used to create the GUIs. [New] Ability to have recalculated scrollbars on resizeable GUIs. GUIScrollbars_Size.au3 - This calculates the Page and Max numbers for the user to feed into the _GUIScrollbar_SetScrollInfoPage/Max commands. The UDF is aimed at the more experienced user and is particularly useful when you have a GUI with a dynamic scroll size (i.e. adding or subtracting controls to the scrollable area as the script runs). First, a short tutorial for those who are interested in how the scrollbars affect your GUI and what it is that the UDFs calculate: All the files mentioned here are in a downloadable zip file at the end of the post. GUIScrollbars_Size.au3 As mentioned previously, the GUIScrollbars_Size.au3 UDF is aimed at the more experienced user who wants to use the full range of _GUIScrollbar comands, but would like a quick way of getting the required Page and Max values. It uses no other include files so you will need to include GUIScrollbars.au3 yourself, as well as the necessary GUIRegisterMsg and procedures for WM_VSCROLL and WM_HSCROLL. The syntax is simple - the size of the scrollable GUI and either the handle of the GUI you have created to hold the scrollbars or the size of the one you are going to create. It returns a 6-element array including the Page and Max values for the scrollbars and factors to compensate for the "shrinkage" of the GUI if you had already drawn some controls and wished to add others. Of interest, the returned Max value is biased not to clip the edges of the GUI - reducing it by 1 makes a tighter fit but can lead to some clipping. (If that does not make sense, please see the tutorial above for more details) The Size_Example_1 script to show the UDF in action - the "Pass Size" button shows the effect of creating the scrollbars BEFORE the controls, the "Pass Handle" button shows what happens if the scrollbars are created AFTER the controls. If you do not understand why there is a difference - go and read the tutorial above ! You will need to have the GUIScrollbar_Size.au3 UDF in the same folder. Where this UDF really helps is if you have a scrollable GUI of variable size - if the number of controls varies with user selections for example. All you need to do is to rerun the UDF with the new size of the scrollable GUI and it produces a new Max value for you to use. The Size_Example_2 script shows how the function enables you to dynamically size your scrollbars depending on the number of controls required. As before it requires the GUIScrollbar_Size.au3 UDF in the same folder. -------- Now the "simple" GUIScrollbars_Ex.au3 (which is actually the more complex internally as you would expect). This UDF is intended to be the single point of call for creating scrollbars on a GUI - it will automatically add the GUIScrollbars UDF and the WM_VSCROLL and WM_HSCROLL GUIRegisterMsg commands and procedures to your script - so you need no commands other than those within the UDF itself. These commands are _GUIScrollbars_Generate and _GUIScrollbars_Scroll_Page. As you might expect, _GUIScrollbars_Generate generates scrollbars for your GUI. It is usually called AFTER you have added all the controls and all you need to use it is the GUI handle and the size of the underlying GUI you want to scroll. If you so wish, you can also decide to generate the scrollbars BEFORE the controls on the scrollable GUI, and you can choose if you want to risk not quite reaching the edge of the GUI when the scrollbars are at the maximum position. So a basic call could be as simple as: _GUIScrollbars_Generate ($hGUI, 1000, 1000) which would put scrollbars on the $hGUI window allowing a 1000x1000 underlying GUI to be displayed. _GUIScrollbars_Scroll_Page lets you scroll a page at a time. If your GUI was 200 pixels wide, you would have 1000/200 = 5 pages to scroll before reaching the edge - no need to know what the actual Page and Max values are, just use this simple division based on the number you use to draw the GUIs. So: _GUIScrollbars_Scroll_Page ($hGUI, 3) would scroll to the third page - it would display the area between 400 and 600 pixels of the full 1000 pixel width. If you ask for a page over the maximum available, you just scroll to the maximum position - asking for page 1 resets you to the origin. Ex_Example_1 shows the UDF working. You can decide whether to have both or just one scrollbar, whether to create the scrollbars before or after the controls, and whether you want the maximum scroll to be tight to the edge or leave a border. Just select the options you want - the script selects a random width and height for both the scrollbar GUI and the underlying GUI - and press the "Scroll" button to show a single page scroll down and/or right followed by a scroll to the bottom right corner of the GUI. There are labels to let you see the size of the GUI and the accuracy of the page scrolls (please read the tutorial above to understand why these are almost certainly inaccurate). The script requires the GUIScrollbars_Ex.au3 UDF in the same folder. Ex_Example_2 is a really simple example to show how easy generating scrollbars can now become! As you can see - no other includes, no GUIRegisterMsg commands, no WM_H/VSCROLL procedure functions. Just accurate scrolling and proportional thumb sizes. Ex_Example_3 shows the automatic calculation of control positions. Ex_Example_4 shows how to initiate the cursor keys to scroll the GUI as well. [New] Ex_Example_5 shows how to use the new _GUIScrollbarsEx_Resizer function. I hope these 2 UDFs are useful to AutoIt users - I certainly find them so. Here is a zip file with the UDFs and examples: Scrollbars.zip My grateful thanks to the authors of the GUIScrollbars and WinAPI UDFs for their code, some of which I have plundered. And as always I welcome constructive criticism and/or effusive congratulations. M23
    15 points
  48. water

    OutlookEX UDF

    Based on the Outlook UDF written by wooltown, we (wooltown and I) decided to extend the functionality of the Outlook UDF. As the OutlookEX UDF ("EX" like "extended") has a completely different approach compared to the Outlook UDF it's a complete rewrite. We would like to discuss the design of the UDF with the community. Every feedback, function request etc. is highly welcome. As soon as the discussion shows that we are on the right track we would like to release an alpha version for everyone to test. So please don't be shy and post what you think of this UDF or what functions you need! Every item in Outlook is uniquely identified by EntryID and StoreID. The default StoreID is your inbox Every item has properties to describe the item (subject, startdate ..) and methods to act upon the item (move, delete …) The search and action functions are now separated. As an example the user first searches for the items to be deleted and then calls the delete function If a method can be used for more than one item type (e.g. mail, calendar and notes) the function is called _OL_ItemXXX else the function is called _OL_CalendarXXX The number of properties you can get or pass to most functions is not limited by the number of parameters defined for the function. Properties can be passed as parameters (up to 10) or in an unlimited array as parameter 1 The UDF allows to access all kind of folders (see the following listing). Folders can be passed by name or as an object to a function A lot of testing is still needed as we have written and tested the functions using Outlook 2002 SP3 and Outlook 2010 "wrapper" or "shortcut" functions will be available to let you do all tasks in one go e.g. _OL_Wrapper_SendMail for all functions above. Documentation: The documentation for this UDF (aside from the docu in the UDF itself) will be placed in the AutoIt Wiki. So we can easily modify the docu without releasing a new version each time. There will be pages describing the UDF in general and pages for individual item types (like mail) with detailed information and a lot of tips & tricks. Tested with Outlook 2003 and 2010. Some users reported that it works with Outlook 2013 as well. Starting point: http://www.autoitscript.com/wiki/OutlookEX_UDF_-_General Download
    15 points
  49. Zedna

    Resources UDF

    Link to pages with general resources description MSDN - Resources OverView & Reference You can embed any binary data into your AutoIt compiled EXE files in it's resources at compile time. As opposite to FileInstall() with resources you can use your embedded data directly without any temporary files on disk. If you wish you can save resources to disk with _ResourceSaveToFile() however. Adding data to resources can be done simply by AutoIt3Wrapper directive: #AutoIt3Wrapper_Res_File_Add=FileName, ResType, ResName As data can be used for example images,cursors,texts,sounds,videos,binary files etc. For loading/using data from resources at run time I made this tiny helper Resources UDF. Functions inside UDF: _ResourceGet($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsString($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsStringW($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsBytes($ResName, $ResType = $RT_RCDATA, $ResLang = 0, $DLL = -1) _ResourceGetAsImage($ResName, $ResType = $RT_RCDATA, $DLL = -1) _ResourceGetAsBitmap($ResName, $ResType = $RT_RCDATA, $DLL = -1) _ResourceSaveToFile($FileName, $ResName, $ResType = $RT_RCDATA, $ResLang = 0, $CreatePath = 0, $DLL = -1) _ResourceSetImageToCtrl($CtrlId, $ResName, $ResType = $RT_RCDATA, $DLL = -1) _SetBitmapToCtrl($CtrlId, $hBitmap) _ResourcePlaySound($ResName, $Flag = 0, $DLL = -1) Notes: * to compile all script examples you must have installed Scite4AutoIt3 --> you must compile script by F7 from full Scite * for using #AutoIt3Wrapper_Res_File_Add directive you must have AutoIt3Wrapper at least version 2.0.1.22 (it's part of latest Scite4AutoIt3) * to compile all script examples must be apropriate resource data files in script directory (from resource_data.zip) * _ResourceGet() always returns pointer to data (for RT_BITMAP returns hBitmap), returning other types can be done by additional wrapper functions like _ResourceGetAsString() or _ResourceGetAsBytes() * _ResourceGetAsStringW() is for Unicode strings (Widechar) * you can use also #number instead of resource name, see examples * general supported resource types are listed in UDF as constants ($RT_BITMAP, $RT_RCDATA, ...) * information about playing video files (AVI) from resources is here thanks matrixnz * information/examples about using animated GIFs from resources is here and here thanks smashly/ProgAndy * information about running EXE files/DLL functions directly from resources is here thanks trancexx/Ward Known problems/limitations: * _ResourceGet() returns resource size (in bytes) in @extended macro but not for resource type RT_BITMAP * _ResourceSetImageToCtrl() works with "static/button" type of controls (picture,label,icon,button,checkbox,radiobutton,groupbox) * _ResourcePlaySound() plays only WAV files (not MP3 files) * _ResourceGetAsBytes() doesn't work for RT_BITMAP type because _ResourceGet() returns hBitmap instead of memory pointer in this case there could be used _ResourceGetAsImage() as workaround * _ResourceGet() has potential memory leak releasing of resources UnlockResource,FreeResource (opposite of LoadResource,LockResource) is not done because it must be done after using of resources at the end and not inside UDF * _GDIPlus_Startup() is called once at start of whole include --> no _GDIPlus_Shutdown() is called History: 2011-06-20 - fixed x64 compatibility (type: int->ptr) - internal change: FindResourceA -> FindResourceW (& type: str->wstr) - _SetBitmapToCtrl() --> $CtrlId parameter now supports also -1 (thanks guinness) - _WinAPI_LoadLibraryEx($DLL, $LOAD_LIBRARY_AS_DATAFILE) instead of _WinAPI_LoadLibrary($DLL) (thanks arcker) - added au3.user.calltips.api, au3.userudfs.properties (thanks guinness) - merged resource_au3.zip + resource_data.zip to one file resources.zip 2010-02-12 - all examples now use fixed #AutoIt3Wrapper_Res_File_Add directive from latest Scite4Autoit3 (no need for ResHacker.exe) - added support for buttons (also checkboxes,radiobuttons,groupboxes) in _ResourceSetImageToCtrl()/_SetBitmapToCtrl() thanks Melba 2009-08-25 - fixed corrupted topic (appeared after forum upgrade) - removed some AU3 tags from topic, note: all AU3 code is untouched inside attached ZIP 2008-11-27 - added _ResourceGetAsStringW() --> for Unicode strings (Widechar) 2008-11-10 - added two very simple examples 2008-08-14 - change: _GDIPlus_Startup() is called once at start of whole include--> no _GDIPlus_Shutdown() is called - fixed support for animated GIFs in _ResourceGetAsImage() --> removed_MemGlobalFree($hData) - used simpler UDF syntax (from WinAPI) instead of DllCall() where possible - added new example for animated GIF image 2008-07-08 - just corrected some typos in this topic (no code changes) 2008-06-25 - big thanks to ProgAndy for ideas,improvements! - added _ResourceGetAsImage(), _ResourceGetAsBitmap() - added optional $DLL parameter to all functions - for loading resources from external EXE,DLL files - fixed previous limitation in _ResourceSaveToFile() - now supports also RT_BITMAP type - new examples in resource_test.au3 2008-05-02 - added new RT,SND constants - fixed bad order of parameters ResName x ResType in FindResourceExA (thanks SmOke_N) - added DeleteObject of oldBmp from STM_SETIMAGE in _SetBitmapToCtrl (thanks ProgAndy) - added settinng SS_BITMAP style to control before STM_SETIMAGE in_SetBitmapToCtrl (support for labels) 2008-04-24 - added support for JPG,GIF,PNG in _ResourceSetImageToCtrl() using GDI+ - thanks ProgAndy - reverted all examples back from #AutoIt3Wrapper_Res_File_Add= to#AutoIt3Wrapper_run_after=ResHacker.exe -add - updated both ZIP archives 2007-10-16 - added _ResourcePlaySound() - thanks Larry - corrected local declaration of $struxt - was problem when Opt("MustDeclareVars",1) - updated resource_test.au3 and resource.au3 in resource_au3.zip 2007-09-14 - added optional parameter $CreatePath in _ResourceSaveToFile() - updated resource_test.au3 and resource.au3 in resource_au3.zip 2007-09-11 - in examples used new AutoIt3Wrapper directive#AutoIt3Wrapper_Res_File_Add from latest Scite4AutoIt3 (instead of #AutoIt3Wrapper_run_after=ResHacker.exe -add ...) - updated resource_test.au3 and resource_test_ie.au3 in resource_au3.zip 2007-09-05 - in #AutoIt3Wrapper_run_after=ResHacker.exe -add ... directive can be resource type in text form -->rcdata instead of 10, bitmap instead of 2 and so on (note: but for htmlmust be used 23 still) - updated only resource_test.au3 in resource_au3.zip 2007-09-04 - added description at top of this topic - added _ResourceSaveToFile() - source is also example for using _ResourceGetAsBytes() - more error checking in UDF and error codes are now differrent todistinguish possible problem - default ResType = 10 ($RT_RCDATA) in all functions - updated both ZIP archives 2007-08-29 - added TODO list - removed not used local variables in _ResourceSetImageToCtrl() - ziparchive not updated yet - revisited WWW links and TODO list and added list of functions 2007-08-10 - first version resource_test_min1.au3 - very simple example script of using UDF #AutoIt3Wrapper_Res_File_Add=image3.jpg, rt_rcdata, TEST_JPG_1 #include "resources.au3" $gui = GUICreate("Data from resources simple example 1",400,150) $pic1 = GUICtrlCreatePic("",0,0,400,150) _ResourceSetImageToCtrl($pic1, "TEST_JPG_1") ; set JPG image to picture control from resource GUISetState(@SW_SHOW) While 1 If GUIGetMsg() = -3 Then Exit WEnd resource_test.au3 - complex example script of using UDF #AutoIt3Wrapper_Res_File_Add=test_1.txt, rt_rcdata, TEST_TXT_1 #AutoIt3Wrapper_Res_File_Add=image1.bmp, rt_bitmap, TEST_BMP_1 #AutoIt3Wrapper_Res_File_Add=image2.bmp, rt_bitmap, TEST_BMP_2 #AutoIt3Wrapper_Res_File_Add=image3.jpg, rt_rcdata, TEST_JPG_3 #AutoIt3Wrapper_Res_File_Add=binary1.dat, rt_rcdata, TEST_BIN_1 #AutoIt3Wrapper_Res_File_Add=C:\WINDOWS\Media\tada.wav, sound, TEST_WAV_1 #include "resources.au3" $gui = GUICreate("Data from resources example",820,400) $pic1 = GUICtrlCreatePic("",0,0,400,300) $pic2 = GUICtrlCreatePic("",400,0,400,150) $pic3 = GUICtrlCreatePic("",400,150,400,150) $pic4 = GUICtrlCreatePic("",600,320,400,100) $label1 = GUICtrlCreateLabel("",20,320,380,100) $label2 = GUICtrlCreateLabel("",400,320,200,100) GUISetState(@SW_SHOW) ; get string from resource $string = _ResourceGetAsString("TEST_TXT_1") GUICtrlSetData($label1, $string) ; set BMP image to picture control from resource bitmap _ResourceSetImageToCtrl($pic1, "TEST_BMP_1", $RT_BITMAP) ; get bitmap from resource (as pointer) $hBmp = _ResourceGet("TEST_BMP_2", $RT_BITMAP) ; and use it for whatever you like _SetBitmapToCtrl($pic2, $hBmp) ; set JPG image to picture control from resource _ResourceSetImageToCtrl($pic3, "TEST_JPG_3") ; set image to picture control from external DLL resource _ResourceSetImageToCtrl($pic4, "#14355", $RT_BITMAP, @SystemDir & "\shell32.dll") ; get/use picture from resources as hImage type $size1 = _ResourceGetImageSize("TEST_BMP_1", $RT_BITMAP) $size2 = _ResourceGetImageSize("TEST_JPG_3") GUICtrlSetData($label2, $size1 & @CRLF & $size2) ; save binary data or another type (image) from resource to file and get its size in bytes $size1 = _ResourceSaveToFile(@ScriptDir & "\binary_data1.dat", "TEST_BIN_1") $size2 = _ResourceSaveToFile(@ScriptDir & "\binary_data2.bmp", "TEST_BMP_1", $RT_BITMAP) ; save binary data from resource to file (create not existing directory) _ResourceSaveToFile("C:\Dir1\SubDir2\binary_data1.dat", "TEST_BIN_1", $RT_RCDATA, 0, 1) _ResourceSaveToFile("C:\Dir1\SubDir2\binary_data2.bmp", "TEST_BMP_1", $RT_BITMAP, 0, 1) ; play WAV from resource (sync/async) _ResourcePlaySound("TEST_WAV_1") _ResourcePlaySound("TEST_WAV_1", $SND_ASYNC) While 1 If GUIGetMsg() = -3 Then Exit WEnd Func _ResourceGetImageSize($ResName, $ResType = 10) ; $RT_RCDATA = 10 ; get/use picture from resources as hImage type $hImage = _ResourceGetAsImage($ResName, $ResType) $width = _GDIPlus_ImageGetWidth ($hImage) $height = _GDIPlus_ImageGetHeight($hImage) Return "Size of " & $ResName & " is: " & $width & "x" & $height EndFunc resources.zip - UDF + examples + sample resource data for examples Previous downloads: 7195 resources.zip
    15 points
  50. Usually you get IP info by connecting to some site that echoes your IP address. The bad thing about that method is almost proverbial need of site administrators to make changes to sites or their policies requiring from you to frequently update your code. Another issue could be caching thingy of the Inet approach. I did some reading about alternative ways to get public IP, and initially tried with SMTP. This Works great but it's kind of slow and on top of that some ISPs tend to block users on port 25 to prevent spam. Then further reading lead me to STUN protocol documentation. STUN servers are made to resolve and echo users' IP addresses, and are often used by VoIP services. The protocol is extremly simple and everything happens very quickly. Client connects (it's UDP so you Know what Imean), sends request, server replies, client parses the response and IP is there. RFC5389 describes STUN in details, so knock yourself out, if you are that crazy. I have found some implementations written in c++ and c sharp, but OMG, some people are just to stubborn and love to write incomprehensible idiotic hundreds of thousands kilobytes of code for something as simple as STUN. That went nowhere for me and gave me only the pain, so I just fall back to RFC and wrote my own client based on documentation. Function is called STUN_GetMyIP() and you can find example of usage in this little script. It's UDP this and UDP that: STUN.au3 If something wouldn't work, do say.
    15 points
×
×
  • Create New...