Include file for Proteus Win32
functions |
; Include file for Proteus Win32 functions
; **** Parameters for W32CREATEFILE ****
; access mode
; read only
CONST W32_GENERIC_READ 0x80000000
; write only
CONST W32_GENERIC_WRITE 0x40000000
; sharing mode
; can be opened for read-only
CONST W32_FILE_SHARE_READ 1
; can be opened for write-only
CONST W32_FILE_SHARE_WRITE 2
; can be opened for delete-only
CONST W32_FILE_SHARE_DELETE 4
; creation rules
; create a new file; fails if it already exists
CONST W32_CREATE_NEW 1
; create a new file; if it exists, overwrite it and reset attributes
CONST W32_CREATE_ALWAYS 2
; open a file; fails if it does not exist
CONST W32_OPEN_EXISTING 3
; open a file; if it does not exist, create it
CONST W32_OPEN_ALWAYS 4
; open file and truncate to 0 length (requires write rights);
; fails if it does not exist
CONST W32_TRUNCATE_EXISTING 5
; attributes
; read-only file
CONST W32_FILE_ATTRIBUTE_READONLY 0x1
; hidden file
CONST W32_FILE_ATTRIBUTE_HIDDEN 0x2
; system file
CONST W32_FILE_ATTRIBUTE_SYSTEM 0x4
; file is to be archived
CONST W32_FILE_ATTRIBUTE_ARCHIVE 0x20
; normal file (use alone)
CONST W32_FILE_ATTRIBUTE_NORMAL 0x80
; temporary file; file system attempts to keep it in memory;
; user is supposed to delete it as soon as he doesn't need it anymore
CONST W32_FILE_ATTRIBUTE_TEMPORARY 0x100
; file not immediately available (moved offline)
CONST W32_FILE_ATTRIBUTE_OFFLINE 0x1000
; write to disk as soon as possible
CONST W32_FILE_FLAG_WRITE_THROUGH 0x80000000
; random access file (optimize caching)
CONST W32_FILE_FLAG_RANDOM_ACCESS 0x10000000
; sequential access from start to end (optimize caching);
; file pointer repositioning is allowed anyway
CONST W32_FILE_FLAG_SEQUENTIAL_SCAN 0x08000000
; automatically deletes the file when no remaining process keep it open
CONST W32_FILE_FLAG_DELETE_ON_CLOSE 0x04000000
; when opening a named pipe: security quality of service information are available
CONST W32_SECURITY_SQOS_PRESENT 0x00100000
; anonymous
CONST W32_SECURITY_ANONYMOUS 0
; identification
CONST W32_SECURITY_IDENTIFICATION 0x10000
; impersonation
CONST W32_SECURITY_IMPERSONATION 0x20000
; delegation
CONST W32_SECURITY_DELEGATION 0x30000
; dynamic security context tracking
CONST W32_SECURITY_CONTEXT_TRACKING 0x40000
; only what is enabled in the security context for the user is available to the server
CONST W32_SECURITY_EFFECTIVE_ONLY 0x80000
; -----------------------------------------------------------------------------------------
; **** Parameters for W32GETCOMSTATE/W32SETCOMSTATE ****
; flags:
; binary transmission, ignore EOF character
CONST W32_COM_BINARY 1
; enable parity control
CONST W32_COM_PARITY_ON 2
; enable hardware flowcontrol (CTS/RTS)
CONST W32_COM_CTSFLOW_ON 4
; enable alternate hardware flowcontrol (DSR/DTR)
CONST W32_COM_DSRFLOW_ON 8
; raise DTR line when device is opened and keep it raised
CONST W32_COM_DTR_ENABLE 16
; enable DTR handshake
CONST W32_COM_DTR_HANDSHAKE 32
; specify that the driver is sensible to DSR state; if set, the driver ignores
; any character received when the line is not raised
CONST W32_COM_DSR_SENSITIVITY 64
; XOFF continues transmission
CONST W32_COM_XOFF_CONTINUE 128
; XON/XOFF handshake when transmitting
CONST W32_COM_XONXOFF_OUT 256
; XON/XOFF handshake when receiving
CONST W32_COM_XONXOFF_IN 512
; use error character if parity is wrong
CONST W32_COM_USE_ERRORCH 1024
; remove NULL characters (chr(0)) from stream
CONST W32_COM_STRIP_NULL 2048
; raise RTS when the device is opened and keep it raised
CONST W32_COM_RTS_ENABLE 4096
; enable handshake: the driver raises RTS signal when input buffer is half full (or less)
; and drops it when it is 75% full.
CONST W32_COM_RTS_HANDSHAKE 8192
; raise RTS if there are bytes to be transmitted, drops it otherwise
CONST W32_COM_RTS_TOGGLE 12288
; terminate read/write operation in case of error; no other communications will be
; accepted until W32ClearComErr is called
CONST W32_COM_ERROR_ABORT 16384
; no parity
CONST W32_COM_PARITY_NONE 0
; odd parity
CONST W32_COM_PARITY_ODD 1
; even parity
CONST W32_COM_PARITY_EVEN 2
; mark parity
CONST W32_COM_PARITY_MARK 3
; space parity
CONST W32_COM_PARITY_SPACE 4
; 1 stop bit
CONST W32_COM_STOP_1 0
; 1.5 stop bit
CONST W32_COM_STOP_15 1
; 2 stop bits
CONST W32_COM_STOP_2 2
; DCB length
CONST W32_COM_GS_DCBLENGTH 1
; baud rate
CONST W32_COM_GS_BAUD 2
; flags
CONST W32_COM_GS_FLAGS 3
; threshold for XON transmission
CONST W32_COM_GS_TXON 5
; threshold for XOFF transmission
CONST W32_COM_GS_TXOFF 6
; data bits
CONST W32_COM_GS_BIT 7
; parity
CONST W32_COM_GS_PARITY 8
; stop bits
CONST W32_COM_GS_STOP 9
; XON character
CONST W32_COM_GS_XONCHAR 10
; XOFF character
CONST W32_COM_GS_XOFFCHAR 11
; error character
CONST W32_COM_GS_ERRCHAR 12
; EOF character
CONST W32_COM_GS_EOFCHAR 13
; character to signal receive event
CONST W32_COM_GS_RXCHAR 14
; -----------------------------------------------------------------------------------------
; **** Parameters for W32SETCOMTIMEOUTS ****
; read timeout interval
CONST W32_COM_TO_READ 1
; multiplier for read timeout
CONST W32_COM_TO_READMUL 2
; constant for read timeout
CONST W32_COM_TO_READCONST 3
; multiplier for write timeout
CONST W32_COM_TO_WRITEMUL 4
; constant for write timeout
CONST W32_COM_TO_WRITECONST 5
; -----------------------------------------------------------------------------------------
; **** Parameters for W32PURGECOM ****
; clear transmission buffer
CONST W32_PURGE_TXCLEAR 0x0004
; clear receive buffer
CONST W32_PURGE_RXCLEAR 0x0008
; -----------------------------------------------------------------------------------------
; **** Parameters for W32ESCCOMFUNC ****
; simulates XOFF reception
CONST W32_COM_SETXOFF 1
; simulates XON reception
CONST W32_COM_SETXON 2
; raise RTS signal (request-to-send)
CONST W32_COM_SETRTS 3
; drop RTS signal (request-to-send)
CONST W32_COM_CLRRTS 4
; raise DTR signal (data-terminal-ready)
CONST W32_COM_SETDTR 5
; drop DTR signal (data-terminal-ready)
CONST W32_COM_CLRDTR 6
; reset device, if possible
CONST W32_COM_RESETDEV 7
; suspend transmission and put line in break mode until
; function EscComFunc is called with parameter CLRBREAK.
; Please note that this extended function does not clear
; data that were not transmitted.
CONST W32_COM_SETBREAK 8
; restore transmission and put line in out-of-break mode.
CONST W32_COM_CLRBREAK 9
; -----------------------------------------------------------------------------------------
; **** Parameters for W32CLEARCOMERR ****
; overflow in input buffer. No room in input buffer or a character was received after EOF
CONST W32_CE_RXOVER 0x0001
; buffer overrun; next character will be lost
CONST W32_CE_OVERRUN 0x0002
; hardware detected a parity error
CONST W32_CE_RXPARITY 0x0004
; hardware detected a framing error
CONST W32_CE_FRAME 0x0008
; hardware detected a breck condition
CONST W32_CE_BREAK 0x0010
; the application tried to transmit a character, but output buffer was full
CONST W32_CE_TXFULL 0x0100
; Windows 95 and Windows 98: time-out on parallel device
CONST W32_CE_PTO 0x0200
; an I/O error happened during communication
CONST W32_CE_IOE 0x0400
; Windows 95 and Windows 98: parallel device not selected
CONST W32_CE_DNS 0x0800
; Windows 95 and Windows 98: parallel device is out of paper
CONST W32_CE_OOP 0x1000
; requested mode is unsupported, or the specified handle is wrong; if this flag is set,
; it is the only valid error.
CONST W32_CE_MODE 0x8000
; indexes for vST array
; status
CONST W32_CE_STATUS 1
; bytes in rx buffer
CONST W32_CE_RXBYTES 2
; bytes in tx buffer
CONST W32_CE_TXBYTES 3
; -----------------------------------------------------------------------------------------
; **** Parameters for W32WAITCOMMEVT ****
; Received a character
CONST EV_RXCHAR 0x0001
; Received the specified character
CONST EV_RXFLAG 0x0002
; Transmission queue is empty
CONST EV_TXEMPTY 0x0004
; CTS status changed
CONST EV_CTS 0x0008
; DSR status changed
CONST EV_DSR 0x0010
; RLSD status changed
CONST EV_RLSD 0x0020
; BREAK received
CONST EV_BREAK 0x0040
; Error detected on the line
CONST EV_ERR 0x0080
; Ring detected
CONST EV_RING 0x0100
; Printer error
CONST EV_PERR 0x0200
; Receive buffer is full at 80%
CONST EV_RX80FULL 0x0400
; Provider specific event #1
CONST EV_EVENT1 0x0800
; Provider specific event #2
CONST EV_EVENT2 0x1000
; -----------------------------------------------------------------------------------------
; **** Parameters for W32GETMODEMSTATUS ****
CONST MS_CTS_ON 0x0010
CONST MS_DSR_ON 0x0020
CONST MS_RING_ON 0x0040
CONST MS_RLSD_ON 0x0080
; -----------------------------------------------------------------------------------------
; **** Parameters for W32GETWINDOW ****
; child window
CONST GW_CHILD 5
; pop-up enabled
CONST GW_ENABLEDPOPUP 6
; first window
CONST GW_HWNDFIRST 0
; last window
CONST GW_HWNDLAST 1
; next window
CONST GW_HWNDNEXT 2
; previous window
CONST GW_HWNDPREV 3
; window owner
CONST GW_OWNER 4
; -----------------------------------------------------------------------------------------
; Flag for COMSTAT
; transmission waiting for CTS signal
CONST W32_CE_CTSHOLD 0x0001
; transmission waiting for DSR signal
CONST W32_CE_DSRHOLD 0x0002
; transmission waiting for RLSD signal
CONST W32_CE_RLSDHOLD 0x0004
; transmission on hold, received XOFF character
CONST W32_CE_XOFFHOLD 0x0008
; transmission on hold, XOFF character sent
CONST W32_CE_XOFFSENT 0x0010
; EOF character sent
CONST W32_CE_EOF 0x0020
; character waiting to be transmitted
CONST W32_CE_TXIM 0x0040
; -----------------------------------------------------------------------------------------
; **** Parameters for functions on registry ****
CONST W32_HKEY_CLASSES_ROOT 0x80000000
CONST W32_HKEY_CURRENT_USER 0x80000001
CONST W32_HKEY_LOCAL_MACHINE 0x80000002
CONST W32_HKEY_USERS 0x80000003
CONST W32_HKEY_PERFORMANCE_DATA 0x80000004
CONST W32_HKEY_CURRENT_CONFIG 0x80000005
; no value
CONST W32_REG_NONE 0
; Unicode string NULL terminated
CONST W32_REG_SZ 1
; Unicode string NULL terminated (with references to environment variables)
CONST W32_REG_EXPAND_SZ 2
; free binary format
CONST W32_REG_BINARY 3
; 32-bit word
CONST W32_REG_DWORD 4
; 32-bit word ("big endian" format)
CONST W32_REG_DWORD_BIG_ENDIAN 5
; symbolic link (Unicode)
CONST W32_REG_LINK 6
; multiple Unicode strings
CONST W32_REG_MULTI_SZ 7
; resource list in resource map
CONST W32_REG_RESOURCE_LIST 8
; resource list in hardware description
CONST W32_REG_FULL_RESOURCE_DESCRIPTOR 9
; resource list in requirements list
CONST W32_REG_RESOURCE_REQUIREMENTS_LIST 10
; -----------------------------------------------------------------------------------------
; **** Parameters for pipe functions ****
; server reads, client writes
CONST PIPE_ACCESS_INBOUND 1
; server writes, client reads
CONST PIPE_ACCESS_OUTBOUND 2
; server and client can read and write
CONST PIPE_ACCESS_DUPLEX 3
; blocking mode
CONST PIPE_WAIT 0
; non-blocking mode
CONST PIPE_NOWAIT 1
; byte reading mode
CONST PIPE_READMODE_BYTE 0
; message reading mode
CONST PIPE_READMODE_MESSAGE 2
; byte type
CONST PIPE_TYPE_BYTE 0
; message type
CONST PIPE_TYPE_MESSAGE 4
; unlimited number of instances
CONST PIPE_UNLIMITED_INSTANCES 255
; wait forever
CONST NMPWAIT_WAIT_FOREVER 0xffffffff
; do not wait
CONST NMPWAIT_NOWAIT 1
; use predefined wait time
CONST NMPWAIT_USE_DEFAULT_WAIT 0