⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 windows.h

📁 用于查询PC机上的USB端口是否有设备挂接上
💻 H
📖 第 1 页 / 共 5 页
字号:
#define WN_BAD_PASSWORD     0x0006
#define WN_ACCESS_DENIED    0x0007
#define WN_FUNCTION_BUSY    0x0008
#define WN_WINDOWS_ERROR    0x0009
#define WN_BAD_USER         0x000A
#define WN_OUT_OF_MEMORY    0x000B
#define WN_CANCEL           0x000C
#define WN_CONTINUE         0x000D

/* Connection errors */
#define WN_NOT_CONNECTED    0x0030
#define WN_OPEN_FILES       0x0031
#define WN_BAD_NETNAME      0x0032
#define WN_BAD_LOCALNAME    0x0033
#define WN_ALREADY_CONNECTED    0x0034
#define WN_DEVICE_ERROR         0x0035
#define WN_CONNECTION_CLOSED    0x0036

/****** Resource Management *************************************************/

DECLARE_HANDLE(HRSRC);

HRSRC   WINAPI FindResource(HINSTANCE, LPCSTR, LPCSTR);
HGLOBAL WINAPI LoadResource(HINSTANCE, HRSRC);
BOOL    WINAPI FreeResource(HGLOBAL);

#ifdef STRICT
void FAR* WINAPI LockResource(HGLOBAL);
#else
char FAR* WINAPI LockResource(HGLOBAL);
#endif

#define     UnlockResource(h)     GlobalUnlock(h)

DWORD   WINAPI SizeofResource(HINSTANCE, HRSRC);

int     WINAPI AccessResource(HINSTANCE, HRSRC);

HGLOBAL WINAPI AllocResource(HINSTANCE, HRSRC, DWORD);

#ifdef STRICT
typedef HGLOBAL (CALLBACK* RSRCHDLRPROC)(HGLOBAL, HINSTANCE, HRSRC);
#else
typedef FARPROC RSRCHDLRPROC;
#endif

RSRCHDLRPROC WINAPI SetResourceHandler(HINSTANCE, LPCSTR, RSRCHDLRPROC);

#define MAKEINTRESOURCE(i)  ((LPCSTR)MAKELP(0, (i)))

#ifndef NORESOURCE

/* Predefined Resource Types */
#define RT_CURSOR       MAKEINTRESOURCE(1)
#define RT_BITMAP       MAKEINTRESOURCE(2)
#define RT_ICON         MAKEINTRESOURCE(3)
#define RT_MENU         MAKEINTRESOURCE(4)
#define RT_DIALOG       MAKEINTRESOURCE(5)
#define RT_STRING       MAKEINTRESOURCE(6)
#define RT_FONTDIR      MAKEINTRESOURCE(7)
#define RT_FONT         MAKEINTRESOURCE(8)
#define RT_ACCELERATOR  MAKEINTRESOURCE(9)
#define RT_RCDATA       MAKEINTRESOURCE(10)
#define RT_MESSAGETABLE MAKEINTRESOURCE(11)     // reserved: NT   ;Internal
#define RT_GROUP_CURSOR MAKEINTRESOURCE(12)
#define RT_MENUEX       MAKEINTRESOURCE(13)     // RT_MENU subtype   ;Internal
#define RT_GROUP_ICON   MAKEINTRESOURCE(14)
#define RT_NAMETABLE    MAKEINTRESOURCE(15)     // removed in 3.1    ;Internal
#define RT_VERSION      MAKEINTRESOURCE(16)     // reserved: NT   ;Internal
#define RT_DLGINCLUDE   MAKEINTRESOURCE(17)     // reserved: NT   ;Internal
#define RT_DIALOGEX     MAKEINTRESOURCE(18)     // RT_DIALOG subtype ;Internal
#define RT_PLUGPLAY     MAKEINTRESOURCE(19)
#define RT_VXD          MAKEINTRESOURCE(20)
#define RT_LAST         MAKEINTRESOURCE(20)     // ;Internal
#define RT_AFXFIRST     MAKEINTRESOURCE(0xF0)   // reserved: AFX     ;Internal
#define RT_AFXLAST      MAKEINTRESOURCE(0xFF)   // reserved: AFX     ;Internal

