Skip to content

Instantly share code, notes, and snippets.

Avatar

Weston Campbell westoncampbell

  • USA
View GitHub Profile
View CLSID_IID_Search.html
This file has been truncated, but you can view the full file.
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
* {
box-sizing: border-box;
}
View PathRelativePathTo.ahk
PathRelativePathTo(From, To) {
VarSetCapacity(pszPath, 260)
R := DllCall("Shlwapi.dll\PathRelativePathTo", "Ptr", &pszPath, "Str", From, "UInt", (InStr(FileExist(From), "D") ? 16 : 0), "Str", To, "UInt", (InStr(FileExist(To), "D") ? 16 : 0))
return (R ? StrGet(&pszPath) : To)
}
View SHEmptyRecycleBin.ahk
SHEmptyRecycleBin(Flags := 0) {
return DllCall("Shell32.dll\SHEmptyRecycleBin", "UInt", 0, "Str", "", "UInt", Flags)
}
View StrFormatByteSize.ahk
StrFormatByteSize(ByteSize) {
VarSetCapacity(SizeFormat, 32)
DllCall("Shlwapi.dll\StrFormatByteSize64A", "Int64", ByteSize, "UInt", &ByteSize, "UInt", 32, "Str")
return StrGet(&ByteSize, "CP0")
}
View SHQueryRecycleBin.ahk
SHQueryRecycleBin(RootPath, ByRef Size, ByRef NumItems) {
VarSetCapacity(SHQueryRBInfo, 20, 0)
NumPut(20, SHQueryRBInfo, 0, "UInt")
HR := DllCall("Shell32.dll\SHQueryRecycleBin", "Str", RootPath, (A_PtrSize = 8 ? "Ptr" : "UInt"), &SHQueryRBInfo, "UInt")
Size := NumGet(SHQueryRBInfo, (A_PtrSize = 8 ? 8 : 4), "Int64")
NumItems := NumGet(SHQueryRBInfo, (A_PtrSize = 8 ? 16 : 12), "Int64")
return HR
}
You can’t perform that action at this time.