Jump to content

Leaderboard

Popular Content

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

  1. Jon

    Google Policy Violations

    The irony is that I'm not entirely sure that this topic doesn't infringe on the last point of having a google trademark in the URL. I hope it means the domain name url part and not anything else ...
    2 points
  2. Hello Community, here's the latest update on... SMF - Search my Files Current Version: v17 (2024-Oct-20) SMF - Search my Files features A good looking GUI, Search files by location, Search files and / or folders, Poll [-]File names and Locations in Long and Short (8.3) format, [-]File Extensions, [-]File Times (modified, created, accessed), [-]File size, [-]File Attributes, [-]File Extended Attributes, Filter by [-]Extension, [-]Attribute, [-]File size, [-]File time, Free Name filtering by usage of RegEx, GUI designed to fit to 800x600 desktops with Tab-Design Nice looking Icon Minimize to Tray (also while searching) Export Result to CSV-file Export Result to XML-file Save & Load search runs Build Tree for local Computer on StartUp, add NetworkDrives optional A separate Report-GUI [-]Pre-Select output columns [-]SQLite driven [-]Dynamically generated statements, fully user adjustable [-]Dynamically sub filtering of results on the fly [-]Results can be executed directly, starting with the default associated program (ShellExcecute) [-]Select Results by drag, copy selected URIs to clipboard [-]Copy, move, delete or Erase results or subset of results md5 driven Duplicate file finder [-]High-Performance [-]added trimmed md5 short calculation (false md5, but sufficient for dup-search and a great speed improvement!) [-]Search 30.000 pics for dups in 1min 30secs Added many other ideas (some not activated / implemented yet) Limitations / Bugs / ToDos Lots and lots of unnecessary Global Variables Ugly code PLUS violations of any coding principal known to man... But hey, thats why I release the source, so that YOU help me to further improve SMF... SMF works fine at least on the 32bit XP SP3 and 64bit Win7/Win8/Win10 machines and I've tested it on. If you find bugs please let me know. Thanks to my sweet girlfriend for reviewing, giving new ideas and having so much patience with me :-*. Thanks to Jon, Larry, Jos, Valik, Jpm, Melba23 and Trancexx and for creating AutoIt and maintaining the forum. And finally thanks to all these great guys from the forum, providing excellent UDFs, snippets of code I use in SMF or help and feedback: Achilles, Ascend4nt, Ed_Maximized, Elgabionline, Erik Pilsits (Wraithdu), Eukalyptus, Gafrost, Holger Kotsch, Jarvis J. Stubblefield (JSThePatriot), Jos, Lahire Biette, Lazycat, Lod3n, Prog@ndy, Ptrex, Rasim, RazorM, RobSaunders, Sean Hart, Siao, Simucal, Smashly, SmOke_N, Teh_hahn, Valik, Ward, WideBoyDixon, Yann Perrin, Yashied & Zedna. Please let me know if you found some piece of code in the source for which I forgot to mention a credit. The executable and the source can be downloaded from my site: https://funk.eu Enjoy, let me know what you think of SMF and with Best Regards
    1 point
  3. abberration

    Software Installer

    Software Installer Version: 2.0 It's been been a long year, but I finally got some time to rework this project. I re-wrote everything from scratch because the old version was getting too complicated with so many options and sub-menus. This new version is much easier to use and I have been testing for a few days and it seems very stable. For those who are new to this software, it helps you install software silently/unattended. This new version tries to determine the silent switch automatically. You can also re-organize the order in which the software installs by dragging & dropping them in the listview. It now supports creating profiles and checks for missing software (and automatically unchecks them, so it does not attempt to install non-existent software). One feature I included was because I have seen several people on Youtube talk about disliking bright screens at night. So, now you can choose from a few color theme (half of them are dark). I dabbled a bit more into GDI+ to draw a few things and show my logo with a transparent background (hint: I'm not good at GDI+). Under the Help menu, you will find a User Guide, which goes through most of it's features. I included a new icon if you want to use when you compile the script (in the Assets > Misc folder). If you have questions, comments or suggestions, all are welcome. Hope you enjoy! Here it is in action: Software_Installer_2.0.zip
    1 point
  4. @timmy2: This looks ok: #AutoIt3Wrapper_UseX64=n #include "Bass.au3" #include "BassExt.au3" #include <GDIPlus.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Opt("GUIOnEventMode", 1) Opt("MustDeclareVars", 1) ;file dialog for testing only. Actual audio file will be specified in the script. Global $sFile = FileOpenDialog("Open...", "", "playable formats (*.MP3;*.MP2;*.MP1;*.OGG;*.WAV;*.AIFF;*.AIF)") If @error Or Not FileExists($sFile) Then Exit Global $iWidth = 410 Global $iHeight = 170 Global $hGui, $hGraphics, $hGfxBuffer, $hBmpBuffer, $hBmpBk, $hBrushFFT Global $aFFT, $aPeak Global $iTimer Global $hStream $hGui = GUICreate("BASS_EXT AudioMeter", $iWidth, $iHeight, -1,-1, BitOR($WS_SYSMENU,$WS_POPUP)) GUISetBkColor(0x000000) _GDIPlus_Startup() $hGraphics = _GDIPlus_GraphicsCreateFromHWND($hGui) $hBmpBuffer = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics) $hGfxBuffer = _GDIPlus_ImageGetGraphicsContext($hBmpBuffer) _GDIPlus_GraphicsSetSmoothingMode($hGfxBuffer, 2) $hBrushFFT = _BrushCreateFFT(0, 0, 410, 170, $iWidth, $iHeight, $hGraphics) $aFFT = _BASS_EXT_CreateFFT(410 / 5, 0, 0, 410, 170, 1, 70, True) $hBmpBk = _BMPCreateBackGround($iWidth, $iHeight, $hGraphics) _BASS_Startup(@ScriptDir & "\bass.dll") ;__Debug(@error, "load bass.dll") _BASS_EXT_Startup(@ScriptDir & "\bassExt.dll") ;__Debug(@error, "load bassext.dll") _BASS_Init(0, -1, 44100, 0, "") ;__Debug(@error, "initialize bass") _BASS_SetConfig($BASS_CONFIG_UPDATEPERIOD, 100) ;__Debug(@error, "set update period") _BASS_SetConfig($BASS_CONFIG_BUFFER, 250) ;__Debug(@error, "set buffer size") GUIRegisterMsg(0x000F, "WM_PAINT") GUISetState() $hStream = _BASS_StreamCreateFile(False, $sFile, 0, 0, 0) ;__Debug(@error, "create stream from file: " & $sFile) $aPeak = _BASS_EXT_ChannelSetMaxPeakDsp($hStream) ;__Debug(@error, "set dsp callback to check for the highest peak") _BASS_ChannelPlay($hStream, True) ;__Debug(@error, "start stream") GUISetOnEvent($GUI_EVENT_CLOSE, "_Exit") While _BASS_ChannelIsActive($hStream) _GDIPlus_GraphicsDrawImage($hGfxBuffer, $hBmpBk, 0, 0) _BASS_EXT_ChannelGetFFT($hStream, $aFFT, 6) If Not @error Then DllCall($ghGDIPDll, "int", "GdipFillPolygonI", "handle", $hGfxBuffer, "handle", $hBrushFFT, "ptr", $aFFT[0], "int", $aFFT[1], "int", "FillModeAlternate") _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0) Sleep(30) WEnd Func WM_PAINT($hWnd, $uMsgm, $wParam, $lParam) _GDIPlus_GraphicsDrawImage($hGraphics, $hBmpBuffer, 0, 0) Return 'GUI_RUNDEFMSG' EndFunc ;==>WM_PAINT Func _BMPCreateBackGround($iW, $iH, $hGraphics) Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iW, $iH, $hGraphics) Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsSetSmoothingMode($hContext, 2) _GDIPlus_GraphicsClear($hContext, 0xFF000000) Local $hBrushBK = _GDIPlus_BrushCreateSolid(0xEE000000) Local $hBrushTXT = _GDIPlus_BrushCreateSolid(0xFF99AAFF) Local $hPen = _GDIPlus_PenCreate(0xFF222222, 1) _GDIPlus_PenDispose($hPen) _GDIPlus_BrushDispose($hBrushBK) _GDIPlus_BrushDispose($hBrushTXT) _GDIPlus_GraphicsDispose($hContext) Return $hBitmap EndFunc ;==>_BMPCreateBackGround Func _BrushCreateFFT($iX, $iY, $iW, $iH, $iWidth, $iHeight, $hGraphics) Local $hBitmap = _GDIPlus_BitmapCreateFromGraphics($iWidth, $iHeight, $hGraphics) Local $hContext = _GDIPlus_ImageGetGraphicsContext($hBitmap) _GDIPlus_GraphicsClear($hContext, 0xFF000000) Local $hBrush[5] $hBrush[0] = _GDIPlus_BrushCreateSolid(0xFFFF0000) $hBrush[1] = _GDIPlus_LineBrushCreate(0, 0, 0, 20, 0xFFFF0000, 0xFFFFAA00, 1) $hBrush[2] = _GDIPlus_LineBrushCreate(0, 20, 0, 40, 0xFFFFAA00, 0xFF00AAFF, 1) $hBrush[3] = _GDIPlus_BrushCreateSolid(0xFF00AAFF) $hBrush[4] = _GDIPlus_LineBrushCreate(0, 0, 0, 4, 0x00000000, 0xAA000000, 0) _GDIPlus_GraphicsFillRect($hContext, $iX, $iY, $iW, 20, $hBrush[0]) _GDIPlus_GraphicsFillRect($hContext, $iX, $iY + 20, $iW, 20, $hBrush[1]) _GDIPlus_GraphicsFillRect($hContext, $iX, $iY + 40, $iW, 20, $hBrush[2]) _GDIPlus_GraphicsFillRect($hContext, $iX, $iY + 60, $iW, $iH - 60, $hBrush[3]) _GDIPlus_GraphicsFillRect($hContext, $iX, $iY, $iW, $iH, $hBrush[4]) For $i = 0 To 4 _GDIPlus_BrushDispose($hBrush[$i]) Next _GDIPlus_GraphicsDispose($hContext) Local $aRet = DllCall($ghGDIPDll, "uint", "GdipCreateTexture", "hwnd", $hBitmap, "int", 0, "int*", 0) _GDIPlus_BitmapDispose($hBitmap) Return $aRet[3] EndFunc ;==>_BrushCreateFFT Func _Exit() _BASS_EXT_ChannelRemoveMaxPeakDsp($aPeak) ;___Debug(@error, "remove peak dsp") _BASS_ChannelStop($hStream) ;___Debug(@error, "stop stream") _BASS_StreamFree($hStream) ;___Debug(@error, "free stream") _BASS_Free() ;___Debug(@error, "free bass") _GDIPlus_BrushDispose($hBrushFFT) _GDIPlus_BitmapDispose($hBmpBk) _GDIPlus_GraphicsDispose($hGfxBuffer) _GDIPlus_BitmapDispose($hBmpBuffer) _GDIPlus_GraphicsDispose($hGraphics) _GDIPlus_Shutdown() GUIDelete() Exit EndFunc ;==>_Exit ;~ Func ___DeBug($iError, $sAction) ;~ Switch $iError ;~ Case -1 ;~ ConsoleWrite(@CRLF & "-" & $sAction & @CRLF) ;~ Case -2 ;~ ConsoleWrite(@CRLF & ">" & $sAction & @CRLF) ;~ Case 0 ;~ ConsoleWrite(@CRLF & "+" & $sAction & " - OK" & @CRLF) ;~ Case Else ;~ ConsoleWrite(@CRLF & "!" & $sAction & " - FAILED, @error: " & $iError & @CRLF) ;~ _Exit() ;~ EndSwitch ;~ EndFunc ;==>___DeBug Func _GDIPlus_LineBrushCreate($nX1, $nY1, $nX2, $nY2, $iARGBClr1, $iARGBClr2, $iWrapMode = 0) Local $tPointF1, $pPointF1 Local $tPointF2, $pPointF2 Local $aResult $tPointF1 = DllStructCreate("float;float") $pPointF1 = DllStructGetPtr($tPointF1) $tPointF2 = DllStructCreate("float;float") $pPointF2 = DllStructGetPtr($tPointF2) DllStructSetData($tPointF1, 1, $nX1) DllStructSetData($tPointF1, 2, $nY1) DllStructSetData($tPointF2, 1, $nX2) DllStructSetData($tPointF2, 2, $nY2) $aResult = DllCall($ghGDIPDll, "uint", "GdipCreateLineBrush", "ptr", $pPointF1, "ptr", $pPointF2, "uint", $iARGBClr1, "uint", $iARGBClr2, "int", $iWrapMode, "int*", 0) If @error Then Return SetError(@error, @extended, 0) ;$GDIP_STATUS = $aResult[0] Return $aResult[6] EndFunc ;==>_GDIPlus_LineBrushCreate Br, UEZ
    1 point
  5. Thanks to MHz for taking the time to explain why it is so. Now here is another different, simpler way to obtain the same result: #include <SQLite.au3> #include <SQLite.dll.au3> _SQLite_Startup () _SQLite_Open ("") _SQLite_Exec(-1,"CREATE TABLE IF NOT EXISTS Architectures (Architecture text);") ; architecture was ambiguous as it was the name of both a table and a column ; while this is valid SQL, it is error prone and best avoided ; also don't enclose schema names (columns or tables or such) in single quotes ; only string literals should be enclosed in single quotes, with escaping (meaningful single quotes doubled) ; use _SQLite_FastEscape() to escape strings. ; schema names containing whitespaces or other special character (but Unicode symbols and letters are allowed) ; must be enclosed with double quotes "my table" or square brackets [♈♉♊♋♌♍♎♏♐♑♒♓ (zodiac)] _SQLite_Exec(-1,"INSERT INTO Architectures VALUES ('x64');") _SQLite_Exec(-1,"INSERT INTO Architectures VALUES ('x32');") _SQLite_Exec(-1,"INSERT INTO Architectures VALUES ('ARM');") Local $aRow _SQLite_QuerySingleRow(-1, "SELECT group_concat(architecture, '|') FROM Architectures group by 'constant';", $aRow) MsgBox(0, 'Result', $aRow[0]) MsgBox(0,'Close', _SQLite_Close ()) MsgBox(0,'Shutdown',_SQLite_Shutdown ())
    1 point
  6. The only thing that I can see right off the bat is that you're using _BASS_StreamFree just before using _BASS_Free, there shouldn't be any need to use _StreamFree if you're using _Free. Not that it will cause any issues, but a point to remember. On my computer, this script uses about 35MB up to the point of asking for which file to play, which means none of the other functions have even started yet, and then when playing adds an addition 8MB. I don't see any changes in memory usage as the song is playing, so it doesn't appear that there's any abnormal memory usage going on.
    1 point
  7. Anything written for a batch file can be replaced with the appropriate AutoIt code.
    1 point
  8. I get the error with using #include <SQLite.dll.au3>, otherwise this works fine as I have SQLite3.dll in path. #include <SQLite.au3> ;~ #include <SQLite.dll.au3> _SQLite_Startup () _SQLite_Open ("") _SQLite_Exec(-1,"CREATE TABLE IF NOT EXISTS Architecture ('Architecture');") _SQLite_Exec(-1,"INSERT INTO Architecture VALUES ('x64');") _SQLite_Exec(-1,"INSERT INTO Architecture VALUES ('x32');") Local $sRet = _Database_Query("SELECT * FROM Architecture;") $sRet = _Database_Query("SELECT * FROM Architecture;") ; added to run another query without closing the first and try to error MsgBox(0, 'Result ' & @error, $sRet) MsgBox(0,'Close', _SQLite_Close ()) MsgBox(0,'Shutdown',_SQLite_Shutdown ()) Func _Database_Query($sSQL, $iOutput = 1) ; output 1 = delimited string, 2 = array Local $vRet, $hQuery, $aRow, $sRet, $bEarlyReturn If _SQLite_Query(-1, $sSQL, $hQuery) = $SQLITE_OK Then ; loop and get all the data While _SQLite_FetchData($hQuery, $aRow) = $SQLITE_OK $sRet &= $aRow[0] & '|' ; If Fetchdata does not finalize as to early exit from the loop then ; you may need to use _SQLite_QueryFinalize() to inform SQLite to release ; from the query. If Random(0, 2, 1) Then ; if this is not called then SQLite may stay busy with the open query ; and you may get the error when you close SQLite or do another query MsgBox(0, 'Finalize', 'Returned: ' & _SQLite_QueryFinalize($hQuery)) Return $sRet EndIf WEnd If $sRet == '' Then Return SetError(1, 0, '') ; trim any trailing | $sRet = StringRegExpReplace($sRet, '[\|]\z', '') ; If $iOutput = 1 Then Return $sRet Return StringSplit($sRet, '|') Else MsgBox(0,'', 'Error: ' & _SQLite_ErrMsg()) Return SetError(2, 0, '') EndIf EndFunc ;==>_Database_Query You initiate the query so SQLite is busy doing the query. You call FetchData in a loop to get the data of the query until finalized. If you do not loop until finalized, then SQLite remains in the busy state with the query and as such it errors if you attempt another query or attempt to close the handle. This is when you call QueryFinalize to end the query. I would not expect use of QueryFinalize in your UDF as you loop through with FetchData until finalized. So if you attempt to use QueryFinalize when it is already finalized then you get an error on close. If the query errors then their is nothing to finalize so no need to use on error either.
    1 point
  9. mrider

    StringRegExp() Help

    I'm thinking something along the lines of StringRegExp($your_string, "^P[A-Z]{3}[0-9A-F]{4}$") should work...
    1 point
  10. PsaltyDS

    How to run bat file

    With Bat computer, of course: Sorry, couldn't resist...
    1 point
×
×
  • Create New...