#endif  /* NORESOURCE */


#ifdef OEMRESOURCE

/* OEM Resource Ordinal Numbers */
#define OBM_CLOSE           32754
#define OBM_UPARROW         32753
#define OBM_DNARROW         32752
#define OBM_RGARROW         32751
#define OBM_LFARROW         32750
#define OBM_REDUCE          32749
#define OBM_ZOOM            32748
#define OBM_RESTORE         32747
#define OBM_REDUCED         32746
#define OBM_ZOOMD           32745
#define OBM_RESTORED        32744
#define OBM_UPARROWD        32743
#define OBM_DNARROWD        32742
#define OBM_RGARROWD        32741
#define OBM_LFARROWD        32740
#define OBM_MNARROW         32739
#define OBM_COMBO           32738
#if (WINVER >= 0x030a)
#define OBM_UPARROWI        32737
#define OBM_DNARROWI        32736
#define OBM_RGARROWI        32735
#define OBM_LFARROWI        32734
#endif  /* WINVER >= 0x030a */

#define OBM_OLD_CLOSE       32767
#define OBM_SIZE            32766
#define OBM_OLD_UPARROW     32765
#define OBM_OLD_DNARROW     32764
#define OBM_OLD_RGARROW     32763
#define OBM_OLD_LFARROW     32762
#define OBM_BTSIZE          32761
#define OBM_CHECK           32760
#define OBM_CHECKBOXES      32759
#define OBM_BTNCORNERS      32758
#define OBM_OLD_REDUCE      32757
#define OBM_OLD_ZOOM        32756
#define OBM_OLD_RESTORE     32755

#if (WINVER >= 0x040A)
#define OBM_RDRVERT         32559
#define OBM_RDRHORZ         32660
#define OBM_RDR2DIM         32661
#endif  /* WINVER >= 0x040A */

#define OCR_NORMAL          32512
#define OCR_IBEAM           32513
#define OCR_WAIT            32514
#define OCR_CROSS           32515
#define OCR_UP              32516
#define OCR_NWPEN           32631   // ;Internal 4.0
#define OCR_SIZE            32640   /* OBSOLETE; use OCR_SIZEALL */
#define OCR_ICON            32641   /* OBSOLETE; use OCR_NORMAL */
#define OCR_SIZENWSE        32642
#define OCR_SIZENESW        32643
#define OCR_SIZEWE          32644
#define OCR_SIZENS          32645
#define OCR_SIZEALL         32646
#define OCR_ICOCUR          32647   /* OBSOLETE; use OIC_WINLOGO */
#define OCR_NO              32648
#if (WINVER >= 0x040A)
#define OCR_HAND            32649
#endif  /* WINVER >= 0x040A */
#define OCR_APPSTARTING     32650   // ;Internal NT 4.0
#if (WINVER >= 0x0400)
#define OCR_HELP            32651   // ;Internal 4.0
#endif  /* WINVER >= 0x400 */

#if (WINVER >= 0x040A)
#define OCR_RDRVERT         32652
#define OCR_RDRHORZ         32653
#define OCR_RDR2DIM         32654
#define OCR_RDRNORTH        32655
#define OCR_RDRSOUTH        32656
#define OCR_RDRWEST         32657
#define OCR_RDREAST         32658
#define OCR_RDRNORTHWEST    32659
#define OCR_RDRNORTHEAST    32660
#define OCR_RDRSOUTHWEST    32661
#define OCR_RDRSOUTHEAST    32662
#endif  /* WINVER >= 0x040A */

/* Default IDs to get original image from User */   // ;Internal
#define OCR_CONFIGURABLE_FIRST  100 // ;Internal
#define OCR_ARROW_DEFAULT       100 // ;Internal
#define OCR_IBEAM_DEFAULT       101 // ;Internal
#define OCR_WAIT_DEFAULT        102 // ;Internal
#define OCR_CROSS_DEFAULT       103 // ;Internal
#define OCR_UPARROW_DEFAULT     104 // ;Internal
#define OCR_SIZENWSE_DEFAULT    105 // ;Internal
#define OCR_SIZENESW_DEFAULT    106 // ;Internal
#define OCR_SIZEWE_DEFAULT      107 // ;Internal
#define OCR_SIZENS_DEFAULT      108 // ;Internal
#define OCR_SIZEALL_DEFAULT     109 // ;Internal
#define OCR_NO_DEFAULT          110 // ;Internal
#define OCR_APPSTARTING_DEFAULT 111 // ;Internal
#define OCR_HELP_DEFAULT        112 // ;Internal
#define OCR_NWPEN_DEFAULT       113 // ;Internal
#define OCR_HAND_DEFAULT        114 // ;Internal
#define OCR_ICON_DEFAULT        115 // ;Internal
#define OCR_CONFIGURABLE_LAST   OCR_ICON_DEFAULT   // ;Internal
#define COCR_CONFIGURABLE       (OCR_CONFIGURABLE_LAST-OCR_CONFIGURABLE_FIRST+1)    // ;Internal

#define OIC_SAMPLE              32512
#define OIC_ERROR               32513
#define OIC_QUES                32514
#define OIC_WARNING             32515
#define OIC_INFORMATION         32516
#define OIC_WINLOGO             32517   // ;Internal NT

#define OIC_HAND                OIC_ERROR
#define OIC_BANG                OIC_WARNING
#define OIC_NOTE                OIC_INFORMATION

/* Default IDs to get original image from User */   // ;Internal
#define OIC_CONFIGURABLE_FIRST  100 // ;Internal
#define OIC_APPLICATION_DEFAULT 100 // ;Internal
#define OIC_WARNING_DEFAULT     101 // ;Internal
#define OIC_QUESTION_DEFAULT    102 // ;Internal
#define OIC_ERROR_DEFAULT       103 // ;Internal
#define OIC_INFORMATION_DEFAULT 104 // ;Internal
#define OIC_WINLOGO_DEFAULT     105 // ;Internal
#define OIC_CONFIGURABLE_LAST   OIC_WINLOGO_DEFAULT // ;Internal
#define COIC_CONFIGURABLE       (OIC_CONFIGURABLE_LAST-OIC_CONFIGURABLE_FIRST+1)    // ;Internal

#endif  /* OEMRESOURCE */

/****** Atom Management *****************************************************/

#define MAKEINTATOM(i)      ((LPCSTR)MAKELP(0, (i)))

#ifndef NOATOM

BOOL    WINAPI InitAtomTable(int);
ATOM    WINAPI AddAtom(LPCSTR);
ATOM    WINAPI DeleteAtom(ATOM);
ATOM    WINAPI FindAtom(LPCSTR);
UINT    WINAPI GetAtomName(ATOM, LPSTR, int);
ATOM    WINAPI GlobalAddAtom(LPCSTR);
ATOM    WINAPI GlobalDeleteAtom(ATOM);
ATOM    WINAPI GlobalFindAtom(LPCSTR);
UINT    WINAPI GlobalGetAtomName(ATOM, LPSTR, int);
HLOCAL  WINAPI GetAtomHandle(ATOM);

#endif  /* NOATOM */

/****** WIN.INI Support *****************************************************/

/* User Profile Routines */
UINT    WINAPI GetProfileInt(LPCSTR, LPCSTR, int);
int     WINAPI GetProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int);
BOOL    WINAPI WriteProfileString(LPCSTR, LPCSTR, LPCSTR);

