Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/06/2022 in all areas

  1. Nine

    GIF Animation (cached)

    New version available.
    1 point
  2. Nine

    GIF Animation (cached)

    @ling3882688 I have found a decent way to achieve it. Here the example using your background image and your GIF. #include <GUIConstants.au3> #include <GDIPlus.au3> #include "Cached GIF Animation.au3" OnAutoItExitRegister(_GIF_Animation_Quit) Local $hGUI = GUICreate("GIF Animation", 800, 600, -1, -1, $WS_POPUP, $WS_EX_CONTROLPARENT) Local $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGUI) Local $hOrig = _GDIPlus_ImageLoadFromFile("bg.png") Local $hImage = _GDIPlus_ImageResize($hOrig, 800, 600) _GDIPlus_ImageDispose($hOrig) GUISetState() _GDIPlus_GraphicsDrawImageRect($hGraphics, $hImage, 0, 0, 800, 600) _GUICtrlCreateAnimGIF("9.gif", 150, 50, 285, 280, -1, -1, False, $hImage, True) Do Until GUIGetMsg() = $GUI_EVENT_CLOSE _GDIPlus_ImageDispose($hImage) _GDIPlus_GraphicsDispose($hGraphics) Please test it with the new UDF. I'll update the first post after (done)...
    1 point
  3. I recommend Koda It's included in Scite4Autoit3 editor: https://www.autoitscript.com/site/autoit-script-editor/ https://www.autoitscript.com/site/autoit-script-editor/downloads/ More Autoit's GUI editors are listed here:
    1 point
  4. I'm not a regular contributor here but if the @argumentum digital signing tool works, I think it would be good to add it to the "AutoIt and Malware" page (https://www.autoitscript.com/wiki/AutoIt_and_Malware) as well as the "solution" post on this thread.
    1 point
  5. Hi there, while I created an example script to generate and execute a function during runtime, I stumbled across a neat way to share data between running autoit scripts. This is done using the amazing magic of AutoItObject_Internal . (You'll need at least Version 3.0.0 of AutoItObject_Internal) Using this UDF, you can create a shared data storage, basically an empty "AutoitObject_Internal-"Object which you can then use to write / read data Inline. no set/get methods, just #include "AutoItSharedData.au3" $oShare = _AutoIt_SharedData_CreateOrAttach("MyCustomID") $oShare.some_data = 'foo' and you're done. any other script accessing this data will have to do: #include "AutoItSharedData.au3" $oShare = _AutoIt_SharedData_CreateOrAttach("MyCustomID") ConsoleWrite($oShare.some_data & @LF) Basically it's Larsj's Implementing IRunningObjectTable Interface, but you dont have a Dictionary, but an IDIspatch Object instead. There are already a bunch of IPC options available - and this is another one. AutoItSharedData.au3 Example Script 1 Example Script 2 Output: To test: run Example Script 1, Then run example Script 2.. or the other way around. Example Script 3 Example_sharedata3.au3 Example_sharedata3_Controlsend.au3 Example_sharedata3_Tooltip.au3 To test: run Example_sharedata3.au3. Output: Example SharedData4: Output: /Edit: Please note that there's a limitation with the Running object table : The Script accessing a variable first, will be the "server" for this variable. This means, access to that variable from other scripts should only be possible, as long the "server" script is running! Use appropriate Object Error handlers in case you don't want the surviving "clients" to crash. Feedback and/or improvements appreciated changelog version 2.0 Removed need for AutoItObject, as AutoItObject_Internal now comes with ROT support Added UDF Header Fixed typo on "#include AutoItObjectInternal.au3" -> "#include AutoItObject_Internal.au3" Added ObjGet() after registering the object fails (in case 2 programs tried to register the same ID simultaneously) Updated Examples & zip archive. Cheers, AutoItSharedData.zip
    1 point
  6. I did this just for fun. #include <WinAPI.au3> #include <WinAPIEx.au3> #include <WinAPIMisc.au3> Beep() _Beep(500,1000,50) _Beep(500,1000,30) _Beep(500,1000,10) _Beep(500,1000,5) _Beep(500,1000,3) _Beep(500,1000,1) ;~ Traslated from http://stackoverflow.com/a/19772815 Func _Beep($iFrequency = 500, $imsDuration = 1000, $iVolume = 100);Volume 1 to 100 Local Const $PI = 3.141592653589 Local Const $TAU = 2 * $PI Local Const $iFormatChunkSize = 16 Local Const $iHeaderSize = 8 Local Const $iFormatType = 1 Local Const $iTracks = 1 Local Const $iSamplesPerSecond = 44100 Local Const $iBitsPerSample = 16 Local Const $iFrameSize = Floor($iTracks * (($iBitsPerSample + 7) / 8)) Local Const $iBytesPerSecond = $iSamplesPerSecond * $iFrameSize Local Const $iWaveSize = 4 Local Const $iSamples = Floor($iSamplesPerSecond * $imsDuration / 1000) Local Const $iDataChunkSize = Int($iSamples * $iFrameSize) Local Const $iFileSize = ($iWaveSize + $iHeaderSize + $iFormatChunkSize + $iHeaderSize + $iDataChunkSize) Local Const $sTagWAVHeader = "char ChunkID[4];int ChunkSize;char Format[4];char Subchunk1ID[4];" & _ "int Subchunk1Size;short AudioFormat;short NumChannels;int SampleRate;" & _ "int ByteRate;short BlockAlign;short BitsPerSample;char Subchunk2ID[4];" & _ "int Subchunk2Size;" Local $sTagWAVHeaderAndData = $sTagWAVHeader & "short AudioWave[" & $iDataChunkSize / 2 & "]" Local $tWAVHeader_Data = DllStructCreate($sTagWAVHeaderAndData) $tWAVHeader_Data.ChunkID = "RIFF" $tWAVHeader_Data.ChunkSize = $iFileSize $tWAVHeader_Data.Format = "WAVE" $tWAVHeader_Data.Subchunk1ID = "fmt " $tWAVHeader_Data.Subchunk1Size = $iFormatChunkSize $tWAVHeader_Data.AudioFormat = $iFormatType $tWAVHeader_Data.NumChannels = $iTracks $tWAVHeader_Data.SampleRate = $iSamplesPerSecond $tWAVHeader_Data.ByteRate = $iBytesPerSecond; $tWAVHeader_Data.BlockAlign = $iFrameSize $tWAVHeader_Data.BitsPerSample = $iBitsPerSample $tWAVHeader_Data.Subchunk2ID = "data" $tWAVHeader_Data.Subchunk2Size = $iDataChunkSize Local $iAmplitude = 16383 / (100 / $iVolume) Local $iShort = 0 $iTheta = $iFrequency * $TAU / $iSamplesPerSecond For $iStep = 0 To $iSamples - 1 $iShort = Int($iAmplitude * Sin($iTheta * ($iStep))) DllStructSetData($tWAVHeader_Data, "AudioWave", $iShort, $iStep + 1) Next _WinAPI_PlaySound(DllStructGetPtr($tWAVHeader_Data), $SND_MEMORY) EndFunc ;==>_Beep Saludos
    1 point
×
×
  • Create New...