All pastes #125031 Raw Edit

Someone

public javascript v1 · immutable
·published 2006-08-10 11:21 UTC
rendered paste body
/*typedef struct {    DWORD lStructSize; 4    HWND hwndOwner; 4    HDC hDC; 4    LPLOGFONT lpLogFont; 4    INT iPointSize; 4    DWORD Flags; 4    COLORREF rgbColors; 4    LPARAM lCustData; 4    LPCFHOOKPROC lpfnHook; 4    LPCTSTR lpTemplateName; 4    HINSTANCE hInstance; 4    LPTSTR lpszStyle; 4     WORD nFontType; 2    INT nSizeMin; 4     INT nSizeMax; 4} CHOOSEFONT, *LPCHOOSEFONT;*///flagsvar CF_INITTOLOGFONTSTRUCT = 0x40;var CF_SCREENFONTS = 0x1;var CHOOSEFONT = Interop.Allocate(60);CHOOSEFONT.WriteDWORD(0, CHOOSEFONT.Size); //lStructSizeCHOOSEFONT.WriteDWORD(4, 0); //hwndOwnerCHOOSEFONT.WriteDWORD(8, 0); //hDC/*typedef struct tagLOGFONT {   LONG lfHeight; 4  LONG lfWidth;  4  LONG lfEscapement; 4  LONG lfOrientation;  4  LONG lfWeight;  4  BYTE lfItalic;  1  BYTE lfUnderline;  1  BYTE lfStrikeOut;  1  BYTE lfCharSet;  1  BYTE lfOutPrecision;  1  BYTE lfClipPrecision;  1  BYTE lfQuality;  1  BYTE lfPitchAndFamily; 1  TCHAR lfFaceName[LF_FACESIZE];  64} LOGFONT, *PLOGFONT; */var LOGFONT = Interop.Allocate(92);LOGFONT.WriteDWORD(0,0); //lfHeightLOGFONT.WriteDWORD(4,0); //lfWidthLOGFONT.WriteDWORD(8,0); //lfEscapementLOGFONT.WriteDWORD(12,0); //lfOrientationLOGFONT.WriteDWORD(16,0); //lfWeightLOGFONT.SetAt(20,0); //lfItalicLOGFONT.SetAt(21,0); //lfUnderlineLOGFONT.SetAt(22,0); //lfCharSetLOGFONT.SetAt(23,0); //lfOutPrecisionLOGFONT.SetAt(24,0); //lfClipPrecisionLOGFONT.SetAt(25,0); //lfQualityLOGFONT.SetAt(26,0); //lfPitchAndFamilyLOGFONT.WriteString(27, ""); // lfFaceNameCHOOSEFONT.WriteDWORD(12, LOGFONT.DataPtr); //LPLOGFONTvar iPointSize = Interop.Allocate(4);CHOOSEFONT.WriteDWORD(16, iPointSize.DataPtr); //iPointSizeCHOOSEFONT.WriteDWORD(20, CF_INITTOLOGFONTSTRUCT | CF_SCREENFONTS ); //FlagsCHOOSEFONT.WriteDWORD(24, 0); // rgbColorsCHOOSEFONT.WriteDWORD(28, 0); // lCustDataCHOOSEFONT.WriteDWORD(32, 0); // lpfnHookCHOOSEFONT.WriteDWORD(36, 0); // lpTemplateNameCHOOSEFONT.WriteDWORD(40, 0); // hInstancevar lpszStyle = Interop.Allocate(514);CHOOSEFONT.WriteDWORD(44, lpszStyle.DataPtr); // lpszStyleCHOOSEFONT.WriteWORD(48, 0x2000); // nFontTypeCHOOSEFONT.WriteDWORD(50, 0); // nSizeMinCHOOSEFONT.WriteDWORD(54, 0); // nSizeMaxInterop.Call("comdlg32.dll", "ChooseFontW", CHOOSEFONT);