Leaderboard
Popular Content
Showing content with the highest reputation on 11/05/2014 in all areas
-
Another way using the math needed for the conversion. #include "date.au3" $FutureTime = "2014/11/25 18:12:05" $days = _DateDiff("D", @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC, $FutureTime) $hours = _DateDiff("h", @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC, $FutureTime) $minutes = _DateDiff("m", @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC, $FutureTime) $seconds = _DateDiff("s", @YEAR & "/" & @MON & "/" & @MDAY & " " & @HOUR & ":" & @MIN & ":" & @SEC, $FutureTime) $iDays = Int($seconds / 86400) $iHours = Int(($seconds - ($iDays * 86400)) / 3600) $iMinutes = Int((($seconds - ($iDays * 86400)) - ($iHours * 3600)) / 60) $iSeconds = Int(((($seconds - ($iDays * 86400)) - ($iHours * 3600) - ($iMinutes * 60)) * 60) / 60) MsgBox(0, "Time until..", $iDays & " Days, " & $iHours & " Hours, " & $iMinutes & " minutes, " & $iSeconds & " seconds")2 points
-
Just very simple but universal/usefull function to get all content of TreeView from external application. It's not optimized for speed and error testing is missing, it's just for very simple code ;-) #Include <String.au3> #Include <GuiTreeView.au3> ; "C:\Program Files (x86)\Resource Kit\oleview.exe" ; COM Library Objects --> ClassMoniker $sAll = _TreeView_GetAll('OLE/COM Object Viewer', '', 'SysTreeView322') FileDelete('treeview_get_all.txt') FileWrite('treeview_get_all.txt', $sAll) ;~ClipPut($sAll) Func _TreeView_GetAll($title, $text, $classNN, $expand = False, $indent = ' ', $bullet = '') ; $bullet = '- ' $sAll = '' $hWnd = ControlGetHandle($title, $text, $classNN) If $expand Then _GUICtrlTreeView_Expand($hWnd) ; Expand All $hItem = _GUICtrlTreeView_GetFirstItem($hWnd) While $hItem <> 0x00000000 $sItem = _GUICtrlTreeView_GetText($hWnd, $hItem) $level = _GUICtrlTreeView_Level($hWnd, $hItem) $sIndent = _StringRepeat($indent, $level) $sAll &= $sIndent & $bullet & $sItem & @CRLF $hItem = _GUICtrlTreeView_GetNext($hWnd, $hItem) WEnd Return $sAll EndFunc Hope it can help somebody ...1 point
-
GUICtrlRead mistake
trdunsworth reacted to BrewManNH for a topic
You're reading from the control as soon as you create it, there's nothing in $mke at that point, although I'm not sure why you're using the advanced parameter in there or what it would normally return for an input control.1 point -
I wrote this power user tool a long while back and it originally had baked in commands and wasn't very extensible. I rewrote the tool and made use of the power and openeness of AutoIt. Some of you may find the concept and/or UI approach interesting (as well as useful) which is why I'm posting here. In all likely-hood, it could be rewritten entirely in AutoIt but that's not something I plan on doing. Good chance there are similar tools out there as well especially since I've sat on this for so long. In short, the tool provides a snazzy user interface (no two interfaces will look alike) which opens right over whatever your working on so you can quickly launch any number of chained AutoIt scripts. My all-time favorite being; normalize clipboard text. https://winclickpro.codeplex.com/ I haven't shared the tool or concept with anyone outside of publishing it so I'm curious to see what people think.1 point
-
Kovacic, One way... #include <date.au3> _duration('2015/11/05 12:00:00') func _duration($target_date) $diff = _datediff('s',_NowCalc(),$target_date) ; calcs adapted from code by UEZ local $days Local $secs = Mod($diff, 60) Local $mins = Mod(Int($diff / 60), 60) Local $hrs = Int($diff / 60 ^ 2) If $hrs > 23 Then $days = Floor($hrs/ 24) $hrs -= $days * 24 endif local $diff_out = stringformat('%02i Days %02i Hours %02i Minutes %02i Seconds to ' & stringleft($target_date,stringinstr($target_date,' ')), $days, $hrs, $mins, $secs) ConsoleWrite($diff_out & @CRLF) endfunc kylomas1 point
-
1 point
-
With Run you can only call executables (.COM, .EXE). With Shellexecute you can open any filetype and the corresponding application will be opnened ("test.docx" will open Word.1 point
-
your @SW_HIDE parametar isn`t on correct place, look in the help file for where to place @SW_HIDE parametar on ShellExecuteWait command1 point
-
1 point
-
WinHTTP functions
bootybay reacted to jvanegmond for a topic
Hey Raizeno, try this: #include "WinHttp.au3" $sAddress = "https://api.pushover.net/1/messages.json" $sApiToken = "av26ac2nAXLyPKg2QMy4zf9YcUjz2G" ; <-yours here $sUserKey = "uMQf396GvMgrsDroaryKEvVyWkgfkw" ; <-yours here $sMessage = "hello world" ; Construct the form Const $sForm = '<form action="' & $sAddress & '" method="post">' & _ '<input name="token" value="' & $sApiToken & '"/>' & _ '<input name="user" value="' & $sUserKey & '"/>' & _ '<input name="message" value="' & $sMessage & '"/>' & _ '</form>' ; Open session $hOpen = _WinHttpOpen() ; To collect connection handle (because the form is inlined) $hConnect = $sForm ; Fill the form $sRead = _WinHttpSimpleFormFill($hConnect, $hOpen) ; Close handles _WinHttpCloseHandle($hConnect) _WinHttpCloseHandle($hOpen) ; Tada mtfk! MsgBox(4096, "Simon says", $sRead)1 point -
Print pdf's and then move to another folder
mLipok reacted to JLogan3o13 for a topic
Perminator, first off welcome to the forum. Secondly, we get that you may be in a rush, but this forum operates on the "Teach a man to fish" model. We help others with their own scripts, rather than having people put in an "urgent" request and someone barfs up code for you. We can certainly assist you with your problem by pointing you in the right direction. Something like this should get you started. It is up to you to loop through your folder and then move the files. Look at _FileListToArray and FileMove in the help file. $oShell = ObjCreate("Shell.Application") $sFullPath = @DesktopDir $sFile = "Proof.pdf" If FileExists($sFullPath) Then $oFolder = $oShell.Namespace($sFullPath) $oItem = $oFolder.ParseName($sFile) EndIf $oItem.InvokeVerbEx("Print")1 point -
The variable has simply been renamed in the GDIPlus UDF, so look at the GDIPlus startup function for a variable similar in name. I am not currently in a position to check, but it's something like $g__hGDIPlusDll*. * It's $__g_hGDIPDll1 point