using System;
namespace ShellExtensions.Interop.Common
{
///
/// The STGM constants are flags that indicate
/// conditions for creating and deleting the object and access modes
/// for the object.
///
/// You can combine these flags, but you can only choose one flag
/// from each group of related flags. Typically one flag from each
/// of the access and sharing groups must be specified for all
/// functions and methods which use these constants.
///
[Flags]
public enum AccessModes
{
///
/// Indicates that, in direct mode, each change to a storage
/// or stream element is written as it occurs.
///
Direct = 0x00000000,
///
/// Indicates that, in transacted mode, changes are buffered
/// and written only if an explicit commit operation is called.
///
Transacted = 0x00010000,
///
/// Provides a faster implementation of a compound file
/// in a limited, but frequently used, case.
///
Simple = 0x08000000,
///
/// Indicates that the object is read-only,
/// meaning that modifications cannot be made.
///
Read = 0x00000000,
///
/// Enables you to save changes to the object,
/// but does not permit access to its data.
///
Write = 0x00000001,
///
/// Enables access and modification of object data.
///
ReadWrite = 0x00000002,
///
/// Specifies that subsequent openings of the object are
/// not denied read or write access.
///
ShareDenyNone = 0x00000040,
///
/// Prevents others from subsequently opening the object in Read mode.
///
ShareDenyRead = 0x00000030,
///
/// Prevents others from subsequently opening the object
/// for Write or ReadWrite access.
///
ShareDenyWrite = 0x00000020,
///
/// Prevents others from subsequently opening the object in any mode.
///
ShareExclusive = 0x00000010,
///
/// Opens the storage object with exclusive access to the most
/// recently committed version.
///
Priority = 0x00040000,
///
/// Indicates that the underlying file is to be automatically destroyed when the root
/// storage object is released. This feature is most useful for creating temporary files.
///
DeleteOnRelease = 0x04000000,
///
/// Indicates that, in transacted mode, a temporary scratch file is usually used
/// to save modifications until the Commit method is called.
/// Specifying NoScratch permits the unused portion of the original file
/// to be used as work space instead of creating a new file for that purpose.
///
NoScratch = 0x00100000,
///
/// Indicates that an existing storage object
/// or stream should be removed before the new object replaces it.
///
Create = 0x00001000,
///
/// Creates the new object while preserving existing data in a stream named "Contents".
///
Convert = 0x00020000,
///
/// Causes the create operation to fail if an existing object with the specified name exists.
///
FailIfThere = 0x00000000,
///
/// This flag is used when opening a storage object with Transacted
/// and without ShareExclusive or ShareDenyWrite.
/// In this case, specifying NoSnapshot prevents the system-provided
/// implementation from creating a snapshot copy of the file.
/// Instead, changes to the file are written to the end of the file.
///
NoSnapshot = 0x00200000,
///
/// Supports direct mode for single-writer, multireader file operations.
///
DirectSingleWriterMultipleReader = 0x00400000
}
#if PREVIEW_HANDLER
///
/// HRESULT Wrapper
///
public enum HResult
{
///
/// S_OK
///
Ok = 0x0000,
///
/// S_FALSE
///
False = 0x0001,
///
/// E_INVALIDARG
///
InvalidArguments = unchecked((int)0x80070057),
///
/// E_OUTOFMEMORY
///
OutOfMemory = unchecked((int)0x8007000E),
///
/// E_NOINTERFACE
///
NoInterface = unchecked((int)0x80004002),
///
/// E_FAIL
///
Fail = unchecked((int)0x80004005),
///
/// E_ELEMENTNOTFOUND
///
ElementNotFound = unchecked((int)0x80070490),
///
/// TYPE_E_ELEMENTNOTFOUND
///
TypeElementNotFound = unchecked((int)0x8002802B),
///
/// NO_OBJECT
///
NoObject = unchecked((int)0x800401E5),
///
/// Win32 Error code: ERROR_CANCELLED
///
Win32ErrorCanceled = 1223,
///
/// ERROR_CANCELLED
///
Canceled = unchecked((int)0x800704C7),
///
/// The requested resource is in use
///
ResourceInUse = unchecked((int)0x800700AA),
///
/// The requested resources is read-only.
///
AccessDenied = unchecked((int)0x80030005)
}
[Flags]
internal enum WindowStyles
{
///
/// The window has a thin-line border.
///
Border = 0x00800000,
///
/// The window has a title bar (includes the WS_BORDER style).
///
Caption = 0x00C00000,
///
/// The window is a child window.
/// A window with this style cannot have a menu bar.
/// This style cannot be used with the WS_POPUP style.
///
Child = 0x40000000,
///
/// Same as the WS_CHILD style.
///
ChildWindow = 0x40000000,
///
/// Excludes the area occupied by child windows when drawing occurs within the parent window.
/// This style is used when creating the parent window.
///
ClipChildren = 0x02000000,
///
/// Clips child windows relative to each other;
/// that is, when a particular child window receives a WM_PAINT message,
/// the WS_CLIPSIBLINGS style clips all other overlapping child windows out of the region of the child window to be updated.
/// If WS_CLIPSIBLINGS is not specified and child windows overlap, it is possible,
/// when drawing within the client area of a child window, to draw within the client area of a neighboring child window.
///
ClipSiblings = 0x04000000,
///
/// The window is initially disabled. A disabled window cannot receive input from the user.
/// To change this after a window has been created, use the EnableWindow function.
///
Disabled = 0x08000000,
///
/// The window has a border of a style typically used with dialog boxes.
/// A window with this style cannot have a title bar.
///
DialogFrame = 0x0040000,
///
/// The window is the first control of a group of controls.
/// The group consists of this first control and all controls defined after it, up to the next control with the WS_GROUP style.
/// The first control in each group usually has the WS_TABSTOP style so that the user can move from group to group.
/// The user can subsequently change the keyboard focus from one control in the group to the next control
/// in the group by using the direction keys.
///
/// You can turn this style on and off to change dialog box navigation.
/// To change this style after a window has been created, use the SetWindowLong function.
///
Group = 0x00020000,
///
/// The window has a horizontal scroll bar.
///
HorizontalScroll = 0x00100000,
///
/// The window is initially minimized.
/// Same as the WS_MINIMIZE style.
///
Iconic = 0x20000000,
///
/// The window is initially maximized.
///
Maximize = 0x01000000,
///
/// The window has a maximize button.
/// Cannot be combined with the WS_EX_CONTEXTHELP style.
/// The WS_SYSMENU style must also be specifie
///
MaximizeBox = 0x00010000,
///
/// The window is initially minimized.
/// Same as the WS_ICONIC style.
///
Minimize = 0x20000000,
///
/// The window has a minimize button.
/// Cannot be combined with the WS_EX_CONTEXTHELP style.
/// The WS_SYSMENU style must also be specified.
///
MinimizeBox = 0x00020000,
///
/// The window is an overlapped window.
/// An overlapped window has a title bar and a border.
/// Same as the WS_TILED style.
///
Overlapped = 0x00000000,
///
/// The windows is a pop-up window.
/// This style cannot be used with the WS_CHILD style.
///
Popup = unchecked((int)0x80000000),
///
/// The window has a sizing border.
/// Same as the WS_THICKFRAME style.
///
SizeBox = 0x00040000,
///
/// The window has a window menu on its title bar.
/// The WS_CAPTION style must also be specified.
///
SystemMenu = 0x00080000,
///
/// The window is a control that can receive the keyboard focus when the user presses the TAB key.
/// Pressing the TAB key changes the keyboard focus to the next control with the WS_TABSTOP style.
///
/// You can turn this style on and off to change dialog box navigation.
/// To change this style after a window has been created, use the SetWindowLong function.
/// For user-created windows and modeless dialogs to work with tab stops,
/// alter the message loop to call the IsDialogMessage function.
///
Tabstop = 0x00010000,
///
/// The window has a sizing border.
/// Same as the WS_SIZEBOX style.
///
ThickFrame = 0x00040000,
///
/// The window is an overlapped window.
/// An overlapped window has a title bar and a border.
/// Same as the WS_OVERLAPPED style.
///
Tiled = 0x00000000,
///
/// The window is initially visible.
///
/// This style can be turned on and off by using the ShowWindow or SetWindowPos function.
///
Visible = 0x10000000,
///
/// The window has a vertical scroll bar.
///
VerticalScroll = 0x00200000,
///
/// The window is an overlapped window.
/// Same as the WS_OVERLAPPEDWINDOW style.
///
TiledWindowMask = Overlapped | Caption | SystemMenu | ThickFrame | MinimizeBox | MaximizeBox,
///
/// The window is a pop-up window.
/// The WS_CAPTION and WS_POPUPWINDOW styles must be combined to make the window menu visible.
///
PopupWindowMask = Popup | Border | SystemMenu,
///
/// The window is an overlapped window. Same as the WS_TILEDWINDOW style.
///
OverlappedWindowMask = Overlapped | Caption | SystemMenu | ThickFrame | MinimizeBox | MaximizeBox,
}
#endif
}