Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/04/2012 in all areas

  1. AutoIt can not handle more than one statement per line, because there's no line/statement end indicator it's harder to tell where you want the statement to end. Besides, troubleshooting code all written on one line would be a major pain in the butt.
    1 point
  2. _GUIImageList_Create(22, 22, 5, 1)
    1 point
  3. Zedna

    Koda Updown for Listbox

    Your search button is broken? ...
    1 point
  4. Raffav, Look at the _FileListToArray command in the Help file to see how to limit the returns to only "*.pst" files. As to the smallest file - you need something like this: $fileName = "" $size = 1e10 ; Set a big number to start with For $i = 1 to UBound($fileArray) - 1 $fileSize = FileGetSize($fileArray[$i]) If $fileSize < $size Then ; Now see if this file is even smaller $size = $fileSize $fileName = $fileArray[$i] EndIf Next MsgBox(0, "Smallest file", "Smallest file is " & $fileName)All clear? M23
    1 point
  5. Spenhouet, You were mixing UDF and native commands when creatign the listviews and their items - always a recipe for tears. Take a look at this - I have also cleaned up the handler a little: #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> #include <GuiListView.au3> #endregion #region ### START GUI section ### #region ### Form $Form1 = GUICreate("Tests", 426, 220, 352, 147) #endregion ### Form #region ### Testlist $testlist = _GUICtrlListView_Create($Form1, "", 56, 15, 353, 70, BitOR($WS_HSCROLL, $WS_VSCROLL, $WS_BORDER, $LVS_REPORT, $LVS_NOCOLUMNHEADER), 0) GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow") _GUICtrlListView_AddColumn($testlist, "", 335) #region ### -> Enter here the existing tests <- $tl_na = _GUICtrlListView_AddItem($testlist, "Set up profile (no-account)", 0) $tl_oI = _GUICtrlListView_AddItem($testlist, "Set up profile (only I)", 0) $tl_aS = _GUICtrlListView_AddItem($testlist, "Adjust profile (add S)", 0) $tl_IS = _GUICtrlListView_AddItem($testlist, "Set up profile (IS)", 0) ;~ $tl_Map = _GUICtrlListView_AddItem($testlist, "Set up 1:1 Mapping",0) ;~ $tl_mail = _GUICtrlListView_AddItem($testlist, "Send an e-mail",0) #endregion ### -> Enter here the existing tests <- #endregion ### Testlist #region ### Test selection $testselection = _GUICtrlListView_Create($Form1, "", 56, 125, 353, 50, BitOR($WS_HSCROLL, $WS_VSCROLL, $WS_BORDER, $LVS_REPORT, $LVS_NOCOLUMNHEADER), 0) GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow") _GUICtrlListView_AddColumn($testselection, "", 335) #endregion ### Test selection #region ### Buttons $test = GUICtrlCreateButton("Test", 320, 175, 90, 30, 0) GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow") $manual = GUICtrlCreateButton("Manual", 216, 175, 90, 30, 0) GUICtrlSetFont(-1, 12, 400, 0, "Arial Narrow") #endregion ### Buttons GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY") GUISetState(@SW_SHOW) #endregion ### START GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Func WM_NOTIFY($hWnd, $iMsg, $wParam, $lParam) #forceref $hWnd, $iMsg, $wParam ; Struct = $tagNMHDR and "int Item" Local $tStruct = DllStructCreate("hwnd;uint_ptr;int_ptr;int", $lParam) Local $hWndFrom, $iCode, $iIndex, $sText $iCode = DllStructGetData($tStruct, 3) Switch $iCode Case $NM_DBLCLK $hWndFrom = HWnd(DllStructGetData($tStruct, 1)) $iIndex = DllStructGetData($tStruct, 4) Switch $hWndFrom Case $testlist $sText = _GUICtrlListView_GetItemText($testlist, $iIndex) _GUICtrlListView_AddItem($testselection, $sText, 0) _GUICtrlListView_DeleteItem($testlist, $iIndex) Case $testselection $sText = _GUICtrlListView_GetItemText($testselection, $iIndex) _GUICtrlListView_AddItem($testlist, $sText, 0) _GUICtrlListView_DeleteItem($testselection, $iIndex) EndSwitch EndSwitch Return $GUI_RUNDEFMSG EndFunc ;==>WM_NOTIFY All clear? Please ask if not. M23
    1 point
  6. At lest for DeleteItem you have to use the handle (not the control ID). $hWndListView2 = GUICtrlGetHandle($testselection) _GUICtrlListView_DeleteItem($hWndListView2 , $inde) HTH, Reinhard
    1 point
  7. czardas

    Default Values

    Yeah maybe I can figure something like that out in the future.I might as well let the cat out of the bag, because I'm tired of trying to figure it out. First of all a little story. Several years ago I did a course with the Open University called Topics in the History of Mathematics. A deep knowledge of maths was not really essential because it was a combined study. I just about scraped a pass. Some of the early material on this course was concerned with simple ratios and theories relating musical intervals, often attributed to Pythagoras. Division of the octave into simple (pure) ratios gave rise to a theory of scales which is still used today. The simpler the ratio, the stronger the harmonic resonance (basic maths). Perhaps you have heard of 'Music of the Spheres'. Unfortunately music developed beyond the scope of these basic (natural) intervals several hundered years ago and certain combinations of notes (key changes) were impossible using the old system. The modern system of tuning is called equal temperament but it does not have the rich acoustic properties of natural notes. I experimented and came up with a scale which borrowed one note from the modern system (the tritone), and this gave rise to a symetrical arrangement with 11 natural notes and one artificial note. It sounded very good on the two wooden monochords that I made to test the scale. The question was how to modulate (change key) using this arrangement because not all semitones are equal. The solution was to imagine that the notes were able to drift between different pitch values to produce the natural notes associated with the new key. Early guitars had frets that could be moved to make these kind of adjustments, but it was never practical in performance and eventually equal temperament became the main (compromised) system. Now it is possible to have an instrument that shifts the value of a note by small amounts to make music sound much richer. That instrument is called the computer. I dubbed my system 'Drifting Temperament' although I recently read something on wiki which sounded quite similar with differennt name - which I forget. Unfortunately there was no detail or mathematical basis to the article, but rather the suggestion that such things are done by feel (by the musician). Well that's nothing new. The following question was not addressed by the article, which I found to be a bit watery. The question I want to answer is whether it is best to have one fixed pitch as an anchor, whether to allow all notes to drift around a hypothetical anchor, whether to allow the music to drift away from the original frequencies with no anchor, and whether or not the notes should drift to the new frequencies suddenly or gradually. Each alternative may have merit. I wonder now if I will ever answer this question. Listening to music which uses natural notes is like seeing in colour for the first time. Even Isaac Newton thought it was important enough to devote time to the subject, although his solution was never taken up due to it being impractical. One thing that has never been heard is Beethoven's 5th in drifting temperament - I imagine it would sound awesome.
    1 point
  8. Inverted

    Traytip doesn't hide

    It also says to call it again with empty text to hide the previous traytip : TrayTip ( "title", "text", 1) sleep (2000) ; ---- wait two seconds TrayTip ( "", "", 1) sleep (100000) This stays on for about 2 seconds.
    1 point
  9. I guess you missed this in the helpfile: 2 seconds is less than 10.
    1 point
  10. Why not FileExists("C:WindowsFontsTAHOMA.TTF") ?
    1 point
  11. I know UEZ has answered your question, but here's another SRE. Local $sIPAddress = @IPAddress1 Local $sReturn = StringRegExpReplace($sIPAddress, '((d{1,3}.){3})d{1,3}', '${1}55') MsgBox(4096, '', $sReturn & @CRLF) Edit: Also just to show that there are more ways to achieve the same goal here is using the native AutoIt functions (though UEZ's is way more efficient! Hint: he doesn't use StringLen, therefore one less function call.) Local $sIPAddress = @IPAddress1 Local $sReturn = StringTrimRight($sIPAddress, StringLen($sIPAddress) - StringInStr($sIPAddress, ".", 0, -1)) & "55" MsgBox(4096, '', $sReturn & @CRLF)
    1 point
  12. That's weird. Try "Desk-Top".
    1 point
  13. guinness

    Autoit Wrappers

    An API alternative to FileExist. ConsoleWrite(_WinAPI_PathFileExists(@ScriptFullPath) & @LF) ; File. ConsoleWrite(_WinAPI_PathFileExists("C:") & @LF) ; Drive. ConsoleWrite(_WinAPI_PathFileExists(@ProgramFilesDir) & @LF) ; Directory. ConsoleWrite(_WinAPI_PathFileExists("Z:File.txt") & @LF) ; Shouldn't exist! Func _WinAPI_PathFileExists($sFilePath) Local $aReturn = DllCall('shlwapi.dll', 'int', 'PathFileExistsW', 'wstr', $sFilePath) If @error Then Return SetError(1, 0, 0) EndIf Return $aReturn[0] EndFunc ;==>_WinAPI_PathFileExists
    1 point
×
×
  • Create New...