Jump to content

Search the Community

Showing results for tags 'extension'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • General
    • Announcements and Site News
    • Administration
  • AutoIt v3
    • AutoIt Help and Support
    • AutoIt Technical Discussion
    • AutoIt Example Scripts
  • Scripting and Development
    • Developer General Discussion
    • Language Specific Discussion
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Categories

  • AutoIt Team
    • Beta
    • MVP
  • AutoIt
    • Automation
    • Databases and web connections
    • Data compression
    • Encryption and hash
    • Games
    • GUI Additions
    • Hardware
    • Information gathering
    • Internet protocol suite
    • Maths
    • Media
    • PDF
    • Security
    • Social Media and other Website API
    • Windows
  • Scripting and Development
  • IT Administration
    • Operating System Deployment
    • Windows Client
    • Windows Server
    • Office

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Location


WWW


Interests

Found 7 results

  1. I am not very sure if I am all right to post here tho. Due to other forums have no respond at all. So I have my custom make google chrome extension, and it will load unpack into Portable Google Chrome, but it keep pop up the alert box Is there any way to disable it? Because my Portable Google Chrome will load as Kiosk mode, so that user can't be uninstall/disable the extension. Many thanks in advance.
  2. In my recent project I'm downloading a bunch of data, so I decided to store it in a SQLite database. NOTE: I'm using sqlite3_x64.dll Everything is working just fine but I'm struggling with getting the Median value. SQLite has an Average function but not a Median one. I googled but all of the provided solutions are way above my pay-grade. After some more searching I found 'extension-functions.c' on the SQLite site where Median is included. After almost an hour of struggling I was able to successfully compile it into a DLL. So I downloaded @jchd's SQLiteExtLoad.au3 as seen here: But I'm getting these errors: "Path\SQLiteExtLoad.au3"(21,40) : warning: $g_hDll_SQLite: possibly used before declaration. Local $RetVal = DllCall($g_hDll_SQLite, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ "Path\SQLiteExtLoad.au3"(21,40) : error: $g_hDll_SQLite: undeclared global variable. Local $RetVal = DllCall($g_hDll_SQLite, ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^ So I tried, copying the function to my file and changing the DLL variable ($g_hDll_SQLite) directly to the DLL location (C:\...\.. .dll), but now this error fires If __SQLite_hChk($hConn, 1) Then Return SetError(@error, 0, $SQLITE_MISUSE) To be honest, I don't know what to use as the $hConn - handle of connection. I would appreciate any help, be it getting the median using SQLite queries or getting the DLL extension loaded using AutoIt. Thanks, S. EDIT: well, I suspect the $hConn variable refers to the return value of the _SQLite_Open function. Well, at least now _SQLite_EnableExtensions doesn't give errors. Now I run into problems with _SQLite_LoadExtension, which gives error -1, and extended 1. Apparently the 1 constant is a generic error where other error do not apply. BTW, anybody knows whether I need to compile the extension DLL "into" x64 when I use a x64 SQLite? That might be the problem... EDIT2: I recompiled the dll and tried it using the SQLite3.exe and it works, so I'm confident the extension DLL has been created correctly
  3. Hi friends! I making a listview who displays files and i need set correct icon example: If computer have installed WinRAR zip files will have winrar icon, if have installed adobe reader pdf files have adobe reader icon. I trying to find a way to get icon associated with a extension on the computer, to after put in my listview. Thanks in advance.
  4. #include-once ; #UDF# ======================================================================================================================= ; Title .........: PathSplitEx ; AutoIt Version : 3.3.8.1 ; Language ......: English ; Description ...: Splits a path into the drive, directory, file name and file extension parts ; Author(s) .....: DXRW4E ; Notes .........: ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ; _PathSplitEx ; _PathSplitParentDir ; _FileExistsEx ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name...........: _PathSplitEx ; Description ...: Splits a path into the drive, directory, file name and file extension parts. An empty string is set if a part is missing. ; Syntax.........: _PathSplitEx($sFilePath, ByRef $sDrive, ByRef $sDir, ByRef $sFileName, ByRef $sExtension) ; Parameters ....: $sFilePath - The path to be split (Can contain a UNC server or drive letter) ; $sDrive - String to hold the drive ; $sDir - String to hold the directory ; $sFileName - String to hold the file name ; $sExtension - String to hold the file extension ; Return values .: Success - Returns an array with 5 elements where 0 = original path 1 = drive, 2 = directory, 3 = filename, 4 = extension ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: This function does not take a command line string. It works on paths, not paths with arguments. ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _PathSplitEx($sFilePath, ByRef $sDrive, ByRef $sDir, ByRef $sFileName, ByRef $sExtension) $sFilePath = StringRegExp($sFilePath, "^((?:\\\\\?\\)*(\\\\[^\?\/\\]+|[A-Za-z]:)?(.*[\/\\])?((?:[^\.\/\\]|(?(?=\.[^\/\\]*\.)\.))*)?([^\/\\]*))$", 1) $sDrive = $sFilePath[1] $sDir = StringRegExpReplace($sFilePath[2], "[\/\\]+\h*", "\" & StringLeft($sFilePath[2], 1)) $sFileName = $sFilePath[3] $sExtension = $sFilePath[4] Return $sFilePath EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _PathSplitParentDir ; Description ...: Splits a path into the drive, directory, file name and file extension parts. An empty string is set if a part is missing. ; Syntax.........: _PathSplit($sFilePath, ByRef $sDrive, ByRef $sDir, ByRef $sParentDir, ByRef $sFileName, ByRef $sExtension) ; Parameters ....: $sFilePath - The path to be split (Can contain a UNC server or drive letter) ; $sDrive - String to hold the drive ; $sDir - String to hold the directory ; $sParentDir - String to hold the parent directory ; $sFileName - String to hold the file name ; $sExtension - String to hold the file extension ; Return values .: Success - Returns an array with 6 elements where 0 = original path 1 = drive, 2 = directory, 3 = parentdir, 4 = filename, 5 = extension ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: This function does not take a command line string. It works on paths, not paths with arguments. ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _PathSplitParentDir($sFilePath, ByRef $sDrive, ByRef $sDir, ByRef $sParentDir, ByRef $sFileName, ByRef $sExtension) $sFilePath = StringRegExp($sFilePath & " ", "^((?:\\\\\?\\)*(\\\\[^\?\/\\]+|[A-Za-z]:)?(.*?[\/\\]+)?([^\/\\]*[\/\\])?[\/\\]*((?:[^\.\/\\]|(?(?=\.[^\/\\]*\.)\.))*)?([^\/\\]*))$", 1) $sDrive = $sFilePath[1] $sFilePath[2] = StringRegExpReplace($sFilePath[2], "[\/\\]+\h*", "\" & StringLeft($sFilePath[2], 1)) $sDir = $sFilePath[2] $sParentDir = $sFilePath[3] $sFileName = $sFilePath[4] $sExtension = $sFilePath[5] Return $sFilePath EndFunc ; #FUNCTION# ==================================================================================================================== ; Name...........: _FileExistsEx ; Description ...: Get New Files Name ; Syntax.........: _FileExistsEx(ByRef $sFilePath[, $iFileExists]) ; Parameters ....: $sFilePath - The Fullpath file ; $iFileExists - Optional ; Author ........: DXRW4E ; Modified.......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: ; =============================================================================================================================== Func _FileExistsEx(ByRef $sFilePath, $iFileExists = 0) While FileExists($sFilePath) $iFileExists += 1 $sFilePath = StringRegExpReplace($sFilePath & " ", "( - \(\d+\))?(\.[^\.\\]*)?(\h)$", " - (" & $iFileExists & ")$2") WEnd EndFunc _PathSplitEx.au3
  5. What is TrIDLib.dll? This standard Win32 DLL library, based on TrID's core engine, make adding file identification / file recognition capabilities to any kind of application a very easy & quick process. If you need a managed library, check the TrIDEngine. For more Info Go to Author website http://mark0.net/index-e.html Functions in the UDF are: _TrIDLib_Startup _TrIDLib_Shutdown _TrIDLib_GetInfo _TrIDLib_GetRealExtension _TrIDLib_GetVersion _TrIDLib_GetFileTypeDef Here is main udf: #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #include-once ; TrIDlib AutoIt Demo[Modified] ; #INDEX# ======================================================================================================================= ; Title .........: 7Zip ; AutoIt Version : 3.3.8.1 ; Language ......: English ; Description ...: Functions that assist with TrIDLib DLL. ; Author(s) .....: Gajjar Tejas ; Notes .........: The original code came from this subject : http://mark0.net/download/tridlib-samples.zip ; - 12 June 2013 : ; * Intial ; * Added _TrIDLib_GetInfo, _TrIDLib_GetVersion, _TrIDLib_GetFileTypeDef,_TrIDLib_Startup, _TrIDLib_Shutdown,_TrIDLib_GetRealExtension ; * 32bit dll Version(v1.0.2.0). ; * Auto Open Dll, Manually Close ; - Note ; * Using _TrIDLib_Startup() and _TrIDLib_Shutdown() is recommanded for multiples Files. ; * The last x32 DLL file can be found here : http://mark0.net/code-tridlib-e.html ; * The last Definition file can be found here : http://mark0.net/soft-trid-e.html ; =============================================================================================================================== ; #CURRENT# ===================================================================================================================== ;_TrIDLib_Startup ;_TrIDLib_Shutdown ;_TrIDLib_GetInfo Auto Open dll*** ;_TrIDLib_GetVersion Auto Open dll ;_TrIDLib_GetFileTypeDef Auto Open dll ;***Using _TrIDLib_Startup() and _TrIDLib_Startup() is recommanded for multiples Files to avoid ; repetitive dll open that can increase operation time. ;***If _TrIDLib_Startup is not specified then dll will open and close automatically for _TrIDLib_GetInfo() ; =============================================================================================================================== ; #VARIABLES# =================================================================================================================== ; Definations & dll File Global $sTridDllFile = @ScriptDir & "\TrIDLib.dll" Global $sTridDefDir = @ScriptDir Global $sTridDefFile = $sTridDefDir & "\triddefs.trd" ; Others Global $iTridIsDllOpen = 0 ;Default Dll is not opened. Global $hTridDll = 0 ;Handle to Dll Global $iTridAutoLoad = 1 ;Default auto load Dll ; Constants FOR TrID_GetInfo Const $TRID_GET_RES_NUM = 1 ;Get the number of results available Const $TRID_GET_RES_FILETYPE = 2 ;Filetype descriptions Const $TRID_GET_RES_FILEEXT = 3 ;Filetype extension Const $TRID_GET_RES_POINTS = 4 ;Matching points Const $TRID_GET_VER = 1001 ;TrIDLib version (major * 100 + minor) Const $TRID_GET_DEFSNUM = 1004 ;Number of filetypes definitions loaded ; =============================================================================================================================== ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib ; Description ...: Identify file types from their binary signatures. ; Syntax ........: _TrIDLib($sFile) ; Parameters ....: $sFile - A full path of file. ; Return values .: Success - Returns the array (n x 4) with results ; n = Total No of possible file type found(UBound(array, 1)) ; array[0][0] = File Type 1st instant ; array[0][1] = Extension " ; array[0][2] = Points " ; array[0][3] = % Point " ; ... ; array[n-1][0] = File Type (n-1)th instant ; array[n-1][1] = Extension " ; array[n-1][2] = Points " ; array[n-1][3] = % Point " ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; |4 = While Loading triddefs.trd(DllCall) ; |5 = While Submitting File(DllCall) ; |6 = While Analysing File(DllCall) ; |7 = Unable to detect file type(DllCall) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _TrIDLib_GetInfo($sFile) If $iTridAutoLoad Then _TrIDLib_Startup() If @error Then Return SetError(@error, 0, 0) $iTridAutoLoad = 1 Else ;Check if Manually Load Using _TrIDLib_Startup and previously dll open or not If Not $iTridIsDllOpen Then _TrIDLib_Startup() If @error Then Return SetError(@error, 0, 0) EndIf EndIf ; load the definitions Local $Ret = DllCall($hTridDll, "int", "TrID_LoadDefsPack", "str", $sTridDefDir) If @error Then Return SetError(4, 0, 0) ; submit the file $Ret = DllCall($hTridDll, "int", "TrID_SubmitFileA", "str", $sFile) If @error Then Return SetError(5, 0, 0) ; perform the analysis $Ret = DllCall($hTridDll, "int", "TrID_Analyze") If @error Then Return SetError(6, 0, 0) Local $Buf $Ret = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_NUM, "int", 0, "str", $Buf) Local $iTotalSumPoints = 0 Local $RetCom If $Ret[0] > 0 Then Local $aTridLibInfoInform2D[$Ret[0]][4] For $ResId = 0 To $Ret[0] - 1 ;Get File Type $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_FILETYPE, "int", $ResId + 1, "str", $Buf) $aTridLibInfoInform2D[$ResId][0] = $RetCom[3] ;First Element ;Get Extension $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_FILEEXT, "int", $ResId + 1, "str", $Buf) $aTridLibInfoInform2D[$ResId][1] = $RetCom[3] ;Second Element ;Get Points $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_RES_POINTS, "int", $ResId + 1, "str", $Buf) $aTridLibInfoInform2D[$ResId][2] = $RetCom[0] $iTotalSumPoints += Number($aTridLibInfoInform2D[$ResId][2]) ;Third Element Next ;Get Points in Percentage If $iTotalSumPoints > 0 Then For $ResId = 0 To $Ret[0] - 1 $aTridLibInfoInform2D[$ResId][3] = Round($aTridLibInfoInform2D[$ResId][2] * 100 / $iTotalSumPoints, 2) ;Fourth Element Next EndIf Else Return SetError(7, 0, 0) EndIf If $iTridAutoLoad Then _TrIDLib_Shutdown() Return $aTridLibInfoInform2D EndFunc ;==>_TrIDLib_GetInfo ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_GetRealExtension ; Description ...: ; Syntax ........: _TrIDLib_GetRealExtension($sFile) ; Parameters ....: $sFile - A full path of file. ; Return values .: Success - Returns the Original File Extension ; Failure - Returns Empty String('') and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; |4 = While Loading triddefs.trd(DllCall) ; |5 = While Submitting File(DllCall) ; |6 = While Analysing File(DllCall) ; |7 = Unable to detect file type(DllCall) ; |8 = File was Identified But Extension Not Found in the Database(null('') extension return by dll) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _TrIDLib_GetRealExtension($sFile) Local $at = _TrIDLib_GetInfo($sFile) Local $iErr = @error Local $sExt = $at[0][1] If Not $iErr Then If $sExt <> "" Then $sExt = "." & $sExt Else Return SetError(8, 0, '');null extension return by dll EndIf Else Return SetError($iErr, 0, '') EndIf Return $sExt EndFunc ;==>_TrIDLib_GetRealExtension ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_GetVersion ; Description ...: Get the TrIDLib.dll version ; Syntax ........: _TrIDLib_GetVersion() ; Parameters ....: ; Return values .: Success - Returns Numrical - Version ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; |4 = While Loading triddefs.trd(DllCall) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: Yes ; =============================================================================================================================== Func _TrIDLib_GetVersion() ;Check if is dll open or not If Not $iTridIsDllOpen Then _TrIDLib_Startup() If @error Then Return SetError(@error, 0, 0) EndIf ;Get TrIDLib version Local $Buf Local $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_VER, "int", 0, "str", $Buf) Return Round($RetCom[0] / 100, 2) EndFunc ;==>_TrIDLib_GetVersion ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_GetFileTypeDef ; Description ...: Get the total no of Definitions triddefs.trd ; Syntax ........: _TrIDLib_GetFileTypeDef() ; Parameters ....: ; Return values .: Success - Returns Numrical - Version ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; |4 = While Loading triddefs.trd(DllCall) ; Author ........: Your Name ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TrIDLib_GetFileTypeDef() ;Check if is dll open or not If Not $iTridIsDllOpen Then _TrIDLib_Startup() If @error Then Return SetError(@error, 0, 0) EndIf ; load the definitions DllCall($hTridDll, "int", "TrID_LoadDefsPack", "str", $sTridDefDir) If @error Then Return SetError(4, 0, 0) ;Get Number of filetypes definitions loaded Local $Buf Local $RetCom = DllCall($hTridDll, "int", "TrID_GetInfo", "int", $TRID_GET_DEFSNUM, "int", 0, "str", $Buf) Return $RetCom[0] EndFunc ;==>_TrIDLib_GetFileTypeDef ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_CheckFiles ; Description ...: Check File ; Syntax ........: _TrIDLib_CheckFiles() ; Parameters ....: ; Return values .: Success - Returns 1 ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TrIDLib_CheckFiles() If Not FileExists($sTridDllFile) Then Return SetError(1, 0, 0) ElseIf Not FileExists($sTridDefFile) Then Return SetError(2, 0, 0) Else Return SetError(0, 0, 1) EndIf EndFunc ;==>_TrIDLib_CheckFiles ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_Startup ; Description ...: Manually Load TrIDLib.dll ; Syntax ........: _TrIDLib_Startup() ; Parameters ....: ; Return values .: Success - Returns 1 ; Failure - Returns 0 and and sets @error to non zero ; |1 = TrIDLib.dll File Not Found.(FileExist) ; |2 = Triddefs.trd File Not Found(FileExist) ; |3 = While Opening TrIDLib.dll(DllOpen) ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TrIDLib_Startup() _TrIDLib_CheckFiles() If @error Then Return SetError(@error, 0, 0) $hTridDll = DllOpen($sTridDllFile) If $hTridDll = -1 Then Return SetError(3, 0, 0) $iTridIsDllOpen = 1 $iTridAutoLoad = 0 Return SetError(0, 0, 1) EndFunc ;==>_TrIDLib_Startup ; #FUNCTION# ==================================================================================================================== ; Name ..........: _TrIDLib_Shutdown ; Description ...:Manually Unload TrIDLib.dll ; Syntax ........: _TrIDLib_Shutdown() ; Parameters ....: ; Return values .: None ; Author ........: Gajjar Tejas ; Modified ......: ; Remarks .......: ; Related .......: ; Link ..........: ; Example .......: No ; =============================================================================================================================== Func _TrIDLib_Shutdown() DllClose($hTridDll) $iTridAutoLoad = 1;Default auto load $iTridIsDllOpen = 0 EndFunc ;==>_TrIDLib_Shutdown Example:1 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #Region ;************ Includes ************ #Include "_TrIDLib.au3" #include <Array.au3> #EndRegion ;************ Includes ************ _Example() Func _Example() MsgBox(0, "Info", _ "TrIDLib.dll version (major * 100 + minor): " & _TrIDLib_GetVersion() & @CRLF & _ "Number of filetypes definitions loaded:" & _TrIDLib_GetFileTypeDef()) Local $sFile, $at, $iErr $sFile = FileOpenDialog("Choose Any File", "", "Any File (*.*)", 3) ; a file to analyze If @error Then Exit $at = _TrIDLib_GetInfo($sFile) $iErr = @error If Not $iErr Then MsgBox(0, "Info", "Total No of possible file type found:" & UBound($at, 1)) MsgBox(0, "Info", "Suggested Extension:" & _TrIDLib_GetRealExtension($sFile)) _ArrayDisplay($at, "Result", -1, 0, "", "|", "No.|File Type|Extension|Points|% Points") Else Switch $iErr Case 1 MsgBox(0, "Error", "TrIDLib.dll File Not Found in Script Directory.") Case 2 MsgBox(0, "Error", "triddefs.trd File Not Found in Script Directory.") Case 3 MsgBox(0, "Error", "Error occurs during opening TrIDLib.dll") Case 4 MsgBox(0, "Error", "Error occurs during Loading triddefs.trd.") Case 5 MsgBox(0, "Error", "Error occurs during Submitting File: " & $sFile) Case 6 MsgBox(0, "Error", "Error occurs during Analysing File: " & $sFile) Case 7 MsgBox(0, "Error", "Unable to detect file type") Case 8 MsgBox(0, "Error", "File was Identified But Extension Not Found in the Database(null extension return by dll)") EndSwitch EndIf EndFunc ;==>_Example Example:2 #AutoIt3Wrapper_AU3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 #Region ;************ Includes ************ #Include "_TrIDLib.au3" #EndRegion ;************ Includes ************ _Example() Func _Example() ;Load Dll _TrIDLib_Startup() ;Select Folder Local $sDir = FileSelectFolder("choose folder", "") If @error Then Exit If StringRight($sDir, 1) <> "\" Then $sDir &= "\" ;Search Handle Local $search = FileFindFirstFile($sDir & "*.*") ; Check if the search was successful If $search = -1 Then MsgBox(0, "Error", "No files/directories matched the search pattern") Exit EndIf MsgBox(0, "Info", "Now,Press Ok to See Console Output") Local $at, $iErr = 0 While 1 ;Search for file and Folder Local $sFile = FileFindNextFile($search) If @error Then ExitLoop ;Only file allowed If StringInStr(FileGetAttrib($sDir & $sFile), "D") = 0 Then ConsoleWrite("==============================================================" & @LF) ConsoleWrite(">File: " & $sDir & $sFile & @LF) ;Get detailed info in array $at = _TrIDLib_GetInfo($sDir & $sFile) $iErr = @error If Not $iErr Then ConsoleWrite("Total no of possible file type found:" & UBound($at, 1) & @LF) ConsoleWrite("-Suggested extension:" & $at[0][1] & @LF) For $i = 0 To UBound($at) - 1 ConsoleWrite($i + 1 & "==============" & @LF) ConsoleWrite("File Type:" & $at[$i][0] & @LF) ConsoleWrite("Extension:" & $at[$i][1] & @LF) ConsoleWrite("Points:" & $at[$i][2] & @LF) ConsoleWrite("Points %:" & $at[$i][3] & @LF) Next Else Switch $iErr Case 1 ConsoleWrite("!Error: TrIDLib.dll File Not Found in Script Directory.") Case 2 ConsoleWrite("!Error: triddefs.trd File Not Found in Script Directory.") Case 3 ConsoleWrite("!Error: Error occurs during opening TrIDLib.dll") Case 4 ConsoleWrite("!Error: Error occurs during Loading triddefs.trd.") Case 5 ConsoleWrite("!Error: Error occurs during Submitting File: " & $sFile) Case 6 ConsoleWrite("!Error: Error occurs during Analysing File: " & $sFile) Case 7 ConsoleWrite("!Error: Unable to detect file type") EndSwitch ConsoleWrite(@LF) EndIf EndIf WEnd ; Close the search handle FileClose($search) ;Close Dll _TrIDLib_Shutdown() EndFunc ;==>_Example This udf require the following components: TrIDLib.dll - The last x32 DLL file can be found here : http://mark0.net/code-tridlib-e.html triddefs.trd - The last Definition file can be found here : http://mark0.net/soft-trid-e.html Includes in Download: Examples, triddefs.trd and TrIDLib.dll _TrIDLib.7z This is my first udf Hope you will like.
  6. Hi there I feel confident that this is possible, and I have searched, but am unable to find how to do this. Brief: My database contains blobs which represent attachments that users have attached. I have a button "open attachment". This button should then, well, open the attachment using whatever programme is defined in the registry as the default programme to open the attachment. WHere I have got to: I can attach the blob. I can then write it out to a temporary directory using the original file name. I can get the file type from the registry using the extension of the filename I write out. What I can't figure out how to do: Lookup the registry and get the associated programme based on the filetype to launch the file. All help appreciated Clark
  7. I've been trying to make an extension for embedding plain text links on imageboards like 4chan. I've taken code from a more fully featured extension that has features that I really don't want because it's incompatible with the more popular extensions out there. I have it working as an extension in my browser, the edited full version of it, but when I pack it for installation and re-install it, it throws errors like "Uncaught TypeError: Cannot read property 'links1' of undefined". I don't know much about JS but I'm wondering why it's not throwing this error in the original version where it's edited but throws the error on the one installed from the packed crx file. var links = /((?:https?|ftp)://[^s'"'<>()]+|www.[^s'"'<>()]+|[-w.+]+@(?:[-w]+.)+[w]{2,6})/gi; function apply() { if (!window.location.href.match(/boards./)) return false; var a = document.getElementsByTagName("iframe"), b = document.getElementsByTagName("embed"); Activate(a,b); } function Activate(a, b) { a = a ? a + " " : ""; for (var d, c = xpath((a == "" ? "." : "id('" + a.substr(1, a.length - 2) + "')") + "//text()[ancestor::blockquote]"), e = 0; e < c.snapshotLength; e++) { d = c.snapshotItem(e); d != null && linkActivation(d); } } function linkActivation(a) { for (var b, d, c = a.textContent, e = null, g = 0, f = {}, youtube, vocaroo, soundcloud; (d = links.exec(c)) !== null;) if (!f[d[0]]) { f[d[0]] = true; null === e && (e = document.createElement("span")); b = d[0].replace(/.*$/, ""); e.appendChild(document.createTextNode(c.substring(g, d.index))); if (!b.match(/.4chan.org/i)) { b = (youtube = b.match(/youtube.com/watch?.*?v=([a-z0-9-_#!]+)/i)) && (settings.youtube1 != "off" && !inThread || settings.youtube2 != "off" && inThread) ? '<iframe class="youtube-player" type="text/html" width="640" height="385" src="http://www.youtube.com/embed/' + youtube[1] + '?wmode=opaque" frameborder="0"></iframe><br /><a href="' + b + '" target="_blank">' + b + "</a>" : (vocaroo = b.match(/vocaroo.com/(i/|?media=)([a-z0-9]+)/i)) && (settings.vocaroo1 != "off" && !inThread || settings.vocaroo2 != "off" && inThread) ? '<object type="application/x-shockwave-flash" style="width: 148px; height: 44px" data="http://vocaroo.com/player.swf?playMediaID=' + vocaroo[2] + '&server=m1.vocaroo.com&autoplay=0""><param name="movie" value="http://vocaroo.com/player.swf?playMediaID=' + vocaroo[2] + '&server=m1.vocaroo.com&autoplay=0"></object><br /><a href="' + b + '" target="_blank">' + b + "</a>" : (soundcloud = b.match(/((www.)?soundcloud.com/([a-z0-9-_]+/?)+)/i)) && (settings.soundcloud1 != "off" && !inThread || settings.soundcloud2 != "off" && inThread) ? '<object height="81" width="400"><param name="movie" value="http://player.soundcloud.com/player.swf?url=http://' + soundcloud[1] + '&amp;g=bb"></param><param name="allowscriptaccess" value="always"></param><embed allowscriptaccess="always" height="81" src="http://player.soundcloud.com/player.swf?url=http://' + soundcloud[1] + '&amp;g=bb" type="application/x-shockwave-flash" width="400"></embed></object><br /><a href="http://' + soundcloud[1] + '" target="_blank">http://' + soundcloud[1] + "</a>" : b.indexOf("@") > -1 && (settings.email1 != "off" && !inThread || settings.email2 != "off" && inThread) ? "<a href='mailto:" + b + "'>" + b + "</a>" : settings.links1 != "off" && !inThread || settings.links2 != "off" && inThread && b.indexOf("@") < 0 ? "<a href='" + (b.match(/^http/i) ? b : "http://" + b) + "' target='_blank'>" + b + "</a>" : b; e.innerHTML = b; g = d.index + d[0].length; } } if (e) { e.appendChild(document.createTextNode(c.substring(g, c.length))); try { a.parentNode.replaceChild(e, a); } catch (h) { console.error(h); } } } function xpath(a) { return document.evaluate(a, document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null) } apply();
×
×
  • Create New...