Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/18/2014 in all areas

  1. Jon

    AutoIt v3.3.13.6 Beta

    File Name: AutoIt v3.3.13.6 Beta File Submitter: Jon File Submitted: 18 Jul 2014 File Category: Beta 3.3.13.6 (18th, 2014) (Beta) AutoIt: - Changed: Tables now called Maps. IsTable() now IsMap() - Changed: All Is... functions and UBound() now using internal ByRef optimization. - Changed: Numerous internal rewrites for Dim, Local, Global, Static. Function param passing. Testing needed! - Added: Test versions for MapAppend(), MapExists(), MapKeys() - dot notation versions still available for now. - Fixed: Regression with Dim $var = [1,2] syntax. UDFs: - Fixed: Undeclared variable in File.au3 due to internal changes. Click here to download this file
    3 points
  2. Dlund, From that reply I can only assume that you are not prepared to tell us as you are well aware that the subject would fall foul of the Forum rules. So, as I suspected would be the final result, the thread is locked. M23
    2 points
  3. 18 months ago I started this "best coding practices" thread and I'm happy to say that I can finally see the community taking pride in the code they produce and not using AutoIt as just some "scripting language" it once was.
    2 points
  4. Here's an enhanced version of _FFWindowOpen that supports private browsing. FYI, I have not tested to see how this update may affect other functions. Let me know if you see any issues. ; #FUNCTION# =================================================================== ; Name ..........: _FFWindowOpen ; Description ...: Opens a new browser window ; Beschreibung ..: Öffnet ein neues Browser Fenster. ; Syntax ........: _FFWindowOpen([$sURL = "about:blank"[, $bActivate = True[, $bLoadWait = True]]]) ; Parameter(s): .: $sURL - Optional: (Default = "about:blank") : ; $bActivate - Optional: (Default = True) ; $bLoadWait - Optional: (Default = True) : ; $bPrivate - Optional: (Default = False) : ; Return Value ..: Success - 1 and sets ; @EXTENDED - Window handle ; Failure - 0 and sets ; @ERROR - ; @EXTENDED - "" ; Author(s) .....: Thorsten Willert ; Date ..........: Fri Nov 13 18:31:06 CET 2009 ; Link ..........: https://developer.mozilla.org/En/DOM/Window, https://developer.mozilla.org/En/NsIWindowMediator ; Related .......: _FFWindowSelect, _FFWindowClose, _FFWindowGetHandle ; Example .......: Yes ; ============================================================================== Func _FFWindowOpen($sURL = "about:blank", $bActivate = True, $bLoadWait = True, $bPrivate = False) Local Const $sFuncName = "_FFWindowOpen" If Not __FFCheckURL($sURL) Then SetError(__FFError($sFuncName, $_FF_ERROR_InvalidDataType, "(URL) $sURL: " & $sURL)) Return 0 EndIf Local $bTrace = $_FF_COM_TRACE $_FF_COM_TRACE = False ConsoleWrite("_FFWindowOpen: " & $sURL & @CRLF) If $bPrivate Then _FFCmd("window.PrivateBrowsingUtils.privacyContextFromWindow(window).usePrivateBrowsing = true") Else _FFCmd("window.PrivateBrowsingUtils.privacyContextFromWindow(window).usePrivateBrowsing = false") EndIf _FFCmd("window.open('" & $sURL & "');") If $bLoadWait Then _FFLoadWait() If Not @error Then If _FFWindowSelect() Then Local $hWin = @extended If Not @error And $bActivate Then WinActivate($hWin) __FFSendJavaScripts() $_FF_COM_TRACE = $bTrace SetExtended($hWin) Return 1 EndIf EndIf $_FF_COM_TRACE = $bTrace SetExtended("") Return 0 EndFunc ;==>_FFWindowOpen
    2 points
  5. guinness

    ResourcesEx UDF.

    So if you haven't noticed Zedna's Resources UDF has been a very popular UDF over the last 7 years and was last updated in 2011, but now is the time to bring the UDF up to date with the current AutoIt language syntax (v3.3.14.2). So with the blessing of Zedna may I present to you ResourcesEx. It's built using the UDF standards I have tried to enforce around here, with improved documentation and an overall UDF structure. I please ask that you try and break the UDF, criticise, educate, whatever, just play around with the functions and example. I do ask that you just don't say "you've missed the point" and leave at that. Provide an alternative or constructive reason as to why I have "missed the point". Thanks. IMPORTANT: You must be using SciTE4AutoIt3, as this comes included with AutoItWrapper Changes between Zedna's UDF and guinness' UDF. _ResourceGet() => _Resource_Get() _ResourceGetAsString() => _Resource_GetAsString() with an additional param of whether to return ANSI. _ResourceGetAsStringW() => _Resource_GetAsString() _ResourceGetAsBytes() => _Resource_GetAsBytes() _ResourceGetAsImage() => _Resource_GetAsImage() _ResourceGetAsBitmap() => _Resource_GetAsBitmap() _ResourceSaveToFile() => _Resource_SaveToFile() _ResourceSetImageToCtrl() => _Resource_SetToCtrlID() _SetBitmapToCtrl() => _Resource_SetBitmapToCtrlID() As to JFX's question of what makes this different... Known problems/limitations: (Taken for Zedna's Resources UDF) _ResourceGet() returns resource size (in bytes) in @extended macro but not for resource type RT_BITMAP [FIXED] _ResourceSetImageToCtrl() works with "static/button" type of controls (picture,label,icon,button,checkbox,radiobutton,groupbox) [NO_ISSUE] _ResourcePlaySound() plays only WAV files (not MP3 files) [FIXED] _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 [FIXED] _GDIPlus_Startup() is called once at start of whole include --> no _GDIPlus_Shutdown() is called [FIXED] Download the ZIP and play around with the Example/UDF. ResourcesEx.zip Jos: 15-9-2022 Updated version replaced $__WINVER with _WinAPI_GetVersion() Jos: 27-4-2023 updated script as they required extra #include: ResourcesEx.zip Changelog: 2015/09/26 Changed: Comments throughout the UDF, removing trailing dot Fixed: Various cosmetic changes 2015/01/12 Fixed: Example directive using double equals sign Fixed: Delete functions not being cast as a bool value. (Thanks Synix) Fixed: @error and @extended not be passed back in nested functions e.g. _Resource_GetAsRaw() 2014/07/19 Added: _Resource_SetBitmapToCtrlID() formely known as _Resource_SetImageToCtrlID() Added: Note about using #AutoIt3Wrapper_Res_Icon_Add to the example. (Thanks Zedna) Added: Passing a blank string to _Resource_SetToCtrlID() through the $sResNameOrID parameter, will delete the image and previous handle Changed: _Resource_SetImageToCtrlID() now accepts a hBitmap not a HBITMAP object Fixed: _Resource_GetAsBitmap() now works the same way as _ResourceGetAsBitmap() did, by converting a jpg, png etc... to HBITMAP Fixed: Memory management of some functions 2014/07/18 Fixed: Destroying a cursor Fixed: Regression from loading the current of external module. (Thanks UEZ) 2014/07/17 Added: Additonal checks to destroy cursors and icons Added: Checking if the dll or exe filepath has a valid extension Added: Example of using an icon and image on a button control Fixed: Icons and cursors (finally) being re-sized to a control Fixed: Using GUIGetStyle() on a non-AutoIt handle would cause issue with controls Fixed: Variable naming of $sDLL to $sDllOrExePath for improved clarity Removed: Workaround for setting icons to AutoIt controls 2014/07/17 Added: Commented workaround in the example for re-sizing an icon control Added: ResourcesEx_PE.au3 created by PreExpand for all you constant variable haters out there!!! Fixed: Changelog comments and source code comments Fixed: Re-sizing icons when the control was different to the icon's size. (Thanks czardas for the MSDN link and Jon.) Fixed: Re-sizing cursors and icons in general 2014/07/15 Added: Comments about using SOUND for wav files and RT_RCDATA for mp3 files. (Thanks Melba23) Added: Option to relevant functions to re-size the image based on the control's dimensions. (Requested by kinch: http://www.autoitscript.com/forum/topic/51103-resources-udf/?p=1147525) Added: Using _Resource_LoadFont() example. (Thanks UEZ) Changed: Certain example resources to now use those found in %AUTOITDIR%\Examples\Helpfile\Extras Changed: Constants and enums readability. (Thank mLipok) Changed: Internal functions for destroying resources Changed: Removed changes made from the previous version for loading resources multiple times. The design needs to be re-thought Changed: Setting styles of controls using native AutoIt functions Fixed: Destroying control resource images would fail to show if reinstated again Fixed: Documentation comments Fixed: Missing certain users who helped with creating this UDF Fixed: Outdated SciTE files 2014/07/14: Added: _Resource_GetAsCursor(), for the loading of animated cursors and standard cursors which can then be used with _WinAPI_SetCursor() Added: _Resource_GetAsIcon(), for loading icon resource types Added: _Resource_LoadFont(), which retrieves a font resource and adds to the current memory of the associated module Added: _Resource_SetCursorToCtrlID() and _Resource_SetIconToCtrlID() Added: Additional resource types to destroy on exit, including $RT_FONT, $RT_ICON and $RT_MENU Added: Playing Mp3s to _Resource_LoadSound(). (Thanks to UEZ and Melba23 with changes made by me.) Changed: _Resource_GetAsBitmap() returns a HTBITMAP handle without converting from hBitmap to HBITMAP Changed: _Resource_PlaySound() to _Resource_LoadSound() Changed: _Resource_SetBitmapToCtrlID() to _Resource_SetImageToCtrlID() Changed: _SendMessage() to GUICtrlSendMsg() Changed: Example files Changed: Setting $iError in the internal get function Changed: Signature of _Resource_Destroy() Changed: Updated example to reflect major changes to the ResourcesEx UDF Changed: Various UDF tweaks that I didn't document because I simply couldn't keep track of all the playing around I did in the last week Fixed: _Resource_GetAsImage() not returning an error when a bitmap couldn't be found in the resource table Fixed: Retrieving length of a string Fixed: Using the current module instead of zero in _Resource_LoadSound() Fixed: Various comment changes. (Thanks mLipok) Fixed: Loading resources multiple times. This is fixed thanks to using the internal storage array 2014/07/07: Added: _Resource_Destroy() and _Resource_DestroyAll() to destroy a particular resource name or all resources Added: Checking if the resource name of id value is empty Added: Descriptions, though could do with a little tweaking Changed: _Resource_Get() to _Resource_GetAsRaw() Changed: Internal workings of __Resource_Storage() Changed: Re-size the storage array when destroyed or on shutdown Fixed: _Resource_GetAsString() with default encoding of ANSI Fixed: Calltips API referencing Resources.au3 and not ResourcesEx.au3 Removed: _Resource_Shudown() due to the addition of _Resource_Destroy() and _Resource_DestroyAll() 2014/07/06: Added: _Resource_Shudown() to free up those resources which aren't loaded using _WinAPI_LockResource(). UnlockResource is obsolete Added: Support for using $RT_STRING Changed: _Resource_GetAsString() now works correctly for most encodings. (Thanks Jos) Changed: _Resource_GetAsString() will now load as a string if the resource type requested is $RT_STRING 2014/07/04: Added: #Regions. (Thanks mLipok) Added: #Tidy_Parameters=/sort_funcs /reel (Thanks mLipok) Added: All optional params now accept the default keyword Added: Link to this thread. (Thanks mLipok) Added: Main header. (Thanks mLipok) Changed: $f.... >> $b..... (Thanks mLipok) 2014/07/03: Initial release
    1 point
  6. Please see this page on the AutoIt Wiki for the most frequently asked questions and answers. The FAQ consists of commonly repeated questions that many users ask and usually in most cases are easy to answer with a quick search. Having trouble running a script? You may need the latest beta version of AutoIt. The latest beta version can be found here.
    1 point
  7. Danp2

    Need help for _FFclick

    You should use Firebug to help you determine the attributes of the element you are interested in clicking. Then you would pass these attributes to _FFClick. The sample script works properly for me. There have been some corrections to the UDF posted in the main Examples section thread. I suggest that you apply those and then let us know if you are still having issues.
    1 point
  8. Its not pretty but I was able to: 1. Goto the website 2. Select all text (CTRL + A) 3. Copy selected text (Ctrl + C) 4. Open notepad 5. Paste the data (Ctrl + V) 6. Search for Van Gaal's major titles (CTRL + F) 7. Goto the beginning of the line (Home Key) 8. Hold down shift and the ctrl + Home to select all the text above the line "Van Gaal's major titles" 9. Hit delete to remove selected data 10. Search for 'When you repeat that, everybody thinks like that' (Ctrl + F) 11. Goto the end of the line (End key) 12. Select everything under the end of the last line (Shift + CTRL + End) 13. Delete the selected data and save the text file. Hope this helps
    1 point
  9. None taken on both sides. This is a >good read on creating code without global variables. I also created >code myself with the approach I use these days in AutoIt. Hopefully it will give you and others some inspiration too.
    1 point
  10. guinness

    ResourcesEx UDF.

    New version. See the first post for more details. Changelog: 2014/07/17 Added: Commented workaround in the example for re-sizing an icon control. Added: ResourcesEx_PE.au3 created by PreExpand for all you constant variable haters out there!!! Fixed: Changelog comments and source code comments. Fixed: Re-sizing icons when the control was different to the icon's size. (Thanks czardas for the MSDN link and Jon.) Fixed: Re-sizing cursors and icons in general.
    1 point
  11. Wombat

    Newbie Question

    I began by looking for tutorials and whatnot, but alas the best thing to do is learn how to use google + this forum and just search for what it is you are wanting to do. 9 times out of 10 it's been done before (maybe differently than you are approaching it) and all you need to do is ask the right question to get the right answer. Coding and life in general can be surmised by this statement: You get out of it what you put in to it. So if you're not getting what you want out of it you are not inputting the required content. Computers are at this time re-active, they do what you tell them to or what others have told them to do. So if you are having trouble finding what you're looking for on the forum, maybe change how you are looking for it. Also, remember search engines run on databases and are best utilized with keywords not entire sentences. You limit your results when using complete sentences. If you are looking for examples check here and look through and see how they are doing theirs: http://www.autoitscript.com/forum/forum/9-example-scripts/ If you want to get an idea of how you can start, 1 way at least, then open SciTE and go to Tools>Koda(form designer) and play around with it, once you have a gui you like press generate form code and look at how the code behind the form you just made is laid out. This is how I got started. good luck
    1 point
×
×
  • Create New...