4 instantiations of HDC
System.Windows.Forms.Primitives.Tests (4)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (1)
251HDC mockHdc = new(1234);
System\Windows\Forms\Internals\ArgumentValidationTests.cs (3)
91HDC param = new(IntPtr.Zero); 99HDC param = new(new IntPtr(24)); 106HDC param = new(IntPtr.Zero);
271 references to HDC
System.Drawing.Common.Tests (5)
Helpers.cs (1)
128internal static Rectangle GetWindowDCRect(HDC hdc) => GetHWndRect(PInvokeCore.WindowFromDC(hdc));
System\Drawing\ImageTests.cs (2)
673HDC hdc = PInvokeCore.CreateEnhMetaFile(HDC.Null, default, null, default(PCWSTR));
System\Drawing\Imaging\MetafileTests.cs (2)
1025HDC hdc = PInvokeCore.CreateEnhMetaFile(HDC.Null, default, null, default(PCWSTR));
System.Private.Windows.Core (71)
System\ArgumentValidation.cs (1)
47internal static void ThrowIfNull(HDC argument, [CallerArgumentExpression(nameof(argument))] string? paramName = null)
Windows\Win32\Foundation\WPARAM.cs (3)
16public static explicit operator HDC(WPARAM value) => (HDC)(nint)value.Value; 17public static explicit operator WPARAM(HDC value) => new((nuint)value.Value);
Windows\Win32\Graphics\Gdi\BeginPaintScope.cs (2)
25public HDC HDC { get; } 35public static implicit operator HDC(in BeginPaintScope scope) => scope.HDC;
Windows\Win32\Graphics\Gdi\CreateBitmapScope.cs (3)
31/// Creates a bitmap compatible with the given <see cref="HDC"/> via 32/// <see cref="PInvokeCore.CreateCompatibleBitmap(HDC, int, int)"/> 34public CreateBitmapScope(HDC hdc, int cx, int cy) => HBITMAP = PInvokeCore.CreateCompatibleBitmap(hdc, cx, cy);
Windows\Win32\Graphics\Gdi\CreateDcScope.cs (4)
22public HDC HDC { get; } 25/// Creates a compatible HDC for <paramref name="hdc"/> using <see cref="PInvokeCore.CreateCompatibleDC(HDC)"/>. 32public CreateDcScope(HDC hdc) 52public static implicit operator HDC(in CreateDcScope scope) => scope.HDC;
Windows\Win32\Graphics\Gdi\GetDcScope.cs (5)
7/// Helper to scope lifetime of an <see cref="Gdi.HDC"/> retrieved via <see cref="PInvokeCore.GetDC(HWND)"/> and 8/// <see cref="PInvokeCore.GetDCEx(HWND, HRGN, GET_DCX_FLAGS)"/>. Releases the <see cref="Gdi.HDC"/> (if any) 19public HDC HDC { get; } 29/// Creates a <see cref="Gdi.HDC"/> using <see cref="PInvokeCore.GetDCEx(HWND, HRGN, GET_DCX_FLAGS)"/>. 60public static implicit operator HDC(in GetDcScope scope) => scope.HDC;
Windows\Win32\Graphics\Gdi\HDC.cs (4)
6internal readonly partial struct HDC : IHandle<HDC> 8HDC IHandle<HDC>.Handle => this; 9object? IHandle<HDC>.Wrapper => null;
Windows\Win32\Graphics\Gdi\HdcHandle.cs (4)
7/// Used when you must keep a handle to an <see cref="HDC"/> in a field. Avoid keeping HDC handles in fields 10internal sealed class HdcHandle : IDisposable, IHandle<HDC> 24public HDC Handle { get; private set; } 26public static implicit operator HDC(in HdcHandle handle) => handle.Handle;
Windows\Win32\Graphics\Gdi\HGDIOBJ.cs (1)
8public static implicit operator HGDIOBJ(HDC value) => (HGDIOBJ)value.Value;
Windows\Win32\Graphics\Gdi\IHDCContext.cs (1)
8HDC GetHdc();
Windows\Win32\Graphics\Gdi\RegionScope.cs (2)
38/// Creates a clipping region copy via <see cref="PInvokeCore.GetClipRgn(HDC, HRGN)"/> for the given device context. 41public RegionScope(HDC hdc)
Windows\Win32\Graphics\Gdi\SaveDcScope.cs (3)
25public HDC HDC { get; } 29/// Saves the device context state using <see cref="PInvokeCore.SaveDC(HDC)"/>. 32public SaveDcScope(HDC hdc)
Windows\Win32\Graphics\Gdi\SelectObjectScope.cs (5)
7/// Helper to scope selecting a GDI object into an <see cref="HDC"/>. Restores the original 8/// object into the <see cref="HDC"/> when disposed. 22private readonly HDC _hdc; 27/// <see cref="PInvokeCore.SelectObject(HDC, HGDIOBJ)"/>. 29public SelectObjectScope(HDC hdc, HGDIOBJ @object)
Windows\Win32\Graphics\Gdi\SelectPaletteScope.cs (2)
21public HDC HDC { get; } 24public SelectPaletteScope(HDC hdc, HPALETTE hpalette, bool forceBackground, bool realizePalette)
Windows\Win32\Graphics\Gdi\SetBackgroundColorScope.cs (3)
19private readonly HDC _hdc; 23/// <see cref="PInvokeCore.SetBkColor(HDC, COLORREF)"/>. 25public SetBackgroundColorScope(HDC hdc, COLORREF color)
Windows\Win32\Graphics\Gdi\SetBkModeScope.cs (2)
23private readonly HDC _hdc; 28public SetBkModeScope(HDC hdc, BACKGROUND_MODE bkmode)
Windows\Win32\Graphics\Gdi\SetMapModeScope.cs (3)
23private readonly HDC _hdc; 27/// <see cref="PInvokeCore.SetMapMode(HDC, HDC_MAP_MODE)"/>. 29public SetMapModeScope(HDC hdc, HDC_MAP_MODE mapMode)
Windows\Win32\Graphics\Gdi\SetRop2Scope.cs (3)
23private readonly HDC _hdc; 26/// Selects <paramref name="rop2"/> into the given <paramref name="hdc"/> using <see cref="PInvokeCore.SetROP2(HDC, R2_MODE)"/>. 28public SetRop2Scope(HDC hdc, R2_MODE rop2)
Windows\Win32\Graphics\Gdi\SetTextAlignmentScope.cs (3)
23private readonly HDC _hdc; 27/// using <see cref="PInvokeCore.SetTextAlign(HDC, TEXT_ALIGN_OPTIONS)"/>. 29public SetTextAlignmentScope(HDC hdc, TEXT_ALIGN_OPTIONS ta)
Windows\Win32\Graphics\Gdi\SetTextColorScope.cs (3)
23private readonly HDC _hdc; 27/// <see cref="PInvokeCore.SetTextColor(HDC, COLORREF)"/>. 29public SetTextColorScope(HDC hdc, COLORREF color)
Windows\Win32\PInvokeCore.BitBlt.cs (8)
8/// <inheritdoc cref="BitBlt(HDC, int, int, int, int, HDC, int, int, ROP_CODE)"/> 15HDC hdcSrc, 18ROP_CODE rop) where T : IHandle<HDC> 34/// <inheritdoc cref="BitBlt(HDC, int, int, int, int, HDC, int, int, ROP_CODE)"/> 36HDC hdc, 44ROP_CODE rop) where T : IHandle<HDC>
Windows\Win32\PInvokeCore.DrawIcon.cs (1)
8public static BOOL DrawIcon<T>(HDC hDC, int x, int y, T hIcon)
Windows\Win32\PInvokeCore.DrawIconEx.cs (2)
8/// <inheritdoc cref="DrawIconEx(HDC, int, int, HICON, int, int, uint, HBRUSH, DI_FLAGS)"/> 10HDC hDC,
Windows\Win32\PInvokeCore.EnumDisplayMonitors.cs (2)
11public delegate bool EnumDisplayMonitorsCallback(HMONITOR monitor, HDC hdc); 27private static BOOL EnumDisplayMonitorsNativeCallback(HMONITOR monitor, HDC hdc, RECT* lprcMonitor, LPARAM lParam)
Windows\Win32\UI\Controls\Dialogs\PRINTDLGEXW.cs (1)
117public HDC hDC;
System.Private.Windows.GdiPlus (9)
System\Drawing\ApplyGraphicsProperties.cs (1)
9/// Enumeration defining the different Graphics properties to apply to an <see cref="HDC"/> when creating it
System\Drawing\IGraphicsContextInfo.cs (1)
10(HDC hdc, int saveState) GetHdc(ApplyGraphicsProperties apply, bool alwaysSaveState);
Windows\Win32\Graphics\Gdi\DeviceContextHdcScope.cs (4)
30public HDC HDC { get; } 39/// When a <see cref="T:System.Drawing.Graphics"/> object is created from a <see cref="Gdi.HDC"/> the clipping region and 40/// the viewport origin are applied (<see cref="PInvokeCore.GetViewportExtEx(HDC, SIZE*)"/>). The clipping 158public static implicit operator HDC(in DeviceContextHdcScope scope) => scope.HDC;
Windows\Win32\Graphics\Gdi\HdcExtensions.cs (1)
20where T : IHandle<HDC>
Windows\Win32\Graphics\Gdi\IGraphicsHdcProvider.cs (2)
27/// Gets the <see cref="HDC"/>, if the object was created from one. 29HDC GetHdc();
System.Windows.Forms (126)
System\Windows\Forms\ActiveX\AxHost.cs (1)
3057internal override HBRUSH InitializeDCForWmCtlColor(HDC dc, MessageId msg)
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (4)
406/// <inheritdoc cref="IViewObject.Interface.Draw(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, HDC, RECTL*, RECTL*, nint, nuint)"/> 412HDC hdcTargetDev, 413HDC hdcDraw,
System\Windows\Forms\ActiveX\Control_ActiveXControlInterfaces.cs (12)
513/// <inheritdoc cref="IViewObject.Draw(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, HDC, RECTL*, RECTL*, nint, nuint)"/> 519HDC hdcTargetDev, 520HDC hdcDraw, 543/// <inheritdoc cref="IViewObject.GetColorSet(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, LOGPALETTE**)"/> 549HDC hicTargetDev, 569/// <inheritdoc cref="IViewObject.Draw(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, HDC, RECTL*, RECTL*, nint, nuint)"/> 575HDC hdcTargetDev, 576HDC hdcDraw, 593/// <inheritdoc cref="IViewObject.GetColorSet(DVASPECT, int, void*, DVTARGETDEVICE*, HDC, LOGPALETTE**)"/> 599HDC hdcTargetDev,
System\Windows\Forms\Control.cs (11)
5852internal virtual HBRUSH InitializeDCForWmCtlColor(HDC dc, MessageId msg) 8771private unsafe void PrintToMetaFile(HDC hDC, IntPtr lParam) 8804private protected virtual void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds) 8837private void PrintToMetaFile_SendPrintMessage(HDC hDC, nint lParam) 11234m.ResultInternal = (LRESULT)(nint)control.InitializeDCForWmCtlColor((HDC)(nint)m.WParamInternal, m.MsgInternal); 11262HDC dc = (HDC)(nint)m.WParamInternal; 11823HDC dc = (HDC)(nint)m.WParamInternal; 11935HDC hdc = (HDC)(nint)m.WParamInternal;
System\Windows\Forms\Control.MetafileDCWrapper.cs (5)
25private readonly HDC _hMetafileDC; 28internal unsafe MetafileDCWrapper(HDC hOriginalDC, Size size) 83internal HDC HDC { get; private set; } 86private unsafe bool DICopy(HDC hdcDest, HDC hdcSrc, RECT rect, bool bStretch)
System\Windows\Forms\Control.PrintPaintEventArgs.cs (1)
14internal PrintPaintEventArgs(Message m, HDC dc, Rectangle clipRect)
System\Windows\Forms\Controls\Buttons\ButtonInternal\CheckBoxBaseAdapter.cs (1)
213internal static Rectangle DrawPopupBorder(HDC hdc, Rectangle r, ColorData colors)
System\Windows\Forms\Controls\Buttons\ButtonInternal\RadioButtonBaseAdapter.cs (1)
97private static void DrawAndFillEllipse(HDC hdc, HPEN borderPen, HBRUSH fieldBrush, Rectangle bounds)
System\Windows\Forms\Controls\Buttons\CheckBoxRenderer.cs (1)
243internal static Size GetGlyphSize(HDC hdc, CheckBoxState state, HWND hwnd)
System\Windows\Forms\Controls\Buttons\RadioButtonRenderer.cs (2)
54HDC hdc, 257internal static Size GetGlyphSize(HDC hdc, RadioButtonState state, HWND hwnd)
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (7)
1990internal override HBRUSH InitializeDCForWmCtlColor(HDC dc, MessageId msg) 3454HDC hdc = (HDC)m.WParamInternal; 3677m.ResultInternal = (LRESULT)(nint)InitializeDCForWmCtlColor((HDC)(nint)m.WParamInternal, m.MsgInternal); 3750HDC dc = useBeginPaint ? paintScope! : (HDC)m.WParamInternal; 3786using Graphics g = Graphics.FromHdcInternal((HDC)m.WParamInternal);
System\Windows\Forms\Controls\ComboBox\ComboBoxRenderer.cs (1)
119internal static void DrawDropDownButtonForHandle(HDC hdc, Rectangle bounds, ComboBoxState state, HWND hwnd)
System\Windows\Forms\Controls\GroupBox\GroupBox.cs (2)
668using Graphics graphics = Graphics.FromHdcInternal((HDC)m.WParamInternal); 675PInvoke.FillRect((HDC)m.WParamInternal, rect, hbrush);
System\Windows\Forms\Controls\ImageList\ImageList.cs (6)
528HDC dc = (HDC)g.GetHdc(); 534new HandleRef<HDC>(g, dc), 664HDC dc = (HDC)graphics.GetHdc(); 670new HandleRef<HDC>(graphics, dc),
System\Windows\Forms\Controls\Labels\Label.cs (1)
1351private protected override void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds)
System\Windows\Forms\Controls\ListBoxes\ListBox.cs (1)
2326using Graphics g = Graphics.FromHdc((HDC)m.WParamInternal);
System\Windows\Forms\Controls\ListView\ListView.cs (1)
6972using Graphics g = Graphics.FromHdc((HDC)m.WParamInternal);
System\Windows\Forms\Controls\TextBox\MaskedTextBox.cs (1)
2889using Graphics g = Graphics.FromHdc((HDC)m.WParamInternal);
System\Windows\Forms\Controls\TextBox\TextBox.cs (2)
825using Graphics g = Graphics.FromHdc((HDC)m.WParamInternal); 866private void DrawPlaceholderText(HDC hdc)
System\Windows\Forms\Controls\TextBox\TextBoxBase.cs (1)
2001internal override HBRUSH InitializeDCForWmCtlColor(HDC dc, MessageId msg)
System\Windows\Forms\Controls\ToolStrips\CachedItemHdcInfo.cs (5)
8internal class CachedItemHdcInfo : IDisposable, IHandle<HDC> 14private HDC _cachedItemHDC; 18public HDC Handle => _cachedItemHDC; 22public HDC GetCachedItemDC(HDC toolStripHDC, Size bitmapSize)
System\Windows\Forms\Controls\ToolStrips\ToolStrip.cs (2)
2649private protected override void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds) 3492HDC itemHDC = ItemHdcInfo.GetCachedItemDC(toolStripHDC, bitmapSize);
System\Windows\Forms\Controls\TreeView\TreeView.cs (1)
3150using Graphics g = Graphics.FromHdc((HDC)m.WParamInternal);
System\Windows\Forms\Design\ComponentEditorForm.PageSelector.cs (2)
89HDC dc, 260private void FillRectDither(HDC dc, RECT rc)
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.cs (1)
167private unsafe void MirrorDcIfNeeded(HDC hdc)
System\Windows\Forms\Input\Cursor.cs (1)
336(HDC)dc,
System\Windows\Forms\Panels\Panel.cs (1)
224private protected override void PrintToMetaFileRecursive(HDC hDC, IntPtr lParam, Rectangle bounds)
System\Windows\Forms\Rendering\ControlPaint.cs (1)
1990HDC dc,
System\Windows\Forms\Rendering\DCMapping.cs (2)
26private readonly HDC _hdc; 29public unsafe DCMapping(HDC hdc, Rectangle bounds)
System\Windows\Forms\Rendering\DrawingEventArgs.cs (4)
27private readonly HDC _hdc; 47HDC dc, 77internal HDC HDC => IsStateClean ? default : _hdc; 120internal HDC GetHDC() => _hdc;
System\Windows\Forms\Rendering\DrawingEventFlags.cs (1)
24/// default when constructing via an <see cref="HDC"/> as it, by definition, has no <see cref="Graphics"/>
System\Windows\Forms\Rendering\DrawItemEventArgs.cs (6)
57HDC hdc, 66HDC hdc, 159internal HDC HDC => _event.HDC; 162HDC IHdcContext.GetHdc() => (HDC)((IDeviceContext)this).GetHdc(); 166HDC IGraphicsHdcProvider.GetHdc() => _event.GetHDC();
System\Windows\Forms\Rendering\FontCache.Data.cs (1)
39HDC hdc = screenDC.HDC;
System\Windows\Forms\Rendering\GdiCache.cs (3)
19/// Gets an <see cref="HDC"/> based off of the primary display. 26/// When disposed the <see cref="HDC"/> will be returned to the cache. Do NOT change the state of the 43/// When disposed the <see cref="Graphics"/> object will be disposed and the underlying <see cref="HDC"/>
System\Windows\Forms\Rendering\PaintEventArgs.cs (6)
49HDC hdc = e.HDC; 68HDC hdc, 132internal HDC HDC => _event.HDC; 135HDC IHdcContext.GetHdc() => (HDC)((IDeviceContext)this).GetHdc(); 139HDC IGraphicsHdcProvider.GetHdc() => _event.GetHDC();
System\Windows\Forms\Rendering\ScreenDcCache.cs (5)
51return new ScreenDcScope(this, (HDC)item); 62private void Release(HDC hdc) 80PInvokeCore.DeleteDC((HDC)temp); 92PInvokeCore.DeleteDC((HDC)hdc); 98private static unsafe void ValidateHdc(HDC hdc)
System\Windows\Forms\Rendering\ScreenDcCache.ScreenDcScope.cs (3)
17public HDC HDC { get; } 20public ScreenDcScope(ScreenDcCache cache, HDC hdc) 26public static implicit operator HDC(in ScreenDcScope scope) => scope.HDC;
System\Windows\Forms\Rendering\TextExtensions.cs (4)
50this HDC hdc, 152this HDC hdc, 211this HDC hdc, 282public static unsafe Size GetTextExtent(this HDC hdc, string? text, HFONT hfont)
System\Windows\Forms\Rendering\TextRenderer.cs (5)
330HDC hdc = e.HDC; 346HDC hdc, 356HDC hdc, 656/// The <see cref="HDC"/> to get the font from if <paramref name="font"/> is <see langword="null"/>. 658private static FontCache.Scope GetFontOrHdcHFONT(Font? font, FONT_QUALITY quality, HDC hdc)
System\Windows\Forms\Screen.cs (3)
54internal unsafe Screen(HMONITOR monitor, HDC hdc) 56HDC screenDC = hdc; 109PInvokeCore.EnumDisplayMonitors((HMONITOR hmonitor, HDC hdc) =>
System\Windows\Forms\Scrolling\ScrollBar.cs (1)
494internal override HBRUSH InitializeDCForWmCtlColor(HDC dc, MessageId msg) => default;
System\Windows\Forms\VisualStyles\VisualStyleRenderer.cs (6)
219internal unsafe void DrawBackground(HDC dc, Rectangle bounds, HWND hwnd = default) 248internal unsafe void DrawBackground(HDC dc, Rectangle bounds, Rectangle clipRectangle, HWND hwnd) 275internal unsafe Rectangle DrawEdge(HDC dc, Rectangle bounds, Edges edges, EdgeStyle style, EdgeEffects effects) 379internal void DrawText(HDC dc, Rectangle bounds, string? textToDraw, bool drawDisabled, TextFormatFlags flags) 413internal Rectangle GetBackgroundContentRectangle(HDC dc, Rectangle bounds) 579internal unsafe Size GetPartSize(HDC dc, ThemeSizeType type, HWND hwnd = default)
System.Windows.Forms.Design (1)
System\Windows\Forms\Design\ControlDesigner.cs (1)
2041using Graphics g = Graphics.FromHdc((HDC)m.WParamInternal);
System.Windows.Forms.Primitives (29)
System\Windows\Forms\DeviceContextExtensions.cs (10)
26this HDC hdc, 43internal static void FillRectangle(this HDC hdc, Rectangle rectangle, HBRUSH hbrush) 56internal static void DrawLine(this HDC hdc, HPEN hpen, Point p1, Point p2) => 62internal static void DrawLine(this HDC hdc, HPEN hpen, int x1, int y1, int x2, int y2) => 80internal static unsafe void DrawLines(this HDC hdc, HPEN hpen, ReadOnlySpan<int> lines) 101/// Calls <see cref="PInvoke.GetNearestColor(HDC, COLORREF)"/> to get the nearest color for the given 117internal static Color FindNearestColor(this HDC hdc, Color color) 123internal static Graphics CreateGraphics(this HDC hdc) => Graphics.FromHdcInternal(hdc); 135this HDC hdc, 152internal static void FillRectangle(this HDC hdc, HBRUSH hbrush, Rectangle rectangle)
System\Windows\Forms\DeviceContextExtensions.IDeviceContextAdapter.cs (2)
14public HDC GetHdc() => (HDC)_deviceContext.GetHdc();
Windows\Win32\PInvoke.DrawTextEx.cs (2)
8/// <inheritdoc cref="DrawTextEx(HDC, PWSTR, int, RECT*, DRAW_TEXT_FORMAT, DRAWTEXTPARAMS*)"/> 10HDC hdc,
Windows\Win32\PInvoke.FillRect.cs (2)
8/// <inheritdoc cref="FillRect(HDC, in RECT, HBRUSH)"/> 10where T : IHandle<HDC>
Windows\Win32\PInvoke.GetTextExtentPoint32.cs (2)
10/// <inheritdoc cref="GetTextExtentPoint32W(HDC, PCWSTR, int, SIZE*)"/> 11public static unsafe BOOL GetTextExtentPoint32W<T>(T hdc, string lpString, int c, Size size) where T : IHandle<HDC>
Windows\Win32\PInvoke.GetThemeFont.cs (2)
10/// <inheritdoc cref="GetThemeFont(HTHEME, HDC, int, int, int, LOGFONTW*)"/> 11public static unsafe HRESULT GetThemeFont<T>(T hTheme, HDC hdc, int iPartId, int iStateId, int iPropId, out LOGFONT pFont)
Windows\Win32\PInvoke.ImageList.cs (4)
28/// <inheritdoc cref="ImageList_Draw(HIMAGELIST, int, HDC, int, int, IMAGE_LIST_DRAW_STYLE)"/> 29public static bool Draw<T>(T himl, int i, HDC hdcDst, int x, int y, IMAGE_LIST_DRAW_STYLE fStyle) 37/// <inheritdoc cref="ImageList_DrawEx(HIMAGELIST, int, HDC, int, int, int, int, COLORREF, COLORREF, IMAGE_LIST_DRAW_STYLE)"/> 48IMAGE_LIST_DRAW_STYLE fStyle) where THIML : IHandle<HIMAGELIST> where THDC : IHandle<HDC>
Windows\Win32\PInvoke.IntersectClipRect.cs (2)
8/// <inheritdoc cref="IntersectClipRect(HDC, int, int, int, int)"/> 9public static GDI_REGION_TYPE IntersectClipRect<T>(T hdc, int left, int top, int right, int bottom) where T : IHandle<HDC>
Windows\Win32\UI\Controls\Dialogs\CHOOSEFONTW.cs (1)
56public HDC hDC;
Windows\Win32\UI\Controls\Dialogs\PRINTDLGW_32.cs (1)
24public HDC hDC;
Windows\Win32\UI\Controls\Dialogs\PRINTDLGW_64.cs (1)
120public HDC hDC;
System.Windows.Forms.Primitives.Tests (9)
System\Windows\Forms\DeviceContextHdcScopeTests.cs (1)
251HDC mockHdc = new(1234);
System\Windows\Forms\DeviceContextScopeTests.cs (2)
13private static extern int GetRandomRgn(HDC hdc, HRGN hrgn, int i); 80Assert.Equal(dcScope.HDC, (HDC)hdc);
System\Windows\Forms\Internals\ArgumentValidationTests.cs (3)
91HDC param = new(IntPtr.Zero); 99HDC param = new(new IntPtr(24)); 106HDC param = new(IntPtr.Zero);
Windows\Win32\RegionTests.cs (3)
14using CreateDcScope hdc = new(HDC.Null); 34using CreateDcScope hdc = new(HDC.Null); 48using CreateDcScope hdc = new(HDC.Null);
System.Windows.Forms.Primitives.TestUtilities (14)
DeviceContextState.cs (1)
26public DeviceContextState(HDC hdc)
HdcDeviceContextAdapter.cs (3)
9/// Simple adapter for passing <see cref="HDC"/> as <see cref="IDeviceContext"/>. Does not manage HDC 14private readonly HDC _hdc; 16public HdcDeviceContextAdapter(HDC hdc) => _hdc = hdc;
Metafiles\EmfRecord.cs (2)
11public HDC HDC { get; } 18HDC hdc,
Metafiles\EmfScope.cs (8)
19public HDC HDC { get; } 27public EmfScope(HDC hdc) 38private static unsafe HDC CreateEnhMetaFile( 39HDC hdc = default, 47HDC metafileHdc = PInvokeCore.CreateEnhMetaFile(hdc, pFileName, lprc, pDesc); 86(delegate* unmanaged[Stdcall]<HDC, HANDLETABLE*, ENHMETARECORD*, int, LPARAM, int>)callback, 234HDC hdc, 247public static implicit operator HDC(in EmfScope scope) => scope.HDC;
System.Windows.Forms.Tests (7)
System\Windows\Forms\AxHostTests.cs (3)
1594iPicture.get_CurDC(out HDC hdc).Should().Be(HRESULT.E_FAIL); 1680iPicture.get_CurDC(out HDC curDc).ThrowOnFailure(); 1708iPicture.get_CurDC(out HDC _).Should().Be(HRESULT.E_FAIL);
System\Windows\Forms\ComponentModel\Com2Interop\COM2PictureConverterTests.cs (4)
197public HRESULT get_CurDC(HDC* phDC) => HRESULT.S_OK; 202public HRESULT Render(HDC hDC, int x, int y, int cx, int cy, int xSrc, int ySrc, int cxSrc, int cySrc, RECT* pRcWBounds) => HRESULT.S_OK; 204public HRESULT SelectPicture(HDC hDCIn, HDC* phDCOut, OLE_HANDLE* phBmpOut) => HRESULT.S_OK;