Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/17/2015 in all areas

  1. wakillon

    Bitmap2AscII

    Bitmap2AscII use Lucida Console font with a size set to 8, so Windows 8/8.1 users need to change their notepad font and size for get a correct display. Image Rescale slider is only available when saving as image. A click on the "PreviewEdit" open AscII string in Notepad. You can save as Text, Html or Image (add the extension you want) Each setting change is immediately applied. Downloads available in the download section Hope you like it !
    2 points
  2. trancexx

    Bitmap2AscII

    ​By using dll or without? I've written some code for extracting frame/s from video files. It's packed in super small dll. If you are interested here's the dll: FrameGrabber.zip Calling it for for one frame would be for example: $sVideo = FileOpenDialog("Choose Video File", "", "All Files (*)") $sOutFolder = @ScriptDir & "\GrabbedFrame\" DirCreate($sOutFolder) $sBMP = $sOutFolder & "\0.bmp" $nFrameTime = 22 ; in seconds $bExtracted = ExtractFrame($sVideo, $sBMP, $nFrameTime) ConsoleWrite("@error = " & @error & ", @extended = 0x" & Hex(@extended) & @CRLF) ConsoleWrite("Extracted = " & $bExtracted & @CRLF) Func ExtractFrame($sVideo, $sBMP, $nFrameTime) Local $aCall = DllCall(@ScriptDir & "\FrameGrabber.dll", "long", "ExtractFrame", _ "wstr", $sVideo, _ "wstr*", $sBMP, _ "int64*", $nFrameTime * 10000000, _ "int", 1) If @error Then Return SetError(1, @error, False) If $aCall[0] Then Return SetExtended($aCall[0], False) Return $aCall[0] = 0 EndFunc ... and for more frames: $sVideo = FileOpenDialog("Choose Video File", "", "All Files (*)") $sOutFolder = @ScriptDir & "\GrabbedFrames\" DirCreate($sOutFolder) ;~ $sBMP0 = $sOutFolder & "\90.bmp" ;~ $sBMP1 = $sOutFolder & "\91.bmp" ;~ $sBMP2 = $sOutFolder & "\92.bmp" ;~ $sBMP3 = $sOutFolder & "\93.bmp" ;~ $sBMP4 = $sOutFolder & "\94.bmp" ;~ $sBMP5 = $sOutFolder & "\95.bmp" ;~ Local $aBmps = [$sBMP0, $sBMP1, $sBMP2, $sBMP3, $sBMP4, $sBMP5] ;~ Local $aTimes = [17.77, 17.87, 17.97, 18.07, 18.17, 18.27] ; Or maybe like this: $iNumFrames = 50 Local $aBmps[$iNumFrames] Local $aTimes[$iNumFrames] For $i = 0 To $iNumFrames - 1 $aBmps[$i] = $sOutFolder & $i & ".bmp" $aTimes[$i] = 22 + $i / 4 ; in seconds Next $bExtracted = ExtractFrames($sVideo, $aBmps, $aTimes) ConsoleWrite("@error = " & @error & ", @extended = 0x" & Hex(@extended) & @CRLF) ConsoleWrite("Extracted = " & $bExtracted & @CRLF) Func ExtractFrames($sVideo, $vBMP, $vFrameTime) Local $tBMPS = DllStructCreate("ptr[" & UBound($vBMP) & "]") Local $tBMP[UBound($vBMP)] For $i = 0 To UBound($vBMP) - 1 $tBMP[$i] = DllStructCreate("wchar[" & StringLen($vBMP[$i]) + 1 & "]") DllStructSetData($tBMP[$i], 1, $vBMP[$i]) DllStructSetData($tBMPS, 1, DllStructGetPtr($tBMP[$i]), $i + 1) Next ReDim $vFrameTime[UBound($vBMP)] Local $tTimes = DllStructCreate("int64[" & UBound($vFrameTime) & "]") For $i = 0 To UBound($vFrameTime) - 1 DllStructSetData($tTimes, 1, $vFrameTime[$i] * 10000000, $i + 1) Next Local $aCall = DllCall(@ScriptDir & "\FrameGrabber.dll", "long", "ExtractFrame", _ "wstr", $sVideo, _ "struct*", $tBMPS, _ "struct*", $tTimes, _ "int", UBound($vBMP)) If @error Then Return SetError(1, @error, False) If $aCall[0] Then Return SetExtended($aCall[0], False) Return $aCall[0] = 0 EndFunc Does it work for you?
    2 points
  3. This is a visual Crop Tool, Version 1.0.0.5 Load the image in the Crop GUIMove the cross-hair to the upper left corner where to start croppingMark the rectangle with left mouse button, releaseAdjust the position with left mouse, release (right mouse = start over)Press enterImage is saved in same folder, same format, with '_cr' added to file nameAs simple as that. Updated script, Visual Crop UDF 1.0.0.4 examples.au3 Visual Crop UDF 1.0.0.4.au3 (No obscuration of non-selected area) Visual Crop UDF 1.0.0.5.au3 (with obscuration) Ver 1.0.0.1 Avoid trespassing the edge of the GUI while selecting the crop area.Ver 1.0.0.4 Mark crop area in any directionResizing Corner grabbers (use with Ctrl Left Mouse button)Mouse cursor changes over move and resizing corner grabbersRedraw when left mouse clicking outside of crop area (restart crop), right Mouse click, same result.Magnifier de-/selectable with Ctrl-M or F2. (original function by Melba23) Note: without image ratio: Magnifier remains visible till the crop area has been marked with image ratio: Magnifier is only visible until the rectangle appears, first corner has been marked. Ver 1.0.0.5 Obscure non crop area, did some hard thinking and found my way... Missing still: ?Enjoy GreenCan Related:
    1 point
  4. I translated and added some parameters to this function from Delphi sources on the web. Function supports 1D and 2D arrays. All array's data are converted to String datatype. This function doesn't depend on installed Microsoft Excel!! _ArrayToXLS(Const ByRef $avArray, $sFileName[, $Transpose = False[, $iStartRow = 0[, $iEndRow = 0[, $iStartCol = 0[, $iEndCol = 0]]]]]) Here it is also with simple example: #include <File.au3> #include <WinAPI.au3> Dim $myArray[6] = ['A','B','C','D','E','F'] _ArrayToXLS($myArray, @ScriptDir & '\test1.xls') _ArrayToXLS($myArray, @ScriptDir & '\test1t.xls', True) ; transpose _ArrayToXLS($myArray, @ScriptDir & '\test1x.xls', False, 2, 4) ; C,D,E _ArrayToXLS($myArray, @ScriptDir & '\test1xt.xls', True, 2, 4) ; C,D,E transposed Dim $myArray[2][3] = [['A','B','C'], ['D','E','F']] _ArrayToXLS($myArray, @ScriptDir & '\test2.xls') _ArrayToXLS($myArray, @ScriptDir & '\test2t.xls', True) ; transpose _ArrayToXLS($myArray, @ScriptDir & '\test2x.xls', False, 1, 1) ; second row: D,E,F _ArrayToXLS($myArray, @ScriptDir & '\test2xt.xls', True, 1, 1) ; second row: D,E,F transposed _ArrayToXLS($myArray, @ScriptDir & '\test2y.xls', False, 0, 0, 1, 2) ; B,C + E,F _ArrayToXLS($myArray, @ScriptDir & '\test2yt.xls', True, 0, 0, 1, 2) ; B,C + E,F transposed $myArray = _FileListToArray(@ScriptDir, '*', 1) _ArrayToXLS($myArray, @ScriptDir & '\test3.xls') _ArrayToXLS($myArray, @ScriptDir & '\test3x.xls', False, 1) ; skip first row (contains number of files) ShellExecute(@ScriptDir & "\test3x.xls") ; #FUNCTION# ==================================================================================================================== ; Name...........: _ArrayToXLS ; Description ...: Places the elements of an 1D or 2D array into an Excel file (XLS). ; Syntax.........: _ArrayToXLS(Const ByRef $avArray, $sFileName[, $Transpose = False[, $iStartRow = 0[, $iEndRow = 0[, $iStartCol = 0[, $iEndCol = 0]]]]]) ; Parameters ....: $avArray - Array to save ; $sFileName - Full path to XLS file ; $Transpose - [optional] At 2D array changes rows and columns ; $iStartRow - [optional] Zero based index (row) of array to start saving at ; $iEndRow - [optional] Zero based index (row) of array to stop saving at, if zero then last row is taken ; $iStartCol - [optional] Zero based index (column) of array to start saving at ; $iEndCol - [optional] Zero based index (column) of array to stop saving at, if zero then last column is taken ; Return values .: Success - 1 ; Failure - 0, sets @error: ; |1 - $avArray is not an array ; |2 - $avArray is not 1D/2D array ; |3 - $iStartRow is greater than $iEndRow ; |4 - $iStartCol is greater than $iEndCol ; |5 - couldn't create XLS file ; Author ........: Zedna ; Modified.......: ; Remarks .......: Function supports 1D and 2D arrays. All array's data are converted to String datatype. ; This function doesn't depend on installed Microsoft Excel. ; Related .......: _ArrayToString, _ArrayToClip ; Link ..........; ; Example .......; Yes ; =============================================================================================================================== Func _ArrayToXLS(Const ByRef $avArray, $FileName, $Transpose = False, $iStartRow = 0, $iEndRow = 0, $iStartCol = 0, $iEndCol = 0) Local $nBytes If Not IsArray($avArray) Then SetError(1, 0, 0) $iDimension = UBound($avArray, 0) If $iDimension > 2 Then SetError(2, 0, 0) $iUBound1 = UBound($avArray, 1) - 1 If $iEndRow < 1 Or $iEndRow > $iUBound1 Then $iEndRow = $iUBound1 If $iStartRow < 0 Then $iStartRow = 0 If $iStartRow > $iEndRow Then Return SetError(3, 0, 0) If $iDimension = 2 Then $iUBound2 = UBound($avArray, 2) - 1 If $iEndCol < 1 Or $iEndCol > $iUBound2 Then $iEndCol = $iUBound2 If $iStartCol < 0 Then $iStartCol = 0 If $iStartCol > $iEndCol Then Return SetError(4, 0, 0) EndIf $hFile = _WinAPI_CreateFile($FileName, 1) If @error Then Return SetError(5, 0, 0) $str_bof = DllStructCreate('short;short;short;short;short;short') DllStructSetData($str_bof, 1, 0x809) DllStructSetData($str_bof, 2, 0x8) DllStructSetData($str_bof, 3, 0x0) DllStructSetData($str_bof, 4, 0x10) DllStructSetData($str_bof, 5, 0x0) DllStructSetData($str_bof, 6, 0x0) _WinAPI_WriteFile($hFile, DLLStructGetPtr($str_bof), DllStructGetSize($str_bof), $nBytes) Switch $iDimension Case 1 ; 1D array For $i = $iStartRow To $iEndRow ; 0 To $iUBound1 If $Transpose Then __XLSWriteCell($hFile, 0, $i - $iStartRow, $avArray[$i]) Else __XLSWriteCell($hFile, $i - $iStartRow, 0, $avArray[$i]) EndIf Next Case 2 ; 2D array For $i = $iStartRow To $iEndRow ; 0 To $iUBound1 For $j = $iStartCol To $iEndCol ; 0 To $iUBound2 If $Transpose Then __XLSWriteCell($hFile, $j - $iStartCol, $i - $iStartRow, $avArray[$i][$j]) Else __XLSWriteCell($hFile, $i - $iStartRow, $j - $iStartCol, $avArray[$i][$j]) EndIf Next Next EndSwitch $str_eof = DllStructCreate('short;short') DllStructSetData($str_eof, 1, 0x0A) DllStructSetData($str_eof, 2, 0x0) _WinAPI_WriteFile($hFile, DLLStructGetPtr($str_eof), DllStructGetSize($str_eof), $nBytes) _WinAPI_CloseHandle($hFile) Return 1 EndFunc ; ==> _ArrayToXLS ; internal helper function for _ArrayToXLS() Func __XLSWriteCell($hFile, $Row, $Col, $Value) Local $nBytes $Value = String($Value) $Len = StringLen($Value) $str_cell = DllStructCreate('short;short;short;short;short;short') DllStructSetData($str_cell, 1, 0x204) DllStructSetData($str_cell, 2, 8 + $Len) DllStructSetData($str_cell, 3, $Row) DllStructSetData($str_cell, 4, $Col) DllStructSetData($str_cell, 5, 0x0) DllStructSetData($str_cell, 6, $Len) _WinAPI_WriteFile($hFile, DLLStructGetPtr($str_cell), DllStructGetSize($str_cell), $nBytes) $tBuffer = DLLStructCreate("byte[" & $Len & "]") DLLStructSetData($tBuffer, 1, $Value) _WinAPI_WriteFile($hFile, DLLStructGetPtr($tBuffer), $Len, $nBytes) EndFunc ; ==> __XLSWriteCell EDIT: Here is original Delphi source http://programujte.com/forum/vlakno/5645-jak-na-exel/ procedure XlsWriteCellLabel(XlsStream: TStream; const ACol, ARow: Word; const AValue: string); var L: Word; const {$J+} CXlsLabel: array[0..5] of Word = ($204, 0, 0, 0, 0, 0); {$J-} begin L := Length(AValue); CXlsLabel[1] := 8 + L; CXlsLabel[2] := ARow; CXlsLabel[3] := ACol; CXlsLabel[5] := L; XlsStream.WriteBuffer(CXlsLabel, SizeOf(CXlsLabel)); XlsStream.WriteBuffer(Pointer(AValue)^, L); end; function SaveAsExcelFile(AGrid: TStringGrid; AFileName: string): Boolean; const {$J+} CXlsBof: array[0..5] of Word = ($809, 8, 00, $10, 0, 0); {$J-} CXlsEof: array[0..1] of Word = ($0A, 00); var FStream: TFileStream; I, J: Integer; begin Result := False; FStream := TFileStream.Create(PChar(AFileName), fmCreate or fmOpenWrite); try CXlsBof[4] := 0; FStream.WriteBuffer(CXlsBof, SizeOf(CXlsBof)); for i := 0 to AGrid.ColCount - 1 do for j := 0 to AGrid.RowCount - 1 do XlsWriteCellLabel(FStream, I, J, AGrid.cells[i, j]); FStream.WriteBuffer(CXlsEof, SizeOf(CXlsEof)); Result := True; finally FStream.Free; end; end; and here is link to more general Delphi code where is handled also writing integer/decimal datatypes. http://kurapaty.blogspot.com/2008/01/creating-excel-xls-from-delphi.html EDIT2: Here is link to topic in Examples for generating XML XLS (XLSX) without Excel installed from Jerome EDIT3: Here is link to topic in Examples for reading Excel data using SQL (ADO) without Excel installed from ptrex EDIT4: Very nice description of Excel x ADO in Delphi Accessing and managing MS Excel sheets with Delphi http://delphi.about.com/od/database/l/aa090903a.htm EDIT5: There is only one issue with XLS files generated this way: Badly formated national characters in cells when opened by Open Office/Libre Office. Inside binary XLS file and also when opened by Microsoft Excel it's OK. So I think it' some bug (maybe some bad autodetection of code page?) of Open Office/Libre Office. EDIT6: There is problem in MS Excel with data in cells bigger than 255 chars. For data > 255 chars Excel loads XLS file without errors but these cells are empty. This 255 chars problem isn't in LibreOffice (version 3.4.1) only in Microsoft Excel. See post #14, #15 for details
    1 point
  5. Following along with the odd clock theme that seems to be popular lately, I have come up with a BCD clock to add to the collection. It's a 24 hour clock, you can modify it to a 12 hour clock, but it's not as interesting that way. This clock can be changed to display milliseconds by changing one variable at the start of the Main function, there are comments describing that. In my opinion I wouldn't have it display the mseconds because they change too fast to keep track of, it looks terrible, and flickers BADLY. The way the clock is set up currently, it displays one icon for the light being "off" and another for it being "on". You can use whatever icons for these that you'd like instead of the ones in the zip file. Change the variables in the Global declaration at the start of the script to whatever you'd like. Another variation that you can use is to set the "off" icon to a blank file name and then it will only turn on the lights that are supposed to be on, and there will be empty spaces for the off icons. If nothing else, at least you'll learn binary and/or BCD numbers. Updated: Corrected the issue with the seconds for the number 7. BCD Clock.zip
    1 point
  6. For this I personally use this *very* simple workaround (but not tested on w7 x64) HotKeySet("{ESC}", "Terminate") Hotkeyset("c", "_get") While 1 Sleep(10) Wend Func _get() Send("^c") Sleep(100) $list = ClipGet() ClipPut("") Msgbox(0,"", $list) EndFunc Func Terminate() Exit EndFunc
    1 point
  7. trancexx

    Bitmap2AscII

    It's written in VScript. That's my version of AutoIt. It has pretty much the same syntax as AutoIt, but has true compiler. It's what I wanted to do with AutoIt while being active in development. Anyway, not to repeat myself, some limited fuckers had different ideas. Oh, and Jon doesn't want me to talk about my work on AutoIt on the forums, so that's about all the info I'm willing to share. Not all codecs support frame count format, particularly those that handle streaming video formats, because streaming is done in time intervals, and not in frames. I can explain the algo if you want, the code can obviously be written in AutoIt. We are going off-topic here, so create new thread somewhere if you want to go further. No PMs please.
    1 point
  8. Incomplete but: ;For $i = 1 To 7 ;etc Local $theRange = (Chr(64 + 2) & 2) With $oExcel $theColor = .ActiveSheet.Range($theRange).Interior.ColorIndex EndWith Msgbox(0, "", $theColor) ;Next
    1 point
  9. wakillon

    Transparent Rolling Text

    ​The appointment is noted
    1 point
  10. Melba23, Your code does definitely not work on Win 7 SP1 64 bit. On that OS Windows Explorer does not contain a SysListView32 control. Instead of it contains a DUIListView control which is a virtual listview. This can be verified with the UI Automation framework or Inspect.exe from Windows SDK. The control is not recognized by the "AutoIt Window Info" tool. To automate this DUIListView you can use Shell objects. One of the problems with Shell objects is, that only the objects which MicroSoft have implemented are available. But you can easily generate a list of selected items. Fortunately the Shell objects can also be created with ObjCreateInterface (native AutoIt function). When we ourselves create the objects, we can create all the objects we need. You can find an implementation of Shell objects created with ObjCreateInterface in Automating Windows Explorer. And you can find a collection of small examples here. This code works on all Windows versions.
    1 point
  11. LarsJ

    Automating Windows Explorer

    Here is a collection of small examples. Windows Explorer should be open before you run the examples. If you create shortcuts for the scripts, and copy the shortcuts to the desktop, you can run the examples and use Windows Explorer at the same time. For some of the examples you can select files or folders before you run the example. 1) GetCurrentFolder.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Get current folder Local $pFolder = GetCurrentFolder(), $sFolder SHGetPathFromIDList( $pFolder, $sFolder ) MsgBox( 0, "Folder", $sFolder ) ; Free memory _WinAPI_CoTaskMemFree( $pFolder ) EndFunc 2) SetCurrentFolder.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Set current folder to desktop Local $pDesktop = _WinAPI_ShellGetSpecialFolderLocation( $CSIDL_DESKTOP ) SetCurrentFolder( $pDesktop, $SBSP_ABSOLUTE ) ; Free memory _WinAPI_CoTaskMemFree( $pDesktop ) EndFunc 3) CountItems.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Count files and folders MsgBox( 0, "Count files and folders", CountItems() ) ; Count selected files and folders MsgBox( 0, "Count selected files and folders", CountItems( True ) ) EndFunc 4) GetFiles.au3 #include "Includes\AutomatingWindowsExplorer.au3" #include <Array.au3> Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Get all files with full path ;GetFiles( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) Local $aFiles = GetFiles( False, True ) _ArrayDisplay( $aFiles, "All files" ) ; Get selected files with full path ;GetFiles( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) $aFiles = GetFiles( True, True ) _ArrayDisplay( $aFiles, "Selected files" ) EndFunc 5) GetFolders.au3 #include "Includes\AutomatingWindowsExplorer.au3" #include <Array.au3> Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Get all folders ;GetFolders( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) Local $aFolders = GetFolders() _ArrayDisplay( $aFolders, "All folders" ) ; Get selected folders ;GetFolders( $fSelected = False, $fFullPath = False, $fPidl = False, $iMax = 0 ) $aFolders = GetFolders( True ) _ArrayDisplay( $aFolders, "Selected folders" ) EndFunc 6) SetSelectedItem.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Set second item selected SetSelectedItem( 1 ) EndFunc 7) GetSetIconView.au3 #include "Includes\AutomatingWindowsExplorer.au3" Opt( "MustDeclareVars", 1 ) Example() Func Example() ; Windows Explorer on XP, Vista, 7, 8 Local $hExplorer = WinGetHandle( "[REGEXPCLASS:^(Cabinet|Explore)WClass$]" ) If Not $hExplorer Then MsgBox( 0, "Automating Windows Explorer", "Could not find Windows Explorer. Terminating." ) Return EndIf ; Get an IShellBrowser interface GetIShellBrowser( $hExplorer ) If Not IsObj( $oIShellBrowser ) Then MsgBox( 0, "Automating Windows Explorer", "Could not get an IShellBrowser interface. Terminating." ) Return EndIf ; Get other interfaces GetShellInterfaces() ; Get current icon view Local $view = GetIconView() Local $iView, $iSize If IsArray( $view ) Then ; OS > XP $iView = $view[0] ; Icon view $iSize = $view[1] ; Icon size If $iView <> $FVM_DETAILS Then ; Not details view SetIconView( $FVM_DETAILS, 16 ) ; Set details view ElseIf $iView <> $FVM_ICON Then ; Not icon view SetIconView( $FVM_ICON, 48 ) ; Set icon view EndIf Sleep( 3000 ) ; Wait 3 seconds SetIconView( $iView, $iSize ) ; Restore old view Else ; OS = XP $iView = $view If $iView <> $FVM_DETAILS Then ; Not details view SetIconView( $FVM_DETAILS ) ; Set details view ElseIf $iView <> $FVM_ICON Then ; Not icon view SetIconView( $FVM_ICON ) ; Set icon view EndIf Sleep( 3000 ) ; Wait 3 seconds SetIconView( $iView ) ; Restore old view EndIf EndFunc Zipfile The zip contains examples and necessary include files. Examples.7z
    1 point
  12. nf67, Or you can use these SREs from Malkey to get various parts of the path directly: Local $sFile = "C:\Program Files\Another Dir\AutoIt3\AutoIt3.chm" ; Drive letter - Example returns "C" Local $sDrive = StringRegExpReplace($sFile, ":.*$", "") ; Full Path with backslash - Example returns "C:\Program Files\Another Dir\AutoIt3\" Local $sPath = StringRegExpReplace($sFile, "(^.*\\)(.*)", "\1") ; Full Path without backslash - Example returns "C:\Program Files\Another Dir\AutoIt3" Local $sPathExDr = StringRegExpReplace($sFile, "(^.:)(\\.*\\)(.*$)", "\2") ; Full Path w/0 backslashes, nor drive letter - Example returns "\Program Files\Another Dir\AutoIt3\" Local $sPathExDrBSs = StringRegExpReplace($sFile, "(^.:\\)(.*)(\\.*$)", "\2") ; Path w/o backslash, not drive letter: - Example returns "Program Files\Another Dir\AutoIt3" Local $sPathExBS = StringRegExpReplace($sFile, "(^.*)\\(.*)", "\1") ; File name with ext - Example returns "AutoIt3.chm" Local $sFilName = StringRegExpReplace($sFile, "^.*\\", "") ; File name w/0 ext - Example returns "AutoIt3" Local $sFilenameExExt = StringRegExpReplace($sFile, "^.*\\|\..*$", "") ; Dot Extenstion - Example returns ".chm" Local $sDotExt = StringRegExpReplace($sFile, "^.*\.", ".$1") ; Extenstion - Example returns "chm" Local $sExt = StringRegExpReplace($sFile, "^.*\.", "") MsgBox(0, "Path File Name Parts", _ "Drive " & @TAB & $sDrive & @CRLF & _ "Path " & @TAB & $sPath & @CRLF & _ "Path w/o backslash" & @TAB & $sPathExBS & @CRLF & _ "Path w/o Drv: " & @TAB & $sPathExDr & @CRLF & _ "Path w/o Drv or \'s" & @TAB & $sPathExDrBSs & @CRLF & _ "File Name " & @TAB & $sFilName & @CRLF & _ "File Name w/o Ext " & @TAB & $sFilenameExExt & @CRLF & _ "Dot Extension " & @TAB & $sDotExt & @CRLF & _ "Extension " & @TAB & $sExt & @CRLF) M23
    1 point
  13. Jon

    Welcome to the new site

    Site has moved to DreamHost from Interland. The site seems to have made in it one piece and it looks like AutoIt downloads are happening OK. The new forum seems pretty cool - just struggling to set it up as I'd like at the moment (a bit tricky to customise the colours/gfx). It slowed down yesterday during testing (around 6pm USA time) when the mySQL server seemed to lag but if it happens again I'll report it - the new host seems very responsive and I'm sure it will be sorted out. Sorry that the user accounts need to be recreated. Hopefully the insane amount of features will help lessen the pain.
    1 point
×
×
  • Create New...