UINT    WINAPI GetPrivateProfileInt(LPCSTR, LPCSTR, int, LPCSTR);
int     WINAPI GetPrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPSTR, int, LPCSTR);
BOOL    WINAPI WritePrivateProfileString(LPCSTR, LPCSTR, LPCSTR, LPCSTR);

#if (WINVER >= 0x0400)
BOOL    WINAPI GetPrivateProfileStruct(LPCSTR, LPCSTR, LPVOID, UINT, LPCSTR);
BOOL    WINAPI WritePrivateProfileStruct(LPCSTR, LPCSTR, LPVOID, UINT, LPCSTR);
UINT    WINAPI GetProfileSectionNames(LPSTR, UINT);
UINT    WINAPI GetPrivateProfileSectionNames(LPSTR, UINT, LPCSTR);
int     WINAPI GetPrivateProfileSection(LPCSTR, LPSTR, UINT, LPCSTR);
int     WINAPI GetProfileSection(LPCSTR, LPSTR, UINT);
BOOL    WINAPI WritePrivateProfileSection(LPCSTR, LPCSTR, LPCSTR);
BOOL    WINAPI WriteProfileSection(LPCSTR, LPCSTR);
#endif /* WINVER >= 0x0400 */

/****** Registration Database Support ***************************************/
/* return codes from Registration functions */
/* Retained for win 3.x compatibility  and not needed 4.0 onwards */
/* For 4.0 onwards you should be including winerror.h */

#if (WINVER < 0x0400)

#define ERROR_SUCCESS                   0L
#define ERROR_BADDB                     1L
#define ERROR_BADKEY                    2L
#define ERROR_CANTOPEN                  3L
#define ERROR_CANTREAD                  4L
#define ERROR_CANTWRITE                 5L
#define ERROR_INSUFFICIENT_MEMORY       6L
#define ERROR_INVALID_PARAMETER         7L
#define ERROR_ACCESS_DENIED             8L

#endif /* WINVER < 0x400 */

#define REG_SZ                          0x0001

#if (WINVER >= 0x0400)
#define REG_BINARY                      0x0003
#define REG_DWORD                       0x0004
#endif

typedef DWORD HKEY;
typedef HKEY FAR* LPHKEY;

#if (WINVER < 0x0400)           // Win 3.1 compatibility
#define HKEY_CLASSES_ROOT               (( HKEY) 0x1)
#else                           // Win 4 upwards
#define HKEY_CLASSES_ROOT               (( HKEY) 0x80000000)
#define HKEY_CURRENT_USER               (( HKEY) 0x80000001)
#define HKEY_LOCAL_MACHINE              (( HKEY) 0x80000002)
#define HKEY_USERS                      (( HKEY) 0x80000003)
#define HKEY_PERFORMANCE_DATA           (( HKEY) 0x80000004)
#define HKEY_CURRENT_CONFIG             (( HKEY) 0x80000005)
#define HKEY_DYN_DATA                   (( HKEY) 0x80000006)
#define HKEY_PREDEF_KEYS                7
#endif

LONG    WINAPI RegOpenKey(HKEY, LPCSTR, LPHKEY);
LONG    WINAPI RegCreateKey(HKEY, LPCSTR, LPHKEY);
LONG    WINAPI RegCloseKey(HKEY);
LONG    WINAPI RegDeleteKey(HKEY, LPCSTR);
LONG    WINAPI RegSetValue(HKEY, LPCSTR, DWORD, LPCSTR, DWORD);
LONG    WINAPI RegQueryValue(HKEY, LPCSTR, LPSTR, LONG FAR*);
LONG    WINAPI RegEnumKey(HKEY, DWORD, LPSTR, DWORD);

