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
Download Visual Studio Add-In

Search Results for "SIZE" in [All]

gdiplus

.

   int length, HandleRef fontFamily, int style, float emSize,

.

static extern int GdipComment(HandleRef graphics, int sizeData, byte[] data);

.

    /// <param name="_bufferSize">

.

    /// The size of the buffer used to store the Windows Metafile bits returned

.

static extern IntPtr GdipEmfToWmfBits(HandleRef hEmf, uint uBufferSize,

.

    ByVal bufferSize as UInteger, ByVal buffer() as byte, ByVal mappingMode as Integer, _

icmp

.

static extern Int32 IcmpSendEcho(IntPtr icmpHandle, Int32 destinationAddress, IntPtr requestData, Int16 requestSize, IntPtr requestOptions, IntPtr replyBuffer, Int32 replySize, Int32 timeout);

.

Declare Function IcmpSendEcho Lib "icmp.dll" (icmpHandle as IntPtr, destinationAddress as Int32, requestData as IntPtr, requestSize as Int16, requestOptions as IntPtr, replyBuffer as IntPtr, replySize as Int32, timeout as Int32) As Int32

.

            public byte OptionsSize;

.

            public short DataSize;

.

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst=250)]

.

        private static extern int IcmpSendEcho(IntPtr icmpHandle, int destinationAddress, string requestData, short requestSize, ref ICMP_OPTIONS requestOptions, ref ICMP_ECHO_REPLY replyBuffer, int replySize, int timeout);

.

            int iReplies = IcmpSendEcho(icmpHandle, BitConverter.ToInt32(ip.GetAddressBytes(), 0), sData, (short)sData.Length, ref icmpOptions, ref icmpReply, Marshal.SizeOf(icmpReply), 30);

.

   UCHAR OptionsSize;

.

   USHORT DataSize;

.

    LPVOID RequestData, WORD RequestSize,

.

    DWORD ReplySize,DWORD Timeout);

.

    DWORD ReplySize = 0;

.

    ReplySize = sizeof(ICMP_ECHO_REPLY) + sizeof(SendData);

.

    ReplyBuffer = (VOID*) malloc(ReplySize);

.

    dwRetVal = IcmpSendEcho(hIcmpFile, ipaddr, SendData, sizeof(SendData),

.

        NULL, ReplyBuffer, ReplySize, maxMsec);

ole32

.

    /// be allocated with a size of zero. If hGlobal is NULL, CreateILockBytesOnHGlobal

.

    /// internally allocates a new shared memory block of size zero.</param>

.

            int SizeOfIstream = ByteSizeOfIPStreamInit(pPersistStream) * 2;  // two bytes per value -- See my OleSaveToStream (ole32)              

.

                IntPtr nativePtr = Marshal.AllocHGlobal(SizeOfIstream); //buffer.Length); // allocate space on the native heap

.

                Marshal.Copy(buffer, 0, nativePtr, SizeOfIstream);      // copy byte array to native heap

.

    int cObjects, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.IUnknown)] object[] lplpUnk,

.

    int cPages, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] Guid[] lpPageClsID,

.

        [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.IUnknown)] object[] lplpUnk,

.

        [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] Guid[] lpPageClsID,

.

    UInt32 cObjects, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4, ArraySubType = UnmanagedType.IUnknown)] object[] lplpUnk,

.

    UInt32 cPages, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 6)] Guid[] lpPageClsID,

.

      pStm.Read(data, sizeof(ushort), IntPtr.Zero);

.

      pStm.Read(data, sizeof(ushort), IntPtr.Zero);

.

       public int ByteSizeOfIPStreamInit(IPersistStreamInit pPersistStream)

.

              iSzOfStreamInBytes = IStreamSizeRead(IPtrStream);

.

    public int IStreamSizeRead(IStream pOutStm)

.

        pOutStm.Seek(0, 0, IntPtr.Zero);// Get size of the stream and read its contents to a byte array.

.

        byte[] data = new byte[fileinfo.cbSize];

.

        int sizeOfInt32 = Marshal.SizeOf(typeof(int));

.

        IntPtr pRead = Marshal.AllocHGlobal(sizeOfInt32);

.

       public int ByteSizeOfIPStreamInit(IPersistStreamInit pPersistStream)

.

              iSzOfStreamInBytes = IStreamSizeRead(IPtrStream);

.

    public int IStreamSizeRead(IStream pOutStm)

.

        pOutStm.Seek(0, 0, IntPtr.Zero);// Get size of the stream and read its contents to a byte array.

.

        byte[] data = new byte[fileinfo.cbSize];

.

        int sizeOfInt32 = Marshal.SizeOf(typeof(int));

.

        IntPtr pRead = Marshal.AllocHGlobal(sizeOfInt32);

.

Guids generated with this will return the name using the FmtIdToPropStgName Function, and can be used to generate a new IPropertyStorage interface with IPropertySetStorage.Create(). The name returned will be filled to 26 chars with the letter 'a' due to the fixed size of a Guid and the fact that we're passing all zeros in the BitArray after the name finishes to reach this size.

15: STGC
.

Define the ulSectorSize member of the STGOPTIONS structure using type uint (which is 32-bits in C#) instead of ulong (which is 64-bits in C#).

gdi32

.

Please note that this API method needs to be called twice! 1st to get the size of the enh meta file and 2nd to fill the buffer.

.

        uint bufferSize = GetEnhMetaFileBits(hMf, 0, null); // Get required buffer size specifying 0 and NULL.

.

        if (bufferSize == 0)

.

        byte[] buffer = new byte[bufferSize];

.

        if (GetEnhMetaFileBits(hMf, bufferSize, buffer) == 0) // Get raw metafile data.

.

dwOffset specifies the offset from the beginning of the file mapping object referenced by hSection where storage for the bitmap’s bit values is to begin (ignored if hSection is NULL). The bitmap’s bit values are aligned on doubleword boundaries, so dwOffset must be a multiple of the size of a DWORD.

.

    IntPtr plogFont = Marshal.AllocHGlobal(Marshal.SizeOf(lf));

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]

.

    int ntmSizeEM;

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]

.

        public const Int32 LF_FACESIZE = 32; // ref WinGDI.h

.

        public const Int32 LF_FULLFACESIZE = 64; // ref WinGDI.h

.

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]

.

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FULLFACESIZE)]

.

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]

.

            public UInt32 ntmSizeEM;

.

    IntPtr plogFont = Marshal.AllocHGlobal(Marshal.SizeOf(lf));

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]

.

    int ntmSizeEM;

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)]

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]

.

    [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 32)]

.

        public const Int32 LF_FACESIZE = 32; // ref WinGDI.h

.

        public const Int32 LF_FULLFACESIZE = 64; // ref WinGDI.h

.

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]

.

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FULLFACESIZE)]

.

            [MarshalAs(UnmanagedType.ByValTStr, SizeConst = LF_FACESIZE)]

.

            public UInt32 ntmSizeEM;

.

        public int StructSize;

.

        rs.StructSize = Marshal.SizeOf(typeof(GCP_RESULTS));

.

        /// Horizontal size in millimeters

.

        HORZSIZE = 4,

.

        /// Vertical size in millimeters

.

        VERTSIZE = 6,

.

        /// Size required for device descriptor

.

        PDEVICESIZE = 26,

.

        SIZEPALETTE = 104,

.

    ''' Horizontal size in millimeters

.

    HORZSIZE = 4

.

    ''' Vertical size in millimeters

.

    VERTSIZE = 6

.

    ''' Size required for device descriptor

.

    PDEVICESIZE = 26

.

    SIZEPALETTE = 104

.

        [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

        [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

        [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

    var bufferSize = GetEnhMetaFileBits(enhMetafileHandle, 0, null);

.

    var buffer = new byte[bufferSize];

.

    GetEnhMetaFileBits(enhMetafileHandle, bufferSize, buffer);

.

    var bufferSize = GetEnhMetaFileBits(enhMetafileHandle, 0, null);

.

    var buffer = new byte[bufferSize];

.

    GetEnhMetaFileBits(enhMetafileHandle, bufferSize, buffer);

.
  • dwOffset: Specifies the offset from the beginning of the font metric table towhere the function should begin retrieving information. If this parameter is zero, the information is retrieved starting at the beginning of the table specified by the dwTable parameter. If this value is greater than or equal to the size of the table, an error occurs.
.
  • lpvBuffer: Points to a byte array to receive the font information. If this parameter is NULL, the function returns the size of the buffer required for the font data.
.
  • cbData: Specifies the length, in bytes, of the information to be retrieved. If this parameter is zero, the size of the font metrics table specified in the dwTable parameter is returned.
.

    /// If this value is greater than or equal to the size of the table, an error occurs.</param>

.

    /// <param name="lpvBuffer">Points to a lpvBuffer to receive the font information. If this parameter is NULL, the function returns the size of the <paramref name="lpvBuffer"/> required for the font data.</param>

.

    /// If this parameter is zero, GetFontData returns the size of the font metrics table specified in the <paramref name="dwTable"/> parameter. </param>

.

        uint size = GetFontUnicodeRanges(hdc, IntPtr.Zero);

.

        IntPtr glyphSet = Marshal.AllocHGlobal((int)size);

.

                    int bufferSize = (int)GetGlyphOutline(hdc, (uint)c, (uint)2, out metrics, 0, IntPtr.Zero, ref matrix);

.

                    IntPtr buffer = Marshal.AllocHGlobal(bufferSize);

.

                        if((ret = GetGlyphOutline(hdc, (uint)c, (uint)2, out metrics, (uint)bufferSize, buffer, ref matrix)) > 0)

.

                            int polygonHeaderSize = Marshal.SizeOf(typeof(TTPOLYGONHEADER));

.

                            int curveHeaderSize = Marshal.SizeOf(typeof(TTPOLYCURVEHEADER));

.

                            int pointFxSize = Marshal.SizeOf(typeof(POINTFX));

.

                            while(index < bufferSize)

.

                                index+=polygonHeaderSize;

.

                                    index+=curveHeaderSize;

.

                                        index+=pointFxSize;

.

GDI32.GetObject(hBitmap, Marshal.SizeOf<GDI32.BITMAP>(), ptrToBitmap);

.

First call returns needed buffer size the second fills buffer by actual data.

.

   [Out] byte [] lpTypes, int nSize);

.

    // The return from this call should be the size of buffer

.

    int dataSize = GetRegionData(hRgn, 0, IntPtr.Zero);

.

    if (dataSize != 0)

.

      bytes = Marshal.AllocCoTaskMem(dataSize);

.

      int retValue = GetRegionData(hRgn, dataSize, bytes);

.

    // header size and start reading rectangles.

.

    int rectOffset = header->dwSize;

.

      rects[i] = *((RECT *)((byte *)bytes+rectOffset+(Marshal.SizeOf(typeof(RECT)) *i)));

.

   int cchString, int nMaxExtent, out int lpnFit, int[] alpDx, out SIZE lpSize);

.

Graphics.MeasureString Method (String, Font, SizeF, StringFormat, out Int32, out Int32) http://msdn.microsoft.com/en-us/library/957webty(v=VS.100).aspx

.

   int cbString, out SIZE lpSize);

.

static extern bool GetTextExtentPoint32(IntPtr hdc, string lpString, int cbString, out SIZE lpSize);

.

public Size getExtent(string text, Graphics graphics, Font font)

.

    Size sz = Size.Empty;

.

    Size size=TextRenderer.MeasureText(g, str, f, new Size(), TextFormatFlags.NoPadding);

.

Since .NET padding has been added to font's height and width. So you need to make use of the format flag TextFormatFlags.NoPadding to get the real size of the text.

.

    new Size() - just a dummy parameter

.

   int cbString, out SIZE lpSize);

.

   int cbString, out SIZE lpSize);

.

public Size getExtent(string text, Graphics graphics, Font font)

.

    Size sz = Size.Empty;

.

    Size size=TextRenderer.MeasureText(g, str, f, new Size(), TextFormatFlags.NoPadding);

.

Since .NET padding has been added to font's height and width. So you need to make use of the format flag TextFormatFlags.NoPadding to get the real size of the text.

.

    new Size() - just a dummy parameter

.

static extern bool GetViewportExtEx(IntPtr hdc, out SIZE lpSize);

.

SIZE

.

static extern bool GetWindowExtEx(IntPtr hdc, out SIZE lpSize);

.

SIZE

.

    uint dwNumMesh,       // size of gradient array

.

  [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

  [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

  [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

  [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

  [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

  [ MarshalAs(UnmanagedType.ByValArray, SizeConst=256)]

.

    static extern bool SetViewportExtEx(IntPtr hDC, int nExtentX, int nExtentY, Size[] prevSize);

.

    static extern bool SetWindowExtEx(IntPtr hDC, int nExtentX, int nExtentY, Size[] prevSize);

.

Size[] size = new Size[1];

.

         size);

.

           size);

.

static extern IntPtr SetMetaFileBitsEx(uint nSize, byte [] lpData);

.

Shared Function SetMetaFileBitsEx(ByVal nSize As UInteger, ByVal lpData As Byte()) As IntPtr

.

            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);

.

            this.ClientSize = new System.Drawing.Size(292, 273);

.

                this.AutoScrollMinSize = bmp.Size;

.

        private void Form1_Resize(object sender, System.EventArgs e)

.

            this.AutoScrollMinSize = bmp.Size;

.

       int cbString, ref Size lpSize);

.

       //You may want to meassure the string's size for layout purposes.

.

    Size MeasureSize = new Size(0, 0);

.

             GetTextExtentPoint(HDC, line, line.Length, ref MeasureSize);

.

             y_pos += MeasureSize.Height;

.

            //You can use the MeasureSize.Width property to implement

secur32

.

    StringBuilder userName, ref int userNameSize);

.

   userName As StringBuilder, ByRef userNameSize As Integer) As Integer

.

      public static extern int GetUserNameEx (int nameFormat, StringBuilder userName, ref int userNameSize);

.

     int userNameSize = userName.Capacity;

.

     if(0 != GetUserNameEx((int)EXTENDED_NAME_FORMAT.NameSamCompatible, userName, ref userNameSize))

.

  ByVal userName As System.Text.StringBuilder, ByRef userNameSize As Integer) As Integer

.

    Dim userNameSize As Integer = UserName.Capacity

.

    If GetUserNameExA(EXTENDED_NAME_FORMAT.NameSamCompatible, UserName, userNameSize) <> 0 Then

.

    public SecBuffer(int bufferSize)

.

    cbBuffer = bufferSize;

.

    pvBuffer = Marshal.AllocHGlobal(bufferSize);

.

    public SecBufferDesc(int bufferSize)

.

        SecBuffer ThisSecBuffer = new SecBuffer(bufferSize);

.

    pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(ThisSecBuffer));

.

        pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(ThisSecBuffer));

.

        pBuffers = Marshal.AllocHGlobal(Marshal.SizeOf(typeof(SecBuffer)) * cBuffers);

.

            int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));

.

            Marshal.WriteInt32(pBuffers,CurrentOffset + Marshal.SizeOf(ThisSecBuffer.cbBuffer),ThisSecBuffer.BufferType);

.

            Marshal.WriteIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(ThisSecBuffer.cbBuffer)+Marshal.SizeOf(ThisSecBuffer.BufferType),ThisSecBuffer.pvBuffer);

.

                    int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));

.

                    IntPtr SecBufferpvBuffer = Marshal.ReadIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(typeof(int))+Marshal.SizeOf(typeof(int)));

.

                int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));

.

                int CurrentOffset = Index*Marshal.SizeOf(typeof(SecBuffer));

.

                IntPtr SecBufferpvBuffer = Marshal.ReadIntPtr(pBuffers,CurrentOffset + Marshal.SizeOf(typeof(int))+Marshal.SizeOf(typeof(int)));

.

public struct SecPkgContext_Sizes

.

    public uint cbBlockSize;

.

        const int MAX_TOKEN_SIZE = 12288;

.

        public const int SECPKG_ATTR_SIZES       =     0;

.

                                                        out SecPkgContext_Sizes pContextAttributes);

.

            SecBufferDesc ClientToken = new SecBufferDesc(MAX_TOKEN_SIZE);

.

            SecBufferDesc ServerToken = new SecBufferDesc(MAX_TOKEN_SIZE);

.

            SecPkgContext_Sizes ContextSizes = new SecPkgContext_Sizes();

.

            if(QueryContextAttributes(ref EncryptionContext,SECPKG_ATTR_SIZES,out ContextSizes) != SEC_E_OK)

.

            ThisSecHelper[1] = new MultipleSecBufferHelper(new byte[ContextSizes.cbSecurityTrailer],SecBufferType.SECBUFFER_TOKEN);

.

            SecPkgContext_Sizes ContextSizes = new SecPkgContext_Sizes();

.

            if(QueryContextAttributes(ref EncryptionContext,SECPKG_ATTR_SIZES,out ContextSizes) != SEC_E_OK)

.

            ThisSecHelper[1] = new MultipleSecBufferHelper(new byte[ContextSizes.cbMaxSignature],SecBufferType.SECBUFFER_TOKEN);

.

    public UInt32 Size;

.

      iter = (IntPtr)((int)iter + Marshal.SizeOf(typeof(LUID)));  //move the pointer forward

.

                    [MarshalAs(UnmanagedType.ByValArray,SizeConst=8)] public byte[] SourceName;

.

                    UInt32 MinimumWorkingSetSize;

.

                    UInt32 MaximumWorkingSetSize;  

.

                        _bufferLength = Marshal.SizeOf(typeof(KERB_S4U_LOGON)) + 2 * (clientUpnLen + clientRealmLen);

.

                            IntPtr curPtr = new IntPtr(_bufferContent.ToInt32()+Marshal.SizeOf(typeof(KERB_S4U_LOGON)));

.

Retrieves information about a specified security package. This information includes the bounds on sizes of authentication information, credentials, and contexts.

.

        int desiredFormat, StringBuilder translatedName, ref int userNameSize);

.

        int desiredFormat, StringBuilder translatedName, ref int userNameSize);

.

          int userNameSize = translatedName.Capacity;

.

              translatedName, ref userNameSize))

hid

.

        Byte[] valueCaps = new Byte[ 1024 ]; // (the array size is a guess)

.

    public Int32 Size;

.

    Public Size As Int32

.

    Specifies the size, in bytes, of the report buffer. The report buffer must be large enough to hold the output report -- excluding its report ID, if report IDs are used -- plus one additional byte that specifies a nonzero report ID or zero.

.

      [MarshalAs(UnmanagedType.LPArray, SizeConst=17)]

.

Specifies the maximum size, in bytes, of all the input reports (including the report ID, if report IDs are used, which is prepended to the report data).

.

Specifies the maximum size, in bytes, of all the output reports (including the report ID, if report IDs are used, which is prepended to the report data).

.

Callers of the HIDClass support routines use the information provided in this structure when a called routine requires, as input, the size of a report type, the number of link collection nodes, the number of control capabilities, or the number of data indices.

rpcrt4

.

     [MarshalAs(UnmanagedType.ByValTStr, SizeConst=8)]

twain_32

.

    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=34)> _

.

    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=34)> _

.

    <MarshalAs(UnmanagedType.ByValTStr, SizeConst:=34)> _

comdlg32

.

     public int lStructSize;

.

     public int iPointSize;

.

     public int nSizeMin;

.

     public int nSizeMax;

.

     CF_LIMITSIZE = 0x00002000,

.

     CF_NOSIZESEL = 0x00200000,

.

IntPtr pLogfont = Marshal.AllocHGlobal(Marshal.SizeOf(logfont));

.

choosefont.lStructSize = Marshal.SizeOf(choosefont);

.

choosefont.nSizeMin = 64;

.

choosefont.nSizeMax = 64;

.

IntPtr pChoosefont = Marshal.AllocHGlobal(Marshal.SizeOf(choosefont));

.

The dwContext parameter is declared as an IntPtr because the original declaration was as a DWORD_PTR, which is noted to be the size of a native pointer on the platform.

.

    '  DWORD     lStructSize;

.

        Public structSize As Integer = 0

.

        ofn.structSize = Marshal.SizeOf(ofn)

.

     DWORD lStructSize;

.

    memset(&ofn, 0, sizeof (ofn));

.

    ofn.lStructSize = sizeof (ofn);

.

    ofn.nMaxFile = sizeof (szFile);

.

    '  DWORD     lStructSize;

.

    Public structSize As Integer = 0

.

    ofn.structSize = Marshal.SizeOf(ofn)

.

        _pdex.lStructSize = Marshal.SizeOf(_pdex)

.

        _pdex.lpPageRanges = Marshal.SizeOf(_ppr)

.

    Public lStructSize As Int32

.

    <MarshalAs(UnmanagedType.LPStr, SizeConst:=&H20)> _

.

        _pdex.lStructSize = Marshal.SizeOf(_pdex)

.

        _pdex.lpPageRanges = Marshal.SizeOf(_ppr)

.

    Public lStructSize As Int32

.

    <MarshalAs(UnmanagedType.LPStr, SizeConst:=&H20)> _

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


 
Access PInvoke.net directly from VS: