Leaderboard
Popular Content
Showing content with the highest reputation on 06/15/2013 in all areas
-
_FileSearch + _FolderSearch
Professor_Bernd reacted to AZJIO for a topic
Function to search for files or folders. FileOperations.7z - version 1.8.4 from 2014.03.18, (pastebin: Ru , Ru-example) _FO_CorrectMask (Help) _FO_FileSearch (Help) _FO_FolderSearch (Help) _FO_SearchEmptyFolders (Help) _FO_FileDirReName (Help) _FO_GetCopyName (Help) _FO_FileBackup (Help) _FO_PathSplit (Help) _FO_IsDir (Help) _FO_ShortFileSize (Help) _FO_IsEmptyFolder (Help) _FO_CreateFile alternative: RecFileListToArray (Melba23) FileListToArrayEx (DXRW4E) FileListToArray (SmOke_N) FileFindFirstFile (NIKZZZZ) old _FileFindFirstFile, _FileFindNextFile (AZJIO) FileDirList (MrCreatoR, amel27), (cmd.exe Dir /b) FileListToArrayRecursive + _Callback (therks) FileSearch (AZJIO), link2 myFileListToArray_AllFiles (akurakkauaaa) Update Accordingly, the updated (26.11.2012) program: >TextReplace, >Create_list_files, >Search_duplicates, >Synchronization Accordingly, the updated (22.11.2011) program: >ReName1 point -
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!1 point
-
USBMon
delphifocus reacted to Melba23 for a topic
delphifocus, Do not hold your breath - as rasim has not been online since Jan 2009 I doubt you will get an answer. And did the fact that there was no answer to the previous requests from over 2 years ago not give you a clue? M231 point -
Support of language files in the program ; coded by AZJIO #include <ComboConstants.au3> ;============================================================= ; This is not necessarily in the script If Not FileExists(@ScriptDir & '\Lang') Then DirCreate(@ScriptDir & '\Lang') $hFile = FileOpen(@ScriptDir & '\Lang\En.lng', 2 + 32) If $hFile <> -1 Then FileWrite($hFile, _ '[lng]' & @CRLF & _ '1=My Programs' & @CRLF & _ '2=Open' & @CRLF & _ '3=Open File' & @CRLF & _ '4=Example choice language' & @CRLF & _ '5=Select' & @CRLF & _ '6=Language') FileClose($hFile) EndIf $hFile = FileOpen(@ScriptDir & '\Lang\Ru.lng', 2 + 32) If $hFile <> -1 Then FileWrite($hFile, _ '[lng]' & @CRLF & _ '1=Моя программа' & @CRLF & _ '2=Открыть' & @CRLF & _ '3=Открыть файл' & @CRLF & _ '4=Пример выбора языка' & @CRLF & _ '5=Выбор' & @CRLF & _ '6=Языковой файл') FileClose($hFile) EndIf ;============================================================= #NoTrayIcon Global $LangPath, $Ini = @ScriptDir & '\prog_set.ini' ; Create a configuration file with the language parameter. Used when you first start. If Not FileExists($Ini) Then $hFile = FileOpen($Ini, 2) If $hFile <> -1 Then FileWrite($hFile, _ '[Set]' & @CRLF & _ 'Lang=none') FileClose($hFile) EndIf EndIf ; By default, set the English language interface, in the absence of language files. Global $aLngDef[7][2] = [[ _ 6, 6],[ _ '1', 'My Programs'],[ _ '2', 'Open'],[ _ '3', 'Open File'],[ _ '4', 'Example choice language'],[ _ '5', 'Select'],[ _ '6', 'Language']] ; Ru ; This is optional, but the convenience of the mother tongue language file is not required If @OSLang = 0419 Then Dim $aLngDef[7][2] = [[ _ 6, 6],[ _ '1', 'Моя программа'],[ _ '2', 'Открыть'],[ _ '3', 'Открыть файл'],[ _ '4', 'Пример выбора языка'],[ _ '5', 'Выбор'],[ _ '6', 'Языковой файл']] EndIf Global $aLng[7] = [6] _SetLangCur($aLngDef) ; initially set by default, in case the language file will be invalid and will not apply to all items ; apply the language file, if specified. $LangPath = IniRead($Ini, 'Set', 'Lang', 'none') If $LangPath <> 'none' And FileExists(@ScriptDir & '\Lang\' & $LangPath) Then $aLngINI = IniReadSection(@ScriptDir & '\Lang\' & $LangPath, 'lng') If Not @error Then _SetLangCur($aLngINI) EndIf $aLngINI = 0 $hGui = GUICreate($aLng[1], 250, 100) $Button = GUICtrlCreateButton($aLng[2], 10, 60, 99, 22) GUICtrlSetTip(-1, $aLng[3]) $Label = GUICtrlCreateLabel($aLng[4], 10, 5, 153, 15) ; $Checkbox = GUICtrlCreateCheckbox ($aLng[5], 10, 50, 55, 22) ; Search for language files to add to the list of Combo $LangList = 'none' $search = FileFindFirstFile(@ScriptDir & '\Lang\*.lng') If $search <> -1 Then While 1 $hFile = FileFindNextFile($search) If @error Then ExitLoop $LangList &= '|' & $hFile WEnd EndIf FileClose($search) GUICtrlCreateLabel('Language', 10, 33, 75, 17) ; This text is usually not recommended to translate, since switching of unintelligible language will lead to difficulties in restoring the native language, since it is not clear what item in the menu to click. $ComboLang = GUICtrlCreateCombo('', 85, 30, 70, 22, $CBS_DROPDOWNLIST) GUICtrlSetData(-1, $LangList, $LangPath) GUISetState() While 1 Switch GUIGetMsg() Case $ComboLang _SetLang() Case -3 Exit EndSwitch WEnd ; function change of language Func _SetLang() Local $aLngINI $LangPath = GUICtrlRead($ComboLang) If $LangPath <> 'none' And FileExists(@ScriptDir & '\Lang\' & $LangPath) Then $aLngINI = IniReadSection(@ScriptDir & '\Lang\' & $LangPath, 'lng') If Not @error Then _SetLangCur($aLngINI) _SetLang2() IniWrite($Ini, 'Set', 'Lang', $LangPath) EndIf Else _SetLangCur($aLngDef) _SetLang2() $LangPath = 'none' IniWrite($Ini, 'Set', 'Lang', 'none') EndIf EndFunc ;==>_SetLang Func _SetLangCur($aLng2D) Local $tmp For $i = 1 To $aLng2D[0][0] If StringInStr($aLng2D[$i][1], '\n') Then $aLng2D[$i][1] = StringReplace($aLng2D[$i][1], '\n', @CRLF) ; Enables line wrapping, which does not support ini $tmp = Number($aLng2D[$i][0]) If $tmp > 0 And $tmp <= $aLng[0] Then $aLng[$tmp] = $aLng2D[$i][1] ; Add text if its parameter is a number used as array index ; In fact if the passed in the $tmp parameter is not a number in the range of indexes of the array, it will be discarded. The array doesn't cause a mistake as the number won't exceed quantity of elements of the array. Next EndFunc ;==>_SetLangCur ; update function of texts in the GUI Func _SetLang2() ; not enough to update the names of variables, they need to change the visible GUI WinSetTitle($hGui, '', $aLng[1]) GUICtrlSetData($Label, $aLng[4]) GUICtrlSetData($Button, $aLng[2]) GUICtrlSetTip($Button, $aLng[3]) ; language change depending on the State of the checkbox ; If $TrCh = 0 Then ; GUICtrlSetTip($Checkbox, $aLng[5]) ; Else ; GUICtrlSetTip($Checkbox, $aLng[6]) ; EndIf EndFunc ;==>_SetLang2 Just an example1 point
-
Actually the style was wrong. Use this. #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> Example() Func Example() Local $hGUI = GUICreate('', 465, 135, Default, Default, BitOR($WS_THICKFRAME, $WS_POPUP)) GUISetState(@SW_SHOW, $hGUI) GUIRegisterMsg($WM_NCHITTEST, 'WM_NCHITTEST') While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch WEnd GUIDelete($hGUI) EndFunc ;==>Example ; If you want the GUI to be moved as well. Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam, $lParam Return $HTCAPTION EndFunc ;==>WM_NCHITTEST Don't post code you've tried in spoiler tags, I only figured that out after I posted.1 point
-
The main(key) part is the following GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam) ;$HT_BORDER = 18 Return 18 EndFunc Register the Msg before showing the GUI. Nothing else is required.1 point
-
Autoit SysInfo Clock v0.9.9.7 build 2014-08-27 beta
mesale0077 reacted to UEZ for a topic
Sure I can use the registry to store values but I prefer the ini variant more. It's more portable this way! @all: if something is not working properly don't hesitate to report it!!! Br, UEZ1 point -
Here we go #include <WindowsConstants.au3> GUICreate("", -1, -1, -1, -1, $WS_SIZEBOX) GUIRegisterMsg($WM_NCHITTEST, "WM_NCHITTEST") GUISetState() While GUIGetMsg() <> -3;$GUI_EVENT_CLOSE = -3 Sleep(10) WEnd Func WM_NCHITTEST($hWnd, $iMsg, $wParam, $lParam) ;$HT_BORDER = 18 Return 18 EndFunc Regards1 point
-
danwilli, Yes, that answers my question exactly. Thanks to TheSaint for also helpful input. Like your Zappa. He's not forgotten - he pioneered freedom of speech in art. Thanks again, all. I'll be back. _aleph_1 point
-
Unpin the grenade. Place grenade in pocket. Close eyes. Clog ears. Relax.1 point
-
Passing parameter ByRef, previously passed ByRef
jaberwacky reacted to Beamer145 for a topic
Hi Firefox, >It's not correct to pass a constant variable by reference. 2 remarks wrt that: A) Why do you say this is not correct. If you are familiar with C, i expect const byref to be equivalent of passing a writable pointer to a const entity (see eg http://en.wikipedia.org/wiki/Const-correctness) . There is nothing fundamentally incorrect with the language construct. B ) While it is of course always possible that the autoit language does not support this concept, I do not think that is the case here, because it did not generate get the same error for function 1 which has exactly the same prototype. You only get this error when you pass through a const byref argument to a another function call, as TheGeneral pointed out in his original code example. So this seems to indicate an au3check bug, not a language limitation (the code also runs fine, as remarked in a previous post, it is just au3check that complains). >I don't see the point at all to use the const keyword in your function parameters. There are plenty of reasons to do that, such as: - It helps to clarify the user of the function what the function will do with the arguments he provides to it. Eg if the user of a function has large amount of data that he/she does not want to have changed which he needs to pass as an argument, and the function has a byref, then the only thing the user can do is first make a copy of that data en then passing the copy, because the function is allowed to change the data. This completely destroys the performance gains of a byref of course. However, if the function has a const byref type, then the user can safely pass his orignal data to the function knowing that it will not be changed. So in a way, in a lot of cases of byref I think is almost useless to not speficy const byref, the only case where a plain byref is usefull is when the function is meant to fill in the data in the argument you provide. - prevent bugs in which the function accidentially change the contents - perfomance optimisations the compiler can do when he knows the data is constant, ... (I probably missed a few, google it, there are plenty of in depth discussions regarding this topic).1 point -
That's KaFu's function just for the record.1 point