Type a page name and press Enter. You'll jump to the page if it exists, or you can create it if it doesn't.
To create a page in a module other than winmm, prefix the name with the module name and a period.
Declare Function mixerGetControlDetails Lib "winmm.dll" (<MarshalAs(UnmanagedType.I4)> ByVal hmxobj As Integer, ByRef pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails As Integer) As Integer
User-Defined Types:
C# Struct
The winmm dll may not execute properly on 64-bit systems. Consequently, the StructLayout must be Sequential, with CharSet = Ansi, and Pack = 4. This particular type has some special layout considerations (the c union keyword) which typically means developers would use the explicit layout. However, the explicit layout breaks down on 64-bit systems for any type with an IntPtr in the type. Consequently, the C# types have been redesigned to use Sequential layout so that they will automatically adjust to 64-bit systems. This means private fields with public properties which perform the gunky work of making it look like there is a union.
None.
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi, Pack = 4)]
public struct MIXERCONTROLDETAILS
{
private UInt32 cbStruct;
private UInt32 dwControlID;
private UInt32 cChannels;
private IntPtr hwndOwner;
// private UInt32 cMultipleItems; //Unioned with hwndOwner /* if _MULTIPLE, the number of items per channel */
private UInt32 cbDetails;
private IntPtr paDetails;
#region Properties
/// <summary>size in bytes of MIXERCONTROLDETAILS</summary>
public UInt32 StructSize
{
get { return this.cbStruct; }
set { this.cbStruct = value; }
}
/// <summary>control id to get/set details on</summary>
public UInt32 ControlID
{
get { return this.dwControlID; }
set { this.dwControlID = value; }
}
/// <summary>number of channels in paDetails array</summary>
public UInt32 Channels
{
get { return this.cChannels; }
set { this.cChannels = value; }
}
/// <summary>for MIXER_SETCONTROLDETAILSF_CUSTOM</summary>
public IntPtr OwnerHandle
{
get { return this.hwndOwner; }
set { this.hwndOwner = value; }
}
/// <summary>if _MULTIPLE, the number of items per channel</summary>
public UInt32 MultipleItems
{
get { return (UInt32)this.hwndOwner; }
set { this.hwndOwner = (IntPtr)value; }
}
/// <summary>size of _one_ details_XX struct</summary>
public UInt32 DetailsItemSize
{
get { return this.cbDetails; }
set { this.cbDetails = value; }
}
/// <summary>pointer to array of details_XX structs</summary>
public IntPtr DetailsPointer
{
get { return this.paDetails; }
set { this.paDetails = value; }
}
#endregion
}
Notes:
None.
Tips & Tricks:
The fdwDetailsmixer parameter can be composed constants from two distinct enumerations, one of which is used frequently in the winmm library, and the other constant is only used with this method. Consequently, you should wrap up the method definition so that it is easier to use, and more consistent. In the following example, the actual extern is private, while the public static method lists both enums to callers.
An IntPtr is a pointer to a memory location (unmanaged) that adapts to the platform it is running on (64-bit, etc.) UNLIKE a standard int/Integer. You should always use this type for unmanaged calls that require it, even though an int will appear to work on your development machine.
1/13/2008 4:00:13 AM - Damon Carr-72.43.165.29
http://mwinapi.sourceforge.net/
3/31/2008 6:53:29 AM - -217.54.254.83
Please edit this page!
Do you have...
helpful tips or sample code to share for using this API in managed code?
corrections to the existing content?
variations of the signature you want to share?
additional languages you want to include?
Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).