Click here to Skip to main content
15,903,203 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I want LOGFONT structure of VC++ in c#.
How to use GetLogFont function of VC++ in c# by using dllimport, pinvoke etc?
Posted
Comments
barneyman 14-Jun-12 3:52am    
reposting the same question 2 hours later will not endear you to the community here

1 solution

Google a little by your self solution is already there.


C#
// logfont.cs
// compile with: /target:module
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential)]
public class LOGFONT
{
    public const int LF_FACESIZE = 32;
    public int lfHeight;
    public int lfWidth;
    public int lfEscapement;
    public int lfOrientation;
    public int lfWeight;
    public byte lfItalic;
    public byte lfUnderline;
    public byte lfStrikeOut;
    public byte lfCharSet;
    public byte lfOutPrecision;
    public byte lfClipPrecision;
    public byte lfQuality;
    public byte lfPitchAndFamily;
    [MarshalAs(UnmanagedType.ByValTStr, SizeConst=LF_FACESIZE)]
    public string lfFaceName;
}


Refer http://msdn.microsoft.com/en-us/library/aa288468(v=vs.71).aspx[^] and http://msdn.microsoft.com/en-us/library/microsoft.windowsce.forms.logfont(v=vs.80).aspx[^] for more details.

Thanks
Rushikesh Joshi
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900