' api_shell.sbp #ifndef _INC_SHELL #define _INC_SHELL #ifdef UNICODE Const _FuncName_DoEnvironmentSubst = "DoEnvironmentSubstW" Const _FuncName_DragQueryFile = "DragQueryFileW" Const _FuncName_ExtractAssociatedIcon = "ExtractAssociatedIconW" Const _FuncName_ExtractIcon = "ExtractIconW" Const _FuncName_ExtractIconEx = "ExtractIconExW" Const _FuncName_FindExecutable = "FindExecutableW" Const _FuncName_GUIDFromString = "GUIDFromStringW" Const _FuncName_SHBrowseForFolder = "SHBrowseForFolderW" Const _FuncName_ShellAbout = "ShellAboutW" Const _FuncName_ShellExecute = "ShellExecuteW" Const _FuncName_SHFileOperation = "SHFileOperationW" Const _FuncName_SHGetPathFromIDList = "SHGetPathFromIDListW" #else Const _FuncName_DoEnvironmentSubst = "DoEnvironmentSubstA" Const _FuncName_DragQueryFile = "DragQueryFileA" Const _FuncName_ExtractAssociatedIcon = "ExtractAssociatedIconA" Const _FuncName_ExtractIcon = "ExtractIconA" Const _FuncName_ExtractIconEx = "ExtractIconExA" Const _FuncName_FindExecutable = "FindExecutableA" Const _FuncName_GUIDFromString = "GUIDFromStringA" Const _FuncName_SHBrowseForFolder = "SHBrowseForFolderA" Const _FuncName_ShellAbout = "ShellAboutA" Const _FuncName_ShellExecute = "ShellExecuteA" Const _FuncName_SHFileOperation = "SHFileOperationA" Const _FuncName_SHGetPathFromIDList = "SHGetPathFromIDListA" #endif '----------- ' Shell API Declare Function DoEnvironmentSubst Lib "shell32" Alias _FuncName_DoEnvironmentSubst ( pszString As PSTR, cchString As DWord ) As DWord Declare Sub DragAcceptFiles Lib "shell32" (hWnd As HWND, bAccept As BOOL) Declare Sub DragFinish Lib "shell32" (hDrop As HDROP) Declare Function DragQueryFile Lib "shell32" Alias _FuncName_DragQueryFile (hDrop As HDROP, iFile As Long, lpszFile As LPTSTR, cch As DWord) As DWord Declare Function DragQueryPoint Lib "shell32" (hDrop As HDROP, ByRef lpPoint As POINTAPI) As Long Declare Function ExtractAssociatedIcon Lib "shell32" Alias _FuncName_ExtractAssociatedIcon (hInst As HINSTANCE, lpIconPath As LPTSTR, lpiIcon As *Word) As HICON Declare Function ExtractIcon Lib "shell32" Alias _FuncName_ExtractIcon (hInst As HINSTANCE, lpszExeFileName As LPCTSTR, nIconIndex As Long) As HICON Declare Function ExtractIconEx Lib "shell32" Alias _FuncName_ExtractIconEx (lpszFile As PCSTR, nIconIndex As Long, phiconLarge As *DWord, phiconSmall As *DWord, nIcons As Long) As HICON Declare Function FindExecutable Lib "shell32" Alias _FuncName_FindExecutable ( pFile As PCTSTR, pDirectory As PCTSTR, pResult As PCTSTR ) As Long Declare Function GUIDFromString Lib "shell32" Alias _FuncName_GUIDFromString ( ByVal psz As PCTSTR, ByRef guid As GUID ) As BOOL ' intshcut.h Declare Function InetIsOffline Lib "url" (dwFlags As DWord) As BOOL ' intshcut.h Declare Function MIMEAssociationDialog Lib "url" ( hwndParent As HWND, dwInFlags As DWord, pcszFile As PCTSTR, pcszMIMEContentType As PCTSTR, pszAppBuf As PTSTR, ucAppBufLen As DWord ) As HRESULT Declare Sub SHAddToRecentDocs Lib "shell32" (ByVal uFlags As Long, ByVal pv As VoidPtr) Const ABM_NEW = &h00000000 Const ABM_REMOVE = &h00000001 Const ABM_QUERYPOS = &h00000002 Const ABM_SETPOS = &h00000003 Const ABM_GETSTATE = &h00000004 Const ABM_GETTASKBARPOS = &h00000005 Const ABM_ACTIVATE = &h00000006 Const ABM_GETAUTOHIDEBAR = &h00000007 Const ABM_SETAUTOHIDEBAR = &h00000008 Const ABM_WINDOWPOSCHANGED = &h0000009 Const ABM_SETSTATE = &h0000000a Const ABN_STATECHANGE = &h0000000 Const ABN_POSCHANGED = &h0000001 Const ABN_FULLSCREENAPP = &h0000002 Const ABN_WINDOWARRANGE = &h0000003 Const ABS_AUTOHIDE = &h0000001 Const ABS_ALWAYSONTOP = &h0000002 Const ABE_LEFT = 0 Const ABE_TOP = 1 Const ABE_RIGHT = 2 Const ABE_BOTTOM = 3 Type APPBARDATA cbSize As DWord hWnd As HWND uCallbackMessage As DWord uEdge As DWord rc As RECT lParam As LPARAM End Type Declare Function SHAppBarMessage Lib "shell32" (dwMessage As DWord, ByRef Data As APPBARDATA) As ULONG_PTR Const BIF_RETURNONLYFSDIRS = &H0001 Const BIF_DONTGOBELOWDOMAIN = &H0002 Const BIF_STATUSTEXT = &H0004 Const BIF_RETURNFSANCESTORS = &H0008 Const BIF_EDITBOX = &H0010 Const BIF_VALIDATE = &H0020 Const BIF_BROWSEFORCOMPUTER = &H1000 Const BIF_BROWSEFORPRINTER = &H2000 Const BIF_BROWSEINCLUDEFILES = &H4000 Typedef BFFCALLBACK = *Function(hwnd As HWND, uMsg As DWord, lParam As LPARAM, lpData As LPARAM) As Long Type BROWSEINFOW hwndOwner As HWND pidlRoot As VoidPtr pszDisplayName As LPWSTR lpszTitle As LPCWSTR ulFlags As DWord lpfn As BFFCALLBACK lParam As LPARAM iImage As Long End Type Type BROWSEINFOA hwndOwner As HWND pidlRoot As VoidPtr pszDisplayName As LPSTR lpszTitle As LPCSTR ulFlags As DWord lpfn As BFFCALLBACK lParam As LPARAM iImage As Long End Type #ifdef UNICODE TypeDef BROWSEINFO = BROWSEINFOW #else TypeDef BROWSEINFO = BROWSEINFOA #endif Type SHITEMID cb As Word abID[ELM(1)] As Byte End Type Type ITEMIDLIST mkid As SHITEMID End Type Declare Function SHBrowseForFolder Lib "shell32" Alias _FuncName_SHBrowseForFolder (ByRef bi As BROWSEINFO) As *ITEMIDLIST Const SHCNE_RENAMEITEM = &h00000001 Const SHCNE_CREATE = &h00000002 Const SHCNE_DELETE = &h00000004 Const SHCNE_MKDIR = &h00000008 Const SHCNE_RMDIR = &h00000010 Const SHCNE_MEDIAINSERTED = &h00000020 Const SHCNE_MEDIAREMOVED = &h00000040 Const SHCNE_DRIVEREMOVED = &h00000080 Const SHCNE_DRIVEADD = &h00000100 Const SHCNE_NETSHARE = &h00000200 Const SHCNE_NETUNSHARE = &h00000400 Const SHCNE_ATTRIBUTES = &h00000800 Const SHCNE_UPDATEDIR = &h00001000 Const SHCNE_UPDATEITEM = &h00002000 Const SHCNE_SERVERDISCONNECT = &h00004000 Const SHCNE_UPDATEIMAGE = &h00008000 Const SHCNE_DRIVEADDGUI = &h00010000 Const SHCNE_RENAMEFOLDER = &h00020000 Const SHCNE_FREESPACE = &h00040000 #ifdef __UNDEFINED__ '#if _WIN32_IE >= 0x0400 Const SHCNE_EXTENDED_EVENT = &h04000000 #endif Const SHCNE_ASSOCCHANGED = &h08000000 Const SHCNE_DISKEVENTS = &h0002381F Const SHCNE_GLOBALEVENTS = &h0C0581E0 Const SHCNE_ALLEVENTS = &h7FFFFFFF Const SHCNE_INTERRUPT = &h80000000 #ifdef __UNDEFINED__ '#if _WIN32_IE >= 0x0400 Const SHCNEE_ORDERCHANGED = 2 Const SHCNEE_MSI_CHANGE = 4 Const SHCNEE_MSI_UNINSTALL = 5 #endif Const SHCNF_IDLIST = &h0000 Const SHCNF_PATHA = &h0001 Const SHCNF_PRINTERA = &h0002 Const SHCNF_DWORD = &h0003 Const SHCNF_PATHW = &h0005 Const SHCNF_PRINTERW = &h0006 Const SHCNF_TYPE = &h00FF Const SHCNF_FLUSH = &h1000 Const SHCNF_FLUSHNOWAIT = &h2000 #ifdef UNICODE Const SHCNF_PATH = SHCNF_PATHW Const SHCNF_PRINTER = SHCNF_PRINTERW #else Const SHCNF_PATH = SHCNF_PATHA Const SHCNF_PRINTER = SHCNF_PRINTERA #endif ' ShlObj.h Declare Sub SHChangeNotify Lib "shell32" (wEventId As Long, uFlags As DWord, dwItem1 As VoidPtr, dwItem2 As VoidPtr) ' ShellApi.h Declare Function ShellAbout Lib "shell32" Alias _FuncName_ShellAbout (hWnd As HWND, szApp As PCTSTR, szOtherStuff As PCTSTR, hIcon As HICON) As Long Const SE_ERR_FNF = 2 Const SE_ERR_PNF = 3 Const SE_ERR_ACCESSDENIED = 5 Const SE_ERR_OOM = 8 Const SE_ERR_DLLNOTFOUND = 32 Const SE_ERR_SHARE = 26 Const SE_ERR_ASSOCINCOMPLETE = 27 Const SE_ERR_DDETIMEOUT = 28 Const SE_ERR_DDEFAIL = 29 Const SE_ERR_DDEBUSY = 30 Const SE_ERR_NOASSOC = 31 ' ShellApi.h Declare Function ShellExecute Lib "shell32" Alias _FuncName_ShellExecute (hWnd As HWND, lpOperation As LPCTSTR, lpFile As LPCTSTR, lpParameters As LPCTSTR, lpDirectory As LPCTSTR, nShowCmd As Long) As HINSTANCE Const FO_MOVE = &H0001 Const FO_COPY = &H0002 Const FO_DELETE = &H0003 Const FO_RENAME = &H0004 Const FOF_MULTIDESTFILES = &H0001 Const FOF_CONFIRMMOUSE = &H0002 Const FOF_SILENT = &H0004 Const FOF_RENAMEONCOLLISION = &H0008 Const FOF_NOCONFIRMATION = &H0010 Const FOF_WANTMAPPINGHANDLE = &H0020 Const FOF_ALLOWUNDO = &H0040 Const FOF_FILESONLY = &H0080 Const FOF_SIMPLEPROGRESS = &H0100 Const FOF_NOCONFIRMMKDIR = &H0200 Const FOF_NOERRORUI = &H0400 Const FOF_NOCOPYSECURITYATTRIBS = &H0800 Type SHFILEOPSTRUCTW hWnd As HWND wFunc As DWord pFrom As PCWSTR pTo As PCWSTR fFlags As Word fAnyOperationsAborted As BOOL hNameMappings As VoidPtr lpszProgressTitle As LPCWSTR End Type Type SHFILEOPSTRUCTA hWnd As HWND wFunc As DWord pFrom As PCSTR pTo As PCSTR fFlags As Word fAnyOperationsAborted As BOOL hNameMappings As VoidPtr lpszProgressTitle As LPCSTR End Type #ifdef UNICODE TypeDef SHFILEOPSTRUCT = SHFILEOPSTRUCTW #else TypeDef SHFILEOPSTRUCT = SHFILEOPSTRUCTA #endif ' ShellApi.h Declare Function SHFileOperation Lib "shell32" Alias _FuncName_SHFileOperation (ByRef FileOp As SHFILEOPSTRUCT) As Long ' ShellApi.h Declare Sub SHFreeNameMappings Lib "shell32" (hNameMappings As HANDLE) 'SHGetDataFromIDList Declare Function SHGetPathFromIDList Lib "shell32" Alias _FuncName_SHGetPathFromIDList (pidl As *ITEMIDLIST, pszPath As PTSTR) As Long #endif '_INC_SHELL