topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • Friday June 27, 2025, 10:53 pm
  • Proudly celebrating 15+ years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Recent Posts

Pages: prev1 ... 143 144 145 146 147 [148] 149 150 151 152 153 ... 225next
3676
Living Room / Re: Show us the View Outside Your Window
« Last post by 4wd on June 23, 2012, 08:46 AM »
...and so as Melbourne Airport gets nuked into the wasteland of time we say farewell to another wintery day....

IMG_4820b.jpg
3677
Finished Programs / Re: DONE: Batch adjust shortcut targets
« Last post by 4wd on June 23, 2012, 02:42 AM »
OK, maybe this slightly modified version will get there:

Added:
  • Basic wildcard filter for file matching.
  • Option to output shortcuts to one directory.

So you should be able to put all your images in one directory, enter 50503*.* in the filter field and have a load of shortcuts for matching files created in another directory sans directory structure.

...so goes the theory.

Absolutely no error trapping or any of that kind of malarkey  - you put something stupid in the filter field it's your fault. :)

2012-06-23_17-41-48.jpg

See above for archive.

Added mouseover tooltips.
3678
General Software Discussion / Re: corrupt index (I think): how to fix?
« Last post by 4wd on June 23, 2012, 12:33 AM »
... after @4wd pointed me to use MediaInfo in another discussion thread:

Sorry  :-[

I tend to always look for the Lite version of things but never actually refer to them by name, eg. MediaInfo when I mean MediaInfo Lite.  That also extended to the laziness in which I just added a link to the main program site.......sorry again.

Plus I run UniExtract over installers to see if programs really need to be installed, so I miss a lot of the extra 'goodies' they put in installers.
3679
Finished Programs / Re: DONE: Batch adjust shortcut targets
« Last post by 4wd on June 23, 2012, 12:16 AM »
What about the world lacking and needing "Batch adjust shortcut targets"???

But what you are doing is copying the files with a new name to a new destination.

It would be easier to create a new shortcut.

Is the folder structure for the images and the shortcuts the same?

If so then try this: BSC (nothing to do with cows)

2012-06-23_17-41-48.jpg

Instructions:

Honestly, do you really want some?

Oh OK, it creates shortcuts in the Destination directory of whatever files are in the Source directory complete with directory structure - Bulk Shortcut Creator.

And yes, that is a cow icon :)

Also BSM in the other archive

2014-10-27 22_39_51.png

