Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Support Forum
Download Visual Studio Add-In

Terms of Use
Privacy Policy

Search Results for "IntPtr" in [All]

dbghelp

.

static extern bool MiniDumpWriteDump(IntPtr hProcess, uint ProcessId, IntPtr hFile, int DumpType, ref MINIDUMP_EXCEPTION_INFORMATION ExceptionParam, IntPtr UserStreamParam, IntPtr CallbackParam);

.

static extern bool MiniDumpWriteDump(IntPtr hProcess, uint ProcessId, IntPtr hFile, int DumpType,

.

    ref MINIDUMP_EXCEPTION_INFORMATION ExceptionParam, IntPtr UserStreamParam, IntPtr CallbackParam);

.

static extern IntPtr GetCurrentProcess();

.

    public IntPtr ExceptionPointers;

.

    MiniDumpWithFullMemory, ref info, IntPtr.Zero, IntPtr.Zero );

winmm

.

static extern Int32 mciSendString(string command, StringBuilder buffer, int bufferSize, IntPtr hwndCallback);

.

Private Shared Function mciSendString(ByVal command As String, ByVal buffer As StringBuilder, ByVal bufferSize As Integer, ByVal hwndCallback As IntPtr) As Integer

.

Declare Ansi Function mciSendString Lib "winmm.dll" Alias "mciSendStringA" (ByVal command As String, ByRef buffer As StringBuilder, ByVal bufferSize As Integer, ByVal hWndCallback As IntPtr) As Integer

.

    IntPtr ptr = IntPtr.Zero;

.

    mciSendString("set CDAudio door open", returnstring,127, IntPtr.Zero);

.

static extern Int32 mciSendString(string command, string buffer, int bufferSize, IntPtr hwndCallback);

.

     mciSendString("set CDAudio door open", rt, 127, IntPtr.Zero);

.

     mciSendString("set CDAudio door closed", rt, 127, IntPtr.Zero);

.

     mciSendString("set CDAudio door open", returnstring, 127, IntPtr.Zero)

.

     mciSendString(sCommand, Nothing, 0, IntPtr.Zero)

.

static extern UInt32 midiConnect(IntPtr hMidi, IntPtr hMidiOut, IntPtr pReserved);

.

Declare Function midiConnect Lib "winmm.dll" (hMidi AS Intptr, hMidiOut AS Intptr, pReserved AS IntPtr) AS UInt32 ' LD83

.

UInt32 Connect(IntPtr midiInputHandle, IntPtr midiOutputHandle)

.

     return midiConnect(midiInputHandle, midiOutputHandle, IntPtr.Zero);

.

static extern UInt32 midiDisconnect(IntPtr hMidi, IntPtr hmo, IntPtr pReserved);

.

UInt32 Disconnect(IntPtr midiInputHandle, IntPtr midiOutputHandle)

.

     return midiDisconnect(midiInputHandle, midiOutputHandle, IntPtr.Zero);

.

    public IntPtr data;

.

    public IntPtr user;

.

    public IntPtr next;

.

    public IntPtr reserved;

.

    public IntPtr[] reservedArray;

.

    private static extern uint midiInClose(IntPtr hMidiIn);

.

Uses an IntPtr for the (opaque) midi handle

.

    private static extern MMRESULT midiInGetDevCaps(UIntPtr uDeviceID, ref MIDIINCAPS caps, uint cbMidiInCaps);

.

            midiInGetDevCaps((UIntPtr)x, ref caps, (uint)Marshal.SizeOf(typeof(MIDIINCAPS)));

.

static extern uint midiInOpen(out IntPtr lphMidiIn, uint uDeviceID, IntPtr dwCallback, IntPtr dwInstance, uint dwFlags);

.

    static extern uint midiInReset(IntPtr hMidiIn);

.

Passes the (opaque) midi handle as an IntPtr

.

private static extern uint midiInStart(IntPtr hMidiIn);

.

This is using an IntPtr for the (opaque) midi handle.

.

