Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/16/2016 in all areas

  1. Simple snowfall using GDI+ & ASM. Thanks to Eukalyptus for the ASM codes. If the script runs too slow reduce the amount of flakes in line 115. You can switch now between local MP3 stream and internet stream. Further you can also set the scrolling text. Command line options: -local "<path to local MP3 file>" -url "<URL to a MP3 file>" -text "<your individual text>" Max. text length are 500 chars. Don't forget the double quotes after the parameters! Download: click me Happy snowing and romantic moments...
    3 points
  2. IE Embedded Control Versioning Use IE 9+ and HTML5 features inside a GUI This UDF allows the use of embedded IE controls which support IE versions greater than IE 7. By default, all embedded IE controls default to IE 7 compatibility mode (unless for some reason somebody has IE 6 installed!), so its not possible to use most of the HTML5 features available today. Fortunately, IE 9 and greater allow the use of HTML5, and the embedded IE control actually supports it. The problem is convincing Windows to let your program actually use those features! There are Registry branches that modify how an IE control works in specific programs. Those branches are: HKCU\Software\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION HKLM\SOFTWARE\Microsoft\Internet Explorer\MAIN\FeatureControl\FEATURE_BROWSER_EMULATION In at least one of these branches, the executable name needs to appear as a value name ("autoit.exe" for example), and the value data needs to indicate what IE version to 'emulate'. The value data is actually dependent on the version and whether quirks-mode is enabled. See Web Browser Control - Specifying the IE Version for more information. Note that a 64-bit O/S needs adjustments to the HKLM paths. Also, prefer the HKCU branch unless the program needs to enable access across all user accounts. HTML5 Canvas Element Example Anyway, all the complexity of setting the right value with the right name with the right 32/64-bit branch is handled for you in this UDF. Enabling support for IE9+, and new HTML5 features, is as simple as making one call to _IE_EmbeddedSetBrowserEmulation(). _IE_EmbeddedSetBrowserEmulation() takes an executable name (@AutoItExe if none is provided), and checks the Registry for an entry for it. If it doesn't find one, it will create one and enable support for later versions of IE. The full parameters to the function are as follows: _IE_EmbeddedSetBrowserEmulation($nIEVersion, $bIgnoreDOCTYPE = True, $bHKLMBranch = False, $sExeName = @AutoItExe) The parameter passed in $nIEVersion can be anything from 8 to 11 [or 12+ in the future], or just the current version of IE, which is available also through a call to _IE_EmbeddedGetVersion(). $bIgnoreDOCTYPE controls when IE will go into quirks mode based on any "<!DOCTYPE>" declarations on webpages. This mode can cause major problems, so by default it is set to ignore it (set this to False to enable it). $bHKLMBranch controls where in the registry the Browser Emulation Mode setting will be stored. If you wish to store the mode for ALL users, set this parameter to True. Note, however, that elevated privileges are required for modifying the HKLM branch! If the call to _IE_EmbeddedSetBrowserEmulation() is successful, then you can enable a (more) HTML5 compliant IE browser control in a GUI. The complete set of functions in the UDF: _IE_EmbeddedGetVersion() ; Gets version of IE Embeddable Control (from ieframe.dll or Registry) _IE_EmbeddedGetBrowserEmulation() ; Gets Browser Emulation Version for given Executable (or 0 if not found) _IE_EmbeddedSetBrowserEmulation() ; Sets Browser Emulation Version. NOTE: HKLM branch REQUIRES ELEVATED PRIVILEGES! _ IMPORTANT: Setting the embedded browser object to a newer version of IE may alter the behavior of some things. See documenation for the HTMLDocumentEvents2 interface and HTMLAnchorEvents2 interface for example. Also, there is at least one difference in behavior noted by mesale0077 in working with IE10 (and possibly other versions of IE) - clicks for elements inside an <a> anchor tag will register as the actual internal element rather than the surrounding anchor. For example, an <img> element wrapped by an <a> anchor will only send the click to the <img> element and not propagate it any further. A workaround for this is to check the parentNode to see if it is an <a> element. See the discussion in the >ObjEvent dont work thread. It could be that there's some other reason for this behavior, but nothing has come to light yet. As an aside, also see trancexx's response in >ObjEvent usage for more techniques for capturing IE events. History: An example of HTML5 use, which has a little interactive Canvas, follows (requires IE9 or higher!): #include "IE_EmbeddedVersioning.au3" ; =============================================================================================================================== ; <IE_EmbeddedHTML5Example.au3> ; ; Example of using 'IE_EmbeddedVersioning' UDF ; ; This example 1st attempts to set the Browser Emulation information in the registry, then ; creates an embedded IE control with an interactive HTML5 Canvas element. ; ; Author: Ascend4nt ; =============================================================================================================================== #Region IE_CANVAS_EXAMPLE #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <IE.au3> ; ----------- ; GLOBALS ; ----------- Global $bMouseDown = False, $iLastX1 = 0, $iLastY1 = 0 Global $g_oCanvas, $g_oCtx Global $hGUI, $ctGUI_ErrMessageLabel Global $GUI_IE_Obj Global $nRet = _WinMain() ; Optionally remove valuename at Exit (not recommended if compiled to executable) ;~ _IE_EmbeddedRemoveBrowserEmulation() Exit $nRet ; ====================================================================================================== ; Embedded IE Browser-Emulation Fix + HTML5 Example ; ====================================================================================================== Func _WinMain() ConsoleWrite("@AutoItX64 = " & @AutoItX64 & ", IsAdmin() = " & IsAdmin() & @CRLF) ;; Get Current IE Embeddable Control Version (from ieframe.dll) Local $sIEVer = _IE_EmbeddedGetVersion(), $nIEVer = @extended ConsoleWrite("Embedded Version = " & $sIEVer & ", as Int: " & $nIEVer & ", @error = " & @error & @CRLF) ; Old IE version w/o HTML5 support? Exit If $nIEVer < 9 Then Return MsgBox(0, "Old IE Version", "IE version is less than 9, HTML5 example will not work") ;; Current Browser Emulation Mode for this executable (if exists) Local $nIEBEVer = _IE_EmbeddedGetBrowserEmulation() ConsoleWrite("GetEmbeddedVersion: " & $nIEBEVer & ", @error = " & @error & ", @extended = " & @extended & @CRLF) ;; Set Browser Emulation Mode for this executable (if not already set or set to a different version) ; HKCU Branch: _IE_EmbeddedSetBrowserEmulation() ; HKLM Branch: ;_IE_EmbeddedSetBrowserEmulation(-1, True, True) If @error Then ; -1 error means trying to access HKLM, so script needs elevation to access the Registry If @error = -1 Then If MsgBox(32 + 3, "Elevation Required", "Elevate script to enable setting Browser Emulation Mode?") = 6 Then Return _ReRunIfNotElevated() Return 1 EndIf Return MsgBox(0, "Error", "Couldn't set Browser Emulation mode") EndIf ;Local $oErrorHandler = ObjEvent("AutoIt.Error", "_ErrFunc") ;; Create Embedded Browser Control and GUI Local $oIE = _IECreateEmbedded() ; GUI (vars are Global) $hGUI = GUICreate("Embedded Web control Test", 460, 360, -1, -1, $WS_OVERLAPPEDWINDOW + $WS_CLIPSIBLINGS + $WS_CLIPCHILDREN) $GUI_IE_Obj = GUICtrlCreateObj($oIE, 10, 10, 440, 340) $ctGUI_ErrMessageLabel = GUICtrlCreateLabel("", 100, 500, 500, 30) GUICtrlSetColor(-1, 0xff0000) GUISetState(@SW_SHOW) ;Show GUI ; Doesn't work (at least for keyboard focus): ;~ ControlFocus($hGUI, '', $GUI_IE_Obj) ;; Initialize Embedded Control and write some HTML5 data to it _IENavigate($oIE, 'about:blank' ) ; Basic Near-Empty HTML (with minimal CSS styling for Canvas element) Local $sHTML = '<!DOCTYPE html>' & @CR & '<html>' & @CR & '<head>' & @CR & _ '<meta content="text/html; charset=UTF-8" http-equiv="content-type">' & @CR & _ '<title>Experiments</title>' & @CR & _ '<style>canvas { display:block; background-color:white; outline:#00FF00 dotted thin;}</style>' & @CR & _ '</head>' & @CR & '<body>' & @CR & '</body>' & @CR & '</html>' _IEDocWriteHTML($oIE, $sHTML) _IEAction($oIE, "refresh") ;; Setup Event Object Functions Local $oEventsDoc = ObjEvent($oIE.document, "Event_", "HTMLDocumentEvents2") #forceref $oEventsDoc ;~ ConsoleWrite("Obj Name = " & ObjName($oIE) & @CRLF) ;~ ConsoleWrite("Location = " & $oIE.document.location.pathname & @CRLF) ; -------------------------------------------------------------------------------------- ; Create Canvas Element through the DOM (optionally just add it in the HTML5 above) ; ------------------------------------------------- ; Note: Support in browsers, see "Can I use..." ; @ http://caniuse.com/#feat=canvas ; and @ http://caniuse.com/#search=canvas ; ------------------------------------------------- ; IE minimum is version 9+, 10+ has more features, but WebGL support requires version 11+ ; -------------------------------------------------------------------------------------- $g_oCanvas = $oIE.document.createElement("canvas") $g_oCanvas.id = "myCanvas" ;~ ConsoleWrite("Canvas ID = " & $g_oCanvas.id & @CRLF) $oIE.document.body.appendChild($g_oCanvas) ; Optionally, if added already through the HTML5 text: ;Local $g_oCanvas = _IEGetObjById($oIE, "myCanvas") If @error Then Return MsgBox(0, "Error", "Error creating/accessing Canvas") ;; Tweak Canvas Size, Move into View ;~ ConsoleWrite("window innerwidth = " & $oIE.document.parentWindow.innerWidth & @CRLF) ;$oIE.document.parentWindow.scrollTo(0, 10) $g_oCanvas.width = 420 $g_oCanvas.height = 320 ;ConsoleWrite("Canvas item offsetTop = " & $g_oCanvas.offsetTop & @CRLF) $g_oCanvas.scrollIntoView() ;; Grab the Canvas 2D Context $g_oCtx = $g_oCanvas.getContext("2d") ;; Example Drawing: Gradiant Local $oGrad = $g_oCtx.createLinearGradient(0,0,0,60) If IsObj($oGrad) Then $oGrad.addColorStop(0, "red") $oGrad.addColorStop(1, "blue") $g_oCtx.fillStyle = $oGrad EndIf $g_oCtx.fillRect(0,0,419,60) ;; Example Drawing: Text $g_oCtx.font = "30px serif" $g_oCtx.fillStyle = "white" $g_oCtx.textBaseline = "top" $g_oCtx.fillText("HTML5 Canvas Drawing!", 50, 10) ;; Example Drawing: Circle, Line $g_oCtx.beginPath() $g_oCtx.arc(200, 100, 20, 0, ACos(-1) * 2) $g_oCtx.fillStyle = "red" $g_oCtx.fill() $g_oCtx.beginPath() $g_oCtx.lineWidth = "3" $g_oCtx.strokeStyle = "green" $g_oCtx.moveTo(185, 85) $g_oCtx.lineTo(215, 115) $g_oCtx.stroke() ; Waiting for user to close the window While GUIGetMsg() <> $GUI_EVENT_CLOSE Sleep(10) WEnd GUIDelete() EndFunc ; ====================================================================================================== ; IE Event Functions - React to Mouse events with some Canvas graphics ; ====================================================================================================== #Region IE_EVENT_FUNCS ; For right-click, the context menu pops up, UNLESS we change the Event's 'returnValue' property Volatile Func Event_oncontextmenu($oEvtObj) If IsObj($oEvtObj) Then ; Convert to string so that 0 doesn't match EVERY string Local $sId = $oEvtObj.srcElement.id & "" If ($sId = "myCanvas") Then $oEvtObj.returnValue = False EndIf EndFunc Volatile Func Event_onmousedown($oEvtObj) If IsObj($oEvtObj) And IsObj($g_oCtx) Then ; Map click coordinates to Canvas coordinates $iLastX1 = $oEvtObj.x - $g_oCanvas.offsetLeft $iLastY1 = $oEvtObj.y - $g_oCanvas.offsetTop ;~ ConsoleWrite("Downclick recvd at X1: " & $iLastX1 & ", Y1: " & $iLastY1 & ", MouseButton [1 = left, 2 = right, etc] = " & $oEvtObj.button & @CRLF) ; Check if click was in fact within Canvas element If $iLastX1 >= 0 And $iLastX1 < $g_oCanvas.width And $iLastY1 >= 0 And $iLastY1 < $g_oCanvas.height Then ; Signal mouse-down occurred inside Canvas $bMouseDown = 1 ; Make a small square where initial down-click was detected $g_oCtx.fillStyle = "blue" $g_oCtx.fillRect($iLastX1 - 2, $iLastY1 - 2, 3, 3) EndIf EndIf EndFunc Volatile Func Event_onmouseup($oEvtObj) If IsObj($oEvtObj) And IsObj($g_oCtx) Then ;~ ConsoleWrite("MouseUp" & @LF) If $bMouseDown Then Local $iX = $oEvtObj.x - $g_oCanvas.offsetLeft, $iY = $oEvtObj.y - $g_oCanvas.offsetTop ; Random color in "#0f1100" (RGB) string form Local $sColor = "#" & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) & Hex(Random(0, 255, 1), 2) ;; Draw either a line or circle depending on where the mouse button is released If $iX = $iLastX1 And $iY = $iLastY1 Then ; Circle if mouse start = mouse end $g_oCtx.beginPath() $g_oCtx.arc($iX, $iY, 8, 0, ACos(-1) * 2) $g_oCtx.fillStyle = $sColor $g_oCtx.fill() Else ; Line if mouse start <> mouse end $g_oCtx.beginPath() $g_oCtx.lineWidth = "3" $g_oCtx.strokeStyle = $sColor $g_oCtx.moveTo($iLastX1, $iLastY1) $g_oCtx.lineTo($iX, $iY) $g_oCtx.stroke() EndIf $bMouseDown = 0 EndIf EndIf EndFunc Volatile Func Event_onkeydown($oEvtObj) If IsObj($oEvtObj) Then ConsoleWrite("Event type: " & $oEvtObj.type & "id (0 is document) = " & $oEvtObj.srcElement.id) ConsoleWrite(", keycode = " & $oEvtObj.keyCode & ", shiftkey = " & $oEvtObj.shiftKey & @CRLF) EndIf EndFunc ; ====================================================================================================== #EndRegion IE_EVENT_FUNCS #EndRegion IE_CANVAS_EXAMPLE #Region UTIL_FUNCS ; ====================================================================================================== ; Func _ReRunIfNotElevated() ; ; Does what it says. (rumored to occasionally say what it does) ; ; Author: Ascend4nt ; ====================================================================================================== Func _ReRunIfNotElevated() If IsAdmin() Then Return 0 Else If @Compiled Then ; If compiled to A3X, we need to execute it as if not compiled. Local $sCmd = (@AutoItExe = @ScriptFullPath) ? "" : ("/AutoIt3ExecuteScript " & @ScriptFullPath) Return ShellExecute(@AutoItExe, $sCmd, @ScriptDir, "runas") Else Return ShellExecute(@AutoItExe,@ScriptFullPath,@ScriptDir,"runas") EndIf EndIf EndFunc #EndRegion UTIL_FUNCS IEEmbeddedVersioning.zip ~prev Downloads: 61 Also, HTML5+Javascript standalone Canvas demo (should run in any browser): HTML5StandaloneCanvasDemo.zip
    2 points
  3. minxomat

    Recommended feature!

    I already use HTML for UI's in AutoIt. Search the forum for embedded IE 11 (or something like that). This allows you to include newer versions of IE and fire precise events from the DOM back to AutoIt, allowing seamless integration. Below is a screenshot from a project I did a while ago but dropped (IDE for Perseus 6). The whole GUI is done by AutoIt, except for the code editor field, which is an embedded, local, HTML page. The framework, the project treeview and toolbar etc. are AutoIt controls used in unusual ways. Why? Because it is something AutoIt is not made for and ultimately can't do: Display large amounts of styles dynamic content. That is what HTML and CSS are for and the possibility to use it is already there - you just have to put some effort into it. Don't expect a programming language to spoonfeed you the right tools . BTW: The icons used are already on your system. They are defined in the OEM Unicode section of the Windows System font (use charmap to explore): Segoe UI (Light/Symbol/Math). Be sure to experiment with the antialiasing option of GuiCtrlSetFont to get rid of some artifacts. Project Explorer Closed Project Explorer Open
    2 points
  4. open 150times :3 i love it
    2 points
  5. Gianni

    Recommended feature!

    thanks for the refreshing of my memory by pointing to that post, I liked that post long ago. I thought instead of an easy way to pass parameters from autoit to javascript's methods and get results back to autoit. (in a way like if you were using native features of AutoIt.... )
    1 point
  6. darknezz21, Why are you still using my old UDF? As I explained above, it is now deprecated and you should use the standard _FileListToArrayRec UDF. And of course the RegEx will not work as you have coded it - the pattern will never match. If you leave the command exactly as I posted it will work. M23
    1 point
  7. darknezz21, The comment refers to excluding certain file extensions from the returned array - not removing the extensions from the returned files. My ChooseFileFolder UDF does have this functionality when displaying a file list (I use it when listing mp3 files) but that is not a lot of use to you. I think you are going to have to remove the extensions in a loop like this: #include <File.au3> Local $aFileList = _FileListToArrayRec(@ScriptDir, "*.*|*.au3", $FLTAR_FILES, $FLTAR_NORECUR, $FLTAR_NOSORT) If @error = 1 Then MsgBox($MB_SYSTEMMODAL, "", "Path was invalid.") Exit EndIf If @error = 4 Then MsgBox($MB_SYSTEMMODAL, "", "No file(s) were found.") Exit EndIf ; Now loop and remove the extension For $i = 1 To $aFileList[0] $aFileList[$i] = StringRegExpReplace($aFileList[$i], "^.*\\|\..*$", "") Next _ArrayDisplay($aFileList, "$aFileList") MsgBox($MB_SYSTEMMODAL, "", $aFileList[1]) Note that the deprecated _RecFileListToArray UDF is now part of the standard UDFs (with a slightly different name) and has a different syntax for the excluded files and folders as you can see - look in the Help file for more details. M23
    1 point
  8. Yeah, I won't .... I've had a memory lapse and I can't remember where I put them.
    1 point
  9. Added 2 additional versions. v1.1.2: plays C64 SID tune v1.1.3: streams a MP3 from http://remix.kwed.org Download
    1 point
  10. minxomat

    Recommended feature!

    And here's the other trick I know: Use 32bit Bitmaps. You probably don't know what they are or that AutoIt supports them, so I give you the TL;DR: 32bit Bitmaps (aka Bitmap 5) are 8bit-transparent .BMP files. That means you can design UI elements as PNGs (with dropshadows and whatnot) and convert them using this utility. You won't be able to display them in the Windows photo viewer etc, but once loaded using GuiCtrlCreatePic, they're displayed with transparency and can be overlayed and handled just like ordinary controls. Furthermore, you can set the drawing z(!) direction using the extended window styles. Also pay attention to the order you create your controls in. Another tip: No harm is done if you utilize child GUIs to build easily manageable custom controls. You can also access the DeviceContext of every control, especially aforementioned bitmaps to apply other effects using clever blitting algorithms. The Windows MSIMG32.DLL provides some excellent tools for alphablending two or more DCs btw. Here's another screenshot of another project I did ages ago (for a client), where they gave me an SVG spritesheet of all pre-designed UI elements and I used the tricks mentioned above to put together a small interactive GUI. This shows the project in the early prototype (or proof-of-work) stage. Every element is working and interact-able, but the whole script only uses a couple of AutoIt controls bundled to custom controls using child GUIs.
    1 point
  11. mLipok

    flash website elements

    I do not know, maybe this:
    1 point
  12. Yes, sorry should have mentioned vbox is a bit of a butt when it comes to snapshots. If you are deleting snapshots without wanting to merge you have to start with the latest snapshot and work your way backward or they will merge, whereas VMware Workstation does just what you would intuitively expect, deletes just that snapshot. So if you have 5 snapshots and want to save number 2, you have to delete #5, then #4, then #3. You can also do something like this: Example, you start with 4 snapshots, want to revert to snapshot 2 and delete 3 and 4. Choose Snapshot 2 and select "Restore Snapshot".This will produce a "Current State" item beneath Snapshot 2.You can then safely delete snapshots 3 and 4 without merging.
    1 point
  13. Here ya go, this worked for me. I took out the ByRef in the parameters of the function since AutoIt is having issues combining strings in the function call, for some strange reason, and not letting me do it properly. #include <GUIConstantsEx.au3> #include <ButtonConstants.au3> #include <GDIPlus.au3> #include <ScreenCapture.au3> Example() Func Example() GUICreate("My GUI") ; will create a dialog box that when displayed is centered Local $sImagePath = @ScriptDir & "\" Local $sOldImage = "Downloaded.jpg" Local $sNewImage = "Downloaded.bmp" InetGet("https://scontent-ord1-1.xx.fbcdn.net/hphotos-xpt1/v/t1.0-9/12418116_880965192022234_6972350528783742954_n.jpg?oh=4d2ecc65e263a37df0fed82910cfcfbf&oe=57409FEF", $sImagePath & $sOldImage) ConvertToBmp($sImagePath & $sOldImage, $sImagePath & $sNewImage) ResizeImage($sImagePath & $sNewImage, 260, 260) $Btn = GUICtrlCreateButton("my picture button", 10, 10, 260, 260, $BS_BITMAP) GUICtrlSetImage(-1, $sImagePath & $sNewImage) GUISetState(@SW_SHOW) ; Loop until the user exits. While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop case $Btn MsgBox("", "", "Button Pressed!") EndSwitch WEnd EndFunc ;==>Example ; #FUNCTION# ==================================================================================================================== ; Name...........: ConvertToBmp ; Description ...: Convert any image file to BMP format ; Syntax.........: ConvertToBmp(Const ByRef $sFileToConvert, Const ByRef $sFileToSave) ; Parameters ....: $sFileToConvert - String path of the file to be converted. (C:\Users\User\Pictures\Pic.png) ; $sFileToSave - String path of the file to save as. (C:\Users\User\Pictures\Converted Pic.bmp) ; Return values .: Success - Returns True ; Failure - Returns False ; =============================================================================================================================== Func ConvertToBmp(Const $sFileToConvert, Const $sFileToSave) ; Start GDIPlus _GDIplus_Startup() ; Load the image to convert Local $hImage = _GDIPlus_ImageLoadFromFile($sFileToConvert) If (@Error) Then MsgBox("", "Load image failed", "Failed to load image " & $sFileToConvert & @CRLF & "Error code = " & @Error & @CRLF & "Extended error = " & @Extended) ; Get encounter for BMP file Local $sCLSID = _GDIPlus_EncodersGetCLSID("BMP") If (@Error) Then MsgBox("", "Encoder failed", "Failed to get encoder CLSID for BMP file type" & @CRLF & "Error code = " & @Error & @CRLF & "Extended error = " & @Extended) ; Same image as BMP type Local const $bSaveImage = _GDIPlus_ImageSaveToFileEx($hImage, $sFileToSave, $sCLSID) If (@Error) Then MsgBox("", "Save image failed", "Failed to save image " & $sFileToSave & @CRLF & "Error code = " & @Error & @CRLF & "Extended error = " & @Extended) ; Clean up resources _GDIPlus_ImageDispose($hImage) _GDIPlus_Shutdown() Return $bSaveImage EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: ResizeImage ; Description ...: Convert any image file to BMP format ; Syntax.........: ResizeImage(Const ByRef $sFileToResize, Const ByRef $iWidth, Const ByRef $iHeight) ; Parameters ....: $sFileToResize - String path of the file to be resized. (C:\Users\User\Pictures\Pic.png) ; $iWidth - New width of the image. ; $iHeight - New height of the image. ; Return values .: Success - Returns True ; Failure - Returns False ; =============================================================================================================================== Func ResizeImage(Const $sFileToResize, Const $iWidth, Const $iHeight) _GDIplus_Startup() Local $hImage = _GDIPlus_ImageLoadFromFile($sFileToResize) If (@Error) Then MsgBox("", "Load image failed", "Failed to load image " & $sFileToResize & @CRLF & "Error code = " & @Error & @CRLF & "Extended error = " & @Extended) Local $hImageResized = _GDIPlus_ImageResize($hImage, $iWidth, $iHeight) Local $bReturn = @Error If ($bReturn) Then MsgBox("", "Resize image failed", "Failed to resize image " & $sFileToResize & @CRLF & "Error code = " & @Error & @CRLF & "Extended error = " & @Extended) _GDIPlus_ImageDispose($hImage) If ($hImageResized) Then ; Delete the old file so save image works properly FileDelete($sFileToResize) EndIf ; Save the resized image if resizing succeeded _GDIPlus_ImageSaveToFile($hImageResized, $sFileToResize) ; Clean up resources _GDIPlus_ImageDispose($hImage) _GDIPlus_ImageDispose($hImageResized) _GDIPlus_Shutdown() Return Not $bReturn EndFuncAlso wanted to let you know there's a function called _GDIPlus_ImageGetWidth and _GDIPlus_ImageGetHeight that will get the width and height of your image (once loaded from file) so you could resize the button to fit the image or use the function to resize the image to fit the button.
    1 point
  14. Thanks for the explanation. Sounds legit to me.
    1 point
  15. HotStrings Example scripts. EDIT: Does not seem like key logger to me.
    1 point
  16. What you still didn't answer: Why does your script need to sense keys in a specific order?
    1 point
  17. Mat

    AutoIt Language Tools

    An Abstract Syntax Tree (so the left/right tree structure) is how it's always done (well, except LISP maybe, but even that results in a tree like structure). The problem I was trying to solve was that AutoIt is not really that good at storing a tree structure. Nested arrays aren't efficient, and we don't have structures/classes and pointers. So the only new thing, is trying to use one array to describe a tree.
    1 point
  18. #include <GUIConstantsEx.au3> #include <EditConstants.au3> $sText = "A nice long string to get the input scrolled to the right" $hGUI = GUICreate("Test", 300, 100) $cInput = GUICtrlCreateInput($sText, 10, 10, 200, 20) GUISetState() GuiCtrlSendMsg($cInput, $EM_SETSEL, 0, 0) While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd
    1 point
  19. DickG, Or perhaps like this: #include <GUIConstantsEx.au3> $sText = "A nice long string to get the input scrolled to the right" $hGUI = GUICreate("Test", 500, 500) $cInput = GUICtrlCreateInput($sText, 10, 10, 200, 20) GUISetState() ControlSend($hGUI, "", $cInput, "{HOME}") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndM23
    1 point
×
×
  • Create New...