37 references to new
System.Private.Windows.Core (1)
Windows\Win32\Foundation\HandleRef.cs (1)
71return new(handle.Wrapper, Unsafe.As<nint, THandle>(ref local));
System.Windows.Forms (31)
System\Windows\Forms\Accessibility\Control.ControlAccessibleObject.cs (2)
472new HandleRef<HWND>(Owner, HandleInternal), 544PInvoke.UiaHostProviderFromHwnd(new HandleRef<HWND>(this, HandleInternal), out IRawElementProviderSimple* provider);
System\Windows\Forms\ActiveX\AxHost.cs (2)
1771if (PInvoke.IsAccelerator(new HandleRef<HACCEL>(this, ctlInfo.hAccel), ctlInfo.cAccel, &msg, lpwCmd: null)) 3142Application.ParkHandle(new HandleRef<HWND>(this, hwnd), DpiAwarenessContext);
System\Windows\Forms\ActiveX\Control.ActiveXImpl.cs (2)
675PInvoke.DestroyAcceleratorTable(new HandleRef<HACCEL>(_control, _accelTable)); 1666PInvoke.DestroyAcceleratorTable(new HandleRef<HACCEL>(_control, _accelTable));
System\Windows\Forms\Control.cs (4)
5225internal static HandleRef<HWND> GetHandleRef(HWND hwnd) => new(FromChildHandle(hwnd), hwnd); 5450hWndChild = PInvoke.GetWindow(new HandleRef<HWND>(this, hWndChild), GET_WINDOW_CMD.GW_HWNDNEXT)) 5777? new(window, hwnd) 7968PInvokeCore.GetClientRect(new HandleRef<HWND>(_window, InternalHandle), out RECT rect);
System\Windows\Forms\Controls\ComboBox\ComboBox.ACNativeWindow.cs (1)
23PInvokeCore.EnumChildWindows(new HandleRef<HWND>(this, acHandle), RegisterACWindowRecursive);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildEditUiaProvider.cs (1)
88PInvoke.UiaHostProviderFromHwnd(new HandleRef<HWND>(this, _handle), out IRawElementProviderSimple* provider);
System\Windows\Forms\Controls\ComboBox\ComboBox.ComboBoxChildListUiaProvider.cs (1)
183PInvoke.UiaHostProviderFromHwnd(new HandleRef<HWND>(this, _childListControlhandle), out IRawElementProviderSimple* provider);
System\Windows\Forms\Controls\ComboBox\ComboBox.cs (2)
1976return DropDownStyle == ComboBoxStyle.Simple ? new(_childListBox) : new(this, _dropDownHandle); 2295hwnd = PInvoke.GetWindow(new HandleRef<HWND>(this, hwnd), GET_WINDOW_CMD.GW_HWNDNEXT);
System\Windows\Forms\Controls\ImageList\ImageList.cs (5)
215if (PInvoke.ImageList.GetIconSize(new HandleRef<HIMAGELIST>(this, _nativeImageList.HIMAGELIST), out int x, out int y)) 221if (PInvoke.ImageList.GetImageInfo(new HandleRef<HIMAGELIST>(this, _nativeImageList.HIMAGELIST), 0, out IMAGEINFO imageInfo)) 353int index = PInvoke.ImageList.ReplaceIcon(this, -1, new HandleRef<HICON>(icon, (HICON)icon.Handle)); 534new HandleRef<HDC>(g, dc), 670new HandleRef<HDC>(graphics, dc),
System\Windows\Forms\Controls\ImageList\ImageListStreamer.cs (2)
116handle = new(_imageList, (HIMAGELIST)_imageList.Handle); 120handle = new(_nativeImageList, _nativeImageList.HIMAGELIST);
System\Windows\Forms\Controls\ListView\ListView.cs (1)
3802PInvoke.InvalidateRect(new HandleRef<HWND>(this, header), lpRect: null, bErase: true);
System\Windows\Forms\Controls\ToolStrips\ToolStripManager.ModalMenuFilter.cs (2)
141ActiveHwndInternal = new(Control.FromHandle(hwndActive), hwndActive); 414ActiveHwndInternal = new(Control.FromHandle(hwndActive), hwndActive);
System\Windows\Forms\Controls\TreeView\TreeView.cs (2)
2005PInvoke.ImageList.Destroy(new HandleRef<HIMAGELIST>(this, (HIMAGELIST)handleOld)); 2016PInvoke.ImageList.Destroy(new HandleRef<HIMAGELIST>(this, (HIMAGELIST)handle));
System\Windows\Forms\Controls\WebBrowser\WebBrowserBase.cs (2)
342if (!PInvoke.IsAccelerator(new HandleRef<HACCEL>(this, controlInfo.hAccel), controlInfo.cAccel, &msg, lpwCmd: null)) 428Application.ParkHandle(new HandleRef<HWND>(AXInPlaceObject, hwndInPlaceObject), DpiAwarenessContext);
System\Windows\Forms\Dialogs\CommonDialogs\CommonDialog.cs (1)
212ownerHwnd = new(nativeWindow, nativeWindow.HWND);
System\Windows\Forms\ErrorProvider\ErrorProvider.ErrorWindow.ErrorWindowAccessibleObject.cs (1)
83PInvoke.UiaHostProviderFromHwnd(new HandleRef<HWND>(this, _owner.HWND), out IRawElementProviderSimple* provider);
System.Windows.Forms.Design (3)
System\ComponentModel\Design\DesignerActionUI.cs (1)
723new HandleRef<HWND>(_mainParentWindow, (HWND)_mainParentWindow.Handle));
System\ComponentModel\Design\DesignerActionUI.DesignerActionToolStripDropDown.cs (1)
117new HandleRef<HWND>(this, hwndActivating),
System\Windows\Forms\Design\Behavior\BehaviorService.cs (1)
458PInvoke.SetActiveWindow(new HandleRef<HWND>(hWnd, (HWND)hWnd.Handle));
System.Windows.Forms.Tests (2)
SerializableTypesTests.cs (2)
96Assert.True(PInvoke.ImageList.GetIconSize(new HandleRef<HIMAGELIST>(this, nativeImageList.HIMAGELIST), out int x, out int y)); 99Assert.True(PInvoke.ImageList.GetImageInfo(new HandleRef<HIMAGELIST>(this, nativeImageList.HIMAGELIST), 0, out IMAGEINFO imageInfo));