### Calling Vanara P/Invoke Function using Static Using (C#) Source: https://github.com/dahall/vanara/blob/master/README.md Demonstrates how to call a Windows API function imported via Vanara using a C# static using directive. This allows calling the function directly without prefixing the class name. Requires C# 6.0 or later. ```C# using static Vanara.PInvoke.Kernel32; var bret = GetComputerName(sb, ref sbSz); ``` -------------------------------- ### Define FontPitch Constants C# Source: https://github.com/dahall/vanara/blob/master/PInvoke/Shared/readme.md Documents the FontPitch constants, which provide information about the pitch, technology, and family of a physical font. Pitch refers to whether characters have fixed or variable widths. ```C# DEFAULT_PITCH, FIXED_PITCH, TMPF_FIXED_PITCH, VARIABLE_PITCH, TMPF_VECTOR, TMPF_TRUETYPE, MONO_FONT, TMPF_DEVICE ``` -------------------------------- ### Define FILE_SHARE Constants C# Source: https://github.com/dahall/vanara/blob/master/PInvoke/Shared/readme.md Documents the FILE_SHARE constants, which specify the requested sharing mode for a file or device. These flags control what types of access (read, write, delete) are allowed for other processes opening the same file. ```C# FILE_SHARE_READ, FILE_SHARE_WRITE, FILE_SHARE_DELETE ``` -------------------------------- ### Mapping Dialog Rectangles in C# Source: https://github.com/dahall/vanara/blob/master/README.md This snippet shows the Vanara C# signature for the Windows API function `MapDialogRect`. It demonstrates the use of the `in` keyword to pass the `RECT` structure by reference without requiring the `ref` keyword, simplifying the call while ensuring the structure is treated as a constant input. ```C# bool MapDialogRect(HWND hDlg, in RECT lpRect); ``` -------------------------------- ### Define FontFamily Constants C# Source: https://github.com/dahall/vanara/blob/master/PInvoke/Shared/readme.md Documents the FontFamily constants, which describe the general look of a font. These are used when the exact typeface is not known or available, allowing the system to substitute a similar font. ```C# FF_DONTCARE, FF_ROMAN, FF_SWISS, FF_MODERN, FF_SCRIPT, FF_DECORATIVE ``` -------------------------------- ### Define FILE_DEVICE Constants C# Source: https://github.com/dahall/vanara/blob/master/PInvoke/Shared/readme.md Documents the FILE_DEVICE constants, which represent the type of underlying hardware for a driver. These constants are used to identify different device types within the Windows operating system. ```C# FILE_DEVICE_BEEP, FILE_DEVICE_CD_ROM, FILE_DEVICE_CD_ROM_FILE_SYSTEM, FILE_DEVICE_CONTROLLER, FILE_DEVICE_DATALINK, FILE_DEVICE_DFS, FILE_DEVICE_DISK, FILE_DEVICE_DISK_FILE_SYSTEM, FILE_DEVICE_FILE_SYSTEM, FILE_DEVICE_INPORT_PORT, FILE_DEVICE_KEYBOARD, FILE_DEVICE_MAILSLOT, FILE_DEVICE_MIDI_IN, FILE_DEVICE_MIDI_OUT, FILE_DEVICE_MOUSE, FILE_DEVICE_MULTI_UNC_PROVIDER, FILE_DEVICE_NAMED_PIPE, FILE_DEVICE_NETWORK, FILE_DEVICE_NETWORK_BROWSER, FILE_DEVICE_NETWORK_FILE_SYSTEM, FILE_DEVICE_NULL, FILE_DEVICE_PARALLEL_PORT, FILE_DEVICE_PHYSICAL_NETCARD, FILE_DEVICE_PRINTER, FILE_DEVICE_SCANNER, FILE_DEVICE_SERIAL_MOUSE_PORT, FILE_DEVICE_SERIAL_PORT, FILE_DEVICE_SCREEN, FILE_DEVICE_SOUND, FILE_DEVICE_STREAMS, FILE_DEVICE_TAPE, FILE_DEVICE_TAPE_FILE_SYSTEM, FILE_DEVICE_TRANSPORT, FILE_DEVICE_UNKNOWN, FILE_DEVICE_VIDEO, FILE_DEVICE_VIRTUAL_DISK, FILE_DEVICE_WAVE_IN, FILE_DEVICE_WAVE_OUT, FILE_DEVICE_8042_PORT, FILE_DEVICE_NETWORK_REDIRECTOR, FILE_DEVICE_BATTERY, FILE_DEVICE_BUS_EXTENDER, FILE_DEVICE_MODEM, FILE_DEVICE_VDM, FILE_DEVICE_MASS_STORAGE, FILE_DEVICE_SMB, FILE_DEVICE_KS, FILE_DEVICE_CHANGER, FILE_DEVICE_SMARTCARD, FILE_DEVICE_ACPI, FILE_DEVICE_DVD, FILE_DEVICE_FULLSCREEN_VIDEO, FILE_DEVICE_DFS_FILE_SYSTEM, FILE_DEVICE_DFS_VOLUME, FILE_DEVICE_SERENUM, FILE_DEVICE_TERMSRV, FILE_DEVICE_KSEC, FILE_DEVICE_FIPS, FILE_DEVICE_INFINIBAND, FILE_DEVICE_VMBUS, FILE_DEVICE_CRYPT_PROVIDER, FILE_DEVICE_WPD, FILE_DEVICE_BLUETOOTH, FILE_DEVICE_MT_COMPOSITE, FILE_DEVICE_MT_TRANSPORT, FILE_DEVICE_BIOMETRIC, FILE_DEVICE_PMI, FILE_DEVICE_EHSTOR, FILE_DEVICE_DEVAPI, FILE_DEVICE_GPIO, FILE_DEVICE_USBEX, FILE_DEVICE_CONSOLE, FILE_DEVICE_NFP, FILE_DEVICE_SYSENV, FILE_DEVICE_VIRTUAL_BLOCK, FILE_DEVICE_POINT_OF_SERVICE, FILE_DEVICE_STORAGE_REPLICATION, FILE_DEVICE_TRUST_ENV, FILE_DEVICE_UCM, FILE_DEVICE_UCMTCPCI ``` -------------------------------- ### Define FileFlagsAndAttributes Constants C# Source: https://github.com/dahall/vanara/blob/master/PInvoke/Shared/readme.md Documents the FileFlagsAndAttributes constants, which represent metadata values stored by the file system. These attributes and flags influence how files are handled by the system and various file I/O APIs. ```C# SECURITY_ANONYMOUS, FILE_ATTRIBUTE_READONLY, FILE_ATTRIBUTE_HIDDEN, FILE_ATTRIBUTE_SYSTEM, FILE_ATTRIBUTE_DIRECTORY, FILE_ATTRIBUTE_ARCHIVE, FILE_ATTRIBUTE_DEVICE, FILE_ATTRIBUTE_NORMAL, FILE_ATTRIBUTE_TEMPORARY, FILE_ATTRIBUTE_SPARSE_FILE, FILE_ATTRIBUTE_REPARSE_POINT, FILE_ATTRIBUTE_COMPRESSED, FILE_ATTRIBUTE_OFFLINE, FILE_ATTRIBUTE_NOT_CONTENT_INDEXED, FILE_ATTRIBUTE_ENCRYPTED, FILE_VOLUME_IS_COMPRESSED, FILE_ATTRIBUTE_INTEGRITY_STREAM, FILE_SUPPORTS_OBJECT_IDS, FILE_ATTRIBUTE_VIRTUAL, SECURITY_IDENTIFICATION, FILE_SUPPORTS_ENCRYPTION, SECURITY_IMPERSONATION, FILE_ATTRIBUTE_NO_SCRUB_DATA, SECURITY_DELEGATION, FILE_ATTRIBUTE_EA, FILE_ATTRIBUTE_RECALL_ON_OPEN, FILE_NAMED_STREAMS, SECURITY_CONTEXT_TRACKING, SECURITY_EFFECTIVE_ONLY, FILE_FLAG_FIRST_PIPE_INSTANCE, FILE_READ_ONLY_VOLUME, FILE_ATTRIBUTE_PINNED, FILE_FLAG_OPEN_NO_RECALL, FILE_SEQUENTIAL_WRITE_ONCE, SECURITY_SQOS_PRESENT, FILE_ATTRIBUTE_UNPINNED, FILE_FLAG_OPEN_REPARSE_POINT, FILE_SUPPORTS_TRANSACTIONS, FILE_SUPPORTS_HARD_LINKS, FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS, FILE_FLAG_SESSION_AWARE, FILE_SUPPORTS_EXTENDED_ATTRIBUTES, FILE_SUPPORTS_OPEN_BY_FILE_ID, FILE_FLAG_POSIX_SEMANTICS, FILE_FLAG_BACKUP_SEMANTICS, FILE_SUPPORTS_USN_JOURNAL, FILE_SUPPORTS_INTEGRITY_STREAMS, FILE_FLAG_DELETE_ON_CLOSE, FILE_FLAG_SEQUENTIAL_SCAN, FILE_SUPPORTS_BLOCK_REFCOUNTING, FILE_FLAG_RANDOM_ACCESS, FILE_SUPPORTS_SPARSE_VDL, FILE_FLAG_NO_BUFFERING, FILE_ATTRIBUTE_STRICTLY_SEQUENTIAL, FILE_DAX_VOLUME, FILE_FLAG_OVERLAPPED, FILE_SUPPORTS_GHOSTING, FILE_FLAG_WRITE_THROUGH ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.