BSC source:
Code: AutoIt [Select]
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Icon=cow.ico
  3. #AutoIt3Wrapper_Outfile=BSC.exe
  4. #AutoIt3Wrapper_UseUpx=n
  5. #AutoIt3Wrapper_Res_requestedExecutionLevel=asInvoker
  6. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  7. #Include <GUIConstantsEx.au3>
  8. #include <EditConstants.au3>
  9. #include <ProgressConstants.au3>
  10. #Include <WindowsConstants.au3>
  11. #include <StaticConstants.au3>
  12. #include 'RecFileListToArray.au3'
  13.  
  14. #Region ### START Koda GUI section ### Form=
  15. $Form1 = GUICreate("BSC v0.1", 349, 180, 192, 124)
  16. $Go = GUICtrlCreateButton("Go", 255, 137, 75, 25)
  17. GUICtrlSetTip(-1, 'Starts shortcut creation')
  18. $Button1 = GUICtrlCreateButton("Source", 280, 13, 50, 25)
  19. GUICtrlSetTip(-1, 'Select a source folder to create' & @CRLF & 'shortcuts for files')
  20. $Button2 = GUICtrlCreateButton("Dest", 280, 56, 50, 25)
  21. GUICtrlSetTip(-1, 'Select a destination folder to put' & @CRLF & 'the shortcuts in')
  22. $progress = GUICtrlCreateProgress(15, 96, 314, 17)
  23. $Input1 = GUICtrlCreateInput("", 16, 14, 258, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
  24. $Input2 = GUICtrlCreateInput("", 17, 57, 256, 21, BitOR($GUI_SS_DEFAULT_INPUT,$ES_READONLY))
  25. $cRecurse = GUICtrlCreateCheckbox("Recurse", 152, 127, 66, 17)
  26. GUICtrlSetTip(-1, 'Recurse down through folder structure')
  27. $Input3 = GUICtrlCreateInput("*.*", 16, 139, 121, 21)
  28. GUICtrlSetTip(-1, 'Wildcard filter for files to' & @CRLF & 'create shortcuts for')
  29. $oDir = GUICtrlCreateCheckbox("One folder", 152, 151, 79, 17)
  30. GUICtrlSetTip(-1, 'Outputs shortcuts to destination folder,' & @CRLF & 'does not duplicate folder tree')
  31. GUICtrlSetState(-1, $GUI_DISABLE)
  32. #EndRegion ### END Koda GUI section ###
  33.  
  34.  
  35.         $nMsg = GUIGetMsg()
  36.         Switch $nMsg
  37.                 Case $cRecurse
  38.                         If (GUICtrlRead($cRecurse) = 1) Then
  39.                                 GUICtrlSetState($oDir, $GUI_ENABLE)
  40.                         Else
  41.                                 GUICtrlSetState($oDir, $GUI_UNCHECKED)
  42.                                 GUICtrlSetState($oDir, $GUI_DISABLE)
  43.                         EndIf
  44.                 Case $Button1
  45.                         $sPath = FileSelectFolder('Source folder:', '', 4)
  46.                         If @error = 1 Then $sPath = ''
  47.                         GUICtrlSetData($Input1, $sPath)
  48.                 Case $Button2
  49.                         $dPath = FileSelectFolder('Destination folder:', '', 4)
  50.                         If @error = 1 Then $dPath = ''
  51.                         GUICtrlSetData($Input2, $dPath)
  52.                 Case $Go
  53.                         If $sPath <> '' And $dPath <> '' Then
  54.                                 $filter = GUICtrlRead($Input3)
  55.                                 If (GUICtrlRead($cRecurse) = 1) Then
  56.                                         If Not (GUICtrlRead($oDir) = 1) Then
  57.                                                 $output = _RecFileListToArray($sPath, '*', 2, 1, 0, 1, '*.lnk')
  58.                                                 _DupeTree($sPath, $dPath)
  59.                                         EndIf
  60.                                         $output = _RecFileListToArray($sPath, $filter, 1, 1, 0, 1, '*.lnk')
  61.                                 Else
  62.                                         $output = _RecFileListToArray($sPath, $filter, 1, 0, 0, 1, '*.lnk')
  63.                                 EndIf
  64.                                 _BSC($sPath, $dPath, (GUICtrlRead($oDir) = 1))
  65.                         EndIf
  66.                 Case $GUI_EVENT_CLOSE
  67.                         Exit
  68.         EndSwitch
  69.  
  70.  
  71. Func _BSC($src, $dest, $oneDir = 0)
  72.         $prg = 0
  73.         $diff = 100 / $output[0]
  74.         GUICtrlSetData($progress, $prg)
  75.         For $i = 1 To $output[0]
  76.                 If $oneDir = 0 Then
  77.                         $temp = $dest & '\' & $output[$i]
  78.                 Else
  79.                         $temp = $dest & StringMid($output[$i], StringInStr($output[$i], '\', 0, -1))
  80.                 EndIf
  81.                 FileCreateShortcut($src & '/' & $output[$i], $temp)
  82.                 $prg += $diff
  83.                 GUICtrlSetData($progress, $prg)
  84.         Next
  85.  
  86.  
  87. Func _DupeTree($src, $dest)
  88.         Local $i
  89.         For $i = 1 To $output[0]
  90.                 If Not FileExists($dest & '\' & $output[$i]) Then DirCreate($dest & '\' & $output[$i])
  91.         Next

BSM source:
Code: AutoIt [Select]
  1. #Region ;**** Directives created by AutoIt3Wrapper_GUI ****
  2. #AutoIt3Wrapper_Outfile=BSM.exe
  3. #AutoIt3Wrapper_UseUpx=n
  4. #AutoIt3Wrapper_Res_Fileversion=0.7.0.4
  5. #AutoIt3Wrapper_Res_Fileversion_AutoIncrement=y
  6. #EndRegion ;**** Directives created by AutoIt3Wrapper_GUI ****
  7.  
  8. #include <GUIConstantsEx.au3>
  9. #include <EditConstants.au3>
  10. #include <ProgressConstants.au3>
  11. #include <WindowsConstants.au3>
  12. #include <StaticConstants.au3>
  13. #include <GuiStatusBar.au3>
  14. #include <GuiListView.au3>
  15. #include <ListViewConstants.au3>
  16. #include <Array.au3>
  17. #include <Date.au3>
  18. #include <File.au3>
  19.  
  20. Global $iSRC = 'C:\', $iPRS = '(.*)', $iPRR = '\1', $iNRS = '(.*)', $iNRR = '\1', $iREC = False, $iTST = False
  21.  
  22. _GetIni()
  23.  
  24. #Region ### START Koda GUI section ### Form=
  25. $guiBSM = GUICreate("BSM v0.7", 354, 251)
  26. $Go = GUICtrlCreateButton("Go", 256, 193, 75, 25)
  27. GUICtrlSetTip(-1, "Starts shortcut modification")
  28. $Button1 = GUICtrlCreateButton("Folder", 280, 13, 50, 25)
  29. GUICtrlSetTip(-1, "Folder with shortcuts")
  30. $progress = GUICtrlCreateProgress(16, 152, 314, 17)
  31. $Input1 = GUICtrlCreateInput($iSRC, 16, 14, 258, 21, $GUI_SS_DEFAULT_INPUT)
  32.  
  33. $cRecurse = GUICtrlCreateCheckbox("Recurse", 170, 194, 66, 17)
  34. If $iREC Then GUICtrlSetState($cRecurse, $GUI_CHECKED)
  35. GUICtrlSetTip(-1, "Recurse down through folder structure")
  36. $cTest = GUICtrlCreateCheckbox("Test", 90, 190, 56, 25)
  37. If $iTST Then GUICtrlSetState($cTest, $GUI_CHECKED)
  38. GUICtrlSetTip(-1, "Display test output")
  39.  
  40. $labelRx = GUICtrlCreateLabel("RegEx", 19, 196, 36, 17)
  41. GUICtrlSetTip(-1, "Click to open browser at RegEx page")
  42. GUICtrlSetColor(-1, '0x000099')
  43.  
  44. $Input2 = GUICtrlCreateInput($iPRS, 16, 80, 140, 21)
  45. GUICtrlSetTip(-1, "Path RegEx to search for")
  46. $Input4 = GUICtrlCreateInput($iPRR, 16, 110, 140, 21)
  47. GUICtrlSetTip(-1, "Path RegEx replacement text")
  48. $Input5 = GUICtrlCreateInput($iNRS, 190, 80, 140, 21)
  49. GUICtrlSetTip(-1, "Name RegEx to search for")
  50. $Input6 = GUICtrlCreateInput($iNRR, 190, 110, 140, 21)
  51. GUICtrlSetTip(-1, "Name RegEx replacement text")
  52. GUICtrlCreateLabel("Path of target", 52, 48, 70, 17)
  53. GUICtrlCreateLabel("Name of target", 215, 49, 75, 17)
  54. GUICtrlCreateLabel("Old", 160, 85, 25, 21, $SS_CENTER)
  55. GUICtrlCreateLabel("New", 160, 115, 25, 21, $SS_CENTER)
  56. $StatusBar1 = _GUICtrlStatusBar_Create($guiBSM)
  57. WinMove("BSM v0.7", '', IniRead($inifile, 'Main', 'XPos', 20), IniRead($inifile, 'Main', 'YPos', 20))
  58. #EndRegion ### END Koda GUI section ###
  59.  
  60.         $nMsg = GUIGetMsg()
  61.         Switch $nMsg
  62.                 Case $labelRx
  63.                         ShellExecute('http://www.autoitscript.com/autoit3/docs/functions/StringRegExp.htm')
  64.                 Case $Button1
  65.                         $iSRC = FileSelectFolder('Select folder:', '', 4)
  66.                         If @error = 1 Then $iSRC = ''
  67.                         GUICtrlSetData($Input1, $iSRC)
  68.                 Case $Go
  69.                         $iSRC = GUICtrlRead($Input1)
  70.                         If Not FileExists($iSRC) Then
  71.                                 MsgBox(48, 'BSM Error', 'Not a valid path')
  72.                         Else
  73.                                 $output = ''
  74.                                 GUICtrlSetData($progress, 0)
  75.                                 $iPRS = GUICtrlRead($Input2)
  76.                                 $iPRR = GUICtrlRead($Input4)
  77.                                 $iNRS = GUICtrlRead($Input5)
  78.                                 $iNRR = GUICtrlRead($Input6)
  79.  
  80.                                 If $iPRS = '' Then $iPRS = '(.*)'
  81.                                 If $iPRR = '' Then $iPRR = '\1'
  82.                                 If $iNRS = '' Then $iNRS = '(.*)'
  83.                                 If $iNRR = '' Then $iNRR = '\1'
  84.  
  85.                                 If $iSRC <> '' Then
  86.                                         _GUICtrlStatusBar_SetText($StatusBar1, 'Finding shortcuts')
  87.                                         Global $start = TimerInit()
  88.                                         If (GUICtrlRead($cRecurse) = 1) Then
  89.                                                 $output = _FileListToArrayPlus($iSRC, "*.lnk", 1, 0, "", 2, True)
  90.                                         Else
  91.                                                 $output = _FileListToArrayPlus($iSRC, "*.lnk", 1, 0, "", 2, False)
  92.                                         EndIf
  93.                                         If @error = 0 Or IsArray($output) Then
  94.                                                 _BSM($output, (GUICtrlRead($cTest) = 1))
  95.                                         Else
  96.                                                 MsgBox(48, 'BSM Error', 'No shortcuts found')
  97.                                         EndIf
  98.                                 EndIf
  99.                         EndIf
  100.                 Case $GUI_EVENT_CLOSE
  101.                         $wPos = WinGetPos("BSM v0.7")
  102.                         IniWrite($inifile, 'Main', 'Folder', $iSRC)
  103.                         IniWrite($inifile, 'Main', 'PathSearch', $iPRS)
  104.                         IniWrite($inifile, 'Main', 'PathReplace', $iPRR)
  105.                         IniWrite($inifile, 'Main', 'NameSearch', $iNRS)
  106.                         IniWrite($inifile, 'Main', 'NameReplace', $iNRR)
  107.                         IniWrite($inifile, 'Main', 'Recurse', (GUICtrlRead($cRecurse) = 1))
  108.                         IniWrite($inifile, 'Main', 'Test', (GUICtrlRead($cTest) = 1))
  109.                         IniWrite($inifile, 'Main', 'XPos', $wPos[0])
  110.                         IniWrite($inifile, 'Main', 'YPos', $wPos[1])
  111.                         Exit
  112.         EndSwitch
  113.  
  114.  
  115. Func _BSM($files, $test = False)
  116.         Local $j = 1, $target, $targetPath, $newTarget, $newWorking, $prg = 1, $fDScut = 0, $fDLog = '', $fCScut = 0, $fCLog = '', $max, $nMsg2
  117.         Local $Percent, $Percent_prev, $interrupt = False
  118.         Dim $temp[101][2]
  119.  
  120.         $max = $files[0]
  121.         Switch $test
  122.                 Case True
  123.                         _GUICtrlStatusBar_SetText($StatusBar1, 'Creating test output')
  124.                         If $files[0] > 100 Then $max = 100
  125.                 Case Else
  126.                         _GUICtrlStatusBar_SetText($StatusBar1, 'Processing ' & $max & ' shortcuts')
  127.         EndSwitch
  128.  
  129.         GUICtrlSetData($Go, 'Stop')
  130.  
  131.         For $i = 1 To $max
  132.                 $nMsg2 = GUIGetMsg()
  133.                 Switch $nMsg2
  134.                         Case $Go
  135.                                 $interrupt = True
  136.                                 ExitLoop
  137.                         Case Else
  138.                                 $details = FileGetShortcut($files[$i])
  139.                                 If $details[0] = "" Then
  140.                                         _ArrayDelete($files, $i)
  141.                                         $max -= 1
  142.                                         $i -= 1
  143.                                 Else
  144.                                         $targetPath = StringLeft($details[0], StringInStr($details[0], '\', 0, -1) - 1)
  145.                                         $target = StringMid($details[0], StringInStr($details[0], '\', 0, -1) + 1)
  146.  
  147.                                         $newTarget = StringRegExpReplace($targetPath, $iPRS, $iPRR) & '\' & StringRegExpReplace($target, $iNRS, $iNRR)
  148.                                         $newWorking = StringRegExpReplace($details[1], $iPRS, $iPRR)
  149.                                         Select
  150.                                                 Case $test
  151.                                                         $temp[$i][0] = $details[0]
  152.                                                         $temp[$i][1] = $newTarget
  153.                                                         $temp[0][0] = $i
  154.                                                 Case Else
  155.                                                         If FileDelete($files[$i]) Then
  156.                                                                 If Not FileCreateShortcut($newTarget, $files[$i], $newWorking, $details[2], $details[3], $details[4], '', $details[5], $details[6]) Then
  157.                                                                         $fCScut += 1
  158.                                                                         $fCLog &= $files[$i] & @CRLF
  159.                                                                 EndIf
  160.                                                         Else
  161.                                                                 $fDScut += 1
  162.                                                                 $fDLog &= $files[$i] & @CRLF
  163.                                                         EndIf
  164.                                         EndSelect
  165.                                         $Percent = Round(($i / $max) * 100, 0)
  166.                                         If $Percent <> $Percent_prev Then
  167.                                                 GUICtrlSetData($progress, $Percent)
  168.                                                 $Percent_prev = $Percent
  169.                                         EndIf
  170.                                 EndIf
  171.                 EndSwitch
  172.         Next
  173.  
  174.         GUICtrlSetData($Go, 'Go')
  175.         If $interrupt Then
  176.                 _GUICtrlStatusBar_SetText($StatusBar1, 'Interrupted')
  177.         Else
  178.                 _GUICtrlStatusBar_SetText($StatusBar1, 'Finished: ' & Round(TimerDiff($start) / 1000, 1) & ' seconds')
  179.         EndIf
  180.  
  181.         If $test Then
  182.                 _ArrayBox($temp, 1, 'BSM Test Output', '|Old Shortcut Target|New Shortcut Target', True)
  183.         Else
  184.                 If $fDScut > 0 Or $fCScut > 0 Or $interrupt Then
  185.                         _Log($fCLog, $fCScut, $fDLog, $fDScut, $files[0], $interrupt)
  186.                 Else
  187.                         MsgBox(64, 'BSM Results', 'Total shortcuts: ' & $files[0] & @CRLF & 'No failures during Delete/Create')
  188.                 EndIf
  189.         EndIf
  190.  
  191.         GUICtrlSetData($progress, 0)
  192. EndFunc   ;==>_BSM
  193.  
  194.  
  195. Func _Log($cl, $cc, $dl, $dc, $tot, $int)
  196.         Local $fLog = FileOpen(@TempDir & '\BSM.log', 138)
  197.         If $fLog = -1 Then
  198.                 MsgBox(64, 'BSM Error', 'Unable to open log file:' & @CRLF & @TempDir & '\BSM.log' & @CRLF & 'for output')
  199.         Else
  200.                 FileWrite($fLog, 'BSM results ' & _Now() & @CRLF & 'Total shortcuts: ' & $tot & @CRLF & @CRLF)
  201.                 If $int Then FileWrite($fLog, '**** INTERRUPTED ****' & @CRLF & @CRLF)
  202.                 FileWrite($fLog, 'Shortcuts that failed to be deleted: ' & $dc & @CRLF)
  203.                 If $dc > 0 Then FileWrite($fLog, $dl & @CRLF & @CRLF)
  204.                 FileWrite($fLog, 'Shortcuts that failed to be created: ' & $cc & @CRLF)
  205.                 If $cc > 0 Then FileWrite($fLog, $cl & @CRLF & @CRLF)
  206.                 FileClose($fLog)
  207.                 ShellExecuteWait(@TempDir & '\BSM.log')
  208.         EndIf
  209. EndFunc   ;==>_Log
  210.  
  211.  
  212. Func _GetIni()
  213.         If FileExists($inifile) Then
  214.                 $iSRC = IniRead($inifile, 'Main', 'Folder', 'C:\')
  215.                 $iPRS = IniRead($inifile, 'Main', 'PathSearch', '(.*)')
  216.                 $iPRR = IniRead($inifile, 'Main', 'PathReplace', '\1')
  217.                 $iNRS = IniRead($inifile, 'Main', 'NameSearch', '(.*)')
  218.                 $iNRR = IniRead($inifile, 'Main', 'NameReplace', '\1')
  219.                 $iREC = IniRead($inifile, 'Main', 'Recurse', 'False')
  220.                 $iTST = IniRead($inifile, 'Main', 'Test', 'False')
  221.         EndIf
  222. EndFunc   ;==>_GetIni
  223.  
  224.  
  225. ;===============================================================================
  226. ;
  227. ; Function Name:    _ArrayBox()
  228. ; Description:      Shows an array in a GUI window.  Improved version of _ArrayDisplay
  229. ; Parameter(s):     $Array - An array, 1d or 2d, 0-based or 1-based
  230. ; $ArrayBase - 1 or 0 - tells what base the array is
  231. ; $sTitle - the title to put on the output window
  232. ; $Width, $Height, $Left, $Top - Set the size and position of the output window
  233. ; Requirement(s):   $Array must be 1d or 2d.  If 1-based, then arraysize is assumed to be $Array[0] or $Array[0][0]
  234. ; Return Value(s):  -1 = $Array is not an array, error=1
  235. ; Author(s):        Mike Ratzlaff <[email protected]>
  236. ; Revision: 20050620A
  237. ;
  238. ;===============================================================================
  239. ;
  240. Func _ArrayBox(ByRef $Array, $ArrayBase = 1, $sTitle = 'Array Box', $sTemp = '', $sIni = False, $Width = 400, $Height = 200, $Left = -1, $Top = -1)
  241.         Dim $AllDone = 0, $msg, $i, $j, $ArrayDimensions = UBound($Array, 0)
  242.         Dim $hndForm_Main, $hndListView_Display
  243.  
  244.         If $ArrayDimensions = 0 Then
  245.                 SetError(1)
  246.                 Return -1
  247.         EndIf
  248.  
  249.         ;Setup
  250.         If $ArrayBase <> 0 Then $ArrayBase = 1
  251.         If $ArrayBase Then
  252.                 Select
  253.                         Case $ArrayDimensions = 1
  254.                                 $ArrayMax = $Array[0]
  255.                         Case $ArrayDimensions = 2
  256.                                 $ArrayMax = $Array[0][0]
  257.                 EndSelect
  258.         Else
  259.                 $ArrayMax = UBound($Array, 1) - 1
  260.         EndIf
  261.  
  262.         ;Create GUI
  263.         If $Height < 100 Then $Height = 100
  264.         If $Width < 100 Then $Width = 100
  265.         $hndForm_Main = GUICreate($sTitle, $Width, $Height, $Left, $Top, BitOR($WS_POPUP, $WS_CAPTION, $WS_SIZEBOX, $WS_MAXIMIZEBOX, $WS_EX_DLGMODALFRAME))
  266.  
  267.         ;Create List Box
  268.         If $ArrayDimensions = 1 Then
  269.                 If $sTemp = '' Then $sTemp = 'Index|Value'
  270.         ElseIf $ArrayDimensions = 2 Then
  271.                 If $sTemp = '' Then
  272.                         $sTemp = 'Index'
  273.                         For $i = 0 To UBound($Array, 2) - 1
  274.                                 $sTemp = $sTemp & '|' & $i
  275.                         Next
  276.                 EndIf
  277.         EndIf
  278.         $hndListView_Display = GUICtrlCreateListView($sTemp, 0, 0, $Width, $Height - 24, BitOR($LVS_SHOWSELALWAYS, $LVS_SINGLESEL, $LVS_NOSORTHEADER))
  279.         GUICtrlSetResizing($hndListView_Display, BitOR($GUI_DockLeft, $GUI_DockTop, $GUI_DockRight, $GUI_DockBottom))
  280.         _GUICtrlListView_SetColumnWidth($hndListView_Display, 0, 36)
  281.  
  282.         ;Create Controls, Show GUI
  283.         $hndButton_Close = GUICtrlCreateButton('&Close', $Width - 80, $Height - 24, 80, 24)
  284.         GUICtrlSetResizing($hndButton_Close, BitOR($GUI_DockRight, $GUI_DockBottom, $GUI_DockSize))
  285.         GUICtrlSetState($hndButton_Close, $GUI_DefButton)
  286.         If $sIni Then WinMove($sTitle, '', IniRead($inifile, 'Test', 'XPos', 20), IniRead($inifile, 'Test', 'YPos', 20), IniRead($inifile, 'Test', 'Width', 400), IniRead($inifile, 'Test', 'Height', 200))
  287.         GUISetState(@SW_SHOW, $hndForm_Main)
  288.  
  289.         ;Display Array
  290.         Select
  291.                 Case $ArrayDimensions = 1 ;1-Dimensional Array
  292.                         For $i = $ArrayBase To $ArrayMax
  293.                                 GUICtrlCreateListViewItem($i & '|' & $Array[$i], $hndListView_Display)
  294.                         Next ;$i
  295.                 Case $ArrayDimensions = 2 ;2-Dimensional Array
  296.                         For $i = $ArrayBase To $ArrayMax
  297.                                 $sTemp = $Array[$i][0]
  298.                                 For $j = 1 To UBound($Array, 2) - 1
  299.                                         $sTemp = $sTemp & '|' & $Array[$i][$j]
  300.                                 Next ;$j
  301.                                 GUICtrlCreateListViewItem('[' & $i & ']|' & $sTemp, $hndListView_Display)
  302.                         Next ;$i
  303.                 Case Else ;Unhandled Type
  304.  
  305.         EndSelect
  306.         _GUICtrlListView_SetColumnWidth($hndListView_Display, 1, $LVSCW_AUTOSIZE)
  307.         _GUICtrlListView_SetColumnWidth($hndListView_Display, 2, $LVSCW_AUTOSIZE)
  308.  
  309.         ;Wait for user to close box
  310.         Do
  311.                 $msg = GUIGetMsg()
  312.                 Select
  313.                         Case $msg = $GUI_EVENT_CLOSE
  314.                                 $AllDone = 1
  315.                         Case $msg = $hndButton_Close
  316.                                 $AllDone = 1
  317.                 EndSelect
  318.         Until $AllDone
  319.         Local $wPos = WinGetPos($sTitle)
  320.         If @error = 0 And $sIni Then
  321.                 IniWrite($inifile, 'Test', 'XPos', $wPos[0])
  322.                 IniWrite($inifile, 'Test', 'YPos', $wPos[1])
  323.                 IniWrite($inifile, 'Test', 'Width', $wPos[2])
  324.                 IniWrite($inifile, 'Test', 'Height', $wPos[3])
  325.         EndIf
  326.         GUIDelete($hndForm_Main)
  327.         Return 0
  328. EndFunc   ;==>_ArrayBox
  329.  
  330.  
  331. ; #FUNCTION# =====================================================================================================================
  332. ; _FileListToArrayPlus($sPath, $sInclude = "*", $iFlag = 0, $sExcludeFolder = "", $sExclude = "", $iPathType = 0, $bRecursive = False)
  333. ; Name...........:  _FileListToArray_Rec
  334. ; Parameters ....:  $sPath: Folder to search
  335. ;     $sInclude: String to match on (wildcards allowed, multiples delimited by ;)
  336. ;     $iFlag: Returned data type. 0 = Files and folders (default), 1 = Files only, 2 = Folders only
  337. ;     $sExcludeFolder: List of folders to exclude from search (wildcards allowed, multiples delimited by ;)
  338. ;     $sExclude: List of filenames to exclude from search (wildcards allowed, multiples delimited by ;)
  339. ;     $iPathType: Returned data format. 0 = Filename only (default), 1 = Path relative to $sPath, 2 = Full path/filename
  340. ;     $bRecursive: False = Search $sPath folder only (default), True = Search $sPath and all subfolders
  341. ; Author ........:  Half the Autoit Community (Forum thread #96952)
  342. ;===================================================================================================================================
  343.  
  344. Func _FileListToArrayPlus($sPath, $sInclude = "", $iFlag = 0, $sExcludeFolder = "", $sExclude = "", $iPathType = 0, $bRecursive = False)
  345.         Local $sRet = "", $sReturnFormat = "", $interrupt = False
  346.         $sPath = StringRegExpReplace($sPath, "[\\/]+\z", "") & "\" ; ensure single trailing slash
  347.         If Not FileExists($sPath) Then Return SetError(1, 1, "")
  348.         ; Edit include files list
  349.         If $sInclude = "*" Then $sInclude = ""
  350.         If $sInclude Then
  351.                 If StringRegExp($sInclude, "[\\/ :><\|]|(?s)\A\s*\z") Then Return SetError(2, 2, "") ; invalid characters test
  352.                 $sInclude = StringRegExpReplace(StringRegExpReplace($sInclude, "(\s*;\s*)+", ";"), "\A;|;\z", "") ; Strip unwanted whitespace
  353.                 $sInclude = StringRegExpReplace($sInclude, "[][$.+^{}()]", "\\$0"); Ignore special characters
  354.                 $sInclude = StringReplace(StringReplace(StringReplace($sInclude, "?", "."), "*", ".*?"), ";", "$|") ; Convert ? to ., * to .*?, and ; to |
  355.                 $sInclude = "(?i)\A(" & $sInclude & "$)"; case-insensitive, match from first char, terminate strings
  356.         EndIf
  357.         ; Edit exclude folders list
  358.         If $sExcludeFolder Then
  359.                 $sExcludeFolder = StringRegExpReplace(StringRegExpReplace($sExcludeFolder, "(\s*;\s*)+", ";"), "\A;|;\z", "") ; Strip unwanted whitespace
  360.                 $sExcludeFolder = StringRegExpReplace($sExcludeFolder, "[][$.+^{}()]", "\\$0"); Ignore special characters
  361.                 $sExcludeFolder = StringReplace(StringReplace(StringReplace($sExcludeFolder, "?", "."), "*", ".*?"), ";", "$|") ; Convert ?=.  *=.*?  ;=|
  362.                 $sExcludeFolder = "(?i)\A(?!" & $sExcludeFolder & "$)"; case-insensitive, match from first char, terminate strings
  363.         EndIf
  364.         ; Edit exclude files list
  365.         If $sExclude Then
  366.                 $sExclude = StringRegExpReplace(StringRegExpReplace($sExclude, "(\s*;\s*)+", ";"), "\A;|;\z", "") ; Strip unwanted whitespace
  367.                 $sExclude = StringRegExpReplace($sExclude, "[][$.+^{}()]", "\\$0"); Ignore special characters
  368.                 $sExclude = StringReplace(StringReplace(StringReplace($sExclude, "?", "."), "*", ".*?"), ";", "$|") ; Convert ?=.  *=.*?  ;=|
  369.                 $sExclude = "(?i)\A(?!" & $sExclude & "$)"; case-insensitive, match from first char, terminate strings
  370.         EndIf
  371.         ;   MsgBox(1,"Masks","File include: " & $sInclude & @CRLF & "File exclude: " & $sExclude & @CRLF & "Dir exclude : " & $sExcludeFolder)
  372.  
  373.         If Not ($iFlag = 0 Or $iFlag = 1 Or $iFlag = 2) Then Return SetError(3, 3, "")
  374.  
  375.         Local $sOrigPathLen = StringLen($sPath), $aQueue[64] = [1, $sPath], $iQMax = 63
  376.         While $aQueue[0]
  377.                 $WorkFolder = $aQueue[$aQueue[0]]
  378.                 $aQueue[0] -= 1
  379.                 $search = FileFindFirstFile($WorkFolder & "*")
  380.                 If @error Then ContinueLoop
  381.                 Switch $iPathType
  382.                         Case 1 ; relative path
  383.                                 $sReturnFormat = StringTrimLeft($WorkFolder, $sOrigPathLen)
  384.                         Case 2 ; full path
  385.                                 $sReturnFormat = $WorkFolder
  386.                 EndSwitch
  387.                 While 1
  388.                         $nMsg2 = GUIGetMsg()
  389.                         Switch $nMsg2
  390.                                 Case $Go
  391.                                         $interrupt = True
  392.                                         ExitLoop
  393.                                 Case Else
  394.                                         $file = FileFindNextFile($search)
  395.                                         If @error Then ExitLoop
  396.                                         If @extended Then ; Folder
  397.                                                 If $sExcludeFolder And Not StringRegExp($file, $sExcludeFolder) Then ContinueLoop
  398.                                                 If $bRecursive Then
  399.                                                         If $aQueue[0] = $iQMax Then
  400.                                                                 $iQMax += 128
  401.                                                                 ReDim $aQueue[$iQMax + 1]
  402.                                                         EndIf
  403.                                                         $aQueue[0] += 1
  404.                                                         $aQueue[$aQueue[0]] = $WorkFolder & $file & "\"
  405.                                                 EndIf
  406.                                                 If $iFlag = 1 Then ContinueLoop
  407.                                                 $sRet &= $sReturnFormat & $file & "|"
  408.                                         Else ; File
  409.                                                 If $iFlag = 2 Then ContinueLoop
  410.                                                 If $sInclude And Not StringRegExp($file, $sInclude) Then ContinueLoop
  411.                                                 If $sExclude And Not StringRegExp($file, $sExclude) Then ContinueLoop
  412.                                                 $sRet &= $sReturnFormat & $file & "|"
  413.                                         EndIf
  414.                         EndSwitch
  415.                 WEnd
  416.                 FileClose($search)
  417.                 If $interrupt Then ExitLoop
  418.         WEnd
  419.         If Not $sRet Then Return SetError(4, 4, "")
  420.         Return StringSplit(StringTrimRight($sRet, 1), "|")
  421. EndFunc   ;==>_FileListToArrayPlus
3680
We called it a 'Prophylactic Power Refresh' when I was with Telstra, ie. it solved the likelihood of further problems.  :D
3681
Screenshot Captor / Re: Time Interval in Auto Capture Timer
« Last post by 4wd on June 22, 2012, 08:54 PM »
Or create a screen-movie, using something like the free CamStudio

CamStudio I think don't have the pause button.
So I only can see the super-quick warning.

Play back the CamStudio capture file with another program, eg. MPC, VLC, etc.

Then you can pause and step through the AVI.
3682
General Software Discussion / Re: corrupt index (I think): how to fix?
« Last post by 4wd on June 22, 2012, 08:27 PM »
http://mediainfo.sourceforge.net/en

Mediainfo: want to hear some shady shit??  Check this out:

MediaInfo Lite - "just the facts m'am"

Always look for the lite ;)
3683
DC Gamer Club / [EXPIRED] Steam Weekend Deal - 75% off All Deus Ex Titles
« Last post by 4wd on June 22, 2012, 05:30 AM »
Via OzBargain again:

2012-06-22_20-29-16.jpg

Click on the image for the Steam store page.
3684
Finished Programs / Re: DONE: Generate sequential serial numbers
« Last post by 4wd on June 22, 2012, 03:00 AM »
Please explain to me how the code would work correctly, even if variable data types are allowed. What is the outcome of mySerial += myFactor when mySerial is something like "000001" (a string). I would be very surprised if you claimed it would equal 3 (integer).

While I'm no good at AutoHK, it did spring from AutoIt - so here's a little excerpt from the help file:
In AutoIt there is only one datatype called a Variant.  A variant can contain numeric or string data and decides how to use the data depending on the situation it is being used in.  For example, if you try and multiply two variants they will be treated as numbers, if you try and concatenate (join) two variants they will be treated as strings.

If a string is used as a number, an implicit call to Number() function is done. So if it doesn't contain a valid number, it will be assumed to equal 0.

So this:
Code: AutoIt [Select]
  1. $mySerial = '000001gh'
  2. $myFactor = 2
  3. $mySerial += $myFactor  ; With the implicit call becomes: Number($mySerial) += $myFactor

$mySerial = 3

Add this:
Code: AutoIt [Select]
  1. StringFormat('%06s', $mySerial) ; With the implicit call becomes: StringFormat('%06s', String($mySerial))

$mySerial = '000003'

Keep up the bad practice if you like!  :Thmbsup:

I'll take function over form any day as long as it gets the job done  ;)
3685
Finished Programs / Re: DONE: Generate sequential serial numbers
« Last post by 4wd on June 22, 2012, 02:20 AM »
... in languages like C#, ...

But it's not C# - each language has it's own set of rules and restrictions.

AutoHK allows typeless variables, as does AutoIt and REXX.

Whether or not a variable is reused for a type other than what it started with comes down to readability and if it works.

Why create more variables than you need?
3686
DC Gamer Club / [EXPIRED] Commandos 3: Destination Berlin *FREE* + 10% voucher
« Last post by 4wd on June 21, 2012, 09:49 PM »
Deal valid until 1100 UTC 22nd June 2012

Via OzBargain:

2012-06-22_12-47-28.jpg

Direct link to cart with it already added: Commandos 3: Destination Berlin

*** You also get a 10% discount voucher. ***
Voucher valid until July 4th, 2012, (well, mine was).
3687
Living Room / Re: Science News Roundup
« Last post by 4wd on June 21, 2012, 09:12 PM »
Maybe if they just short-stroked the population  ;) and left emotions out of it, we'd all be better off. And possibly be left smiling a lot more too.

Yep, I think cranio's going to have his work cut out for him  :P
3688
Living Room / Re: Raspberry Pi's $35 Linux PC
« Last post by 4wd on June 21, 2012, 09:08 PM »
....
Quite a range out there. The $19 board freaks me out. But, there are lots of options.

You've also got the Android 4.0 based MK802, (Engadget link), for $78, (DX link).
3689
General Software Discussion / Re: corrupt index (I think): how to fix?
« Last post by 4wd on June 21, 2012, 08:48 PM »
Um, that's ~89GB, (23562998*4096/1024/1024/1024), of drive that chkdsk has just found to be bad, ie. the equivalent of all your free space.

I'd be taking the SJ approach here and copying all the data you can to another drive forthwith - only then would I even consider running any further tools over the drive.
3690
Living Room / Re: Raspberry Pi's $35 Linux PC
« Last post by 4wd on June 21, 2012, 04:46 AM »
Melbourne's The Age newspaper today:

[3.3MB]
IMG_4819.JPG


Also, this article from May 21, 2012.
3691
General Software Discussion / Re: Checking Bad sector in HDD and ExtHDD
« Last post by 4wd on June 20, 2012, 08:29 PM »
Whether or not you can find a program to mark existing bad sectors, that does not matter. My very sincere advice is: Do not attempt to continue using a HDD once you find it start developing bad sector.

While I'm not seeking an argument or trying to get overly pedantic, I think this comes down to what you are going to use the drive for and whether or not you're prepared to wear the consequences.

I have a 1TB drive that developed, as it happened, software bad blocks - I LLF'd it and it's been happily running with constant use every day without any further errors for the last 2 years - well past even the 1 year warranty they provide.

Be that as it may, it carries no data that I'm not prepared to lose and none of it is backed up....but then I have a fatalistic approach to computers, "Shit happens, get over it."

Of course, if the drive in question is your only source of backups or that you deem your data is your life then what you and SJ have said x 2.

The fact that manufacturers provide spare blocks shows that they expect there to be sector failures over the life of the drive - it's whether or not the number of those is excessive, in what circumstances, (time frame), they occurred and the life of the drive that would be of more interest to me in determining whether or not the drive is still suitable for my purposes.

One sector fail does automatically consign the drive to the dustbin in my circumstances - hell, you only have to look at the screen grab above and this one* to see that :)

All the OP wanted was a way to mark the sector as bad, to me that shows willingness to continue using the drive, beyond that... th_106.gif


* Yes, both those drives are still happily working.
3692
Living Room / Re: Petaflop is a stupid word
« Last post by 4wd on June 19, 2012, 10:27 PM »
I vote that after zetta and yotta we have lotta  :D
3693
General Software Discussion / Re: Checking Bad sector in HDD and ExtHDD
« Last post by 4wd on June 19, 2012, 10:08 PM »
Normally the controller on the drive will perform any remapping of hardware bad blocks, (eg. platter defects), to its spare area and add them to its Grown Defects List, (G-list), without any user intervention.

You can also have software bad blocks where the ECC data is no longer valid for the sectors affected, (probably a greatly simplified explanation but good enough for me).  You can attempt to 'repair' these by running a Low Level Format, (which isn't really), or by running MHDD in ERASE mode.

However, as Shades has said, they are destructive procedures so don't do them until you have a backup or don't require the data.

Apart from specific test hardware/software I don't know of anything that will let you insert sectors into the G or P list.

You could also try reading the S.M.A.R.T. data and see if there has been any sector remappings.

eg. Here's Hard Disk Sentinel on one of my drives:

2012-06-20_13-13-33.jpg
3694
Living Room / Re: Raspberry Pi's $35 Linux PC
« Last post by 4wd on June 19, 2012, 05:06 AM »
Your Raspberry Pi Id number is 244205

Woohoo!  I'll get to order at the end of the week!!!   ...and then I get to wait..... :(

Registration date recorded betweenEstimated Invited to order dateEstimated shipping lead-time*
6th March - 12th MarchTuesday 19 June9 weeks
13th March - 21st MarchWednesday 20 June10 weeks
22nd March - 5th AprilThursday 21 June11 weeks
6th April - 16 AprilFriday 22 June11 weeks
17th April - 25 AprilMonday 25 June12 weeks
26th April - 8th MayTuesday 26 June12 weeks
9th May - 23rd MayWednesday 27 June13 weeks
24th May - 7th JuneThursday 28 June14 weeks
8th June onwardsFriday 29 June14 weeks
             
RS Components Australia Raspberry Pi FAQ

Not even worth buying an extra one to extort more money from Renegade since he's would arrive three weeks later anyway  :P
3695
Living Room / Re: Science News Roundup
« Last post by 4wd on June 18, 2012, 11:50 PM »
27.gif  He's sleeping....
3696
Finished Programs / Re: DONE: Folder Properties Auto-Update....
« Last post by 4wd on June 18, 2012, 11:46 PM »
Thanks, I think we can get skwire to move this into the Finished area now :)
3697
Living Room / Re: Science News Roundup
« Last post by 4wd on June 18, 2012, 10:23 PM »
One earlier study on reproductive success, in common European birds called great tits, found smaller clutches near roaring highways.

It's quite often that you'll find great tits in a clutch....usually when attempting reproduction.
3698
Finished Programs / Re: DONE: Folder Properties Auto-Update....
« Last post by 4wd on June 18, 2012, 09:55 PM »
OK, I think I'm there now:

2012-06-19_13-12-51.jpg

  • Updates the file/size count every 1000 milliseconds.
  • Updates the Window title every 5000 milliseconds.
  • Font is a bit bigger (14pt).

Changing the update intervals dropped CPU usage back down to 0-1% on my computers.

See above for archive.
3699
Finished Programs / Re: DONE: Folder Properties Auto-Update....
« Last post by 4wd on June 18, 2012, 01:26 AM »
Another update, see first post for file.

Window title gets updated with the number of files in the folder.

NOTE: This only happens every 60 seconds - more frequently pushes CPU usage up too high AFAIAC, (~10%), and it won't change until a minute has passed after running it, (meh - I'm lazy).  So you will get discrepancies between the two numbers until the title gets updated.

2012-06-18_16-19-58.jpg

So this means your Taskbar label gets updated with the number of files :)
3700
Finished Programs / Re: DONE: Folder Properties Auto-Update....
« Last post by 4wd on June 18, 2012, 12:25 AM »
OK, here's the colourised version :)  (See attachment here)

Just copy over the old version and run it, the colour defaults to Yellow on Black, (except for the two buttons - yes, that's right!  A whole new button!).

You can change the colours by editing the ini file, exit the program first otherwise it'll just overwrite the ini file when you do exit it.

Colours are in RGB format:

Background=0x000000
Text=0xFFFF00

Pretty self-explanatory, here's a list of RGB values.

Now that it has an Exit button, (dang it - just ruined the surprise!), I might change it to a borderless window.  (More reading.)

Or I could make it buttonless and you use the keyboard or a menu on the tray icon.
Pages: prev1 ... 143 144 145 146 147 [148] 149 150 151 152 153 ... 225next