#if (WINVER >= 0x0400)
LONG    WINAPI RegDeleteValue(HKEY, LPCSTR);
LONG    WINAPI RegEnumValue(HKEY, DWORD, LPCSTR,
                         LONG FAR *, DWORD, LONG FAR *, LPBYTE,
                         LONG FAR *);
LONG    WINAPI RegQueryValueEx(HKEY, LPCSTR, LONG FAR *, LONG FAR *,
                            LPBYTE, LONG FAR *);
LONG    WINAPI RegSetValueEx(HKEY, LPCSTR, DWORD, DWORD, LPBYTE, DWORD);
LONG    WINAPI RegFlushKey(HKEY);
LONG    WINAPI RegSaveKey(HKEY, LPCSTR,LPVOID);
LONG    WINAPI RegLoadKey(HKEY, LPCSTR,LPCSTR);
LONG    WINAPI RegUnLoadKey(HKEY, LPCSTR);

#endif          // WINVER >= 0x0400

/****** International & Char Translation Support ****************************/

//                                                                  ;Internal
// BOOL WINAPI  CharToOem(LPCSTR, LPSTR);               /* NT */ ;Internal
// BOOL WINAPI  OemToChar(LPCSTR, LPSTR);               /* NT */ ;Internal
//                                                                  ;Internal
void    WINAPI AnsiToOem(const char _huge*, char _huge*);
void    WINAPI OemToAnsi(const char _huge*, char _huge*);

//                                                                  ;Internal
// BOOL WINAPI  CharToOemBuff(LPCSTR, LPSTR, UINT);     /* NT */ ;Internal
// BOOL WINAPI  OemToCharBuff(LPCSTR, LPSTR, DWORD);    /* NT */ ;Internal
//                                                                  ;Internal
void    WINAPI AnsiToOemBuff(LPCSTR, LPSTR, UINT);
void    WINAPI OemToAnsiBuff(LPCSTR, LPSTR, UINT);

//                                                                  ;Internal
// LPSTR WINAPI CharNext(LPCSTR);                       /* NT */ ;Internal
// LPSTR WINAPI CharPrev(LPCSTR, LPCSTR);               /* NT */ ;Internal
//                                                                  ;Internal
LPSTR   WINAPI AnsiNext(LPCSTR);
LPSTR   WINAPI AnsiPrev(LPCSTR, LPCSTR);

//                                                                  ;Internal
// LPSTR WINAPI CharUpper(LPSTR);                       /* NT */ ;Internal
// LPSTR WINAPI CharLower(LPSTR);                       /* NT */ ;Internal
//                                                                  ;Internal
LPSTR   WINAPI AnsiUpper(LPSTR);
LPSTR   WINAPI AnsiLower(LPSTR);

//                                                                  ;Internal
// LPSTR WINAPI CharUpperBuff(LPSTR, WORD);             /* NT */ ;Internal
// LPSTR WINAPI CharLowerBuff(LPSTR, WORD);             /* NT */ ;Internal
//                                                                  ;Internal
UINT    WINAPI AnsiUpperBuff(LPSTR, UINT);
UINT    WINAPI AnsiLowerBuff(LPSTR, UINT);

/* Language driver entry point ordinal */   // ;Internal
#define ORD_LANGDRIVER   1                  // ;Internal
                                            // ;Internal
#ifndef  NOLANGUAGE
BOOL    WINAPI IsCharAlpha(char);
BOOL    WINAPI IsCharAlphaNumeric(char);
BOOL    WINAPI IsCharUpper(char);
BOOL    WINAPI IsCharLower(char);
#endif

#ifndef NOLSTRING
int     WINAPI lstrcmp(LPCSTR, LPCSTR);
int     WINAPI lstrcmpi(LPCSTR, LPCSTR);
LPSTR   WINAPI lstrcpy(LPSTR, LPCSTR);
LPSTR   WINAPI lstrcat(LPSTR, LPCSTR);
int     WINAPI lstrlen(LPCSTR);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -