#pragma warning disable IDE1006 // Naming Styles using System; using System.Runtime.InteropServices; using System.Text; using static Vanara.PInvoke.User32; namespace Vanara.PInvoke { /// Items from the Vfw32.dll public static partial class Vfw32 { /// Seek from the end. public const int MCIWND_END = -2; /// Seek from the start. public const int MCIWND_START = -1; private const string Lib_Msvfw32 = "msvfw32.dll"; /// Window messages for MCI functions. [PInvokeData("mciapi.h")] public enum MCI : uint { /// /// The MCI_OPEN command initializes a device or file. All devices recognize this command. /// To send this command, call the mciSendCommand function with the following parameters. /// /// MCIERROR mciSendCommand( MCIDEVICEID wDeviceID, MCI_OPEN, DWORD dwFlags, (DWORD) (LPMCI_OPEN_PARMS) lpOpen ); /// /// /// /// wDeviceID /// Device identifier of the MCI device that is to receive the command message. /// /// /// dwFlags /// MCI_NOTIFY or MCI_WAIT. For information about these flags, see The Wait, Notify, and Test Flags. /// /// /// lpOpen /// Pointer to an MCI_OPEN_PARMS structure. (Devices with extended command sets might replace this structure /// with a device-specific structure.) /// /// /// Return Value /// Returns zero if successful or an error otherwise. /// /// /// /// /// The following additional flags apply to all devices supporting MCI_OPEN: /// MCI_OPEN_ALIAS /// An alias is included in the lpstrAlias member of the structure identified by lpOpen. /// MCI_OPEN_SHAREABLE /// The device or file should be opened as sharable. /// MCI_OPEN_TYPE /// A device type name or constant is included in the lpstrDeviceType member of the structure identified by lpOpen. /// MCI_OPEN_TYPE_ID /// /// The low-order word of the lpstrDeviceType member of the structure identified by lpOpen contains a standard MCI device type /// identifier and the high-order word optionally contains the ordinal index for the device. Use this flag with the /// MCI_OPEN_TYPE flag. /// /// The following additional flags apply to compound devices: /// MCI_OPEN_ELEMENT /// A filename is included in the lpstrElementName member of the structure identified by lpOpen. /// MCI_OPEN_ELEMENT_ID /// /// The lpstrElementName member of the structure identified by lpOpen is interpreted as a DWORD value and has meaning internal /// to the device. Use this flag with the MCI_OPEN_ELEMENT flag. /// /// The following additional flags are used with the digitalvideo device type: /// MCI_DGV_OPEN_NOSTATIC /// /// The device should reduce the number of static (system) colors in the palette. This increases the number of colors available /// for rendering the video stream. This flag applies only to devices that share a palette with Windows. /// /// MCI_DGV_OPEN_PARENT /// The parent window handle is specified in the hWndParent member of the structure identified by lpOpen. /// MCI_DGV_OPEN_WS /// A window style is specified in the dwStyle member of the structure identified by lpOpen. /// MCI_DGV_OPEN_16BIT /// Indicates a preference for 16-bit MCI device support. /// MCI_DGV_OPEN_32BIT /// Indicates a preference for 32-bit MCI device support. /// For digital-video devices, the lpOpen parameter points to an MCI_DGV_OPEN_PARMS structure. /// The following additional flags are used with the overlay device type: /// MCI_OVLY_OPEN_PARENT /// The parent window handle is specified in the hWndParent member of the structure identified by lpOpen. /// MCI_OVLY_OPEN_WS /// /// A window style is specified in the dwStyle member of the structure identified by lpOpen. The dwStyle value specifies the /// style of the window that the driver will create and display if the application does not provide one. The style parameter /// takes an integer that defines the window style. These constants are the same as the standard window styles (such as /// WS_CHILD, WS_OVERLAPPEDWINDOW, or WS_POPUP). /// /// For video-overlay devices, the lpOpen parameter points to an MCI_OVLY_OPEN_PARMS structure. /// The following additional flag is used with the waveaudio device type: /// MCI_WAVE_OPEN_BUFFER /// A buffer length is specified in the dwBufferSeconds member of the structure identified by lpOpen. /// /// For waveform-audio devices, the lpOpen parameter points to an MCI_WAVE_OPEN_PARMS structure. The MCIWAVE driver requires an /// asynchronous waveform-audio device. /// /// MCI_OPEN = 0x0803, /// MCI_CLOSE = 0x0804, /// MCI_PLAY = 0x0806, /// MCI_SEEK = 0x0807, /// MCI_STOP = 0x0808, /// MCI_PAUSE = 0x0809, /// MCI_STEP = 0x080E, /// MCI_RECORD = 0x080F, /// MCI_SAVE = 0x0813, /// MCI_CUT = 0x0851, /// MCI_COPY = 0x0852, /// MCI_PASTE = 0x0853, /// MCI_RESUME = 0x0855, /// MCI_DELETE = 0x0856, } /// The MCI constant defining the time format. [PInvokeData("mciapi.h")] public enum MCI_FORMAT { /// Milliseconds MCI_FORMAT_MILLISECONDS = 0, /// Hours, minutes, seconds MCI_FORMAT_HMS = 1, /// Minutes, seconds, frames MCI_FORMAT_MSF = 2, /// Frames MCI_FORMAT_FRAMES = 3, /// SMPTE 24 MCI_FORMAT_SMPTE_24 = 4, /// SMPTE 25 MCI_FORMAT_SMPTE_25 = 5, /// SMPTE 30 drop MCI_FORMAT_SMPTE_30 = 6, /// SMPTE 30 non-drop MCI_FORMAT_SMPTE_30DROP = 7, /// Bytes MCI_FORMAT_BYTES = 8, /// Samples MCI_FORMAT_SAMPLES = 9, /// Tracks, minutes, seconds, frames MCI_FORMAT_TMSF = 10, } /// An integer corresponding to the MCI constant defining the mode. [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetMode")] public enum MCI_MODE { /// Not ready MCI_MODE_NOT_READY = 524, /// Stopped MCI_MODE_STOP = 525, /// Playing MCI_MODE_PLAY = 526, /// Recording MCI_MODE_RECORD = 527, /// Seeking MCI_MODE_SEEK = 528, /// Paused MCI_MODE_PAUSE = 529, /// Open MCI_MODE_OPEN = 530, } /// Window messages for MCI functions. [PInvokeData("vfw.h")] public enum MCIMessage : uint { /// MCIWNDM_GETDEVICEID = WM_USER + 100, /// MCIWNDM_GETSTART = WM_USER + 103, /// MCIWNDM_GETLENGTH = WM_USER + 104, /// MCIWNDM_GETEND = WM_USER + 105, /// MCIWNDM_EJECT = WM_USER + 107, /// MCIWNDM_SETZOOM = WM_USER + 108, /// MCIWNDM_GETZOOM = WM_USER + 109, /// MCIWNDM_SETVOLUME = WM_USER + 110, /// MCIWNDM_GETVOLUME = WM_USER + 111, /// MCIWNDM_SETSPEED = WM_USER + 112, /// MCIWNDM_GETSPEED = WM_USER + 113, /// MCIWNDM_SETREPEAT = WM_USER + 114, /// MCIWNDM_GETREPEAT = WM_USER + 115, /// MCIWNDM_REALIZE = WM_USER + 118, /// MCIWNDM_VALIDATEMEDIA = WM_USER + 121, /// MCIWNDM_PLAYFROM = WM_USER + 122, /// MCIWNDM_PLAYTO = WM_USER + 123, /// MCIWNDM_GETPALETTE = WM_USER + 126, /// MCIWNDM_SETPALETTE = WM_USER + 127, /// MCIWNDM_SETTIMERS = WM_USER + 129, /// MCIWNDM_SETACTIVETIMER = WM_USER + 130, /// MCIWNDM_SETINACTIVETIMER = WM_USER + 131, /// MCIWNDM_GETACTIVETIMER = WM_USER + 132, /// MCIWNDM_GETINACTIVETIMER = WM_USER + 133, /// MCIWNDM_CHANGESTYLES = WM_USER + 135, /// MCIWNDM_GETSTYLES = WM_USER + 136, /// MCIWNDM_GETALIAS = WM_USER + 137, /// MCIWNDM_PLAYREVERSE = WM_USER + 139, /// MCIWNDM_GET_SOURCE = WM_USER + 140, /// MCIWNDM_PUT_SOURCE = WM_USER + 141, /// MCIWNDM_GET_DEST = WM_USER + 142, /// MCIWNDM_PUT_DEST = WM_USER + 143, /// MCIWNDM_CAN_PLAY = WM_USER + 144, /// MCIWNDM_CAN_WINDOW = WM_USER + 145, /// MCIWNDM_CAN_RECORD = WM_USER + 146, /// MCIWNDM_CAN_SAVE = WM_USER + 147, /// MCIWNDM_CAN_EJECT = WM_USER + 148, /// MCIWNDM_CAN_CONFIG = WM_USER + 149, /// MCIWNDM_PALETTEKICK = WM_USER + 150, /// MCIWNDM_OPENINTERFACE = WM_USER + 151, /// MCIWNDM_SETOWNER = WM_USER + 152, //define both A and W messages /// MCIWNDM_SENDSTRINGA = WM_USER + 101, /// MCIWNDM_GETPOSITIONA = WM_USER + 102, /// MCIWNDM_GETMODEA = WM_USER + 106, /// MCIWNDM_SETTIMEFORMATA = WM_USER + 119, /// MCIWNDM_GETTIMEFORMATA = WM_USER + 120, /// MCIWNDM_GETFILENAMEA = WM_USER + 124, /// MCIWNDM_GETDEVICEA = WM_USER + 125, /// MCIWNDM_GETERRORA = WM_USER + 128, /// MCIWNDM_NEWA = WM_USER + 134, /// MCIWNDM_RETURNSTRINGA = WM_USER + 138, /// MCIWNDM_OPENA = WM_USER + 153, /// MCIWNDM_SENDSTRINGW = WM_USER + 201, /// MCIWNDM_GETPOSITIONW = WM_USER + 202, /// MCIWNDM_GETMODEW = WM_USER + 206, /// MCIWNDM_SETTIMEFORMATW = WM_USER + 219, /// MCIWNDM_GETTIMEFORMATW = WM_USER + 220, /// MCIWNDM_GETFILENAMEW = WM_USER + 224, /// MCIWNDM_GETDEVICEW = WM_USER + 225, /// MCIWNDM_GETERRORW = WM_USER + 228, /// MCIWNDM_NEWW = WM_USER + 234, /// MCIWNDM_RETURNSTRINGW = WM_USER + 238, /// map defaults to A or W depending on app's UNICODE setting MCIWNDM_OPENW = WM_USER + 252, /// MCIWNDM_SENDSTRING = MCIWNDM_SENDSTRINGW, /// MCIWNDM_GETPOSITION = MCIWNDM_GETPOSITIONW, /// MCIWNDM_GETMODE = MCIWNDM_GETMODEW, /// MCIWNDM_SETTIMEFORMAT = MCIWNDM_SETTIMEFORMATW, /// MCIWNDM_GETTIMEFORMAT = MCIWNDM_GETTIMEFORMATW, /// MCIWNDM_GETFILENAME = MCIWNDM_GETFILENAMEW, /// MCIWNDM_GETDEVICE = MCIWNDM_GETDEVICEW, /// MCIWNDM_GETERROR = MCIWNDM_GETERRORW, /// MCIWNDM_NEW = MCIWNDM_NEWW, /// MCIWNDM_RETURNSTRING = MCIWNDM_RETURNSTRINGW, /// MCIWNDM_OPEN = MCIWNDM_OPENW, } /// /// Flags defining the window style. In addition to specifying the window styles used with the function, you can specify the following styles to use with MCIWnd windows. /// [Flags] public enum MCIWNDF : uint { /// Will not change the dimensions of an MCIWnd window when the image size changes. MCIWNDF_NOAUTOSIZEWINDOW = 0x0001, /// Hides the toolbar from view and prohibits users from accessing it. MCIWNDF_NOPLAYBAR = 0x0002, /// Will not change the dimensions of the destination rectangle when an MCIWnd window size changes. MCIWNDF_NOAUTOSIZEMOVIE = 0x0004, /// Hides the Menu button from view on the toolbar and prohibits users from accessing its pop-up menu. MCIWNDF_NOMENU = 0x0008, /// Displays the name of the open MCI device or data file in the MCIWnd window title bar. MCIWNDF_SHOWNAME = 0x0010, /// Displays the current position within the content of the MCI device in the window title bar. MCIWNDF_SHOWPOS = 0x0020, /// /// Displays the current mode of the MCI device in the window title bar. For a list of device modes, see the MCIWndGetMode macro. /// MCIWNDF_SHOWMODE = 0x0040, /// Causes all MCIWNDF_SHOW styles to be used. MCIWNDF_SHOWALL = 0x0070, /// /// Causes MCIWnd to notify the parent window with an MCIMessage.MCIWNDM_NOTIFYMODE message whenever the device changes /// operating modes. The lParam parameter of this message identifies the new mode, such as MCI_MODE_STOP. /// MCIWNDF_NOTIFYMODE = 0x0100, /// /// Causes MCIWnd to notify the parent window with an MCIMessage.MCIWNDM_NOTIFYPOS message whenever a change in the playback or /// record position within the content occurs. The lParam parameter of this message contains the new position in the content. /// MCIWNDF_NOTIFYPOS = 0x0200, /// Causes MCIWnd to notify the parent window when the MCIWnd window size changes. MCIWNDF_NOTIFYSIZE = 0x0400, /// Causes MCIWnd to notify the parent window when an MCI error occurs. MCIWNDF_NOTIFYERROR = 0x1000, /// Causes all MCIWNDF window notification styles to be used. MCIWNDF_NOTIFYALL = 0x1F00, /// /// Causes MCIWnd to use an ANSI string instead of a Unicode string when notifying the parent window of device mode changes. /// This flag is used in combination with MCIWNDF_NOTIFYMODE. /// MCIWNDF_NOTIFYANSI = 0x0080, /// /// Causes MCIWnd to notify the parent window with an MCIMessage.MCIWNDM_NOTIFYMEDIA message whenever a new device is used or a /// data file is opened or closed. The lParam parameter of this message contains a pointer to the new file name. /// MCIWNDF_NOTIFYMEDIAA = 0x0880, /// /// Causes MCIWnd to notify the parent window with an MCIMessage.MCIWNDM_NOTIFYMEDIA message whenever a new device is used or a /// data file is opened or closed. The lParam parameter of this message contains a pointer to the new file name. /// MCIWNDF_NOTIFYMEDIAW = 0x0800, /// /// Causes MCIWnd to notify the parent window with an MCIMessage.MCIWNDM_NOTIFYMEDIA message whenever a new device is used or a /// data file is opened or closed. The lParam parameter of this message contains a pointer to the new file name. /// MCIWNDF_NOTIFYMEDIA = MCIWNDF_NOTIFYMEDIAW, /// /// Adds a Record button to the toolbar and adds a new file command to the menu if the MCI device has recording capability. /// MCIWNDF_RECORD = 0x2000, /// Inhibits display of MCI errors to users. MCIWNDF_NOERRORDLG = 0x4000, /// /// Hides the open and close commands from the MCIWnd menu and prohibits users from accessing these choices in the pop-up menu. /// MCIWNDF_NOOPEN = 0x8000, } /// Flags associated with the device or file to open. [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndOpen")] [Flags] public enum MCIWNDOPENF { /// Specifies a new file is to be created with the name specified in szFile. MCIWNDOPENF_NEW = 0x0001 } /// /// The MCIWndCanConfig macro determines if an MCI device can display a configuration dialog box. You can use this macro or /// explicitly send the MCIWNDM_CAN_CONFIG message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndcanconfig void MCIWndCanConfig( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndCanConfig")] public static bool MCIWndCanConfig(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_CAN_CONFIG) != 0; /// /// The MCIWndCanEject macro determines if an MCI device can eject its media. You can use this macro or explicitly send the /// MCIWNDM_CAN_EJECT message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndcaneject void MCIWndCanEject( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndCanEject")] public static bool MCIWndCanEject(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_CAN_EJECT) != 0; /// /// The MCIWndCanPlay macro determines if an MCI device can play a data file or content of some other kind. You can use this /// macro or explicitly send the MCIWNDM_CAN_PLAY message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndcanplay void MCIWndCanPlay( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndCanPlay")] public static bool MCIWndCanPlay(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_CAN_PLAY) != 0; /// /// The MCIWndCanRecord macro determines if an MCI device supports recording. You can use this macro or explicitly send the /// MCIWNDM_CAN_RECORD message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndcanrecord void MCIWndCanRecord( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndCanRecord")] public static bool MCIWndCanRecord(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_CAN_RECORD) != 0; /// /// The MCIWndCanSave macro determines if an MCI device can save data. You can use this macro or explicitly send the /// MCIWNDM_CAN_SAVE message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndcansave void MCIWndCanSave( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndCanSave")] public static bool MCIWndCanSave(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_CAN_SAVE) != 0; /// /// The MCIWndCanWindow macro determines if an MCI device supports window-oriented MCI commands. You can use this macro or /// explicitly send the MCIWNDM_CAN_WINDOW message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndcanwindow void MCIWndCanWindow( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndCanWindow")] public static bool MCIWndCanWindow(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_CAN_WINDOW) != 0; /// /// The MCIWndChangeStyles macro changes the styles used by the MCIWnd window. You can use this macro or explicitly send the /// MCIWNDM_CHANGESTYLES message. /// /// Handle of the MCIWnd window. /// /// Mask that identifies the styles that can change. This mask is the bitwise OR operator of all styles that will be permitted to change. /// /// /// New style settings for the window. Specify zero for this parameter to turn off all styles identified in the mask. For a list of /// the available styles, see the MCIWndCreate function. /// /// None /// For an example of using MCIWndChangeStyles, see Pausing and Resuming Playback. // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndchangestyles void MCIWndChangeStyles( hwnd, mask, value ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndChangeStyles")] public static int MCIWndChangeStyles(HWND hwnd, MCIWNDF mask, [Optional] int value) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_CHANGESTYLES, unchecked((int)mask), value); /// /// The MCIWndClose macro closes an MCI device or file associated with an MCIWnd window. Although the MCI device closes, the /// MCIWnd window is still open and can be associated with another MCI device. You can use this macro or explicitly send the /// MCI_CLOSE command. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndclose void MCIWndClose( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndClose")] public static int MCIWndClose(HWND hwnd) => MCIWndSM(hwnd, MCI.MCI_CLOSE); /// /// The MCIWndCreate function registers the MCIWnd window class and creates an MCIWnd window for using MCI services. /// MCIWndCreate can also open an MCI device or file (such as an AVI file) and associate it with the MCIWnd window. /// /// Handle to the parent window. /// Handle to the module instance to associate with the MCIWnd window. /// /// /// Flags defining the window style. In addition to specifying the window styles used with the CreateWindowEx function, you can /// specify the following styles to use with MCIWnd windows. /// /// /// /// Value /// Meaning /// /// /// MCIWNDF_NOAUTOSIZEWINDOW /// Will not change the dimensions of an MCIWnd window when the image size changes. /// /// /// MCIWNDF_NOAUTOSIZEMOVIE /// Will not change the dimensions of the destination rectangle when an MCIWnd window size changes. /// /// /// MCIWNDF_NOERRORDLG /// Inhibits display of MCI errors to users. /// /// /// MCIWNDF_NOMENU /// Hides the Menu button from view on the toolbar and prohibits users from accessing its pop-up menu. /// /// /// MCIWNDF_NOOPEN /// /// Hides the open and close commands from the MCIWnd menu and prohibits users from accessing these choices in the pop-up menu. /// /// /// /// MCIWNDF_NOPLAYBAR /// Hides the toolbar from view and prohibits users from accessing it. /// /// /// MCIWNDF_NOTIFYANSI /// /// Causes MCIWnd to use an ANSI string instead of a Unicode string when notifying the parent window of device mode changes. This /// flag is used in combination with MCIWNDF_NOTIFYMODE. /// /// /// /// MCIWNDF_NOTIFYMODE /// /// Causes MCIWnd to notify the parent window with an MCIMessage.MCIWNDM_NOTIFYMODE message whenever the device changes operating /// modes. The lParam parameter of this message identifies the new mode, such as MCI_MODE_STOP. /// /// /// /// MCIWNDF_NOTIFYPOS /// /// Causes MCIWnd to notify the parent window with an MCIMessage.MCIWNDM_NOTIFYPOS message whenever a change in the playback or /// record position within the content occurs. The lParam parameter of this message contains the new position in the content. /// /// /// /// MCIWNDF_NOTIFYMEDIA /// /// Causes MCIWnd to notify the parent window with an MCIMessage.MCIWNDM_NOTIFYMEDIA message whenever a new device is used or a data /// file is opened or closed. The lParam parameter of this message contains a pointer to the new file name. /// /// /// /// MCIWNDF_NOTIFYSIZE /// Causes MCIWnd to notify the parent window when the MCIWnd window size changes. /// /// /// MCIWNDF_NOTIFYERROR /// Causes MCIWnd to notify the parent window when an MCI error occurs. /// /// /// MCIWNDF_NOTIFYALL /// Causes all MCIWNDF window notification styles to be used. /// /// /// MCIWNDF_RECORD /// Adds a Record button to the toolbar and adds a new file command to the menu if the MCI device has recording capability. /// /// /// MCIWNDF_SHOWALL /// Causes all MCIWNDF_SHOW styles to be used. /// /// /// MCIWNDF_SHOWMODE /// /// Displays the current mode of the MCI device in the window title bar. For a list of device modes, see the MCIWndGetMode macro. /// /// /// /// MCIWNDF_SHOWNAME /// Displays the name of the open MCI device or data file in the MCIWnd window title bar. /// /// /// MCIWNDF_SHOWPOS /// Displays the current position within the content of the MCI device in the window title bar. /// /// /// /// Null-terminated string indicating the name of an MCI device or data file to open. /// Returns the handle to an MCI window if successful or zero otherwise. /// /// /// Default window styles for a child window are WS_CHILD, WS_BORDER, and WS_VISIBLE. MCIWndCreate assumes a child window /// when a non- NULL handle of a parent window is specified. /// /// /// Default window styles for a parent window are WS_OVERLAPPEDWINDOW and WS_VISIBLE. MCIWndCreate assumes a parent window /// when a NULL handle of a parent window is specified. /// /// /// Use the window handle returned by this function for the window handle in the MCIWnd macros. If your application uses this /// function, it does not need to use the MCIWndRegisterClass function. /// /// /// Note /// /// The vfw.h header defines MCIWndCreate as an alias which automatically selects the ANSI or Unicode version of this function based /// on the definition of the UNICODE preprocessor constant. Mixing usage of the encoding-neutral alias with code that not /// encoding-neutral can lead to mismatches that result in compilation or runtime errors. For more information, see Conventions for /// Function Prototypes. /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndcreatea HWND VFWAPIV MCIWndCreateA( HWND hwndParent, // HINSTANCE hInstance, DWORD dwStyle, LPCSTR szFile ); [DllImport(Lib_Msvfw32, SetLastError = false, CharSet = CharSet.Auto)] [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndCreateA")] public static extern HWND MCIWndCreate([In, Optional] HWND hwndParent, [In, Optional] HINSTANCE hInstance, MCIWNDF dwStyle, [In, Optional, MarshalAs(UnmanagedType.LPTStr)] string szFile); /// /// The MCIWndDestroy macro closes an MCI device or file associated with an MCIWnd window and destroys the window. You can /// use this macro or explicitly send the WM_CLOSE message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwnddestroy void MCIWndDestroy( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndDestroy")] public static void MCIWndDestroy(HWND hwnd) => MCIWndSM(hwnd, WindowMessage.WM_CLOSE); /// /// The MCIWndEject macro sends a command to an MCI device to eject its media. You can use this macro or explicitly send the /// MCIWNDM_EJECT message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndeject void MCIWndEject( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndEject")] public static int MCIWndEject(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_EJECT); /// /// The MCIWndEnd macro moves the current position to the end of the content. You can use this macro or explicitly send the /// MCI_SEEK message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndend void MCIWndEnd( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndEnd")] public static int MCIWndEnd(HWND hwnd) => MCIWndSeek(hwnd, MCIWND_END); /// /// The MCIWndGetActiveTimer macro retrieves the update period used when the MCIWnd window is the active window. You can use /// this macro or explicitly send the MCIWNDM_GETACTIVETIMER message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetactivetimer void MCIWndGetActiveTimer( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetActiveTimer")] public static uint MCIWndGetActiveTimer(HWND hwnd) => unchecked((uint)MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETACTIVETIMER)); /// /// The MCIWndGetAlias macro retrieves the alias used to open an MCI device or file with the mciSendString function. You can /// use this macro or explicitly send the MCIWNDM_GETALIAS message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetalias void MCIWndGetAlias( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetAlias")] public static uint MCIWndGetAlias(HWND hwnd) => unchecked((uint)MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETALIAS)); /// /// The MCIWndGetDest macro retrieves the coordinates of the destination rectangle used for zooming or stretching the images /// of an AVI file during playback. You can use this macro or explicitly send the MCIWNDM_GET_DEST message. /// /// Handle of the MCIWnd window. /// Pointer to a RECT structure to return the coordinates of the destination rectangle. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetdest void MCIWndGetDest( hwnd, prc ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetDest")] public static bool MCIWndGetDest(HWND hwnd, out RECT prc) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GET_DEST, out prc, 0) != 0; /// /// The MCIWndGetDevice macro retrieves the name of the current MCI device. You can use this macro or explicitly send the /// MCIWNDM_GETDEVICE message. /// /// Handle of the MCIWnd window. /// Pointer to an application-defined buffer to return the device name. /// None /// If the null-terminated string containing the device name is longer than the buffer, MCIWnd truncates it. // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetdevice void MCIWndGetDevice( hwnd, lp, len ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetDevice")] public static bool MCIWndGetDevice(HWND hwnd, StringBuilder lp) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETDEVICE, lp) != 0; /// /// The MCIWndGetDeviceID macro retrieves the identifier of the current MCI device to use with the mciSendCommand function. /// You can use this macro or explicitly send the MCIWNDM_GETDEVICEID message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetdeviceid void MCIWndGetDeviceID( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetDeviceID")] public static uint MCIWndGetDeviceID(HWND hwnd) => unchecked((uint)MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETDEVICEID)); /// /// The MCIWndGetEnd macro retrieves the location of the end of the content of an MCI device or file. You can use this macro /// or explicitly send the MCIWNDM_GETEND message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetend void MCIWndGetEnd( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetEnd")] public static int MCIWndGetEnd(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETEND); /// /// The MCIWndGetError macro retrieves the last MCI error encountered. You can use this macro or explicitly send the /// MCIWNDM_GETERROR message. /// /// Handle of the MCIWnd window. /// Pointer to an application-defined buffer used to return the error string. /// None /// /// If lp is a valid pointer, a null-terminated string corresponding to the error is returned in its buffer. If the error string is /// longer than the buffer, MCIWnd truncates it. /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgeterror void MCIWndGetError( hwnd, lp, len ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetError")] public static int MCIWndGetError(HWND hwnd, StringBuilder lp) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETERROR, lp); /// /// The MCIWndGetFileName macro retrieves the filename used by an MCI device. You can use this macro or explicitly send the /// MCIWNDM_GETFILENAME message. /// /// Handle of the MCIWnd window. /// Pointer to an application-defined buffer to return the filename. /// None /// If the null-terminated string containing the filename is longer than the buffer, MCIWnd truncates the filename. // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetfilename void MCIWndGetFileName( hwnd, lp, len ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetFileName")] public static int MCIWndGetFileName(HWND hwnd, StringBuilder lp) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETFILENAME, lp); /// /// The MCIWndGetInactiveTimer macro retrieves the update period used when the MCIWnd window is the inactive window. You can /// use this macro or explicitly send the MCIWNDM_GETINACTIVETIMER message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetinactivetimer void MCIWndGetInactiveTimer( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetInactiveTimer")] public static uint MCIWndGetInactiveTimer(HWND hwnd) => unchecked((uint)MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETINACTIVETIMER)); /// /// The MCIWndGetLength macro retrieves the length of the content or file currently used by an MCI device. You can use this /// macro or explicitly send the MCIWNDM_GETLENGTH message. /// /// Handle of the MCIWnd window. /// None /// This value added to the value returned for the MCIWndGetStart macro equals the end of the content. // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetlength void MCIWndGetLength( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetLength")] public static int MCIWndGetLength(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETLENGTH); /// /// The MCIWndGetMode macro retrieves the current operating mode of an MCI device. MCI devices have several operating modes, /// which are designated by constants. You can use this macro or explicitly send the MCIWNDM_GETMODE message. /// /// Handle of the MCIWnd window. /// Pointer to the application-defined buffer used to return the mode. /// None /// /// If the null-terminated string describing the mode is longer than the buffer, it is truncated. /// /// Not all devices can operate in every mode. For example, the MCIAVI device is a playback device; it doesn't support the recording /// mode. The following modes can be retrieved by using MCIWNDM_GETMODE: /// /// /// /// Operating mode /// MCI constant /// /// /// not ready /// MCI_MODE_NOT_READY /// /// /// open /// MCI_MODE_OPEN /// /// /// paused /// MCI_MODE_PAUSE /// /// /// playing /// MCI_MODE_PLAY /// /// /// recording /// MCI_MODE_RECORD /// /// /// seeking /// MCI_MODE_SEEK /// /// /// stopped /// MCI_MODE_STOP /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetmode void MCIWndGetMode( hwnd, lp, len ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetMode")] public static MCI_MODE MCIWndGetMode(HWND hwnd, StringBuilder lp) => (MCI_MODE)MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETMODE, lp); /// /// The MCIWndGetPalette macro retrieves a handle of the palette used by an MCI device. You can use this macro or explicitly /// send the MCIWNDM_GETPALETTE message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetpalette void MCIWndGetPalette( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetPalette")] public static HPALETTE MCIWndGetPalette(HWND hwnd) => SendMessage(hwnd, MCIMessage.MCIWNDM_GETPALETTE); /// /// The MCIWndGetPosition macro retrieves the numerical value of the current position within the content of the MCI device. /// You can use this macro or explicitly send the MCIWNDM_GETPOSITION message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetposition void MCIWndGetPosition( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetPosition")] public static int MCIWndGetPosition(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETPOSITION); /// /// The MCIWndGetPositionString macro retrieves the numerical value of the current position within the content of the MCI /// device. This macro also provides the current position in string form in an application-defined buffer. You can use this macro or /// explicitly send the MCIWNDM_GETPOSITION message. /// /// Handle of the MCIWnd window. /// /// Pointer to an application-defined buffer used to return the position. Use zero to inhibit retrieval of the position as a string. /// If the device supports tracks, the string position information is returned in the form TT:MM:SS:FF where TT corresponds to /// tracks, MM and SS correspond to minutes and seconds, and FF corresponds to frames. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetpositionstring void MCIWndGetPositionString( hwnd, lp, len ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetPositionString")] public static int MCIWndGetPositionString(HWND hwnd, StringBuilder lp) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETPOSITION, lp); /// /// The MCIWndGetRepeat macro determines if continuous playback has been activated. You can use this macro or explicitly send /// the MCIWNDM_GETREPEAT message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetrepeat void MCIWndGetRepeat( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetRepeat")] public static bool MCIWndGetRepeat(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETREPEAT) != 0; /// /// The MCIWndGetSource macro retrieves the coordinates of the source rectangle used for cropping the images of an AVI file /// during playback. You can use this macro or explicitly send the MCIWNDM_GET_SOURCE message. /// /// Handle of the MCIWnd window. /// Pointer to a RECT structure to contain the coordinates of the source rectangle. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetsource void MCIWndGetSource( hwnd, prc ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetSource")] public static bool MCIWndGetSource(HWND hwnd, out RECT prc) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GET_SOURCE, out prc, 0) != 0; /// /// The MCIWndGetSpeed macro retrieves the playback speed of an MCI device. You can use this macro or explicitly send the /// MCIWNDM_GETSPEED message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetspeed void MCIWndGetSpeed( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetSpeed")] public static int MCIWndGetSpeed(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETSPEED); /// /// The MCIWndGetStart macro retrieves the location of the beginning of the content of an MCI device or file. You can use /// this macro or explicitly send the MCIWNDM_GETSTART message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetstart void MCIWndGetStart( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetStart")] public static int MCIWndGetStart(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETSTART); /// /// The MCIWndGetStyles macro retrieves the flags specifying the current MCIWnd window styles used by a window. You can use /// this macro or explicitly send the MCIWNDM_GETSTYLES message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetstyles void MCIWndGetStyles( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetStyles")] public static MCIWNDF MCIWndGetStyles(HWND hwnd) => unchecked((MCIWNDF)MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETSTYLES)); /// /// The MCIWndGetTimeFormat macro retrieves the current time format of an MCI device in two forms: as a numerical value and /// as a string. You can use this macro or explicitly send the MCIWNDM_GETTIMEFORMAT message. /// /// Handle of the MCIWnd window. /// Pointer to a buffer to contain the null-terminated string form of the time format. /// None /// /// If the time format string is longer than the return buffer, MCIWnd truncates the string. /// An MCI device can support one or more of the following time formats: /// /// /// Time format /// MCI constant /// /// /// Bytes /// MCI_FORMAT_BYTES /// /// /// Frames /// MCI_FORMAT_FRAMES /// /// /// Hours, minutes, seconds /// MCI_FORMAT_HMS /// /// /// Milliseconds /// MCI_FORMAT_MILLISECONDS /// /// /// Minutes, seconds, frames /// MCI_FORMAT_MSF /// /// /// Samples /// MCI_FORMAT_SAMPLES /// /// /// SMPTE 24 /// MCI_FORMAT_SMPTE_24 /// /// /// SMPTE 25 /// MCI_FORMAT_SMPTE_25 /// /// /// SMPTE 30 drop /// MCI_FORMAT_SMPTE_30DROP /// /// /// SMPTE 30 (non-drop) /// MCI_FORMAT_SMPTE_30 /// /// /// Tracks, minutes, seconds, frames /// MCI_FORMAT_TMSF /// /// /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgettimeformat void MCIWndGetTimeFormat( hwnd, lp, len ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetTimeFormat")] public static MCI_FORMAT MCIWndGetTimeFormat(HWND hwnd, StringBuilder lp) => (MCI_FORMAT)MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETTIMEFORMAT, lp); /// /// The MCIWndGetVolume macro retrieves the current volume setting of an MCI device. You can use this macro or explicitly /// send the MCIWNDM_GETVOLUME message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetvolume void MCIWndGetVolume( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetVolume")] public static int MCIWndGetVolume(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETVOLUME); /// /// The MCIWndGetZoom macro retrieves the current zoom value used by an MCI device. You can use this macro or explicitly send /// the MCIWNDM_GETZOOM message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndgetzoom void MCIWndGetZoom( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndGetZoom")] public static uint MCIWndGetZoom(HWND hwnd) => unchecked((uint)MCIWndSM(hwnd, MCIMessage.MCIWNDM_GETZOOM)); /// /// The MCIWndHome macro moves the current position to the beginning of the content. You can use this macro or explicitly /// send the MCI_SEEK command. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndhome void MCIWndHome( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndHome")] public static int MCIWndHome(HWND hwnd) => MCIWndSeek(hwnd, MCIWND_START); /// /// The MCIWndNew macro creates a new file for the current MCI device. You can use this macro or explicitly send the /// MCIWNDM_NEW message. /// /// Handle of the MCIWnd window. /// Pointer to a buffer containing the name of the MCI device that will use the file. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndnew void MCIWndNew( hwnd, lp ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndNew")] public static bool MCIWndNew(HWND hwnd, string lp) => SendMessage(hwnd, MCIMessage.MCIWNDM_NEW, 0, lp) != IntPtr.Zero; /// /// The MCIWndOpen macro opens an MCI device and associates it with an MCIWnd window. For MCI devices that use data files, /// this macro can also open a specified data file, name a new file to be created, or display a dialog box to let the user select a /// file to open. You can use this macro or explicitly send the MCIWNDM_OPEN message. /// /// Handle of the MCIWnd window. /// /// Pointer to a null-terminated string identifying the filename or MCI Device Names to open. Specify ?1 for this parameter to /// display the Open dialog box. /// /// /// Flags associated with the device or file to open. The MCIWNDOPENF_NEW flag specifies a new file is to be created with the name /// specified in szFile. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndopen void MCIWndOpen( hwnd, sz, f ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndOpen")] public static int MCIWndOpen(HWND hwnd, string sz, MCIWNDOPENF f) => SendMessage(hwnd, MCIMessage.MCIWNDM_OPEN, (IntPtr)(int)f, sz).ToInt32(); /// /// The MCIWndOpenDialog macro opens a user-specified data file and corresponding type of MCI device, and associates them /// with an MCIWnd window. This macro displays the Open dialog box for the user to select the data file to associate with an MCI /// window. You can use this macro or explicitly send the MCIWNDM_OPEN message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndopendialog void MCIWndOpenDialog( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndOpenDialog")] public static int MCIWndOpenDialog(HWND hwnd) => SendMessage(hwnd, MCIMessage.MCIWNDM_OPEN, (IntPtr)0, new IntPtr(-1)).ToInt32(); /// /// The MCIWndOpenInterface macro attaches the data stream or file associated with the specified interface to an MCIWnd /// window. You can use this macro or explicitly send the MCIWNDM_OPENINTERFACE message. /// /// Handle of the MCIWnd window. /// Pointer to an IAVI interface that points to a file or a data stream in a file. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndopeninterface void MCIWndOpenInterface( hwnd, pUnk ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndOpenInterface")] public static bool MCIWndOpenInterface(HWND hwnd, [In, MarshalAs(UnmanagedType.IUnknown)] object pUnk) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_OPENINTERFACE, default, Marshal.GetIUnknownForObject(pUnk)) != 0; /// Undocumented. /// Handle of the MCIWnd window. /// None [PInvokeData("vfw.h")] public static bool MCIWndPaletteKick(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_PALETTEKICK) != 0; /// The MCIWndPause macro sends a command to an MCI device to pause playing or recording. /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndpause void MCIWndPause( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndPause")] public static int MCIWndPause(HWND hwnd) => MCIWndSM(hwnd, MCI.MCI_PAUSE); /// /// The MCIWndPlay macro sends a command to an MCI device to start playing from the current position in the content. You can /// use this macro or explicitly send the MCI_PLAY command. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndplay void MCIWndPlay( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndPlay")] public static int MCIWndPlay(HWND hwnd) => MCIWndSM(hwnd, MCI.MCI_PLAY); /// /// The MCIWndPlayFrom macro plays the content of an MCI device from the specified location to the end of the content or /// until another command stops playback. You can use this macro or explicitly send the MCIWNDM_PLAYFROM message. /// /// Handle of the MCIWnd window. /// Starting location. The units for the starting location depend on the current time format. /// None /// You can also specify both a starting and ending location for playback by using the MCIWndPlayFromTo macro. // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndplayfrom void MCIWndPlayFrom( hwnd, lPos ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndPlayFrom")] public static int MCIWndPlayFrom(HWND hwnd, int lPos) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_PLAYFROM, 0, lPos); /// /// The MCIWndPlayFromTo macro plays a portion of content between specified starting and ending locations. This macro seeks /// to the specified point to begin playback, then plays the content to the specified ending location. This macro is defined using /// the MCIWndSeek and MCIWndPlayTo macros, which in turn use the MCI_SEEK command and the MCIWNDM_PLAYTO message. /// /// Handle of the MCIWnd window. /// Position to seek; it is also the starting location. /// Ending location. /// None /// The units for the seek position depend on the current time format. // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndplayfromto void MCIWndPlayFromTo( hwnd, lStart, lEnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndPlayFromTo")] public static int MCIWndPlayFromTo(HWND hwnd, int lStart, int lEnd) { MCIWndSeek(hwnd, lStart); return MCIWndPlayTo(hwnd, lEnd); } /// /// The MCIWndPlayReverse macro plays the current content in the reverse direction, beginning at the current position and /// ending at the beginning of the content or until another command stops playback. You can use this macro or explicitly send the /// MCIWNDM_PLAYREVERSE message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndplayreverse void MCIWndPlayReverse( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndPlayReverse")] public static int MCIWndPlayReverse(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_PLAYREVERSE); /// /// The MCIWndPlayTo macro plays the content of an MCI device from the current position to the specified ending location or /// until another command stops playback. If the specified ending location is beyond the end of the content, playback stops at the /// end of the content. You can use this macro or explicitly send the MCIWNDM_PLAYTO message. /// /// Handle of the MCIWnd window. /// Ending location. The units for the ending location depend on the current time format. /// None /// You can also specify both a starting and ending location for playback by using the MCIWndPlayFromTo macro. // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndplayto void MCIWndPlayTo( hwnd, lPos ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndPlayTo")] public static int MCIWndPlayTo(HWND hwnd, int lPos) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_PLAYTO, 0, lPos); /// /// The MCIWndPutDest macro redefines the coordinates of the destination rectangle used for zooming or stretching the images /// of an AVI file during playback. You can use this macro or explicitly send the MCIWNDM_PUT_DEST message. /// /// Handle of the MCIWnd window. /// Pointer to a RECT structure containing the coordinates of the destination rectangle. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndputdest void MCIWndPutDest( hwnd, prc ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndPutDest")] public static int MCIWndPutDest(HWND hwnd, in RECT prc) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_PUT_DEST, 0, prc); /// /// The MCIWndPutSource macro redefines the coordinates of the source rectangle used for cropping the images of an AVI file /// during playback. You can use this macro or explicitly send the MCIWNDM_PUT_SOURCE message. /// /// Handle of the MCIWnd window. /// Pointer to a RECT structure containing the coordinates of the source rectangle. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndputsource void MCIWndPutSource( hwnd, prc ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndPutSource")] public static int MCIWndPutSource(HWND hwnd, in RECT prc) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_PUT_SOURCE, 0, prc); /// /// The MCIWndRealize macro controls how an MCI window realized in the foreground or background. This macro also causes the /// palette for the MCI window to be realized in the process. You can use this macro or explicitly send the MCIWNDM_REALIZE message. /// /// Handle of the MCIWnd window. /// /// Background flag. Specify TRUE for this parameter for the window to be realized in the background or FALSE if the /// window can be realized in the foreground. /// /// None /// /// /// A common use for MCIWndRealize is to coordinate palette ownership between an MCI control and the application that /// contains it. The application can have the MCI window realize in the background and realize its own palette in the foreground. /// /// /// If your application contains an MCI control, but does not need to realize its palette, you can use this macro to handle the /// WM_PALETTECHANGED and WM_QUERYNEWPALETTE messages, instead of using RealizePalette. However, it is usually easier to call /// the SendMessage function to forward the message to the MCIWnd window, which will automatically realize the palette. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndrealize void MCIWndRealize( hwnd, fBkgnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndRealize")] public static int MCIWndRealize(HWND hwnd, bool fBkgnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_REALIZE, fBkgnd ? 1 : 0, 0); /// /// The MCIWndRecord macro begins recording content using the MCI device. The recording process begins at the current /// position in the content and will overwrite existing data for the duration of the recording. /// /// Handle of the MCIWnd window. /// None /// /// The function that an MCI device performs during recording depends on the characteristics of the device. An MCI device that uses /// files, such as a waveform-audio device, sends data to the file during recording. An MCI device that does not use files, such as /// a video-cassette recorder, receives and externally records data on another medium. /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndrecord void MCIWndRecord( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndRecord")] public static int MCIWndRecord(HWND hwnd) => MCIWndSM(hwnd, MCI.MCI_RECORD); /// The MCIWndRegisterClass function registers the MCI window class MCIWND_WINDOW_CLASS. /// Returns zero if successful. /// /// After registering the MCI window class, use the CreateWindow or CreateWindowEx functions to create an MCIWnd /// window. If your application uses this function, it does not need to use the MCIWndCreate function. /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndregisterclass BOOL VFWAPIV MCIWndRegisterClass(); [DllImport(Lib_Msvfw32, SetLastError = false, ExactSpelling = true)] [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndRegisterClass")] [return: MarshalAs(UnmanagedType.Bool)] public static extern bool MCIWndRegisterClass(); /// /// The MCIWndResume macro resumes playback or recording content from the paused mode. This macro restarts playback or /// recording from the current position in the content. You can use this macro or explicitly send the MCI_RESUME command. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndresume void MCIWndResume( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndResume")] public static int MCIWndResume(HWND hwnd) => MCIWndSM(hwnd, MCI.MCI_RESUME); /// /// The MCIWndReturnString macro retrieves the reply to the most recent MCI string command sent to an MCI device. Information /// in the reply is supplied as a null-terminated string. You can use this macro or explicitly send the MCIWNDM_RETURNSTRING message. /// /// Handle of the MCIWnd window. /// Pointer to an application-defined buffer to contain the null-terminated string. /// None /// If the null-terminated string is longer than the buffer, the string is truncated. // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndreturnstring void MCIWndReturnString( hwnd, lp, len ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndReturnString")] public static int MCIWndReturnString(HWND hwnd, StringBuilder lp) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_RETURNSTRING, lp); /// /// The MCIWndSave macro saves the content currently used by an MCI device. This macro can save the content to a specified /// data file or display the Save dialog box to let the user select a filename to store the content. You can use this macro or /// explicitly send the MCI_SAVE command. /// /// Handle of the MCIWnd window. /// /// Null-terminated string containing the name and path of the destination file. Specify ?1 for this parameter to display the Save /// dialog box. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsave void MCIWndSave( hwnd, szFile ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSave")] public static int MCIWndSave(HWND hwnd, string szFile) => SendMessage(hwnd, MCI.MCI_SAVE, 0, szFile).ToInt32(); /// /// The MCIWndSaveDialog macro saves the content currently used by an MCI device. This macro displays the Save dialog box to /// let the user select a filename to store the content. You can use this macro or explicitly send the MCI_SAVE command. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsavedialog void MCIWndSaveDialog( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSaveDialog")] public static int MCIWndSaveDialog(HWND hwnd) => SendMessage(hwnd, MCI.MCI_SAVE, (IntPtr)0, new IntPtr(-1)).ToInt32(); /// /// The MCIWndSave macro saves the content currently used by an MCI device. This macro can save the content to a specified /// data file or display the Save dialog box to let the user select a filename to store the content. You can use this macro or /// explicitly send the MCI_SAVE command. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsave void MCIWndSave( hwnd, szFile ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSave")] public static int MCIWndSaveWithDialog(HWND hwnd) => MCIWndSM(hwnd, MCI.MCI_SAVE, 0, -1); /// /// The MCIWndSeek macro moves the playback position to the specified location in the content. You can use this macro or /// explicitly use the MCI_SEEK command. /// /// Handle of the MCIWnd window. /// /// Position to seek. You can specify a position using the current time format, the MCIWND_START constant to designate the beginning /// of the content, or the MCIWND_END constant to designate the end of the content. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndseek void MCIWndSeek( hwnd, lPos ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSeek")] public static int MCIWndSeek(HWND hwnd, int lPos) => MCIWndSM(hwnd, MCI.MCI_SEEK, 0, lPos); /// /// The MCIWndSendString macro sends an MCI command in string form to the device associated with the MCIWnd window. You can /// use this macro or explicitly send the MCIWNDM_SENDSTRING message. /// /// Handle of the MCIWnd window. /// String command to send to the MCI device. /// None /// /// /// The message handler for MCIWndSendString (and MCIWNDM_SENDSTRING) appends a device alias to the MCI command you /// send to the device. Therefore, you should not use any alias in an MCI command that you issue with MCIWndSendString. /// /// To get the return string, which contains the result of the command, use the MCIWndReturnString macro. /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsendstring void MCIWndSendString( hwnd, sz ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSendString")] public static int MCIWndSendString(HWND hwnd, string sz) => SendMessage(hwnd, MCIMessage.MCIWNDM_SENDSTRING, IntPtr.Zero, sz).ToInt32(); /// /// The MCIWndSetActiveTimer macro sets the update period used by MCIWnd to update the trackbar in the MCIWnd window, update /// position information displayed in the window title bar, and send notification messages to the parent window when the MCIWnd /// window is active. You can use this macro or explicitly send the MCIWNDM_SETACTIVETIMER message. /// /// Handle of the MCIWnd window. /// Update period, in milliseconds. The default is 500 milliseconds. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsetactivetimer void MCIWndSetActiveTimer( hwnd, active ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetActiveTimer")] public static void MCIWndSetActiveTimer(HWND hwnd, uint active) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETACTIVETIMER, unchecked((int)active), 0); /// /// The MCIWndSetInactiveTimer macro sets the update period used by MCIWnd to update the trackbar in the MCIWnd window, /// update position information displayed in the window title bar, and send notification messages to the parent window when the /// MCIWnd window is inactive. You can use this macro or explicitly send the MCIWNDM_SETINACTIVETIMER message. /// /// Handle of the MCIWnd window. /// Update period, in milliseconds. The default is 2000 milliseconds. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsetinactivetimer void MCIWndSetInactiveTimer( hwnd, inactive ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetInactiveTimer")] public static void MCIWndSetInactiveTimer(HWND hwnd, uint inactive) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETINACTIVETIMER, unchecked((int)inactive), 0); /// /// The MCIWndSetOwner macro sets the window to receive notification messages associated with the MCIWnd window. You can use /// this macro or explicitly send the MCIWNDM_SETOWNER message. /// /// Handle of the MCIWnd window. /// Handle of the window to receive the notification messages. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsetowner void MCIWndSetOwner( hwnd, hwndP ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetOwner")] public static int MCIWndSetOwner(HWND hwnd, HWND hwndP) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETOWNER, (IntPtr)hwndP); /// /// The MCIWndSetPalette macro sends a palette handle to the MCI device associated with the MCIWnd window. You can use this /// macro or explicitly send the MCIWNDM_SETPALETTE message. /// /// Handle of the MCIWnd window. /// Palette handle. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsetpalette void MCIWndSetPalette( hwnd, hpal ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetPalette")] public static int MCIWndSetPalette(HWND hwnd, HPALETTE hpal) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETPALETTE, (IntPtr)hpal); /// /// The MCIWndSetRepeat macro sets the repeat flag associated with continuous playback. You can use this macro or explicitly /// send the MCIWNDM_SETREPEAT message. /// /// Handle of the MCIWnd window. /// New state of the repeat flag. Specify TRUE to turn on continuous playback. /// None /// /// /// The MCIWndSetRepeat macro only affects playback that the user initiates by hitting the play button on the toolbar. It /// will not affect playback started with the MCIWndPlay macro. /// /// Currently, MCIAVI is the only device that supports continuous playback. /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsetrepeat void MCIWndSetRepeat( hwnd, f ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetRepeat")] public static void MCIWndSetRepeat(HWND hwnd, bool f) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETREPEAT, 0, f ? 1 : 0); /// /// The MCIWndSetSpeed macro sets the playback speed of an MCI device. You can use this macro or explicitly send the /// MCIWNDM_SETSPEED message. /// /// Handle of the MCIWnd window. /// /// Playback speed. Specify 1000 for normal speed, larger values for faster speeds, and smaller values for slower speeds. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsetspeed void MCIWndSetSpeed( hwnd, iSpeed ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetSpeed")] public static int MCIWndSetSpeed(HWND hwnd, uint iSpeed) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETSPEED, 0, iSpeed); /// /// The MCIWndSetTimeFormat macro sets the time format of an MCI device. You can use this macro or explicitly send the /// MCIWNDM_SETTIMEFORMAT message. /// /// Handle of the MCIWnd window. /// /// Pointer to a buffer containing the null-terminated string indicating the time format. Specify "frames" to set the time format to /// frames, or "ms" to set the time format to milliseconds. /// /// None /// /// /// An application can specify time formats other than frames or milliseconds as long as the formats are supported by the MCI /// device. Noncontinuous formats, such as tracks and SMPTE, can cause the trackbar to behave erratically. For these time formats, /// you might want to turn off the toolbar by using the MCIWndChangeStyles macro and specifying the MCIWNDF_NOPLAYBAR window style. /// /// /// If you want to set the time format to frames or milliseconds, you can also use the MCIWndUseFrames or /// MCIWndUseTime macro. For a list of time formats, see the MCIWndGetTimeFormat macro. /// /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsettimeformat void MCIWndSetTimeFormat( hwnd, lp ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetTimeFormat")] public static int MCIWndSetTimeFormat(HWND hwnd, string lp) => SendMessage(hwnd, MCIMessage.MCIWNDM_SETTIMEFORMAT, 0, lp).ToInt32(); /// /// The MCIWndSetTimers macro sets the update periods used by MCIWnd to update the trackbar in the MCIWnd window, update the /// position information displayed in the window title bar, and send notification messages to the parent window. You can use this /// macro or explicitly send the MCIWNDM_SETTIMERS message. /// /// Handle of the MCIWnd window. /// /// Update period used by MCIWnd when it is the active window. The default value is 500 milliseconds. Storage for this value is /// limited to 16 bits. /// /// /// Update period used by MCIWnd when it is the inactive window. The default value is 2000 milliseconds. Storage for this value is /// limited to 16 bits. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsettimers void MCIWndSetTimers( hwnd, active, inactive ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetTimers")] public static void MCIWndSetTimers(HWND hwnd, uint active, uint inactive) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETTIMERS, unchecked((int)active), unchecked((int)inactive)); /// /// The MCIWndSetVolume macro sets the volume level of an MCI device. You can use this macro or explicitly send the /// MCIWNDM_SETVOLUME message. /// /// Handle of the MCIWnd window. /// /// New volume level. Specify 1000 for normal volume level. Specify a higher value for a louder volume or a lower value for a /// quieter volume. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsetvolume void MCIWndSetVolume( hwnd, iVol ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetVolume")] public static int MCIWndSetVolume(HWND hwnd, uint iVol) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETVOLUME, 0, iVol); /// /// The MCIWndSetZoom macro resizes a video image according to a zoom factor. This marco adjusts the size of an MCIWnd window /// while maintaining a constant aspect ratio. You can use this macro or explicitly send the MCIWNDM_SETZOOM message. /// /// Handle of the MCIWnd window. /// /// Zoom factor expressed as a percentage of the original image. Specify 100 to display the image at its authored size, 200 to /// display the image at twice its normal size, or 50 to display the image at half its normal size. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndsetzoom void MCIWndSetZoom( hwnd, iZoom ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndSetZoom")] public static void MCIWndSetZoom(HWND hwnd, uint iZoom) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_SETZOOM, 0, iZoom); /// /// The MCIWndStep macro moves the current position in the content forward or backward by a specified increment. You can use /// this macro or explicitly send the MCI_STEP command. /// /// Handle of the MCIWnd window. /// /// Step value. Negative values step the device through the content in reverse. The units for the step value depend on the current /// time format. /// /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndstep void MCIWndStep( hwnd, n ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndStep")] public static int MCIWndStep(HWND hwnd, int n) => MCIWndSM(hwnd, MCI.MCI_STEP, 0, n); /// /// The MCIWndStop macro stops playing or recording the content of the MCI device associated with the MCIWnd window. You can /// use this macro or explicitly send the MCI_STOP command. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndstop void MCIWndStop( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndStop")] public static int MCIWndStop(HWND hwnd) => MCIWndSM(hwnd, MCI.MCI_STOP); /// /// The MCIWndUseFrames macro sets the time format of an MCI device to frames. You can use this macro or explicitly send the /// MCIWNDM_SETTIMEFORMAT message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwnduseframes void MCIWndUseFrames( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndUseFrames")] public static int MCIWndUseFrames(HWND hwnd) => MCIWndSetTimeFormat(hwnd, "frames"); /// /// The MCIWndUseTime macro sets the time format of an MCI device to milliseconds. You can use this macro or explicitly send /// the MCIWNDM_SETTIMEFORMAT message. /// /// Handle of the MCIWnd window. /// None // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndusetime void MCIWndUseTime( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndUseTime")] public static int MCIWndUseTime(HWND hwnd) => MCIWndSetTimeFormat(hwnd, "ms"); /// /// The MCIWndValidateMedia macro updates the starting and ending locations of the content, the current position in the /// content, and the trackbar according to the current time format. You can use this macro or explicitly send the /// MCIWNDM_VALIDATEMEDIA message. /// /// Handle of the MCIWnd window. /// None /// /// Typically, you should not need to use this macro; however, if your application changes the time format of a device without using /// MCIWnd; the starting and ending locations of the content, as well as the trackbar, continue to use the old format. You can use /// this macro to update these values. /// // https://docs.microsoft.com/en-us/windows/win32/api/vfw/nf-vfw-mciwndvalidatemedia void MCIWndValidateMedia( hwnd ); [PInvokeData("vfw.h", MSDNShortId = "NF:vfw.MCIWndValidateMedia")] public static void MCIWndValidateMedia(HWND hwnd) => MCIWndSM(hwnd, MCIMessage.MCIWNDM_VALIDATEMEDIA); private static int MCIWndSM(HWND hwnd, TEnum msg, int wparam, int lparam) where TEnum : struct, IConvertible => SendMessage(hwnd, msg, (IntPtr)wparam, (IntPtr)lparam).ToInt32(); private static int MCIWndSM(HWND hwnd, TEnum msg, [Optional] IntPtr wparam, [Optional] IntPtr lparam) where TEnum : struct, IConvertible => SendMessage(hwnd, msg, wparam, lparam).ToInt32(); private static int MCIWndSM(HWND hwnd, TEnum msg, StringBuilder lparam) where TEnum : struct, IConvertible => SendMessage(hwnd, msg, (IntPtr)(lparam?.Capacity ?? 0), lparam).ToInt32(); private static int MCIWndSM(HWND hwnd, TEnum msg, out TLP lparam, int size = -1) where TEnum : struct, IConvertible where TLP : struct { TLP res = default; var ret = SendMessage(hwnd, msg, (IntPtr)(size == -1 ? Marshal.SizeOf(typeof(TLP)) : size), ref res).ToInt32(); lparam = res; return ret; } private static int MCIWndSM(HWND hwnd, TEnum msg, int size, in TLP lparam) where TEnum : struct, IConvertible where TLP : struct { TLP res = lparam; return SendMessage(hwnd, msg, (IntPtr)(size == -1 ? Marshal.SizeOf(typeof(TLP)) : size), ref res).ToInt32(); } } }