shsemip.h
来自「用于查询PC机上的USB端口是否有设备挂接上」· C头文件 代码 · 共 421 行 · 第 1/2 页
H
421 行
#ifndef _SHSEMIP_H_
#define _SHSEMIP_H_
//
// Define API decoration for direct importing of DLL references.
//
#ifndef RC_INVOKED
#pragma pack(1) /* Assume byte packing throughout */
#endif /* !RC_INVOKED */
#ifdef __cplusplus
extern "C" { /* Assume C declarations for C++ */
#endif /* __cplusplus */
#ifndef DONT_WANT_SHELLDEBUG
#ifndef DebugMsg /* ;Internal */
#define DM_TRACE 0x0001 // Trace messages /* ;Internal */
#define DM_WARNING 0x0002 // Warning /* ;Internal */
#define DM_ERROR 0x0004 // Error /* ;Internal */
#define DM_ASSERT 0x0008 // Assertions /* ;Internal */
#define Assert(f) /* ;Internal */
#define AssertE(f) (f) /* ;Internal */
#define AssertMsg 1 ? (void)0 : (void) /* ;Internal */
#define DebugMsg 1 ? (void)0 : (void) /* ;Internal */
#endif // DebugMsg /* ;Internal */
/* ;Internal */
#endif // DONT_WANT_SHELLDEBUG
typedef void (WINAPI FAR* RUNDLLPROC)(HWND hwndStub,
HINSTANCE hAppInstance,
LPSTR lpszCmdLine, int nCmdShow);
//=======================================================================
// String constants for
// 1. Registration database keywords (prefix STRREG_)
// 2. Exported functions from handler dlls (prefix STREXP_)
// 3. .INI file keywords (prefix STRINI_)
// 4. Others (prefix STR_)
//=======================================================================
#define STRREG_SHELLUI "ShellUIHandler"
#define STRREG_SHELL "Shell"
#define STRREG_DEFICON "DefaultIcon"
#define STRREG_SHEX "shellex"
#define STRREG_SHEX_PROPSHEET STRREG_SHEX "\\PropertySheetHandlers"
#define STRREG_SHEX_DDHANDLER STRREG_SHEX "\\DragDropHandlers"
#define STRREG_SHEX_MENUHANDLER STRREG_SHEX "\\ContextMenuHandlers"
#define STRREG_SHEX_COPYHOOK "Directory\\" STRREG_SHEX "\\CopyHookHandlers"
#define STRREG_SHEX_PRNCOPYHOOK "Printers\\" STRREG_SHEX "\\CopyHookHandlers"
#define STREXP_CANUNLOAD "DllCanUnloadNow" // From OLE 2.0
#define STRINI_CLASSINFO ".ShellClassInfo" // secton name
#define STRINI_SHELLUI "ShellUIHandler"
#define STRINI_OPENDIRICON "OpenDirIcon"
#define STRINI_DIRICON "DirIcon"
#define STR_DESKTOPINI "desktop.ini"
// Maximum length of a path string
#define CCHPATHMAX MAX_PATH
#define MAXSPECLEN MAX_PATH
#define DRIVEID(path) ((path[0] - 'A') & 31)
#define ARRAYSIZE(a) (sizeof(a)/sizeof(a[0]))
#define PATH_CCH_EXT 64
// PathResolve flags
#define PRF_VERIFYEXISTS 0x0001
#define PRF_TRYPROGRAMEXTENSIONS (0x0002 | PRF_VERIFYEXISTS)
#define PRF_FIRSTDIRDEF 0x0004
#define PRF_DONTFINDLNK 0x0008 // if PRF_TRYPROGRAMEXTENSIONS is specified
//
// For CallCPLEntry16
//
DECLARE_HANDLE(FARPROC16);
// Needed for RunFileDlg
#define RFD_NOBROWSE 0x00000001
#define RFD_NODEFFILE 0x00000002
#define RFD_USEFULLPATHDIR 0x00000004
#define RFD_NOSHOWOPEN 0x00000008
#ifdef RFN_FIRST
#define RFN_EXECUTE (RFN_FIRST - 0)
typedef struct {
NMHDR hdr;
LPCSTR lpszCmd;
LPCSTR lpszWorkingDir;
int nShowCmd;
} NMRUNFILE, FAR *LPNMRUNFILE;
#endif
// RUN FILE RETURN values from notify message
#define RFR_NOTHANDLED 0
#define RFR_SUCCESS 1
#define RFR_FAILURE 2
int WINAPI DriveType(int iDrive);
int WINAPI RestartDialog(HWND hwnd, LPCSTR lpPrompt, DWORD dwReturn);
int WINAPI PickIconDlg(HWND hwnd, LPSTR pszIconPath, UINT cbIconPath, int FAR *piIconIndex);
//===================================================================
// Shell_MergeMenu parameter
//
#define MM_ADDSEPARATOR 0x00000001L
#define MM_SUBMENUSHAVEIDS 0x00000002L
//-------- drive type identification --------------
// iDrive drive index (0=A, 1=B, ...)
//
#define DRIVE_CDROM 5 // extended DriveType() types
#define DRIVE_RAMDRIVE 6
#define DRIVE_TYPE 0x000F // type masek
#define DRIVE_SLOW 0x0010 // drive is on a slow link
#define DRIVE_LFN 0x0020 // drive supports LFNs
#define DRIVE_AUTORUN 0x0040 // drive has AutoRun.inf in root.
#define DRIVE_AUDIOCD 0x0080 // drive is a AudioCD
#define DRIVE_AUTOOPEN 0x0100 // should *always* auto open on insert
#define DRIVE_NETUNAVAIL 0x0200 // Network drive that is not available
#define DRIVE_SHELLOPEN 0x0400 // should auto open on insert, if shell has focus
#define DriveTypeFlags(iDrive) DriveType('A' + (iDrive))
#define DriveIsSlow(iDrive) (DriveTypeFlags(iDrive) & DRIVE_SLOW)
#define DriveIsLFN(iDrive) (DriveTypeFlags(iDrive) & DRIVE_LFN)
#define DriveIsAutoRun(iDrive) (DriveTypeFlags(iDrive) & DRIVE_AUTORUN)
#define DriveIsAutoOpen(iDrive) (DriveTypeFlags(iDrive) & DRIVE_AUTOOPEN)
#define DriveIsShellOpen(iDrive) (DriveTypeFlags(iDrive) & DRIVE_SHELLOPEN)
#define DriveIsAudioCD(iDrive) (DriveTypeFlags(iDrive) & DRIVE_AUDIOCD)
#define DriveIsNetUnAvail(iDrive) (DriveTypeFlags(iDrive) & DRIVE_NETUNAVAIL)
#define IsCDRomDrive(iDrive) (DriveType(iDrive) == DRIVE_CDROM)
#define IsRamDrive(iDrive) (DriveType(iDrive) == DRIVE_RAMDRIVE)
#define IsRemovableDrive(iDrive) (DriveType(iDrive) == DRIVE_REMOVABLE)
#define IsRemoteDrive(iDrive) (DriveType(iDrive) == DRIVE_REMOTE)
//-------- file engine stuff ----------
// "current directory" management routines. used to set parameters
// that paths are qualfied against in MoveCopyDeleteRename()
int WINAPI GetDefaultDrive();
int WINAPI SetDefaultDrive(int iDrive);
int WINAPI SetDefaultDirectory(LPCSTR lpPath);
void WINAPI GetDefaultDirectory(int iDrive, LPSTR lpPath);
typedef enum {
PARSEFILENAME_QUALIFY = 1,
} PARSEFILENAME_FLAGS;
// this parses a list of file names (like you'd get from an edit control)
// into a double null terminated list appropriate for passing to the file
// engine or drag/drop. this accounts for excape sequences and strings
// in quotes
LPSTR WINAPI ParseFilenames(LPCSTR lpNames, PARSEFILENAME_FLAGS fFlags);
// this can be used to walk through a string of file names, dealing with
// seperators and escapes
LPSTR WINAPI GetNextFile(LPCSTR pFrom, LPSTR pTo, int cbMax);
// NOTES: No reason to have this one here, but I don't want to break the build.
//
#ifndef WINCOMMCTRLAPI
int WINAPI StrToInt(LPCSTR lpSrc); // atoi()
#endif
#define POSINVALID 32767 // values for invalid position
#define IDCMD_SYSTEMFIRST 0x8000
#define IDCMD_SYSTEMLAST 0xbfff
#define IDCMD_CANCELED 0xbfff
#define IDCMD_PROCESSED 0xbffe
#define IDCMD_DEFAULT 0xbffe
/*
* The SHFormatDrive API provides access to the Shell
* format dialog. This allows apps which want to format disks
* to bring up the same dialog that the Shell does to do it.
*
* This dialog is not sub-classable. You cannot put custom
* controls in it. If you want this ability, you will have
* to write your own front end for the DMaint_FormatDrive
* engine.
*
* NOTE that the user can format as many diskettes in the specified
* drive, or as many times, as he/she wishes to. There is no way to
* force any specififc number of disks to format. If you want this
* ability, you will have to write your own front end for the
* DMaint_FormatDrive engine.
*
* NOTE also that the format will not start till the user pushes the
* start button in the dialog. There is no way to do auto start. If
* you want this ability, you will have to write your own front end
* for the DMaint_FormatDrive engine.
*
* PARAMETERS
*
* hwnd = The window handle of the window which will own the dialog
* NOTE that unlike SHCheckDrive, hwnd == NULL does not cause
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?