Some useful Windows Shell object libraries (already packaged for user objects)

xiaoxiao2021-04-08  377

Download: www.pdriver.com/pb02/11/6shell.zip (size: 11kb) (PB 6.x format)

Description: Tao Qing this procedure is written in foreigners, with a packaged user object and source code, but there is no write call routine, the function's annotation and parameter description is more detailed (English), you spend some time to write some calling routines Bar

1. There is a Move / Copy / Delete multiple files (including directory and subdirectory) feature 2. Since the standard Windows shell method is used, the results are the same as the "Explorer" effect, that is, the animation prompt, there is a rename of the same meeting. Tip Whether it is overwriting 3. You can browse (directory / printer / online neighbor) <- This site has many objects that can be done, all methods are consistent. 4. You can format the disk. (The same is the same as the effect of Windows)

The following API functions are used in the program.

=== Shell functionsSubroutine SHAddToRecentDocs (ulong uFlags, Ref String pV) Library "shell32.dll" Function long SHBrowseForFolder (Ref BROWSEINFO lpBi) Library "shell32.dll" Function boolean SHGetPathFromIDList (long pIDL, Ref String pszPath) Library "shell32.dll "Alias ​​For" SHGetPathFromIDListA "Function long SHFileOperation (Ref SHFILEOPSTRUCT lpFileOp) Library" shell32.dll "Alias ​​For" SHFileOperationA "Function long SHGetSpecialFolderLocation (long hwndOwner, long nFolder, Ref Long ppidl) Library" shell32.dll "Function long SHFormatDrive (ulong HWnd, Ulong IDrive, Ulong Icapacity, Ulong ITYPE) Library "shell32.dll"

=== Memory functionsFunction long RtlMoveMemory (REF Char Destination [], long Source, long Size) library "kernel32" Function long RtlMoveMemory (long Destination, REF Char Source [], long Size) library "kernel32" Function long LocalAlloc (long Flags LONG BYTES) LIBRARY "kernel32" Function Long LocalFree (long memhandle) library "kernel32"

Reprinted: http://www.pdriver.com/display.asp? Key_ID = 1180

============================================================================================================================================================================================================= ======== instance variables

// Max_Path Constant for File OperationsPrivate constant long max_path = 260

// SHBrowseForFolder constantsPrivate: constant ulong BIF_RETURNONLYFSDIRS = 1 // Browse for directoryconstant ulong BIF_DONTGOBELOWDOMAIN = 2 // For starting the Find Computerconstant ulong BIF_STATUSTEXT = 4constant ulong BIF_RETURNFSANCESTORS = 8constant ulong BIF_EDITBOX = 16constant ulong BIF_BROWSEFORCOMPUTER = 4096 // Browse for computerconstant ulong BIF_BROWSEFORPRINTER = 8192 // Browse for PrintersConstant Ulong Bif_BrowseInCludefiles = 16384 // Browse for Everything

// shaddtorecentdocs constantsprivate: constant ulong shard_pidl = 1constant Ulong Shard_path = 2

// file operation constantsprivate: constant ulong fo_move = 1constant Ulong fo_copy = 2constant ulong fo_delete = 3constant Ulong fo_rename = 4

// File Operation flagsPrivate: constant ulong FOF_MULTIDESTFILES = 1 // 0x0001constant ulong FOF_CONFIRMMOUSE = 2 // 0x0002constant ulong FOF_SILENT = 4 // 0x0004constant ulong FOF_RENAMEONCOLLISION = 8 // 0x0008constant ulong FOF_NOCONFIRMATION = 16 // 0x0010constant ulong FOF_WANTMAPPINGHANDLE = 32 // 0x0020constant ulong FOF_ALLOWUNDO = 64 // 0x0040constant ulong FOF_FILESONLY = 128 // 0x0080constant ulong FOF_SIMPLEPROGRESS = 256 // 0x0100constant ulong FOF_NOCONFIRMMKDIR = 512 // 0x0200constant ulong FOF_NOERRORUI = 1024 // 0x0400

// SHGetSpecialFolderLocation constantsPublic: constant ulong CSIDL_DESKTOP = 0 // 0x0000constant ulong CSIDL_PROGRAMS = 2 // 0x0002constant ulong CSIDL_CONTROLS = 3 // 0x0003constant ulong CSIDL_PRINTERS = 4 // 0x0004constant ulong CSIDL_PERSONAL = 5 // 0x0005constant ulong CSIDL_FAVORITES = 6 // 0x0006constant ulong CSIDL_STARTUP = 7 // 0x0007constant ulong CSIDL_RECENT = 8 // 0x0008constant ulong CSIDL_SENDTO = 9 // 0x0009constant ulong CSIDL_BITBUCKET = 10 // 0x000aconstant ulong CSIDL_STARTMENU = 11 // 0x000bconstant ulong CSIDL_DESKTOPDIRECTORY = 16 // 0x0010constant ulong CSIDL_DRIVES = 17 // 0x0011constant ulong CSIDL_NETWORK = 18 // 0x0012constant ulong CSIDL_NETHOOD = 19 // 0x0013constant ulong CSIDL_FONTS = 20 // 0x0014constant ulong CSIDL_TEMPLATES = 21 // 0x0015constant ulong CSIDL_COMMON_STARTMENU = 22 // 0x0016constant ulong CSIDL_COMMON_PROGRAMS = 23 // 0X0017constant ulong CSIDL_COMMON_STARTUP = 24 // 0x0018constant ulong CSIDL_COMMON_DESKTOPDIRECTORY = 25 // 0x0019Constant Ulong CSIDL_Appdata = 26 // 0x001aconstant Ulong CSIDL_PRINTHOD = 27 // 0x001Blocal External Functions

// Shell functionsSubroutine SHAddToRecentDocs (ulong uFlags, Ref String pV) Library "shell32.dll" Function long SHBrowseForFolder (Ref BROWSEINFO lpBi) Library "shell32.dll" Function boolean SHGetPathFromIDList (long pIDL, Ref String pszPath) Library "shell32.dll" Alias ​​For "SHGetPathFromIDListA" Function long SHFileOperation (Ref SHFILEOPSTRUCT lpFileOp) Library "shell32.dll" Alias ​​For "SHFileOperationA" Function long SHGetSpecialFolderLocation (long hwndOwner, long nFolder, Ref Long ppidl) Library "shell32.dll" Function long SHFormatDrive (ulong hWnd , ulong iDrive, ulong iCapacity, ulong iType) Library "shell32.dll" // Memory functionsFunction long RtlMoveMemory (REF Char Destination [], long Source, long Size) library "kernel32" Function long RtlMoveMemory (long Destination, REF Char Source [ ], long size "kernel32" FUNCTION Long Localaloc (Long Flags, Long Bytes) Library "kernel32" Function Long Localfree (Long MemHandle) library "kernel32"

转载请注明原文地址:https://www.9cbs.com/read-132755.html

New Post(0)