📄 win32api.txt
字号:
hFile As Long
hProcess As Long
hThread As Long
lpBaseOfImage As Long
dwDebugInfoFileOffset As Long
nDebugInfoSize As Long
lpThreadLocalBase As Long
lpStartAddress As Long
lpImageName As Long
fUnicode As Integer
End Type
Type EXIT_THREAD_DEBUG_INFO
dwExitCode As Long
End Type
Type EXIT_PROCESS_DEBUG_INFO
dwExitCode As Long
End Type
Type LOAD_DLL_DEBUG_INFO
hFile As Long
lpBaseOfDll As Long
dwDebugInfoFileOffset As Long
nDebugInfoSize As Long
lpImageName As Long
fUnicode As Integer
End Type
Type UNLOAD_DLL_DEBUG_INFO
lpBaseOfDll As Long
End Type
Type OUTPUT_DEBUG_STRING_INFO
lpDebugStringData As String
fUnicode As Integer
nDebugStringLength As Integer
End Type
Type RIP_INFO
dwError As Long
dwType As Long
End Type
' GetDriveType return values
Public Const DRIVE_REMOVABLE = 2
Public Const DRIVE_FIXED = 3
Public Const DRIVE_REMOTE = 4
Public Const DRIVE_CDROM = 5
Public Const DRIVE_RAMDISK = 6
Public Const FILE_TYPE_UNKNOWN = &H0
Public Const FILE_TYPE_DISK = &H1
Public Const FILE_TYPE_CHAR = &H2
Public Const FILE_TYPE_PIPE = &H3
Public Const FILE_TYPE_REMOTE = &H8000
Public Const STD_INPUT_HANDLE = -10&
Public Const STD_OUTPUT_HANDLE = -11&
Public Const STD_ERROR_HANDLE = -12&
Public Const NOPARITY = 0
Public Const ODDPARITY = 1
Public Const EVENPARITY = 2
Public Const MARKPARITY = 3
Public Const SPACEPARITY = 4
Public Const ONESTOPBIT = 0
Public Const ONE5STOPBITS = 1
Public Const TWOSTOPBITS = 2
Public Const IGNORE = 0 ' Ignore signal
Public Const INFINITE = &HFFFF ' Infinite timeout
' Comm Baud Rate indices
Public Const CBR_110 = 110
Public Const CBR_300 = 300
Public Const CBR_600 = 600
Public Const CBR_1200 = 1200
Public Const CBR_2400 = 2400
Public Const CBR_4800 = 4800
Public Const CBR_9600 = 9600
Public Const CBR_14400 = 14400
Public Const CBR_19200 = 19200
Public Const CBR_38400 = 38400
Public Const CBR_56000 = 56000
Public Const CBR_57600 = 57600
Public Const CBR_115200 = 115200
Public Const CBR_128000 = 128000
Public Const CBR_256000 = 256000
' Error Flags
Public Const CE_RXOVER = &H1 ' Receive Queue overflow
Public Const CE_OVERRUN = &H2 ' Receive Overrun Error
Public Const CE_RXPARITY = &H4 ' Receive Parity Error
Public Const CE_FRAME = &H8 ' Receive Framing error
Public Const CE_BREAK = &H10 ' Break Detected
Public Const CE_TXFULL = &H100 ' TX Queue is full
Public Const CE_PTO = &H200 ' LPTx Timeout
Public Const CE_IOE = &H400 ' LPTx I/O Error
Public Const CE_DNS = &H800 ' LPTx Device not selected
Public Const CE_OOP = &H1000 ' LPTx Out-Of-Paper
Public Const CE_MODE = &H8000 ' Requested mode unsupported
Public Const IE_BADID = (-1) ' Invalid or unsupported id
Public Const IE_OPEN = (-2) ' Device Already Open
Public Const IE_NOPEN = (-3) ' Device Not Open
Public Const IE_MEMORY = (-4) ' Unable to allocate queues
Public Const IE_DEFAULT = (-5) ' Error in default parameters
Public Const IE_HARDWARE = (-10) ' Hardware Not Present
Public Const IE_BYTESIZE = (-11) ' Illegal Byte Size
Public Const IE_BAUDRATE = (-12) ' Unsupported BaudRate
' Events
Public Const EV_RXCHAR = &H1 ' Any Character received
Public Const EV_RXFLAG = &H2 ' Received certain character
Public Const EV_TXEMPTY = &H4 ' Transmitt Queue Empty
Public Const EV_CTS = &H8 ' CTS changed state
Public Const EV_DSR = &H10 ' DSR changed state
Public Const EV_RLSD = &H20 ' RLSD changed state
Public Const EV_BREAK = &H40 ' BREAK received
Public Const EV_ERR = &H80 ' Line status error occurred
Public Const EV_RING = &H100 ' Ring signal detected
Public Const EV_PERR = &H200 ' Printer error occured
Public Const EV_RX80FULL = &H400 ' Receive buffer is 80 percent full
Public Const EV_EVENT1 = &H800 ' Provider specific event 1
Public Const EV_EVENT2 = &H1000 ' Provider specific event 2
' Escape Functions
Public Const SETXOFF = 1 ' Simulate XOFF received
Public Const SETXON = 2 ' Simulate XON received
Public Const SETRTS = 3 ' Set RTS high
Public Const CLRRTS = 4 ' Set RTS low
Public Const SETDTR = 5 ' Set DTR high
Public Const CLRDTR = 6 ' Set DTR low
Public Const RESETDEV = 7 ' Reset device if possible
Public Const SETBREAK = 8 'Set the device break line
Public Const CLRBREAK = 9 ' Clear the device break line
' PURGE function flags.
Public Const PURGE_TXABORT = &H1 ' Kill the pending/current writes to the comm port.
Public Const PURGE_RXABORT = &H2 ' Kill the pending/current reads to the comm port.
Public Const PURGE_TXCLEAR = &H4 ' Kill the transmit queue if there.
Public Const PURGE_RXCLEAR = &H8 ' Kill the typeahead buffer if there.
Public Const LPTx = &H80 ' Set if ID is for LPT device
' Modem Status Flags
Public Const MS_CTS_ON = &H10&
Public Const MS_DSR_ON = &H20&
Public Const MS_RING_ON = &H40&
Public Const MS_RLSD_ON = &H80&
' WaitSoundState() Constants
Public Const S_QUEUEEMPTY = 0
Public Const S_THRESHOLD = 1
Public Const S_ALLTHRESHOLD = 2
' Accent Modes
Public Const S_NORMAL = 0
Public Const S_LEGATO = 1
Public Const S_STACCATO = 2
' SetSoundNoise() Sources
Public Const S_PERIOD512 = 0 ' Freq = N/512 high pitch, less coarse hiss
Public Const S_PERIOD1024 = 1 ' Freq = N/1024
Public Const S_PERIOD2048 = 2 ' Freq = N/2048 low pitch, more coarse hiss
Public Const S_PERIODVOICE = 3 ' Source is frequency from voice channel (3)
Public Const S_WHITE512 = 4 ' Freq = N/512 high pitch, less coarse hiss
Public Const S_WHITE1024 = 5 ' Freq = N/1024
Public Const S_WHITE2048 = 6 ' Freq = N/2048 low pitch, more coarse hiss
Public Const S_WHITEVOICE = 7 ' Source is frequency from voice channel (3)
Public Const S_SERDVNA = (-1) ' Device not available
Public Const S_SEROFM = (-2) ' Out of memory
Public Const S_SERMACT = (-3) ' Music active
Public Const S_SERQFUL = (-4) ' Queue full
Public Const S_SERBDNT = (-5) ' Invalid note
Public Const S_SERDLN = (-6) ' Invalid note length
Public Const S_SERDCC = (-7) ' Invalid note count
Public Const S_SERDTP = (-8) ' Invalid tempo
Public Const S_SERDVL = (-9) ' Invalid volume
Public Const S_SERDMD = (-10) ' Invalid mode
Public Const S_SERDSH = (-11) ' Invalid shape
Public Const S_SERDPT = (-12) ' Invalid pitch
Public Const S_SERDFQ = (-13) ' Invalid frequency
Public Const S_SERDDR = (-14) ' Invalid duration
Public Const S_SERDSR = (-15) ' Invalid source
Public Const S_SERDST = (-16) ' Invalid state
Public Const NMPWAIT_WAIT_FOREVER = &HFFFF
Public Const NMPWAIT_NOWAIT = &H1
Public Const NMPWAIT_USE_DEFAULT_WAIT = &H0
Public Const FS_CASE_IS_PRESERVED = FILE_CASE_PRESERVED_NAMES
Public Const FS_CASE_SENSITIVE = FILE_CASE_SENSITIVE_SEARCH
Public Const FS_UNICODE_STORED_ON_DISK = FILE_UNICODE_ON_DISK
Public Const FS_PERSISTENT_ACLS = FILE_PERSISTENT_ACLS
Public Const SECTION_QUERY = &H1
Public Const SECTION_MAP_WRITE = &H2
Public Const SECTION_MAP_READ = &H4
Public Const SECTION_MAP_EXECUTE = &H8
Public Const SECTION_EXTEND_SIZE = &H10
Public Const SECTION_ALL_ACCESS = STANDARD_RIGHTS_REQUIRED Or SECTION_QUERY Or SECTION_MAP_WRITE Or SECTION_MAP_READ Or SECTION_MAP_EXECUTE Or SECTION_EXTEND_SIZE
Public Const FILE_MAP_COPY = SECTION_QUERY
Public Const FILE_MAP_WRITE = SECTION_MAP_WRITE
Public Const FILE_MAP_READ = SECTION_MAP_READ
Public Const FILE_MAP_ALL_ACCESS = SECTION_ALL_ACCESS
' OpenFile() Flags
Public Const OF_READ = &H0
Public Const OF_WRITE = &H1
Public Const OF_READWRITE = &H2
Public Const OF_SHARE_COMPAT = &H0
Public Const OF_SHARE_EXCLUSIVE = &H10
Public Const OF_SHARE_DENY_WRITE = &H20
Public Const OF_SHARE_DENY_READ = &H30
Public Const OF_SHARE_DENY_NONE = &H40
Public Const OF_PARSE = &H100
Public Const OF_DELETE = &H200
Public Const OF_VERIFY = &H400
Public Const OF_CANCEL = &H800
Public Const OF_CREATE = &H1000
Public Const OF_PROMPT = &H2000
Public Const OF_EXIST = &H4000
Public Const OF_REOPEN = &H8000
Public Const OFS_MAXPATHNAME = 128
' OpenFile() Structure
Type OFSTRUCT
cBytes As Byte
fFixedDisk As Byte
nErrCode As Integer
Reserved1 As Integer
Reserved2 As Integer
szPathName(OFS_MAXPATHNAME) As Byte
End Type
Declare Function InterlockedIncrement Lib "kernel32" Alias "InterlockedIncrement" (lpAddend As Long) As Long
Declare Function InterlockedDecrement Lib "kernel32" Alias "InterlockedDecrement" (lpAddend As Long) As Long
Declare Function InterlockedExchange Lib "kernel32" Alias "InterlockedExchange" (Target As Long, ByVal Value As Long) As Long
' Loader Routines
Declare Function GetModuleFileName Lib "kernel32" Alias "GetModuleFileNameA" (ByVal hModule As Long, ByVal lpFileName As String, ByVal nSize As Long) As Long
Declare Function GetModuleHandle Lib "kernel32" Alias "GetModuleHandleA" (ByVal lpModuleName As String) As Long
Declare Function CreateProcess Lib "kernel32" Alias "CreateProcessA" (ByVal lpApplicationName As String, ByVal lpCommandLine As String, lpProcessAttributes As SECURITY_ATTRIBUTES, lpThreadAttributes As SECURITY_ATTRIBUTES, ByVal bInheritHandles As Long, ByVal dwCreationFlags As Long, lpEnvironment As Any, ByVal lpCurrentDriectory As String, lpStartupInfo As STARTUPINFO, lpProcessInformation As PROCESS_INFORMATION) As Long
Declare Function SetProcessShutdownParameters Lib "kernel32" Alias "SetProcessShutdownParameters" (ByVal dwLevel As Long, ByVal dwFlags As Long) As Long
Declare Function GetProcessShutdownParameters Lib "kernel32" Alias "GetProcessShutdownParameters" (lpdwLevel As Long, lpdwFlags As Long) As Long
Declare Sub FatalAppExit Lib "kernel32" Alias "FatalAppExitA" (ByVal uAction As Long, ByVal lpMessageText As String)
Declare Sub GetStartupInfo Lib "kernel32" Alias "GetStartupInfoA" (lpStartupInfo As STARTUPINFO)
Declare Function GetCommandLine Lib "kernel32" Alias "GetCommandLineA" () As String
Declare Function GetEnvironmentVariable Lib "kernel32" Alias "GetEnvironmentVariableA" (ByVal lpName As String, ByVal lpBuffer As String, ByVal nSize As Long) As Long
Declare Function SetEnvironmentVariable Lib "kernel32" Alias "SetEnvironmentVariableA" (ByVal lpName As String, ByVal lpValue As String) As Long
Declare Function ExpandEnvironmentStrings Lib "kernel32" Alias "ExpandEnvironmentStringsA" (ByVal lpSrc As String, ByVal lpDst As String, ByVal nSize As Long) As Long
Declare Function LoadLibrary Lib "kernel32" Alias "LoadLibraryA" (ByVal lpLibFileName As String) As Long
Declare Function LoadLibraryEx Lib "kernel32" Alias "LoadLibraryExA" (ByVal lpLibFileName As String, ByVal hFile As Long, ByVal dwFlags As Long) As Long
Public Const DONT_RESOLVE_DLL_REFERENCES = &H1
Declare Function LoadModule Lib "kernel32" Alias "LoadModule" (ByVal lpModuleName As String, lpParameterBlock As Any) As Long
Declare Function FreeLibrary Lib "kernel32" Alias "FreeLibrary" (ByVal hLibModule As Long) As Long
Declare Function WinExec Lib "kernel32" Alias "WinExec" (ByVal lpCmdLine As String, ByVal nCmdShow As Long) As Long
Declare Sub DebugBreak Lib "kernel32" Alias "DebugBreak" ()
Declare Function ContinueDebugEvent Lib "kernel32" Alias "ContinueDebugEvent" (ByVal dwProcessId As Long, ByVal dwThreadId As Long, ByVal dwContinueStatus As Long) As Long
Declare Function DebugActiveProcess Lib "kernel32" Alias "DebugActiveProcess" (ByVal dwProcessId As Long) As Long
Type CRITICAL_SECTION
dummy As Long
End Type
Declare Sub InitializeCriticalSection Lib "kernel32" Alias "InitializeCriticalSection" (lpCriticalSection As CRITICAL_SECTION)
Declare Sub EnterCriticalSection Lib "kernel32" Alias "EnterCriticalSection" (lpCriticalSection As CRITICAL_SECTION)
Declare Sub LeaveCriticalSection Lib "kernel32" Alias "LeaveCriticalSection" (lpCriticalSection As CRITICAL_SECTION)
Declare Sub DeleteCriticalSection Lib "kernel32" Alias "DeleteCriticalSection" (lpCriticalSection As CRITICAL_SECTION)
Declare Function SetEvent Lib "kernel32" Alias "SetEvent" (ByVal hEvent As Long) As Long
Declare Function ResetEvent Lib "kernel32" Alias "ResetEvent" (ByVal hEvent As Long) As Long
Declare Function PulseEvent Lib "kernel32" Alias "PulseEvent" (ByVal hEvent As Long) As Long
Declare Function ReleaseSemaphore Lib "kernel32" Alias "ReleaseSemaphore" (ByVal hSemaphore As Long, ByVal lReleaseCount As Long, lpPreviousCount As Long) As Long
Declare Function ReleaseMutex Lib "kernel32" Alias "ReleaseMutex" (ByVal hMutex As Long) As Long
Declare Function WaitForSingleObject Lib "kernel32" Alias "WaitForSingleObject" (ByVal hHandle As Long, ByVal dwMilliseconds As Long) As Long
Declare Function WaitForMultipleObjects Lib "kernel32" Alias "WaitForMultipleObjects" (ByVal nCount As Long, lpHandles As Long, ByVal bWaitAll As Long, ByVal dwMilliseconds As Long) As Long
Declare Sub Sleep Lib "kernel32" Alias "Sleep" (ByVal dwMilliseconds As Long)
Declare Sub OutputDebugString Lib "kernel32" Alias "OutputDebugStringA" (ByVal lpOutputString As String)
Declare Function GetVersion Lib "kernel32" Alias "GetVersion" () As Long
Declare Function OpenFile Lib "kernel32" Alias "OpenFile" (ByVal lpFileName As String, lpReOpenBuff As OFSTRUCT, ByVal wStyle As Long) As Long
' GetTempFileName() Flags
'
Public Const TF_FORCEDRIVE = &H80
Declare Function GetTempFileName Lib "kernel32" Alias "GetTempFileNameA" (ByVal lpszPath As String, ByVal lpPrefixString As String, ByVal wUnique As Long, ByVal lpTempFileName As String) As Long
Declare Function SetHandleCount Lib "kernel32" Alias "SetHandleCount" (ByVal wNumber As Long) As Long
Declare Function GetLogicalDrives Lib "kernel32" Alias "GetLogicalDrives" () As Long
Declare Function LockFile Lib "kernel32" Alias "LockFile" (ByVal hFile As Long, ByVal dwFileOffsetLow As Long, ByVal dwFileOffsetHigh As Long, ByVal nNumberOfBytesToLockLow As Long, ByVal nNumberOfBytesToLockHigh As Long) As Long
Declare Function UnlockFile Lib "kernel32" Alias "UnlockFile" (ByVal hFile As Long, ByVal dwFileOffsetLow As Long, ByVal dwFileOffsetHigh As Long, ByVal nNumberOfBytesToUnlockLow As Long, ByVal nNumberOfBytesToUnlockHigh As Long) As Long
Declare Function LockFileEx Lib "kernel32" Alias "LockFileEx" (ByVal hFile As Long, ByVal dwFlags As Long, ByVal dwReserved As Long, ByVal nNumberOfBytesToLockLow As Long, ByVal nNumberOfBytesToLockHigh As Long, lpOverlapped As OVERLAPPED) As Long
Public Const LOCKFILE_FAIL_IMMEDIATELY = &H1
Public Const LOCKFILE_EXCLUSIVE_LOCK = &H2
Declare Function UnlockFileEx Lib "kernel32" Alias "UnlockFileEx" (ByVal hFile As Long, ByVal dwReserved As Long, ByVal nNumberOfBytesToUnlockLow As Long, ByVal nNumberOfBytesToUnlockHigh As Long, lpOverlapped As OVERLAPPED) As Long
Type BY_HANDLE_FILE_INFORMATION
dwFileAttributes As Long
ftCreationTime As FILETIME
ftLastAccessTime As FILETIME
ftLastWriteTime As FILETIME
dwVolumeSerialNumber As Long
nFileSizeHigh As Long
nFileSizeLow As Long
nNumberOfLinks As Long
nFileIndexHigh As Long
nFileIndexLow As Long
End Type
Declare Function GetFileInformationByHandle Lib "kernel32" Alias "GetFileInformationByHandle" (ByVal hFile As Long, lpFileInformation As BY_HANDLE_FILE_INFORMATION) As Long
Declare Function GetFileType Lib "kernel32" Alias "GetFileType" (ByVal hFile As Long) As Long
Declare Function GetFileSize Lib "kernel32" Alias "GetFileSize" (ByVal hFile As Long, lpFileSizeHigh As Long) As Long
Declare Function GetStdHandle Lib "kernel32" Alias "GetStdHandle" (ByVal nStdHandle As Long) As Long
Declare Function SetStdHandle Lib "kernel32" Alias "SetS
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -