Leaderboard
Popular Content
Showing content with the highest reputation on 06/14/2013 in all areas
-
AutoIt SysInfo Clock is a small tool in widget style to show the clock, current CPU usage, CPU speed, memory usage and network activity (tcp, ip and udp). Additionally you can use it as an alarm clock. To stop alarm clock tone press the left LED (mail) or wait 60 seconds. The current CPU usage code is beta and might be not working for some CPUs! Main window: Move mouse to area below seconds and press rmb to select different color scheme. Alarm Clock window: Tray menu: Credits: see scroller (select About). Special thanks to trancexx for helping me to read out current CPU speed using the WinAPI stuff, AndyG for troubleshooting performance counter issue, czardas for composing "Für Elise" and Ascend4nt for the support! Download source code + compiled version: Click Me (previous downloads: 1386) (Please don't use any download manager!) Compiled version only: MediaFire.com or 4Shared.com Coded on Win7 x64 using Aero / Win8.1 x64 and AutoIt v3.3.12.0. Br, UEZ This project is discontinued! Change log: v0.9.5.0 build 2013-06-14: initial release v0.9.6.0 build 2013-06-15: added _WinAPI_CreateRoundRectRgn() to fix transparency issue on non Aero desktops, small internal modifications and added check for whether performance counters are enabled v0.9.6.5 build 2013-06-15: fixed a bug when "Reset Windows Position" was selected twice and color of scroller will fit to clock color schema v0.9.8.0 build 2013-06-20: added little music to About part -> many thanks to czardas for mus++ and arranging "Für Elise", added date to clock, replaced CPU usage code -> thanks Ascend4nt v0.9.9.0 build 2013-06-21: added 2 more color schemas (mint and purple), added network traffic LED, compiled exe now included in archive v0.9.9.0 build 2013-06-22: forgot to increase a variable in ini section v0.9.9.0 build 2013-06-24: found also missing modification in context menue after adding two more color schemas v0.9.9.0 build 2013-06-26: Ops, forgot to change also radio item proper check in clock color schema sub menu v0.9.9.1 build 2013-06-27: added option to select whether SysInfo Clock should start at windows startup v0.9.9.2 build 2013-07-01: added yellow-red mark to the small info indicators and additional info when hovering about the small indicators, small internal changes v0.9.9.5 build 2013-07-05: added features: singleton, update check, visit web site, bring GUI to front and fixed some smaller bugs + some internal changes v0.9.9.6 build 2013-07-11: added alarm clock feature v0.9.9.7 build 2014-06-23: adapted code to run on AutoIt version 3.3.12.0 v0.9.9.7 build 2014-08-27: some internal "cosmetic" changes -> this project is discontinued!2 points
-
New MVPs
DigitalFacade82 and one other reacted to Melba23 for a topic
In case anyone had not noticed, I am happy to announce that we have three new MVPs: PhoenixXL, FireFox and kylomas. I am sure you will all join in with my hearty congratulations to them all. M232 points -
LNKEditorGUI - Windows Shortcut LNK Link Editor GUI
Earthshine reacted to robertcollier4 for a topic
Scenario: Editing .lnk shortcuts with the Windows dialog is very frustrating due to the small input boxes and non-resizable small dialog window. Very often you need to create a link with a long path and many arguments which becomes hard to see and make edits. Solution: LNKEditorGUI is a resizable and easy to use creator and editor of LNK Windows Shortcut files. This GUI uses built-in AutoIt functions FileGetShortcut() and FileCreateShortcut() to read and write .lnk files. A nice and big (and resizable) GUI is presented with which the user can easily edit and create LNK shortcuts with. A command line argument is accepted and the GUI will automatically open the first file passed to it as an argument allowing for easy association on the right-click menu (see .lnk file right-click context menu registry association example below). Download: LNKEditorGUI.zip Screenshot: Reg Script Use a Registry Script such as following to create a right-click menu entry for LnkEditorGUI for .lnk files. Windows Registry Editor Version 5.00 [HKEY_CLASSES_ROOT\lnkfile\shell\LNKEditorGUI] @="LNK&EditorGUI" [HKEY_CLASSES_ROOT\lnkfile\shell\LNKEditorGUI\command] @="\"C:\\Program Files\\LNKEditorGUI.exe\" \"%1\"" LNKEditorGUI.au3 Code: #include <WindowsConstants.au3> #include <StaticConstants.au3> #include <GUIConstantsEx.au3> #include <EditConstants.au3> #include <ComboConstants.au3> #include <GuiStatusBar.au3> #include <Timers.au3> #include <Array.au3> Opt("GUIOnEventMode", 1) Global Const $CmbWinstateNorm = @SW_SHOWNORMAL & " - Normal Window" Global Const $CmbWinstateMin = @SW_SHOWMINNOACTIVE & " - Minimized" Global Const $CmbWinstateMax = @SW_SHOWMAXIMIZED & " - Maximized" #region - GUI $GUI = GUICreate("LNKEditorGUI - Windows Shortcut LNK File Editor", 800, 640, -1, -1, BitOr($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX ), $WS_EX_ACCEPTFILES) GUISetOnEvent($GUI_EVENT_CLOSE, '_exit') GUISetOnEvent($GUI_EVENT_DROPPED, "On_Drop_InFilename") GUISetFont(10) $Status = _GUICtrlStatusBar_Create($GUI) GUICtrlCreateLabel("File:", 4, 6, 36, 24) $inFilename = GUICtrlCreateInput("", 36, 4, 672, 24) GUICtrlSetState(-1, $GUI_DROPACCEPTED) $btBrowseForFile = GUICtrlCreateButton("Browse...", 712, 4, 84, 24) GUICtrlSetOnEvent(-1, '_btBrowseForFile') $btOpenFile = GUICtrlCreateButton("Load LNK File", 20, 32, 370, 28) GUICtrlSetOnEvent(-1, '_btOpenFile') GUICtrlSetResizing($btOpenFile, $GUI_DOCKLEFT) $btSaveFile = GUICtrlCreateButton("Save LNK File", 410, 34, 370, 28) GUICtrlSetOnEvent(-1, '_btSaveFile') GUICtrlSetResizing($btSaveFile, $GUI_DOCKRIGHT) GUICtrlCreateLabel("Target EXE", 4, 80, 172, 24) $inTargetEXE = GUICtrlCreateInput("", 4, 104, 792, 24) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Target Arguments", 4, 148, 172, 24) $editTargetArgs = GUICtrlCreateEdit("", 4, 172, 792, 96, $ES_MULTILINE) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Working Dir", 4, 288, 172, 24) $inWorkingDir = GUICtrlCreateInput("", 4, 312, 792, 24) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Window State", 4, 356, 172, 24) $cmbWindowState = GUICtrlCreateCombo("", 4, 380, 792, 24, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, $CmbWinstateNorm & "|" & $CmbWinstateMin & "|" & $CmbWinstateMax, $CmbWinstateNorm) ; add other item snd set a new default GUICtrlCreateLabel("Icon File", 4, 424, 172, 24) $inIconFile = GUICtrlCreateInput("", 4, 448, 650, 24) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUICtrlCreateLabel("Icon Index", 680, 424, 172, 24) $inIconIndex = GUICtrlCreateInput("", 674, 448, 112, 24) GUICtrlCreateLabel("Comment", 4, 492, 172, 24) $editComment = GUICtrlCreateEdit("", 4, 516, 792, 96, $ES_MULTILINE) GUICtrlSetState(-1, $GUI_DROPACCEPTED) GUISetState(@SW_SHOW, $GUI) #endregion - GUI If $CmdLine[0] > 0 Then ;MsgBox(0,0,$CmdLine[1]) GUICtrlSetData($inFilename, $CmdLine[1]) _btOpenFile() EndIf While 1 Sleep(100) WEnd ;--------------------------------------------------------------- Func StatusBarNotify($msg) _GUICtrlStatusBar_SetText($Status, $msg) _Timer_SetTimer($GUI, 5000, "_ClearStatusBar") EndFunc ;--------------------------------------------------------------- Func _ClearStatusBar($hWnd, $msg, $iIDTimer, $dwTime) #forceref $hWnd, $msg, $iIDTimer, $dwTime _GUICtrlStatusBar_SetText($Status, "") _Timer_KillTimer($hWnd, $iIDTimer) EndFunc ;--------------------------------------------------------------- Func _btBrowseForFile() Local $var = FileSaveDialog("Choose a LNK File Name", "D:\", "LNK Shortcuts (*.lnk)", 2) ; option 2 = dialog remains until valid path/file selected If @error Then ;MsgBox(4096, "", "No File(s) chosen") Else $var = StringReplace($var, "|", @CRLF) GUICtrlSetData($inFilename, $var) EndIf EndFunc ;--------------------------------------------------------------- Func On_Drop_InFilename() If ( (@GUI_DropId = $inFilename) OR (@GUI_DropId = $inTargetEXE) ) Then GUICtrlSetData(@GUI_DropId, @GUI_DragFile) EndIf If ( (@GUI_DropId = $inFilename) AND (@GUI_DragFile <> "") ) Then OpenFile(@GUI_DragFile) EndIf EndFunc ;--------------------------------------------------------------- Func _btOpenFile() Local $filename = GUICtrlRead($inFilename) If $filename = "" Then ;_btBrowseForFile() ;$filename = GUICtrlRead($inFilename) StatusBarNotify("ERROR: Trying to open file but no file specified.") MsgBox(0,"ERROR","Trying to open file but no file specified.") Else OpenFile($filename) EndIf EndFunc ;--------------------------------------------------------------- Func OpenFile($filename) Local $lnkArray = FileGetShortcut($filename) If Not @error Then ;_ArrayDisplay($lnkArray) Else StatusBarNotify("ERROR: Unable to open file.") MsgBox(0,"ERROR","Unable to open file, please check the file name.") Return EndIf GUICtrlSetData($inTargetEXE, $lnkArray[0]) GUICtrlSetData($editTargetArgs, $lnkArray[2]) GUICtrlSetData($inWorkingDir, $lnkArray[1]) GUICtrlSetData($inIconFile, $lnkArray[4]) GUICtrlSetData($inIconIndex, $lnkArray[5]) GUICtrlSetData($editComment, $lnkArray[3]) If($lnkArray[6] = @SW_SHOWNORMAL) Then GUICtrlSetData($cmbWindowState, $CmbWinstateNorm) ElseIf($lnkArray[6] = @SW_SHOWMINNOACTIVE) Then GUICtrlSetData($cmbWindowState, $CmbWinstateMin) ElseIf($lnkArray[6] = @SW_SHOWMAXIMIZED) Then GUICtrlSetData($cmbWindowState, $CmbWinstateMax) EndIf StatusBarNotify("Successfully loaded file: " & $filename) EndFunc ;--------------------------------------------------------------- Func _btSaveFile() $filename = GUICtrlRead($inFilename) If $filename = "" Then StatusBarNotify("ERROR: Trying to save but no file name specified.") MsgBox(0,"ERROR","Trying to save but no file name specified.") Return EndIf Local $WinStateToWrite Switch GuiCtrlRead($cmbWindowState) Case $CmbWinstateNorm $WinStateToWrite = @SW_SHOWNORMAL Case $CmbWinstateMin $WinStateToWrite = @SW_SHOWMINNOACTIVE Case $CmbWinstateMax $WinStateToWrite = @SW_SHOWMAXIMIZED Case Else $WinStateToWrite = @SW_SHOWNORMAL EndSwitch $saveResult = FileCreateShortcut(GuiCtrlRead($inTargetEXE), $filename, GuiCtrlRead($inWorkingDir), GuiCtrlRead($editTargetArgs), GuiCtrlRead($editComment), GuiCtrlRead($inIconFile), "", GuiCtrlRead($inIconIndex), $WinStateToWrite) If($saveResult) Then StatusBarNotify("Successfully saved file to: " & $filename) Else StatusBarNotify("ERROR: Unable to save file, please check the file name and values.") MsgBox(0,"ERROR","Unable to save file, please check the file name and values.") EndIf EndFunc ;--------------------------------------------------------------- Func _exit() Exit EndFunc ;---------------------------------------------------------------1 point -
UDF Deprecated - 23 Dec 2013 As since the release of v3.3.10.0 the basis of this UDF is now included in the standard AutoIt UDFs as _FileListToArrayRec in File.au3, support will end in this thread and any future bug reports or feature requests should be made via Trac. Note that there are a couple of major changes in the new function compared to this UDF: - You must place the Include|Exclude|Exclude_Folder masks in the single $sMask parameter, delimited by "|". The old syntax with the "exclude" masks at the end of the parameter list will no longer work, unlike this UDF. - The values returned in @extended in the event of an error have been reordered to reflect the above - so you might need to amend your errorchecking. But note that "no files found" still returns 9 in @extended - I am not that cruel! - The sort algorithm has been changed from QuickSort to DualPivot, which is significantly faster for large arrays. I hope you appreciate the faster return times. This zip remians available for those who do not wish to update immediately: RFLTA.zip M231 point
-
Unpin the grenade. Place grenade in pocket. Close eyes. Clog ears. Relax.1 point
-
MSSQL Connection
Hallistorm1989 reacted to Zedna for a topic
As was said, post what you have tried and also search this forum. There are many examples for using SQL in AutoIt and also some UDFs in Examples section simplifiing the whole thing.1 point -
MSSQL Connection
Hallistorm1989 reacted to michaelslamet for a topic
Hi Hallistorm1989, Please post your code. And which MySQL UDF do you use?1 point -
MSSQL Connection
Hallistorm1989 reacted to JLogan3o13 for a topic
Hallistorm1989, please do not bump your post without waiting at least 24 hours. This is not a 24 hour support forum, the person who can best assist you may not be online right now1 point -
exit script after a specified time
somebadhat reacted to FireFox for a topic
Hi. ;OPTION 1 AdlibRegister("_Exit", 10000) ;do stuff Func _Exit() AdlibUnregister("_Exit") Exit EndFunc ;OPTION 2 Local $hTimer = TimerInit() ;dostuff While 1 If TimerDiff($hTimer) >= 10000 Then _Exit() Sleep(10) WEnd Func _Exit() Exit EndFunc Edit: Please use autoit code tags to post your code, thanks. Br, FireFox.1 point -
List files to array and sort them by date
michaelslamet reacted to JohnQSmith for a topic
C:\> sfk sort sfk ... +sort sort text lines, case insensitive by default. requires a previous command producing text output. options -case case sensitive text comparison -rev[erse] reverse sorting order examples sfk filter csv.txt +sort print sorted contents of csv.txt sfk filter csv.txt +sort +view shows output with the dview GUI tool So change the command to... sfk list -flattime . +sort -rev Also look at... sfk dumphelp1 point -
See >this reply... (ok I'm a little bit late; better late than never)1 point
-
Hahahah, that made me laugh. mmm, das verboten parameter..1 point
-
Write to txt file
Wombat reacted to Mechaflash for a topic
Well... try this on for size... Make sure that sumatra is set to your default PDF reader first. And replace $sReader $dirPDF and $sPDF with the correct values if you would. Tested on WinXP _PDFSearch() Func _PDFSearch() Local $sReader, $dirPDF, $sPDF, $pidReader, $hReader, $hTimer, $x $sReader = "C:\Program Files\SumatraPDF\SumatraPDF.exe" $dirPDF = "C:\path\to\pdfs\" $sPDF = "pdfname.pdf" $pidReader = Run($sReader & ' "' & $dirPDF & $sPDF & '"') if not $pidReader Then msgbox(16 + 262144, @AutoItExe, "Failed to open PDF file.") Exit EndIf WinWait($sPDF & " - SumatraPDF") $hReader = WinGetHandle($sPDF & " - SumatraPDF") WinActivate($hReader) if not WinWaitActive($hReader, "", 5) Then msgbox(16 + 262144, @AutoItExe, "Timed out waiting for application window to gain focus.") Exit EndIf ControlFocus($hReader, "", "[CLASS:SUMATRA_PDF_CANVAS; INSTANCE:1]") Sleep(500) ClipPut("") $hTimer = TimerInit() $x = 500 While not ClipGet() If TimerDiff($hTimer) > 5000 Then msgbox(16 + 262144, @AutoItExe, "Timed out attempting to get text from document.") Exit EndIf ControlSend($hReader, "", "[CLASS:SUMATRA_PDF_CANVAS; INSTANCE:1]", "^a") Sleep($x) ControlSend($hReader, "", "[CLASS:SUMATRA_PDF_CANVAS; INSTANCE:1]", "^c") Sleep($x) $x+=500 WEnd $sStringData = ClipGet() If not WinClose($hReader) Then ProcessClose($pidReader) ConsoleWrite($sStringData & @CRLF) msgbox(0,"","Check your console output. Now you have everything stored in $sStringData for you to manipulate") EndFunc EDIT: I just pray you're not dealing with a PDF with multiple columns XD EDIT2: Replaced shellexecute() of file to Run() of application with the file as a parameter1 point -
Automating the IE Save AS file Dialog
adarsh12in reacted to steveellis99 for a topic
Greetings all, After having recieved and absolute ton of assistance from all the user posts here, I feel obliged to share a bit of code I created to interact with the file-download dialog in IE. There might be better/easier ways, but I sure couldn't find them...or make them work in AutoIT as a newbie. I know there is an INetGet tool, but it won't work on the pages I'm using (security stuff...dynamic linking and my general ignorance). The code below will change the default text to a directory name, click the button, and replace the original file name back into the box. It's probably the equivalent of digital duct-tape, but I hope it can help somebody. Note: I have the destination directory stored in a variable ($dest) from a FileSelectFolder call. I'm not sure all the sleep() steps are essential, but it doesn't hurt ot have a little patience. ....after having a link clicked elsewhere in the script....snip: WinWait("File Download") WinActivate("File Download") sleep(500) ControlClick("File Download","","Button2") ; this clicks the default "save" button on the first dialog WinWait("Save As") ; Wait for the "Save As" box to pop up WinActivate("Save As") sleep(500) $filename=ControlGetText("Save As","Save &in:","Edit1") ;Get the file name before we erase it ControlSetText("Save As","Save &in:","Edit1","") ; erase the file name to make room for the $dest string sleep(1000) ControlSetText("Save As","Save &in:","Edit1", $dest) ; set the Edit1 text to the $dest and hit the button to swithc directories. ControlClick("Save As","","Button2") sleep(1000) ControlSetText("Save As","Save &in:","Edit1", $filename) ; reset the name of the file to the original value. sleep(1000) ControlClick("Save As","","Button2")1 point