static extern UInt32 midiOutClose(IntPtr hMidiOut);

.

Declare Function midiOutClose Lib "winmm.dll" (ByRef phMidiOut As IntPtr) As Uinteger

.

public static extern MMRESULT midiOutGetDevCaps(UIntPtr uDeviceID, ref MIDIOUTCAPS lpMidiOutCaps, uint cbMidiOutCaps);

.

        midiOutGetDevCaps((UIntPtr) x, ref caps, (uint)Marshal.SizeOf(typeof(MIDIOUTCAPS)));

.

static extern UInt32 midiOutLongMsg(IntPtr hmo, IntPtr lpMidiOutHdr, UInt32 cbMidiOutHdr); // LD83

.

Declare Function midiOutLongMsg Lib "winmm.dll" (hmo AS Intptr, lpMidiOutHdr AS Intptr, cbMidiOutHdr AS UInt32) AS UInt32 ' Untested - LD83

.

    static extern uint midiOutOpen(out IntPtr lphMidiOut, uint uDeviceID, IntPtr dwCallback, IntPtr dwInstance, uint dwFlags);

.

    <DllImport("winmm.dll")> Shared Function midiOutOpen(ByRef lphMidiOut As IntPtr, ByVal uDeviceID As UInteger, ByVal dwCallback As IntPtr, ByVal dwInstance As IntPtr, ByVal dwFlags As UInteger) As UInteger

.

IntPtr hmidi;

.

midiOutOpen(out hmidi, 0, IntPtr.Zero, IntPtr.Zero, 0);

.

static extern UInt32 midiOutPrepareHeader(IntPtr hMidiOut, IntPtr lpMidiOutHdr, UInt32 cbMidiOutHdr); // LD83

.

Declare Function midiOutPrepareHeader Lib "winmm.dll" (hMidiOut AS Intptr, lpMidiOutHdr AS IntPtr, cbMidiOutHdr) AS UInt32 ' LD83

.

static extern uint midiOutReset(IntPtr hMidiOut); // LD83

.

static extern uint midiOutShortMsg(IntPtr hMidiOut, uint dwMsg);

.

Declare Function midiOutShortMsg Lib "winmm.dll" (hMidiOut As Intptr,dwMsg As UInt32) As UInt32

.

//hmidi is an IntPtr obtained via midiOutOpen or other means.

.

static extern UInt32 midiOutUnprepareHeader(IntPtr hMidiOut, IntPtr lpMidiOutHdr, UInt32 cbMidiOutHdr); // LD83

.

Declare Function midiOutUnprepareHeader Lib "winmm.dll" (hMidiOut AS Intptr, lpMidiOutHdr AS IntPtr, cbMidiOutHdr) AS UInt32 ' LD83

.

extern static Int32 midiStreamClose(IntPtr hMidiStream);

.

Public Declare Function midiStreamClose Lib "winmm.dll" (ByVal hMidiStream As IntPtr) As Integer

.

extern static Int32 midiStreamOpen(ref IntPtr hMidiStream, ref Int32 puDeviceID, Int32 cMidi, IntPtr dwCallback, IntPtr dwInstance, Int32 fdwOpen);

.

Public Declare Function midiStreamOpen Lib "winmm.dll" (ByVal hMidiStream As IntPtr, ByVal puDeviceId As IntPtr, ByVal cMidi As Integer, ByVal dwCallback As IntPtr, ByVal dwInstance As IntPtr, ByVal fdwOpen As Integer) As Integer

.

static extern Int32 midiStreamOut(IntPtr hMidiStream, MIDIHDR lpMidiHdr, uint cbMidiHdr);

.

Declare Function midiStreamOut Lib "winmm.dll" (ByVal hMidiStream As IntPtr, ByVal lpMidiHdr As MIDIHDR, ByVal cbMidiHdr As UInteger) As Integer

.

     IntPtr dwUser;

.

     IntPtr reserved;

.

     IntPtr dwReserved;

.

     Dim dwUser As IntPtr

.

     Dim reserved As IntPtr

.

     Dim dwReserved As IntPtr

.

static extern Int32 midiStreamPause(IntPtr hMidiStream);

.

Declare Function midiStreamPause Lib "winmm.dll" (ByVal hMidiStream As IntPtr) As Integer

.

Declare Function midiStreamPosition Lib "winmm.dll" (ByVal hms As IntPtr, ByVal pmmt As MMTIME, ByVal cbmmt As UInteger) As Integer

.

static extern Int32 midiStreamRestart(IntPtr hMidiStream);

.

static extern Int32 midiStreamStop(IntPtr hMidiStream);

.

static extern Int32 mixerClose(IntPtr hmx);

.

Declare Function mixerClose Lib "winmm.dll" (ByVal hmx As IntPtr) As Integer

.

static extern Int32 mixerGetControlDetails(IntPtr hmxobj,

.

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.

.

     private IntPtr hwndOwner;

.

     private IntPtr paDetails;

.

     public IntPtr OwnerHandle

.

        set { this.hwndOwner = (IntPtr)value; }

.

     public IntPtr DetailsPointer

.

private static extern Int32 mixerGetControlDetails(IntPtr hmxobj, ref MIXERCONTROLDETAILS pmxcd, uint fdwDetails);

.

public static Int32 mixerGetControlDetails(IntPtr hmxobj, ref MIXERCONTROLDETAILS pmxcd, MIXER_OBJECTF fdwDetails, MIXER_GETCONTROLDETAILSF getControlDetails)

.

static extern Int32 mixerGetLineControls(IntPtr hmxobj,

.

Declare Function mixerGetLineControls Lib "winmm.dll" (hmxobj As IntPtr, _

.

private static extern Int32 mixerGetLineControls(IntPtr hmxobj, ref MIXERLINECONTROLS pmxlc, uint fdwControls);

.

public static Int32 mixerGetLineControls(IntPtr hmxobj, ref MIXERLINECONTROLS pmxlc, MIXER_OBJECTF mixerFlags, MIXER_GETLINECONTROLSF controlsFlags)

.

static extern Int32 mixerGetLineInfo(IntPtr hmxobj,

.

private static extern Int32 mixerGetLineInfo(IntPtr hmxobj, ref MIXERLINE pmxl, uint fdwInfo);

.

public static Int32 mixerGetLineInfo(IntPtr hmxobj, ref MIXERLINE pmxl, MIXER_OBJECTF fdwInfo, MIXER_GETLINEINFOF fieldToFollow)

.

static extern Int32 mixerOpen(ref IntPtr phmx, uint pMxId,

.

   IntPtr dwCallback, IntPtr dwInstance, UInt32 fdwOpen);

.

Declare Function mixerOpen Lib "winmm.dll" (ByRef phmx As IntPtr, ByVal pMxId As UInteger, ByVal dwCallback As IntPtr, ByVal dwInstance As IntPtr, ByVal fdwOpen As UInteger) As Integer

.

static extern Int32 mixerSetControlDetails(IntPtr hmxobj,

.

Declare Function mixerSetControlDetails Lib "winmm.dll" (ByVal hmxobj As IntPtr, ByVal pmxcd As MIXERCONTROLDETAILS, ByVal fdwDetails As Integer) As Integer

.

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.

.

     Dim hWndOwner As IntPtr

.

     Dim paDeatails As IntPtr

.

private static extern Int32 mixerSetControlDetails(IntPtr hmxobj, ref MIXERCONTROLDETAILS pmxcd, uint fdwDetails);

.

public static Int32 mixerSetControlDetails(IntPtr hmxobj, ref MIXERCONTROLDETAILS pmxcd, MIXER_OBJECTF fdwDetails, MIXER_SETCONTROLDETAILSF setControlDetails)

.

static extern bool PlaySound(string pszSound, UIntPtr hmod, uint fdwSound);

.

static extern bool PlaySound(byte[] pszSound, IntPtr hmod, SoundFlags fdwSound);

.

   ByVal hModule As UIntPtr, _

.

Public Declare Auto Function PlaySound Lib "winmm.dll" (ByVal pszSound As String, ByVal hmod As IntPtr, ByVal fdwSound As Integer) As Boolean

.

Public Declare Auto Function PlaySound Lib "winmm.dll" (ByVal pszSound As Byte(), ByVal hmod As IntPtr, ByVal fdwSound As SoundFlags) As Boolean

.

    PlaySound (strFileName, UIntPtr.Zero, (uint)(SoundFlags.SND_FILENAME | SoundFlags.SND_ASYNC));

.

    PlaySound (waveData, IntPtr.Zero, PlayFlags.SND_ASYNC | PlayFlags.SND_MEMORY);

.

     UIntPtr ip = UIntPtr.Zero;

.

     PlaySound(strFileName, IntPtr.Zero, SoundFlags.SND_FILENAME Or SoundFlags.SND_ASYNC)

.

     PlaySound(waveData, IntPtr.Zero, SoundFlags.SND_ASYNC Or SoundFlags.SND_MEMORY)

.

     Dim ip As UIntPtr = UIntPtr.Zero

.

     Dim result As Boolean = PlaySound("C:\path\to\wav\file.wav", IntPtr.Zero, ip)

.

    static extern uint timeSetEvent(uint uDelay, uint uResolution, TimerCallback lpTimeProc, UIntPtr dwUser, uint fuEvent);

.

    delegate void TimerCallback(uint uTimerID, uint uMsg, UIntPtr dwUser, UIntPtr dw1, UIntPtr dw2);

.

        id = timeSetEvent(ms, 0, thisCB, UIntPtr.Zero, (uint)f);

.

    void CBFunc(uint uTimerID, uint uMsg, UIntPtr dwUser, UIntPtr dw1, UIntPtr dw2)

.

public static extern uint waveInAddBuffer(IntPtr hwi, ref WAVEHDR pwh, uint cbwh);

.

Shared Function waveInAddBuffer(<MarshalAs(UnmanagedType.I4)> ByVal hwi As Integer, ByVal pwh As IntPtr, ByVal cbwh As UInteger) As MMRESULT

.

When recording waveform audio, usually buffers are allocated with unmanaged functions and kept in an IntPtr() array; for this reason the function is provided in two versions, one processing a WAVEHDR ByRef and the other working with an IntPtr.

.

static extern uint waveInClose(IntPtr hwi);

.

delegate void waveInProc(IntPtr hwi, WIMMessages uMsg, IntPtr dwInstance, IntPtr dwParam1, IntPtr dwParam2);

.

Delegate Sub waveInProc(<MarshalAs(UnmanagedType.I4)> ByVal hwi As Integer, ByVal uMsg As WIMMessages, ByVal dwInstance As UIntPtr, ByVal dwParam1 As UIntPtr, ByVal dwParam2 As UIntPtr)

.

static extern uint waveInReset(IntPtr hwi);

.

static extern uint waveInStart(IntPtr hwi);

.

static extern MMRESULT waveInUnprepareHeader(IntPtr hwi, ref WAVEHDR pwh, uint cbwh);

.

Shared Function waveInUnprepareHeader(<MarshalAs(UnmanagedType.I4)> ByVal hwi As Integer, ByVal pwh As IntPtr, ByVal cbwh As UInteger) As MMRESULT

.

public static extern uint waveOutClose(IntPtr hwo);

.

Declare Auto Function waveOutClose Lib "winmm.dll" (ByVal hwo As IntPtr) As UInteger

.

public static extern uint waveOutGetDevCaps(IntPtr hwo,ref WAVEOUTCAPS pwoc,uint cbwoc);

.

  public static extern uint waveOutGetPlaybackRate(IntPtr hwo, uint dwRate);

.

public static extern uint waveOutGetVolume(IntPtr hwo, uint dwVolume);

.

Declare Function waveOutGetVolume Lib "winmm.dll" (ByVal hwo As IntPtr, ByRef dwVolume As UInteger) As Integer

.

public static extern int waveOutGetVolume(IntPtr hwo, out uint dwVolume);

.

public static extern uint waveOutOpen(ref IntPtr hWaveOut, IntPtr uDeviceID, ref WAVEFORMATEX lpFormat, delegateWaveOutProc dwCallback, IntPtr dwInstance, uint dwFlags);

.

Declare Function waveOutOpen Lib "winmm.dll" Alias "waveOutOpen" (ByRef phwi As IntPtr, ByVal uDeviceID As IntPtr, ByRef pwfx As WAVEFORMATEX, ByVal dwCallback As IntPtr, ByVal dwCallbackInstance As IntPtr, ByVal fdwOpen As WAVE_FLAGS) As MMSYSERR

.

Declare Function waveOutOpen Lib "winmm.dll" Alias "waveOutOpen" (ByRef phwi As IntPtr, ByVal uDeviceID As IntPtr, ByRef pwfx As WAVEFORMATEXTENSIBLE, ByVal dwCallback As IntPtr, ByVal dwCallbackInstance As IntPtr, ByVal fdwOpen As WAVE_FLAGS) As MMSYSERR

.

See http://social.msdn.microsoft.com/Forums/en-US/windowspro-audiodevelopment/thread/14926e01-635e-4360-998b-ec6124d888a7 - correct C# signature at the bottom (including uDeviceId). This is based on http://msdn.microsoft.com/en-us/library/windows/desktop/dd743866%28v=vs.85%29.aspx which shows a UINT_PTR for that parameter. Note that the _PTR parameters are the only ones that are different sizes in 32 vs. 64 bit mode. In .Net you use IntPtr for that purpose.

.

public static extern uint waveOutPause(IntPtr hwo);

.

Public Shared Function waveOutPause(ByVal hwo As IntPtr) As UInteger

.

  public static extern uint waveOutPrepareHeader(IntPtr hWaveOut, IntPtr pwh, int uSize);

.

  // Need to use IntPtr as WAVEHEADER struct must be in a fixed memory location. See Tips & Tricks below

.

public static extern uint waveOutReset(IntPtr hwo);

.

  public static extern uint waveOutSetPlaybackRate(IntPtr hwo, uint dwRate);

.

public static extern uint waveOutSetVolume(IntPtr uDeviceID, uint dwVolume);

.

Declare Auto Function waveOutSetVolume Lib "winmm.dll" (ByVal uDeviceID As IntPtr, ByVal dwVolume As UInteger) As UInteger

.

        if (m_WaveOut != IntPtr.Zero)

.

public static extern uint waveOutUnprepareHeader(IntPtr hwo,ref WAVEHDR pwh,uint cbwh);

.

public static extern uint waveOutWrite(IntPtr hwo, ref WAVEHDR pwh, uint cbwh);

ncrypt

.

    IntPtr hProvider, out IntPtr hKey,

.

                IntPtr hKey,

.

                IntPtr pPaddingInfo,

.

internal static extern int  NCryptDeleteKey(IntPtr hKey, int dwFlags);

.

        internal static extern int NCryptEncrypt(IntPtr hKey,

.

            IntPtr pPaddingInfo,

.

        internal static extern int NCryptFinalizeKey(IntPtr hObject,

.

    internal static extern int NCryptFreeObject(IntPtr hObject);

.

    internal static extern int NCryptOpenKey(IntPtr hProvider,

.

                     out IntPtr hKey,  

.

    static extern int NCryptOpenStorageProvider(out IntPtr hProvider, [MarshalAs(UnmanagedType.LPWStr)] string szProviderName, int flags);

.

    IntPtr hObject,

.

    IntPtr pbInputByteArray,

.

    internal static extern int NCryptSetProperty(IntPtr hObject,

Cut off search results after 60. Please refine your search.


 
Access PInvoke.net directly from VS: