using System; using System.Runtime.InteropServices; using static Vanara.PInvoke.User32; namespace Vanara.PInvoke { public static partial class ComCtl32 { public enum ProgressMessage { PBM_SETRANGE = WindowMessage.WM_USER + 1, PBM_SETPOS = WindowMessage.WM_USER + 2, PBM_DELTAPOS = WindowMessage.WM_USER + 3, PBM_SETSTEP = WindowMessage.WM_USER + 4, PBM_STEPIT = WindowMessage.WM_USER + 5, PBM_SETRANGE32 = WindowMessage.WM_USER + 6, // lParam = high, wParam = low PBM_GETRANGE = WindowMessage.WM_USER + 7, // wParam = return (TRUE ? low : high). lParam = PPBRANGE or NULL PBM_GETPOS = WindowMessage.WM_USER + 8, PBM_SETBARCOLOR = WindowMessage.WM_USER + 9, // lParam = bar color PBM_SETBKCOLOR = CommonControlMessage.CCM_SETBKCOLOR, // lParam = bkColor PBM_SETMARQUEE = WindowMessage.WM_USER + 10, PBM_GETSTEP = WindowMessage.WM_USER + 13, PBM_GETBKCOLOR = WindowMessage.WM_USER + 14, PBM_GETBARCOLOR = WindowMessage.WM_USER + 15, PBM_SETSTATE = WindowMessage.WM_USER + 16, // wParam = PBST_[State] (NORMAL, ERROR, PAUSED) PBM_GETSTATE = WindowMessage.WM_USER + 17, } /// State of the progress bar used in PBM_SETSTATE and PBM_GETSTATE messages. [PInvokeData("Commctrl.h", MSDNShortId = "bb760850")] public enum ProgressState { /// In progress PBST_NORMAL = 0x0001, /// Error. PBST_ERROR = 0x0002, /// Paused. PBST_PAUSED = 0x0003, } /// The following control styles are supported by Progress Bar controls: [PInvokeData("Commctrl.h", MSDNShortId = "bb760820")] [Flags] public enum ProgressStyle { /// /// Version 4.70 or later. The progress bar displays progress status in a smooth scrolling bar instead of the default segmented /// bar. This style is supported only in the Windows Classic theme. All other themes override this style. /// PBS_SMOOTH = 0x01, /// Version 4.70 or later. The progress bar displays progress status vertically, from bottom to top. PBS_VERTICAL = 0x04, /// /// Version 6.0 or later. The progress indicator does not grow in size but instead moves repeatedly along the length of the bar, /// indicating activity without specifying what proportion of the progress is complete. Comctl32.dll version 6 /// is not redistributable but it is included in Windows or later. To use Comctl32.dll version 6, specify it in a manifest. For /// more information on manifests, see Enabling Visual Styles. /// PBS_MARQUEE = 0x08, /// /// Version 6.0 or later and Windows Vista. Determines the animation behavior that the progress bar should use when moving /// backward (from a higher value to a lower value). If this is set, then a "smooth" transition will occur, otherwise the control /// will "jump" to the lower value. /// PBS_SMOOTHREVERSE = 0x10, } /// /// Contains information about the high and low limits of a progress bar control. This structure is used with the PBM_GETRANGE message. /// [PInvokeData("Commctrl.h", MSDNShortId = "bb760822")] [StructLayout(LayoutKind.Sequential)] public struct PBRANGE { /// Low limit for the progress bar control. This is a signed integer. public int iLow; /// High limit for the progress bar control. This is a signed integer. public int iHigh; } } }