Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 04/05/2017 in all areas

  1. spudw2k

    multi MsgBox dont wanted

    Here's a simple hack: #include <GuiConstantsEx.au3> #include <Windowsconstants.au3> #include <SendMessage.au3> #include <WinAPI.au3> ;~ HotKeySet("{[}", "_boxminus") HotKeySet("{]}", "_boxplus") HotKeySet("{ESC}", "On_Exit") $hGUI = GUICreate("", 100, 100, -1, -1, $WS_POPUP, BitOr($WS_EX_LAYERED, $WS_EX_COMPOSITED, $WS_EX_TOPMOST)) GUISetBkColor(0x00FF00) GuiCtrlCreateLabel("", 3, 3, 94, 94) GUICtrlSetBkColor(-1, 0xABCDEF) GUICtrlSetResizing(-1, $GUI_DOCKBORDERS) GUISetState() _WinAPI_SetLayeredWindowAttributes($hGui, 0xABCDEF) $box_range = 100 While 1 $pos = MouseGetPos() WinMove($hGUI, "", $pos[0] - ($box_range / 2), $pos[1] - ($box_range / 2), $box_range, $box_range) WEnd ;~ Func _boxminus() ;~ If $box_range >= 30 Then $box_range = $box_range - 10 ;~ If $box_range < 30 Then $box_range = $box_range - 1 ;~ EndFunc Func _boxplus() If $box_range < 200 Then $box_range = $box_range + 10 Else HotKeySet("{]}") MsgBox(0,"ERROR", "Maximum size already exist") HotKeySet("{]}", "_boxplus") EndIf EndFunc Func On_Exit() Exit EndFunc
    2 points
  2. Verssuss, Why did you not post in the UDF thread as I suggest to you earlier? After considerable testing since you PMed me about the problem I can now reproduce the same error on occasion - it happens if you keep the "w" key depressed permanently and the HotKey fires again before the previous _Insert function has completed - it interrupts that function in mid flow and so the error occurs as the new instance now thinks that the actual ListView content and the UDF shadow are not in sync. Quite why you would want to add items to a ListView in such quick succession is beyond me, but you can solve the problem by unsetting the HotKey as you enter the function and resetting it as you leave. That way the HotKey will only fire again once the UDF has completed inserting the previous row: Func _wait() HotKeySet("w") ; Unset HotKey <<<<<<<<<<<<<<<<<<<<<<<<<<< $nazwa = $nazwa + 1 Global $vData[6] = ["Name " & $nazwa, "Wait", "", "", "", ""] $iCount += 1 _GUIListViewEx_Insert($vData) HotKeySet("w", "_wait") ; Reset HotKey <<<<<<<<<<<<<<<<<<<<<<<<<<< EndFunc ;==>_wait M23
    1 point
  3. Subz

    Shortcut launch error

    Compiling the original as x64 should do the same thing. It appears you're trying to execute 64 bit app via 32 bit compiled script.
    1 point
  4. Gianni

    Get Data OFF Webpage

    seems you need functions from the ie.au3 library. to extract a table from a web page opened within internet explorer, have a look to the _IETableWriteToArray() function examples and related examples on the forum..
    1 point
  5. Jfish

    exercices for autoit

    I am guessing the OP meant my download ...
    1 point
  6. Subz

    String button click

    Here is a really basic example to get you started: #include <IE.au3> Local $sURL = "https://www.autoitscript.com/autoit3/docs/libfunctions/_IELinkGetCollection.htm" Local $oIE = _IECreate($sURL) Local $oLinks = _IELinkGetCollection($oIE) For $oLink In $oLinks If StringStripWS($oLink.InnerText, 7) = "_IEAction()" Then _IEAction($oLink, "Click") ExitLoop EndIf Next
    1 point
  7. For a ListView you should not use any of these functions but _GUICtrlListView_RedrawItems. For a TreeView it doesn't matter which function to use. Personally, I prefer _WinAPI_RedrawWindow( $hTV, 0, 0, $RDW_INVALIDATE ) because it clearly tells what's going on: The TreeView window is invalidated and then redrawn.
    1 point
  8. Sooo...after long waiting the ISN AutoIt Studio Version 1.04 is finally out! Happy testing! Changelog: (translated by google) -> ISN AutoIt Studio: <- ----------------------------------- - Bugfix: Various bug fixes - Bugfix: The navigation menu in the program settings now has a scroll bar (if too many elements are open) - Bugfix: CPU utilization of the ISN optimized at idle - Bugfix: MDI windows of the ISN AutoIt Studios can no longer be moved out of the desktop by accident - Bugfix: If the ISN Form Studio was active, the ISN could not be restored from the taskliste. This is now fixed! (FINALLY!) - Bugfix: Chinese Encoding improved - NEW: Italian language update (thx to Stefano cerbioni) - NEW: Chiesian language update (thx to bfgxp) - NEW: The position and size of the main window can now be saved when the ISN AutoIt Studio is terminated and restored the next time you start it. This option can be activated in the program settings under "Display". - NEW: Under "Edit" you will find a new entry: Select line (s) / Remove marking (Hotkey: CTRL + F2) - NEW: The area in which are now only the program log was displayed, is now marked as "QuickView" area. This window area can now have several functions. (The contents can be changed via Tabs) - NEW: In the new QuickView window of the ISN there is now a small code storage. In the end, only a small text field in case something is fast Down, or copy. The code store will not be saved and will automatically empty as soon as the project is closed. - NEW: The ISN AutoIt Studio now has its own ToDo list for your projects! You can assign your own categories here and enter tasks. The ToDo list is also displayed in the new "QuickView" window area. Info: The ToDo list requires Windows Vista or higher for correct display! - NEW: The full screen mode is now activated on the monitor on which the ISN window is currently located. - NEW: In the program settings there is now a new entry named "Tools". Here you can deactivate various integrated tools of the ISN AutoIt Studio. (Eg the bit-operation tester or the new PELock AutoIt Obfuscator) - NEW: The PELock AutoIt Obfuscator is now integrated in the ISN AutoIt Studio! (To be found under Tools or in the context menu of the project tree) The whole can be deactivated, of course, on request. (Program Settings -> Tools) In order to use the Obfuscator in full, a license is required! Find out more about the PELock AutoIt Obfuscator at https://www.pelock.com/products/autoit-obfuscator - NEW: The ISN AutoIt Studio can now also use language files (* .lng) in UTF-8 format. - NEW: The config.ini is now created as standard UTF-16 (LE) file. The file is automatically converted to the new format when the ISN is started. - NEW: The project files (* .isn) are now saved as standard with UTF-16 (LE) coding. This should solve problems with other languages (eg Chinese) or umlauts. The conversion is started as soon as a project is opened. (Infomission is displayed) The current project file (* .isn) is renamed to * .bak and can be deleted, if no problems occur. The whole also applies to templates! (The "Default" template is automatically converted when the ISN is started!) -> ISN Form Studio 2: <- ----------------------------------- - Bugfix: Various bug fixes - Bugfix: Chinese Encoding improved - NEW: Chiesian language update (thx to bfgxp) -> Homepage (http://www.isnetwork.at): <- ----------------------------------- - NEW: The homepage, the forum and the bugtracker are now all accessible via HTTPS! -> Plugin SDK: <- ----------------------------------- - NEW: Function _ISNPlugin_Get_langstring extended by the new UTF8 encoding.
    1 point
  9. It is not working for me in win 7 .
    1 point
  10. You can try using Direct3D, but D3D requires more code: #include "D3D9.au3" #include <File.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Opt("GUIOnEventMode", 1) Local Const $sFolder = "Images" Local Const $sFolderPath = @ScriptDir & "\" & $sFolder Local Const $iWidth = 640, $iHeight = 480 Local const $nRatio = $iWidth / $iHeight Local Const $FVF_VERTEX = BitOR($D3DFVF_XYZ, $D3DFVF_TEX1) Local $aFiles = _FileListToArray($sFolderPath, "*.jpg", 1) If @error Then Exit MsgBox(0x10, "Error", 'Could not locate image folder: "' & $sFolder & '"') Local $hGUI = GUICreate("", $iWidth, $iHeight, -1, -1, $WS_POPUP) Local $pDevice, $oDevice, $pTextureOut, $oTextureOut, $pTextureIn, $oTextureIn, $pVB, $oVB Local $tMtrlOut, $pMtrlOut, $tMtrlIn, $pMtrlIn Local $iImgIdx = 2, $iImgMax = $aFiles[0] _D3D_Startup() $pDevice = _D3D_Init($hGUI, $iWidth, $iHeight) $oDevice = _AutoItObject_WrapperCreate($pDevice, $tagID3DDevice9Interface) $pTextureOut = _D3DX_CreateTextureFromFile($pDevice, $sFolderPath & "\" & $aFiles[1]) $oTextureOut = _AutoItObject_WrapperCreate($pTextureOut, $tagIDirect3DTexture9) $pTextureIn = _D3DX_CreateTextureFromFile($pDevice, $sFolderPath & "\" & $aFiles[2]) $oTextureIn = _AutoItObject_WrapperCreate($pTextureIn, $tagIDirect3DTexture9) _Setup() GUISetOnEvent(-3, "_Quit") OnAutoItExitRegister("_Cleanup") GUISetState() Local $nOpacityOut = 1, $nOpacityIn = 0 Local $nTimer = TimerInit() While 1 _Render() _HighPrecisionSleep(4000) $nOpacityOut -= 0.005 $nOpacityIn += 0.005 If $nOpacityOut > 1 Then $nOpacityOut = 1 ElseIf $nOpacityOut < 0 Then $nOpacityOut = 0 EndIf If $nOpacityIn > 1 Then $nOpacityIn = 1 ElseIf $nOpacityIn < 0 Then $nOpacityIn = 0 EndIf If TimerDiff($nTimer) > 3000 Then $nOpacityOut = 1 $nOpacityIn = 0 $iImgIdx += 1 If $iImgIdx > $iImgMax Then $iImgIdx = 1 _UpdateTextures($iImgIdx) $nTimer = TimerInit() EndIf WEnd Func _UpdateTextures($iIndex) $pTextureOut = 0 $oTextureOut = 0 $pTextureOut = $pTextureIn $oTextureOut = $oTextureIn $pTextureIn = _D3DX_CreateTextureFromFile($pDevice, $sFolderPath & "\" & $aFiles[$iIndex]) $oTextureIn = _AutoItObject_WrapperCreate($pTextureIn, $tagIDirect3DTexture9) EndFunc Func _Render() $oDevice.Clear("long", "uint", 0, "ptr", 0, "uint", BitOR($D3DCLEAR_TARGET, $D3DCLEAR_ZBUFFER), "uint", 0, "float", 1, "uint", 0) $oDevice.BeginScene("long") DllStructSetData($tMtrlOut, "Diffuse", $nOpacityOut, 4) DllStructSetData($tMtrlIn, "Diffuse", $nOpacityIn, 4) If IsObj($oTextureOut) And IsObj($oTextureIn) Then ; Set our vertex buffer as the source of the triangles vertices $oDevice.SetStreamSource("long", "uint", 0, "ptr", Number($pVB), "uint", 0, "uint", 20) ; Set the flexible vertex format (xyz and texture coordinates in this example) $oDevice.SetFVF("long", "uint", $FVF_VERTEX) ; Set materials and textures and draw $oDevice.SetMaterial("long", "ptr", Number($pMtrlOut)) $oDevice.SetTexture("long", "uint", 0, "ptr", Number($pTextureOut)) $oDevice.DrawPrimitive("long", "int", $D3DPT_TRIANGLEFAN, "uint", 0, "uint", 2) $oDevice.SetMaterial("long", "ptr", Number($pMtrlIn)) $oDevice.SetTexture("long", "uint", 0, "ptr", Number($pTextureIn)) $oDevice.DrawPrimitive("long", "int", $D3DPT_TRIANGLEFAN, "uint", 0, "uint", 2) EndIf $oDevice.EndScene("long") ; Present our next scene for rendering (swap back and front buffers) $oDevice.Present("long", "ptr", 0, "ptr", 0, "hwnd", 0, "ptr", 0) EndFunc Func _Setup() Local $aResult, $tLight, $tVertex, $pVertex Local $aVertices[4][5] = [ _ [-$nRatio, 1, 1, 0, 0], _ [ $nRatio, 1, 1, 1, 0], _ [ $nRatio, -1, 1, 1, 1], _ [-$nRatio, -1, 1, 0, 1]] $tMtrlOut = _D3D_CreateMaterial() $pMtrlOut = DllStructGetPtr($tMtrlOut) $tMtrlIn = _D3D_CreateMaterial() $pMtrlIn = DllStructGetPtr($tMtrlIn) $aResult = $oDevice.CreateVertexBuffer("long", "uint", 4 * 20, "uint", $D3DUSAGE_WRITEONLY, "uint", $FVF_VERTEX, "int", $D3DPOOL_MANAGED, "ptr*", 0, "ptr", 0) $pVB = $aResult[6] $oVB = _AutoItObject_WrapperCreate($pVB, $tagIDirect3DVertexBuffer9) $aResult = $oVB.Lock("long", "uint", 0, "uint", 0, "ptr*", 0, "uint", 0) $pVertex = $aResult[4] $tVertex = DllStructCreate("float[" & 4 * 5 & "]", $pVertex) For $i = 0 To UBound($aVertices)-1 For $j = 0 To UBound($aVertices, 2)-1 DllStructSetData($tVertex, 1, $aVertices[$i][$j], $i*5+$j+1) Next Next $oVB.Unlock("long") $tLight = DllStructCreate($tagD3DLIGHT9) DllStructSetData($tLight, "Type", $D3DLIGHT_DIRECTIONAL) For $i = 1 To 4 DllStructSetData($tLight, "Diffuse", 1, $i) DllStructSetData($tLight, "Specular", 1, $i) DllStructSetData($tLight, "Ambient", 1, $i) Next $oDevice.SetLight("long", "uint", 0, "ptr", Number(DllStructGetPtr($tLight))) $oDevice.LightEnable("long", "uint", 0, "bool", True) $oDevice.SetSamplerState("long", "uint", 0, "int", $D3DSAMP_MAGFILTER, "uint", $D3DTEXF_LINEAR) $oDevice.SetSamplerState("long", "uint", 0, "int", $D3DSAMP_MINFILTER, "uint", $D3DTEXF_LINEAR) $oDevice.SetSamplerState("long", "uint", 0, "int", $D3DSAMP_MIPFILTER, "uint", $D3DTEXF_POINT) $oDevice.SetTextureStageState("long", "uint", 0, "int", $D3DTSS_ALPHAARG1, "uint", $D3DTA_DIFFUSE) $oDevice.SetTextureStageState("long", "uint", 0, "int", $D3DTSS_ALPHAOP, "uint", $D3DTOP_SELECTARG1) $oDevice.SetRenderState("long", "int", $D3DRS_SRCBLEND, "uint", $D3DBLEND_SRCALPHA) $oDevice.SetRenderState("long", "int", $D3DRS_DESTBLEND, "uint", $D3DBLEND_INVSRCALPHA) Local $tProj = _D3DX_MatrixPerspectiveFovLH(ASin(1), $nRatio, 1, 1000) $oDevice.SetTransform("long", "int", $D3DTS_PROJECTION, "ptr", Number(DllStructGetPtr($tProj))) ; Enable alpha-blend channel processing $oDevice.SetRenderState("long", "int", $D3DRS_ALPHABLENDENABLE, "uint", True) EndFunc Func _Quit() Exit EndFunc Func _Cleanup() If IsObj($oTextureIn) Then $oTextureIn = 0 If IsObj($oTextureOut) Then $oTextureOut = 0 If IsObj($oVB) Then $oVB = 0 $oDevice = 0 GUIDelete() _D3D_Shutdown() EndFunc ; #FUNCTION#;=============================================================================== ; ; Name...........: _HighPrecisionSleep() ; Description ...: Sleeps down to 0.1 microseconds ; Syntax.........: _HighPrecisionSleep( $iMicroSeconds, $hDll=False) ; Parameters ....: $iMicroSeconds - Amount of microseconds to sleep ; $hDll - Can be supplied so the UDF doesn't have to re-open the dll all the time. ; Return values .: None ; Author ........: Andreas Karlsson (monoceres) ; Modified.......: ; Remarks .......: Even though this has high precision you need to take into consideration that it will take some time for autoit to call the function. ; Related .......: ; Link ..........; ; Example .......; No ; ;;========================================================================================== Func _HighPrecisionSleep($iMicroSeconds,$hDll=False) Local $hStruct, $bLoaded If Not $hDll Then $hDll=DllOpen("ntdll.dll") $bLoaded=True EndIf $hStruct=DllStructCreate("int64 time;") DllStructSetData($hStruct,"time",-1*($iMicroSeconds*10)) DllCall($hDll,"dword","ZwDelayExecution","int",0,"ptr",DllStructGetPtr($hStruct)) If $bLoaded Then DllClose($hDll) EndFunc Download the attachment for includes. Also, you need to download AutoItObject UDF, thanks to the developers by the way. Edit: Fixed _D3D_Init function and the flickering. (hopefully) D3D9.rar
    1 point
×
×
  • Create New...