Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/13/2013 in all areas

  1. MHz

    Au3 Script Database Viewer

    Summary The program which I will abbreviate as ASDV was created with the intention of easily archiving AutoIt scripts that are loaded in a programming editor. Sometimes you may find many scripts open in your editor and may want an easy way to store them and release them from the editor. ASDV takes a single path parameter so the editor can pass the path to the script and the ASDV will insert it into a SQLite database. The whole process should be rather simple to store the script. Once done and satisfied, then you can close the script in the editor and have fewer scripts open at one time. ASDV allows you access to the stored script at any time. You can make routine backups of the database to prevent any data loss. Backups can be compressed by zip or similar and may take up a little amount of space. ASDV supports adding scripts as mentioned previous and also does the following features when you right click on the title listbox. About title - Output of information about the title selected from the database Copy title - Copies for e.g. "Example 1" to the clipboard Copy script - Copies the whole script in the viewer to the clipboard Delete title and script - Removes the entry permanently from the database RunWait script - Writes the viewed script to a file in @TempDir and runs it from there with @AutoItExe Save script - Saves the viewed script to an au3 file View script in your web browser - Perhaps a nicer way to view a script with some coloring done on keywords Font size - For preference of those with great eye sight or near blind Download Au3 Script Database.zip Under terms of GPL3 Requires SQLite.au3 which will is a standard include in AutoIt3. SQLite3.dll if you do not have it already here. Tested with AutoIt 3.3.8.1 + and latest SQLite3.dll. Further details can be found in the help file included. Homepage can be found here.
    1 point
  2. mLipok

    Figlet Tool for SciTE

    Please attach this file or do a link.
    1 point
  3. Hi All, Here is a little script I have been using for a long time and since I haven't seen it on here, finally decided to post. PathFinder is an executable that gives you the ability to right click a file and get it's Absolute or Relative Path and copy it to the clipboard. Has only been tested on Windows 7 32 Bit Constructive Comments & Questions are welcome! Bill p.s. Everything is in the zip file... Quellcode: Installer: Uninstaller: readme.txt: PathFinder.zip Some Pics
    1 point
  4. BrewManNH

    self_update

    Better idea would be to have a separate script that downloads the updates and then copies the files to the installation location. Run the update script, and exit the current script right after you do that. Then you don't need to force close the main script as it's already closed.
    1 point
  5. eukalyptus

    AutoIt Mp3 DJ

    Hi This is a DJ-program like the Denon DN2000F using bass.dll & co There are still a lot of bugs... you can use different audiointerfaces to play and monitor (if you have more than one...) ($iMainDevice and $iMonDevice to choose) http://rapidshare.com/files/201769180/AMD.rar enjoy E
    1 point
  6. kylomas

    Changegui by "index"

    #include <WindowsConstants.au3> #include <EditConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <date.au3> #include <array.au3> #include <GuiListView.au3> #include <ComboConstants.au3> #include <GuiComboBox.au3> local $array_with_data[20][7] ; data array to demo filling various controls local $array_for_controls[20][2] ; array of control ids / column 0 = buttons / column 1 = listview items ; fill data array for $1 = 0 to ubound($array_with_data) - 1 for $2 = 0 to ubound($array_with_data,2) - 1 $array_with_data[$1][$2] = stringformat('%02i-%02i', $1+1, $2+1) Next Next ; create listview header local $hdr for $1 = 0 to ubound($array_with_data,2) - 1 $hdr &= 'Col ' & stringformat('%02i',$1+1) & '|' Next $hdr = StringTrimRight($hdr,1) ; create gui local $gui010 = guicreate('Examples of Array Usage with Controls and Data',900,700,-1,-1) guictrlcreatelabel('A LISTVIEW Control is Similar to a Spread Sheet',10,10,370,25, _ bitor($SS_CENTER, $SS_CENTERIMAGE)) guictrlsetfont(-1,10,800) guictrlsetcolor(-1,0xaa0000) local $lv010 = guictrlcreatelistview($hdr,10,35,370,300,-1,bitor($LVS_EX_FULLROWSELECT,$LVS_EX_GRIDLINES)) local $LVsize = controlgetpos($gui010,'',$lv010) guictrlsetfont($lv010,8,800,-1,'courier new') guictrlcreatelabel('ListBox Control',20,400,110,20,bitor($SS_CENTER, $SS_CENTERIMAGE)) guictrlsetfont(-1,10,800) guictrlsetcolor(-1,0xaa0000) local $lb010 = guictrlcreatelist('',35,450,60,220) guictrlcreatelabel('*-Col 2',45,425,200,20) guictrlsetfont(-1,7,800,-1,'courier new') guictrlcreatelabel('Combo Control',140,400,110,20,bitor($SS_CENTER, $SS_CENTERIMAGE)) guictrlsetfont(-1,10,800,-1) guictrlsetcolor(-1,0xaa0000) local $cb010 = GUICtrlCreateCombo('',155,450,80,20) _GUICtrlComboBox_SetCueBanner($cb010, "Selections...") guictrlcreatelabel('*-Col 5',175,425,200,20) guictrlsetfont(-1,7,800,-1,'courier new') local $grp010 = guictrlcreategroup('',450,65,50,500) local $lbl010 = guictrlcreatelabel('Press a Button to See the Corresponding Listview Row',400,15,150,50,$SS_CENTER) guictrlsetfont(-1,9,800,-1,'Comic Sans MS') guictrlcreatelabel('"Click on any entry in the Listview, List or Combo controls to see the controls value in the edit box"', _ 125,520,200,200) guictrlsetfont(-1,10,800,-1,'Comic Sans MS') ; create 1 button for each row of the array and put the buttons in the group control for $1 = 0 to ubound($array_with_data) - 1 $array_for_controls[$1][0] = GUICtrlCreateButton($1+1,460,85+$1*23,30,20) GUICtrlSetBkColor(-1, '0x' & hex(random(0,255,1),2) & hex(random(0,255,1),2) & hex(random(0,255,1),2)) ; just dick'in around setting random colors guictrlsetfont(-1,10,800) next GUICtrlCreateGroup('',99,99,1,1) local $edt010 = guictrlcreateedit('',550,70,320,600,bitor($ES_READONLY, $WS_HSCROLL, $WS_VSCROLL)) guictrlsetfont(-1,7,800,-1,'Lucida Console') guictrlsetdata($edt010,'Application Started at ' & _now() & @crlf,1) ; populate the listview with array data local $lv_item for $1 = 0 to ubound($array_with_data) - 1 for $2 = 0 to ubound($array_with_data,2) - 1 $lv_item &= $array_with_data[$1][$2] & '|' next $array_for_controls[$1][1] = GUICtrlCreateListViewItem($lv_item,$lv010) $lv_item = '' next ; adjust the listview to distribute the columns evenly across the control for $1 = 0 to _GUICtrlListView_GetColumnCount($lv010) _GUICtrlListView_SetColumnWidth($lv010, $1, ($LVSize[2])/_GUICtrlListView_GetColumnCount($lv010)-3) next ; populate the listbox with column 2 of the data array local $lb_str for $1 = 0 to ubound($array_with_data) - 1 $lb_str &= $array_with_data[$1][1] & '|' Next $lb_str = stringtrimright($lb_str,1) guictrlsetdata($lb010,$lb_str) ; populate the combo control with column 5 of the data array $lb_str = '' for $1 = 0 to ubound($array_with_data) - 1 $lb_str &= $array_with_data[$1][4] & '|' Next $lb_str = stringtrimright($lb_str,1) guictrlsetdata($cb010,$lb_str) guisetstate() local $msg while 1 $msg = guigetmsg() switch $msg case $GUI_EVENT_CLOSE Exit ; test for a listview item control case $array_for_controls[0][1] to $array_for_controls[ubound($array_for_controls) - 1][1] guictrlsetdata($edt010,@crlf & 'ListView Row from mouse select ------' & @crlf & guictrlread(guictrlread($lv010)) & @crlf,1) case $lb010 guictrlsetdata($edt010,@crlf & 'Entry From List ------' & @crlf & guictrlread($lb010) & @crlf,1) case $cb010 guictrlsetdata($edt010,@crlf & 'Entry From combo ------' & @crlf & guictrlread($cb010) & @crlf,1) ; test for a button control case $array_for_controls[0][0] to $array_for_controls[ubound($array_for_controls) - 1][0] for $1 = 0 to ubound($array_for_controls) - 1 if $msg = $array_for_controls[$1][0] then guictrlsetdata($edt010,@crlf & 'ListView Row from button push ------' & @crlf & _guictrllistview_getitemtextstring($lv010,$1) & @crlf,1) exitloop EndIf next EndSwitch WEnd Some examples...
    1 point
  7. Can you try this: Main.au3 #AutoIt3Wrapper_UseX64=n #include "ExtMsgBox.au3" #include <WindowsConstants.au3> GUIRegisterMsg($WM_COPYDATA, '_WM_COPYDATA') $TITLE_RECEIVER = 'FFT_Child_Window' $wPID = Run("Child.exe") Sleep(2000) _ExtMsgBox(0, 0, "", "press enter to reduce volume", 0, 1, 1) _SendData(WinGetHandle($TITLE_RECEIVER), 0.1) _ExtMsgBox(0, 0, "", "press enter to raise volume", 0, 1, 1) _SendData(WinGetHandle($TITLE_RECEIVER), 0.5) _ExtMsgBox(0, 0, "", "press enter to exit", 0, 1, 1) _SendData(WinGetHandle($TITLE_RECEIVER), -1) Sleep(2000) Exit Func _SendData($hWnd, $sData) Local $tCOPYDATA, $tMsg $tMsg = DllStructCreate('char[' & StringLen($sData) + 1 & ']') DllStructSetData($tMsg, 1, $sData) $tCOPYDATA = DllStructCreate('dword;dword;ptr') DllStructSetData($tCOPYDATA, 2, StringLen($sData) + 1) DllStructSetData($tCOPYDATA, 3, DllStructGetPtr($tMsg)) $Ret = DllCall('user32.dll', 'lparam', 'SendMessage', 'hwnd', $hWnd, 'int', $WM_COPYDATA, 'wparam', 0, 'lparam', DllStructGetPtr($tCOPYDATA)) If (@error) Or ($Ret[0] = -1) Then Return 0 EndIf Return 1 EndFunc ;==>_SendData Func _WM_COPYDATA($hWnd, $msgID, $wParam, $lParam) Local $tCOPYDATA = DllStructCreate('dword;dword;ptr', $lParam) Local $tMsg = DllStructCreate('char[' & DllStructGetData($tCOPYDATA, 2) & ']', DllStructGetData($tCOPYDATA, 3)) Return 0 EndFunc ;==>_WM_COPYDATA Child.au3 #AutoIt3Wrapper_UseX64=n #include "Bass.au3" #include "BassExt.au3" #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("MustDeclareVars", 1) Global $sFile = FileOpenDialog("Open...", "", "playable formats (*.MP3;*.MP2;*.MP1;*.OGG;*.WAV;*.AIFF;*.AIF)", 3) If @error Or Not FileExists($sFile) Then Exit Global $iWidth = 522 Global $iHeight = 170 _GDIPlus_Startup() Global $hGui = GUICreate("FFT_Child_Window", $iWidth, $iHeight, -1, -1, BitOR($WS_SYSMENU, $WS_POPUP)) GUISetState() Global $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui) Global $hBmp_Buffer = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Global $hGfx_Buffer = _GDIPlus_ImageGetGraphicsContext($hBmp_Buffer) _GDIPlus_GraphicsSetSmoothingMode($hGfx_Buffer, 2) Global $hBrush = _CreateFFTBrush(5, 5, $iWidth - 10, $iHeight - 10) Global $sMsg _BASS_Startup() _BASS_EXT_Startup() _BASS_Init(0, -1, 44100, 0, "") Global $hStream = _BASS_StreamCreateFile(False, String($sFile), 0, 0, $BASS_SAMPLE_FLOAT) If Not $hStream Then _Exit() Global $aFFT = _BASS_EXT_CreateFFT(128, 5, 5, $iWidth - 10, $iHeight - 10, 1, True) _BASS_ChannelPlay($hStream, True) Global $dummy = GUICtrlCreateDummy() GUIRegisterMsg($WM_PAINT, "WM_PAINT") GUIRegisterMsg($WM_COPYDATA, '_WM_COPYDATA') While _BASS_ChannelIsActive($hStream) Switch GUIGetMsg() Case -3, $dummy ; allows Parent program to use WinClose to close this program. ExitLoop EndSwitch _GDIPlus_GraphicsClear($hGfx_Buffer, 0xFF110022) _BASS_EXT_ChannelGetFFT($hStream, $aFFT, 2) If Not @error Then DllCall($ghGDIPDll, "int", "GdipFillPolygon", "handle", $hGfx_Buffer, "handle", $hBrush, "ptr", $aFFT[0], "int", $aFFT[1], "int", "FillModeAlternate") _GDIPlus_GraphicsDrawImage($hGraphics, $hBmp_Buffer, 0, 0) WEnd _Exit() Func _WM_COPYDATA($hWnd, $msgID, $wParam, $lParam) Local $tCOPYDATA = DllStructCreate('dword;dword;ptr', $lParam) Local $tMsg = DllStructCreate('char[' & DllStructGetData($tCOPYDATA, 2) & ']', DllStructGetData($tCOPYDATA, 3)) $sMsg = DllStructGetData($tMsg, 1) Switch $sMsg Case 0.0 To 1.0 _BASS_SetVolume($sMsg) Case -1 GUICtrlSendToDummy($Dummy) EndSwitch Return 0 EndFunc ;==>_WM_COPYDATA Func _CreateFFTBrush($iX, $iY, $iWidth, $iHeight) Local $hBitmap = _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight) Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) Local $hBrush_FFT = _GDIPlus_LineBrushCreate(0, 0, 0, $iHeight, 0, 0, 3) Local $aColors[5][2] = [[4]] $aColors[1][0] = 0xFFFF0000 $aColors[1][1] = 0 $aColors[2][0] = 0xFFFFAA00 $aColors[2][1] = 0.25 $aColors[3][0] = 0xFF00AAFF $aColors[3][1] = 0.5 $aColors[4][0] = 0xFF00AAFF $aColors[4][1] = 1 _GDIPlus_LineBrushSetPresetBlend($hBrush_FFT, $aColors) Local $hBrush_LED = _GDIPlus_LineBrushCreate(0, 0, 0, 4, 0xAA000000, 0x00000000, 0) _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iWidth, $iHeight, $hBrush_FFT) _GDIPlus_GraphicsFillRect($hContext, 0, 0, $iWidth, $iHeight, $hBrush_LED) _GDIPlus_BrushDispose($hBrush_LED) _GDIPlus_BrushDispose($hBrush_FFT) _GDIPlus_GraphicsDispose($hContext) Local $hBrush = _GDIPlus_TextureCreate($hBitmap) _GDIPlus_BitmapDispose($hBitmap) DllCall($ghGDIPDll, "uint", "GdipTranslateTextureTransform", "hwnd", $hBrush, "float", $iX, "float", $iY, "int", 0) Return $hBrush EndFunc ;==>_CreateFFTBrush Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmp_Buffer, 0, 0) Return $GUI_RUNDEFMSG EndFunc ;==>WM_PAINT ; #FUNCTION# ==================================================================================================================== ; Author ........: Authenticity ; Modified.......: UEZ ; =============================================================================================================================== Func _GDIPlus_BitmapCreateFromScan0($iWidth, $iHeight, $iPixelFormat = $GDIP_PXF32ARGB, $iStride = 0, $pScan0 = 0) Local $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateBitmapFromScan0", "int", $iWidth, "int", $iHeight, "int", $iStride, "int", $iPixelFormat, "ptr", $pScan0, "handle*", 0) If @error Then Return SetError(@error, @extended, 0) If $aResult[0] Then Return SetError(10, $aResult[0], 0) Return $aResult[6] EndFunc ;==>_GDIPlus_BitmapCreateFromScan0 ; #FUNCTION# ==================================================================================================================== ; Author ........: Authenticity ; Modified.......: UEZ ; =============================================================================================================================== Func _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2, $iWrapMode = 0) Local $tPointF1, $tPointF2, $aResult $tPointF1 = DllStructCreate("float;float") $tPointF2 = DllStructCreate("float;float") DllStructSetData($tPointF1, 1, $nX1) DllStructSetData($tPointF1, 2, $nY1) DllStructSetData($tPointF2, 1, $nX2) DllStructSetData($tPointF2, 2, $nY2) $aResult = DllCall($ghGDIPDll, "int", "GdipCreateLineBrush", "struct*", $tPointF1, "struct*", $tPointF2, "uint", $iARGBClr1, "uint", $iARGBClr2, "int", $iWrapMode, "handle*", 0) If @error Then Return SetError(@error, @extended, 0) If $aResult[0] Then Return SetError(10, $aResult[0], 0) Return $aResult[6] EndFunc ;==>_GDIPlus_LineBrushCreate ; #FUNCTION# ==================================================================================================================== ; Author ........: Authenticity ; Modified.......: UEZ ; =============================================================================================================================== Func _GDIPlus_LineBrushSetPresetBlend($hLineGradientBrush, $aInterpolations) Local $iI, $iCount, $tColors, $tPositions, $aResult $iCount = $aInterpolations[0][0] $tColors = DllStructCreate("uint[" & $iCount & "]") $tPositions = DllStructCreate("float[" & $iCount & "]") For $iI = 1 To $iCount DllStructSetData($tColors, 1, $aInterpolations[$iI][0], $iI) DllStructSetData($tPositions, 1, $aInterpolations[$iI][1], $iI) Next $aResult = DllCall($ghGDIPDll, "int", "GdipSetLinePresetBlend", "handle", $hLineGradientBrush, "struct*", $tColors, "struct*", $tPositions, "int", $iCount) If @error Then Return SetError(@error, @extended, False) If $aResult[0] Then Return SetError(10, $aResult[0], False) Return True EndFunc ;==>_GDIPlus_LineBrushSetPresetBlend ; #FUNCTION# ==================================================================================================================== ; Author ........: Authenticity ; Modified.......: UEZ ; =============================================================================================================================== Func _GDIPlus_TextureCreate($hImage, $iWrapMode = 0) Local $aResult = DllCall($ghGDIPDll, "int", "GdipCreateTexture", "handle", $hImage, "int", $iWrapMode, "handle*", 0) If @error Then Return SetError(@error, @extended, 0) If $aResult[0] Then Return SetError(10, $aResult[0], 0) Return $aResult[3] EndFunc ;==>_GDIPlus_TextureCreate Func _Exit() _BASS_StreamFree($hStream) _BASS_Free() _GDIPlus_BrushDispose($hBrush) _GDIPlus_GraphicsDispose($hGfx_Buffer) _GDIPlus_BitmapDispose($hBmp_Buffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() Exit EndFunc ;==>_Exit Compile Child.au3 and start Main.au3. Both scripts must be compiled as x86 because of Bass.dll and WM_COPYDATA code. Br, UEZ
    1 point
  8. This example creates a colored triangle in a black window. Global Const $dllFreeGLUT = DllOpen( "freeglut.dll" ) Global Const $dllOpenGL32 = DllOpen( "opengl32.dll" ) #include "Utilities\Utilities.au3" #include "OpenGL\OpenGLconstants.au3" #include "OpenGL\OpenGLfunctions.au3" #include "FreeGLUT\FreeGLUTstdConsts.au3" #include "FreeGLUT\FreeGLUTextConsts.au3" #include "FreeGLUT\FreeGLUTstdFuncs.au3" #include "FreeGLUT\FreeGLUTextFuncs.au3" Opt( "MustDeclareVars", 1 ) Global $CurrentWidth = 800, $CurrentHeight = 600 Global $FrameCount = 0 MainFunc() DllClose( $dllFreeGLUT ) DllClose( $dllOpenGL32 ) Func MainFunc() Local $argc = 1 Local $argv[$argc] = [ @ScriptName ] glutInit( $argc, $argv ) glutInitContextVersion( 1, 1 ) ;glutInitContextVersion( 3, 3 ) ;glutInitContextFlags( $GLUT_FORWARD_COMPATIBLE ) ;glutInitContextProfile( $GLUT_CORE_PROFILE ) glutSetOption( $GLUT_ACTION_ON_WINDOW_CLOSE, $GLUT_ACTION_GLUTMAINLOOP_RETURNS ) glutInitWindowSize( $CurrentWidth, $CurrentHeight ) glutInitWindowPosition( 400, 100 ) glutInitDisplayMode( $GLUT_DEPTH + $GLUT_DOUBLE + $GLUT_RGBA ) Local $Title = "Triangle" Local $WindowHandle = glutCreateWindow( $Title ); glutReshapeFunc( "ResizeFunction" ) glutDisplayFunc( "RenderFunction" ) glutIdleFunc( "IdleFunction" ) glutTimerFunc( 0, "TimerFunction", 0 ) glClearColor( 0.0, 0.0, 0.0, 0.0 ) glutMainLoop() EndFunc ; Callback function Func ResizeFunction( $Width, $Height ) $CurrentWidth = $Width $CurrentHeight = $Height glViewport( 0, 0, $CurrentWidth, $CurrentHeight ) EndFunc ; Callback function Func RenderFunction() $FrameCount += 1 glClear( $GL_COLOR_BUFFER_BIT + $GL_DEPTH_BUFFER_BIT ) glBegin($GL_TRIANGLES) glColor3f ( 0.0, 1.0, 0.0 ) glVertex3f( -0.75, -0.50, 0.00 ) glColor3f ( 1.0, 0.0, 0.0 ) glVertex3f( 0.00, 0.75, 0.00 ) glColor3f ( 0.0, 0.0, 1.0 ) glVertex3f( 0.75, -0.50, 0.00 ) glEnd() glutSwapBuffers() glutPostRedisplay() EndFunc ; Callback function Func IdleFunction() glutPostRedisplay() EndFunc ; Callback function Func TimerFunction( $Value ) If $Value <> 0 Then Local $Title = "Triangle: " & _ $FrameCount * 4 & " Frames Per Second" & _ " @ " & $CurrentWidth & " x " & $CurrentHeight glutSetWindowTitle( $Title ) Endif $FrameCount = 0 glutTimerFunc( 250, "TimerFunction", 1 ) EndFunc Example and UDFs are in the zip file but not the dll files. Take a look at this thread in the Examples section. Triangle.7z
    1 point
  9. Hi, can I use winwaitactive for more windows? so if some window appears it opens mspaint, and if some other window is detected, it also opens mspaint, I tried the code i posted here, but it doesen't work, since it waits for the first window (Notepad) Opt("WinTitleMatchMode", 2) func test1() ShellExecute("mspaint.exe") EndFunc WinWaitActive("Notepad") Call("test1") WinWaitActive("Test") Call("test1")
    1 point
×
×
  • Create New...