600 references to SafeNativeMethods
System.Windows.Forms (600)
winforms\Managed\System\WinForms\Application.cs (36)
764VisualStyleState vState = (VisualStyleState) SafeNativeMethods.GetThemeAppProperties(); 776SafeNativeMethods.SetThemeAppProperties((int)value); 780SafeNativeMethods.EnumThreadWindowsCallback callback = new SafeNativeMethods.EnumThreadWindowsCallback(Application.SendThemeChanged); 781SafeNativeMethods.EnumWindows(callback, IntPtr.Zero); 794int thisPID = SafeNativeMethods.GetCurrentProcessId(); 795SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(null, handle), out processId); 796if (processId == thisPID && SafeNativeMethods.IsWindowVisible(new HandleRef(null, handle))) { 799SafeNativeMethods.RedrawWindow(new HandleRef(null, handle), 1244int id = SafeNativeMethods.GetWindowThreadProcessId(handle, out pid); 2110if (msg.hwnd != IntPtr.Zero && SafeNativeMethods.IsWindowUnicode(new HandleRef(null, msg.hwnd))) { 2396UnsafeNativeMethods.DuplicateHandle(new HandleRef(null, SafeNativeMethods.GetCurrentProcess()), new HandleRef(null, SafeNativeMethods.GetCurrentThread()), 2397new HandleRef(null, SafeNativeMethods.GetCurrentProcess()), ref address, 0, false, 2402id = SafeNativeMethods.GetCurrentThreadId(); 2783bool ourThread = SafeNativeMethods.GetCurrentThreadId() == id; 2865int hwndThread = SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(parkingWindows[0], parkingWindows[0].Handle), out pid); 2866int currentThread = SafeNativeMethods.GetCurrentThreadId(); 3063if (context == null && id == SafeNativeMethods.GetCurrentThreadId()) { 3105if (culture == null || culture.LCID != SafeNativeMethods.GetThreadLocale()) 3106culture = new CultureInfo(SafeNativeMethods.GetThreadLocale()); 3430if (SafeNativeMethods.IsWindowEnabled(hwndOwner)) { 3431SafeNativeMethods.EnableWindow(hwndOwner, false); 3445SafeNativeMethods.IsWindowEnabled(new HandleRef(currentForm, currentForm.Handle)) != modalEnabled) { 3446SafeNativeMethods.EnableWindow(new HandleRef(currentForm, currentForm.Handle), modalEnabled); 3488SafeNativeMethods.EnableWindow(hwndOwner, true); 3535if (msg.hwnd != IntPtr.Zero && SafeNativeMethods.IsWindowUnicode(new HandleRef(null, msg.hwnd))) { 3750if (culture != null && culture.LCID != SafeNativeMethods.GetThreadLocale()) { 3751SafeNativeMethods.SetThreadLocale(culture.LCID); 3968SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(null, UnsafeNativeMethods.GetActiveWindow()), out pid); 3969if (pid == SafeNativeMethods.GetCurrentProcessId()) { 4149int id = SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(this, HandleInternal), out lpdwProcessId); 4240UnsafeNativeMethods.EnumThreadWindows(SafeNativeMethods.GetCurrentThreadId(), 4251if (SafeNativeMethods.IsWindowVisible(new HandleRef(null, hWnd)) && SafeNativeMethods.IsWindowEnabled(new HandleRef(null, hWnd))) { 4301if (UnsafeNativeMethods.IsWindow(new HandleRef(null, hWnd))) SafeNativeMethods.EnableWindow(new HandleRef(null, hWnd), state);
winforms\Managed\System\WinForms\AxHost.cs (10)
123private readonly int REGMSG_MSG = SafeNativeMethods.RegisterWindowMessage(Application.WindowMessagesVersion + "_subclassCheck"); 131private static Guid ifontDisp_Guid = typeof(SafeNativeMethods.IFontDisp).GUID; 2118msg.time = SafeNativeMethods.GetTickCount(); 2123if (SafeNativeMethods.IsAccelerator(new HandleRef(ctlInfo, ctlInfo.hAccel), ctlInfo.cAccel, ref msg, null)) { 3381SafeNativeMethods.OleCreatePropertyFrame(new HandleRef(this, handle), 0, 0, name, 1, ref o, uuids.cElems, new HandleRef(null, uuids.pElems), Application.CurrentCulture.LCID, 0, IntPtr.Zero); 4972SafeNativeMethods.IFontDisp rval = SafeNativeMethods.OleCreateIFontDispIndirect(GetFONTDESCFromFont(font), ref ifontDisp_Guid); 4993SafeNativeMethods.IFontDisp oleFont = (SafeNativeMethods.IFontDisp)font; 5175SafeNativeMethods.SysFreeString(new HandleRef(null, pbstr));
winforms\Managed\System\WinForms\ButtonInternal\ButtonStandardAdapter.cs (2)
100SafeNativeMethods.FillRect(new HandleRef(e, e.HDC), ref r, new HandleRef(this, 101isHighContrastHighlighted ? SafeNativeMethods.GetSysColorBrush(ColorTranslator.ToOle(color) & 0xFF) : Control.BackColorBrush));
winforms\Managed\System\WinForms\ButtonInternal\CheckBoxBaseAdapter.cs (1)
263SafeNativeMethods.DrawFrameControl(new HandleRef(offscreen, dc), ref rcCheck,
winforms\Managed\System\WinForms\CheckedListBox.cs (4)
108LBC_GETCHECKSTATE = SafeNativeMethods.RegisterWindowMessage("LBC_GETCHECKSTATE"); 109LBC_SETCHECKSTATE = SafeNativeMethods.RegisterWindowMessage("LBC_SETCHECKSTATE"); 551SafeNativeMethods.InvalidateRect(new HandleRef(this, Handle), ref rect, false); 880SafeNativeMethods.InvalidateRect(new HandleRef(this, Handle), null, true);
winforms\Managed\System\WinForms\ColorDialog.cs (1)
297if (!SafeNativeMethods.ChooseColor(cc)) return false;
winforms\Managed\System\WinForms\ComboBox.cs (21)
2049SafeNativeMethods.InvalidateRect(new HandleRef(this, childEdit.Handle), null, false); 2052SafeNativeMethods.InvalidateRect(new HandleRef(this, childListBox.Handle), null, false); 2211SafeNativeMethods.SetTextColor(new HandleRef(null, dc), ColorTranslator.ToWin32(ForeColor)); 2212SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(BackColor)); 2293SafeNativeMethods.RedrawWindow(new HandleRef(this, Handle), 3165SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), mode); 3189SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), mode); 3212SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), mode); 3229int ret = SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), (int)AutoCompleteSource | mode); 3239SafeNativeMethods.SHAutoComplete(new HandleRef(this, childEdit.Handle), mode); 3376SafeNativeMethods.SetWindowPos(new HandleRef(this, dropDownHandle), NativeMethods.NullHandleRef, 0, 0, DropDownWidth, height, 3454SafeNativeMethods.GetClientRect(new HandleRef(this, Handle), ref rect); 3621SafeNativeMethods.SelectPalette(new HandleRef(this, dis.hDC), new HandleRef(null, oldPal), 0); 3763NativeMethods.RegionFlags updateRegionFlags = (NativeMethods.RegionFlags)SafeNativeMethods.GetUpdateRgn(new HandleRef(this, this.Handle), new HandleRef(this, wr.HRegion), true); 4804SafeNativeMethods.InvalidateRect(new HandleRef(this, _owningComboBox.GetListHandle()), null, false); 5782return SafeNativeMethods.IsWindowVisible(new HandleRef(this, Handle)); 5871UnsafeNativeMethods.EnumThreadWindows(SafeNativeMethods.GetCurrentThreadId(), new NativeMethods.EnumThreadWindowsCallback(this.Callback), new HandleRef(null, IntPtr.Zero)); 6110SafeNativeMethods.ValidateRect(new HandleRef(comboBox, comboBox.Handle), ref validRect); 6115SafeNativeMethods.ValidateRect(new HandleRef(comboBox, comboBox.Handle), ref validRect); 6120SafeNativeMethods.ValidateRect(new HandleRef(comboBox, comboBox.Handle), ref validRect); 6125SafeNativeMethods.ValidateRect(new HandleRef(comboBox, comboBox.Handle), ref validRect);
winforms\Managed\System\WinForms\CommonDialog.cs (2)
182SafeNativeMethods.SetWindowPos(new HandleRef(null, hWnd), NativeMethods.NullHandleRef, x, y, 0, 0, NativeMethods.SWP_NOSIZE | 294helpMsg = SafeNativeMethods.RegisterWindowMessage("commdlg_help");
winforms\Managed\System\WinForms\ComponentManagerBroker.cs (3)
113int pid = SafeNativeMethods.GetCurrentProcessId(); 267_creationThread = SafeNativeMethods.GetCurrentThreadId(); 474if (_refCount == 1 && SafeNativeMethods.GetCurrentThreadId() == _creationThread) {
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2AboutBoxPropertyDescriptor.cs (1)
168SafeNativeMethods.GetThreadLCID(),
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2ComponentEditor.cs (2)
69SafeNativeMethods.OleCreatePropertyFrame(new HandleRef(parent, handle), 0, 0, "PropertyPages", 1, ref o, 1, new Guid[]{guid}, Application.CurrentCulture.LCID, 0, IntPtr.Zero); 92SafeNativeMethods.OleCreatePropertyFrame(new HandleRef(parent, handle), 0, 0, "PropertyPages", 1, ref o, uuids.cElems, new HandleRef(uuids, uuids.pElems), Application.CurrentCulture.LCID, 0, IntPtr.Zero);
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2IManagedPerPropertyBrowsingHandler.cs (2)
207SafeNativeMethods.SysFreeString(new HandleRef(null, bstr)); 240SafeNativeMethods.VariantClear(new HandleRef(null, curVariant));
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2PropertyDescriptor.cs (6)
158oleConverters[typeof(SafeNativeMethods.IFontDisp).GUID] = typeof(Com2FontConverter); 880SafeNativeMethods.GetThreadLCID(), 1243SafeNativeMethods.VariantInit(new HandleRef(null, mem)); 1251SafeNativeMethods.GetThreadLCID(), 1295int result = SafeNativeMethods.FormatMessage(NativeMethods.FORMAT_MESSAGE_FROM_SYSTEM | 1322SafeNativeMethods.VariantClear(new HandleRef(null, mem));
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2PropertyPageUITypeConverter.cs (2)
101SafeNativeMethods.OleCreatePropertyFrame(new HandleRef(null, parentHandle), 108SafeNativeMethods.GetThreadLCID(),
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\COM2TypeInfoProcessor.cs (2)
98pTypeInfo = iDispatch.GetTypeInfo(0, SafeNativeMethods.GetThreadLCID()); 185int hr = obj.GetIDsOfNames(ref g, names, 1, SafeNativeMethods.GetThreadLCID(), pDispid);
winforms\Managed\System\WinForms\ComponentModel\COM2Interop\ComNativeDescriptor.cs (2)
167int hr = iDispatch.GetIDsOfNames(ref g, names, 1, SafeNativeMethods.GetThreadLCID(), dispid); 208SafeNativeMethods.GetThreadLCID(),
winforms\Managed\System\WinForms\ContainerControl.cs (3)
755HandleRef hfontOld = new HandleRef(this, SafeNativeMethods.SelectObject(hdc, hfont)); 759SafeNativeMethods.GetTextMetrics(hdc, ref tm); 775SafeNativeMethods.SelectObject(hdc, hfontOld);
winforms\Managed\System\WinForms\ContextMenu.cs (1)
231SafeNativeMethods.TrackPopupMenuEx(new HandleRef(this, Handle),
winforms\Managed\System\WinForms\Control.cs (89)
164WM_GETCONTROLNAME = SafeNativeMethods.RegisterWindowMessage("WM_GETCONTROLNAME"); 165WM_GETCONTROLTYPE = SafeNativeMethods.RegisterWindowMessage("WM_GETCONTROLTYPE"); 1056backBrush = SafeNativeMethods.GetSysColorBrush(ColorTranslator.ToOle(color) & 0xFF); 1060backBrush = SafeNativeMethods.CreateSolidBrush(ColorTranslator.ToWin32(color)); 1405bool visible = SafeNativeMethods.IsWindowVisible(new HandleRef(window, Handle)); 1406bool enabled = SafeNativeMethods.IsWindowEnabled(new HandleRef(window, Handle)); 1483SafeNativeMethods.ReleaseCapture(); 2020return SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(this, Handle), out pid); 2023return SafeNativeMethods.GetCurrentThreadId(); 3021if (SafeNativeMethods.IsWindowVisible(new HandleRef(null, next))) { 3100int hwndThread = SafeNativeMethods.GetWindowThreadProcessId(hwnd, out pid); 3101int currentThread = SafeNativeMethods.GetCurrentThreadId(); 3592if (UnsafeNativeMethods.SetWindowRgn(new HandleRef(this, Handle), new HandleRef(this, regionHandle), SafeNativeMethods.IsWindowVisible(new HandleRef(this, Handle))) != 0) { 3599SafeNativeMethods.DeleteObject(new HandleRef(null, regionHandle)); 4538int textLen = SafeNativeMethods.GetWindowTextLength(new HandleRef(window, Handle)); 5615else if (IsHandleCreated && GetTopLevel() && SafeNativeMethods.IsWindowEnabled(new HandleRef(window, Handle))) { 5616SafeNativeMethods.SetWindowPos(new HandleRef(window, Handle), NativeMethods.HWND_TOP, 0, 0, 0, 0, 6000SafeNativeMethods.DeleteObject(new HandleRef(this, p)); 6125SafeNativeMethods.DoDragDrop(dataObject, dropSource, (int)allowedEffects, finalEffect); 6180SafeNativeMethods.BitBlt(new HandleRef(destGraphics, desthDC), targetBounds.X, targetBounds.Y, width, height, 6214if (SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(marshaler, marshaler.Handle), out pid) == SafeNativeMethods.GetCurrentThreadId()) { 7110SafeNativeMethods.TrackMouseEvent(trackMouseEvent); 7142SafeNativeMethods.SetTextColor(new HandleRef(null, dc), ColorTranslator.ToWin32(ForeColor)); 7143SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(BackColor)); 7178int message = SafeNativeMethods.RegisterWindowMessage(NativeMethods.MSH_MOUSEWHEEL); 7218SafeNativeMethods.RedrawWindow(new HandleRef(this, Handle), 7228SafeNativeMethods.InvalidateRgn(new HandleRef(this, Handle), 7235SafeNativeMethods.DeleteObject(new HandleRef(region, regionHandle)); 7269SafeNativeMethods.RedrawWindow(new HandleRef(window, Handle), 7279SafeNativeMethods.InvalidateRect(new HandleRef(window, Handle), 7314SafeNativeMethods.RedrawWindow(new HandleRef(window, Handle), 7328SafeNativeMethods.InvalidateRect(new HandleRef(window, Handle), 7759SafeNativeMethods.AdjustWindowRectExForDpi(ref rect, style, bMenu, exStyle, (uint)deviceDpi); 7761SafeNativeMethods.AdjustWindowRectEx(ref rect, style, bMenu, exStyle); 7805if (SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(this, Handle), out pid) == SafeNativeMethods.GetCurrentThreadId()) { 7828threadCallbackMessage = SafeNativeMethods.RegisterWindowMessage(Application.WindowMessagesVersion + "_ThreadCallbackMessage"); 7971SafeNativeMethods.DeleteObject(new HandleRef(this, p)); 8170SafeNativeMethods.EnableWindow(new HandleRef(this, Handle), Enabled); 8752if (UnsafeNativeMethods.SetWindowRgn(new HandleRef(this, Handle), new HandleRef(this, regionHandle), SafeNativeMethods.IsWindowVisible(new HandleRef(this, Handle))) != 0) { 8759SafeNativeMethods.DeleteObject(new HandleRef(null, regionHandle)); 8876SafeNativeMethods.DeleteObject(new HandleRef(this, p)); 10349bool success = SafeNativeMethods.GetViewportOrgEx(hDC, viewportOrg); 10352HandleRef hClippingRegion = new HandleRef(null, SafeNativeMethods.CreateRectRgn(viewportOrg.x,viewportOrg.y, viewportOrg.x + this.Width, viewportOrg.y + this.Height)); 10357NativeMethods.RegionFlags selectResult = (NativeMethods.RegionFlags)SafeNativeMethods.SelectClipRgn(hDC, hClippingRegion); 10365success = SafeNativeMethods.DeleteObject(hClippingRegion); 11793SafeNativeMethods.SetWindowPos(new HandleRef(window, Handle), NativeMethods.HWND_BOTTOM, 0, 0, 0, 0, 11898SafeNativeMethods.SetWindowPos(new HandleRef(window, Handle), NativeMethods.NullHandleRef, x, y, width, height, flags); 12055IntPtr result = SafeNativeMethods.SelectPalette(new HandleRef(null, dc), new HandleRef(null, halftonePalette), (force ? 0 : 1)); 12058SafeNativeMethods.RealizePalette(new HandleRef(null, dc)); 12131SafeNativeMethods.ShowWindow(new HandleRef(this, Handle), value ? ShowParams : NativeMethods.SW_HIDE); 12144SafeNativeMethods.SetWindowPos(new HandleRef(window, Handle), 12183if (!SafeNativeMethods.IsWindowVisible(new HandleRef(this,this.Handle))) { 12197SafeNativeMethods.SetWindowPos( 12505SafeNativeMethods.UpdateWindow(new HandleRef(window, InternalHandle)); 12708SafeNativeMethods.SetWindowPos(new HandleRef(ctl.window, ctl.Handle), new HandleRef(null, prevHandle), 0, 0, 0, 0, 12755SafeNativeMethods.SetWindowPos( 13767SafeNativeMethods.SelectPalette(new HandleRef(null, dc), new HandleRef(null, oldPal), 0); 16693SafeNativeMethods.LPtoDP(new HandleRef(null, hdcDraw), ref rc, 2); 16695iMode = SafeNativeMethods.SetMapMode(new HandleRef(null, hdcDraw), NativeMethods.MM_ANISOTROPIC); 16696SafeNativeMethods.SetWindowOrgEx(new HandleRef(null, hdcDraw), 0, 0, pW); 16697SafeNativeMethods.SetWindowExtEx(new HandleRef(null, hdcDraw), control.Width, control.Height, sWindowExt); 16698SafeNativeMethods.SetViewportOrgEx(new HandleRef(null, hdcDraw), rc.left, rc.top, pVp); 16699SafeNativeMethods.SetViewportExtEx(new HandleRef(null, hdcDraw), rc.right - rc.left, rc.bottom - rc.top, sViewportExt); 16721SafeNativeMethods.SetWindowOrgEx(new HandleRef(null, hdcDraw), pW.x, pW.y, null); 16722SafeNativeMethods.SetWindowExtEx(new HandleRef(null, hdcDraw), sWindowExt.cx, sWindowExt.cy, null); 16723SafeNativeMethods.SetViewportOrgEx(new HandleRef(null, hdcDraw), pVp.x, pVp.y, null); 16724SafeNativeMethods.SetViewportExtEx(new HandleRef(null, hdcDraw), sViewportExt.cx, sViewportExt.cy, null); 16725SafeNativeMethods.SetMapMode(new HandleRef(null, hdcDraw), iMode); 17449IntPtr newRegion = SafeNativeMethods.CreateRectRgn(0, 0, 0, 0); 17451SafeNativeMethods.CombineRgn(new HandleRef(null, newRegion), new HandleRef(null, region), new HandleRef(this, clipRegion), NativeMethods.RGN_DIFF); 17452SafeNativeMethods.DeleteObject(new HandleRef(null, region)); 17455SafeNativeMethods.DeleteObject(new HandleRef(null, newRegion)); 18418clipRegion = SafeNativeMethods.CreateRectRgn(rcIntersect.left, rcIntersect.top, 18438UnsafeNativeMethods.SetWindowRgn(new HandleRef(control, control.Handle), new HandleRef(this, finalClipRegion), SafeNativeMethods.IsWindowVisible(new HandleRef(control, control.Handle))); 18534if (SafeNativeMethods.IsWindowUnicode(new HandleRef(null, lpmsg.hwnd))) { 19252hBitmap = new HandleRef(this, SafeNativeMethods.CreateBitmap(size.Width, size.Height, planes, bitsPixel, IntPtr.Zero)); 19254hOriginalBmp = new HandleRef(this, SafeNativeMethods.SelectObject(hBitmapDC, hBitmap)); 19271SafeNativeMethods.SelectObject(hBitmapDC, hOriginalBmp); 19272success = SafeNativeMethods.DeleteObject(hBitmap); 19300HandleRef hNullBitmap = new HandleRef(this, SafeNativeMethods.CreateBitmap(1, 1, 1, 1, IntPtr.Zero)); 19304HandleRef hBitmap = new HandleRef(this, SafeNativeMethods.SelectObject(hdcSrc, hNullBitmap)); 19309SafeNativeMethods.SelectObject(hdcSrc, hBitmap); 19336SafeNativeMethods.GetSystemPaletteEntries(hdcSrc, 0, (int)iColors, aj); 19362int diRet = SafeNativeMethods.GetDIBits(hdcSrc, hBitmap, 0, bmp.bmHeight, lpBits, 19385int iRet = SafeNativeMethods.StretchDIBits(hdcDest, 19393SafeNativeMethods.DeleteObject(hNullBitmap); 20017SafeNativeMethods.DeleteObject(new HandleRef(this, handle));
winforms\Managed\System\WinForms\ControlPaint.cs (50)
163IntPtr palette = SafeNativeMethods.CreateHalftonePalette(new HandleRef(null, hdcS)); 166SafeNativeMethods.GetPaletteEntries(new HandleRef(null, palette), 0, entryCount, entries); 175SafeNativeMethods.DeleteObject(new HandleRef(null, palette)); 205hBitmap = SafeNativeMethods.CreateDIBSection(new HandleRef(null, hdcS), new HandleRef(null, bitmapInfo), NativeMethods.DIB_RGB_COLORS, 215IntPtr previousBitmap = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, hBitmap)); 220SafeNativeMethods.DeleteObject( new HandleRef( null, previousBitmap ) ); 230SafeNativeMethods.DeleteObject( new HandleRef( null, hBitmap ) ); 287IntPtr mask = SafeNativeMethods.CreateBitmap(size.Width, size.Height, 1, /* 1bpp */ 1, bits); 311IntPtr previousSourceBitmap = SafeNativeMethods.SelectObject(new HandleRef(null, source), new HandleRef(null, monochromeMask)); 312IntPtr previousTargetBitmap = SafeNativeMethods.SelectObject(new HandleRef(null, target), new HandleRef(null, colorMask)); 321SafeNativeMethods.SetBkColor(new HandleRef(null, target), 0x00ffffff); // white 322SafeNativeMethods.SetTextColor(new HandleRef(null, target), 0); // black 323SafeNativeMethods.BitBlt(new HandleRef(null, target), 0, 0, size.Width, size.Height, new HandleRef(null, source), 326SafeNativeMethods.SelectObject(new HandleRef(null, source), new HandleRef(null, previousSourceBitmap)); 327SafeNativeMethods.SelectObject(new HandleRef(null, target), new HandleRef(null, previousTargetBitmap)); 340IntPtr hBitmap = SafeNativeMethods.CreateBitmap(8, 8, 1, 1, grayPattern); 346IntPtr brush = SafeNativeMethods.CreateBrushIndirect(lb); 348SafeNativeMethods.DeleteObject(new HandleRef(null, hBitmap)); 362bool result = SafeNativeMethods.BitBlt(targetHDC, destinationLocation.X, destinationLocation.Y, destWidth, destHeight, 973SafeNativeMethods.DrawEdge(new HandleRef(wg, wg.DeviceContext.Hdc), ref rc, edge, flags); 1284SafeNativeMethods.DrawFrameControl(new HandleRef(null, dc), ref rcCheck, 1367SafeNativeMethods.DrawFrameControl(new HandleRef(wg, wg.DeviceContext.Hdc), ref rcFrame, kind, (int) state); 1788pen = SafeNativeMethods.CreatePen(NativeMethods.PS_DOT, 1, ColorTranslator.ToWin32(backColor)); 1793pen = SafeNativeMethods.CreatePen(NativeMethods.PS_SOLID, 2, ColorTranslator.ToWin32(backColor)); 1797int prevRop2 = SafeNativeMethods.SetROP2(new HandleRef(null, dc), rop2); 1798IntPtr oldBrush = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, UnsafeNativeMethods.GetStockObject(NativeMethods.HOLLOW_BRUSH))); 1799IntPtr oldPen = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, pen)); 1800SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(graphicsColor)); 1801SafeNativeMethods.Rectangle(new HandleRef(null, dc), rectangle.X, rectangle.Y, rectangle.Right, rectangle.Bottom); 1803SafeNativeMethods.SetROP2(new HandleRef(null, dc), prevRop2); 1804SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, oldBrush)); 1805SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, oldPen)); 1809SafeNativeMethods.DeleteObject(new HandleRef(null, pen)); 1827IntPtr pen = SafeNativeMethods.CreatePen(NativeMethods.PS_SOLID, 1, ColorTranslator.ToWin32(backColor)); 1829int prevRop2 = SafeNativeMethods.SetROP2(new HandleRef(null, dc), rop2); 1830IntPtr oldBrush = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, UnsafeNativeMethods.GetStockObject(NativeMethods.HOLLOW_BRUSH))); 1831IntPtr oldPen = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, pen)); 1834SafeNativeMethods.MoveToEx(new HandleRef(null, dc), start.X, start.Y, null); 1835SafeNativeMethods.LineTo(new HandleRef(null, dc), end.X, end.Y); 1837SafeNativeMethods.SetROP2(new HandleRef(null, dc), prevRop2); 1838SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, oldBrush)); 1839SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, oldPen)); 1840SafeNativeMethods.DeleteObject(new HandleRef(null, pen)); 2008IntPtr brush = SafeNativeMethods.CreateSolidBrush(ColorTranslator.ToWin32(backColor)); 2010int prevRop2 = SafeNativeMethods.SetROP2(new HandleRef(null, dc), rop2); 2011IntPtr oldBrush = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, brush)); 2014SafeNativeMethods.PatBlt(new HandleRef(null, dc), rectangle.X, rectangle.Y, rectangle.Width, rectangle.Height, rop3); 2016SafeNativeMethods.SetROP2(new HandleRef(null, dc), prevRop2); 2017SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, oldBrush)); 2018SafeNativeMethods.DeleteObject(new HandleRef(null, brush));
winforms\Managed\System\WinForms\Cursor.cs (15)
185SafeNativeMethods.GetClipCursor(ref r); 221IntPtr curHandle = SafeNativeMethods.GetCursor(); 278SafeNativeMethods.GetIconInfo(new HandleRef(this, currentIcon.Handle), info); 287SafeNativeMethods.ExternalDeleteObject(new HandleRef(null, info.hbmMask)); 292SafeNativeMethods.ExternalDeleteObject(new HandleRef(null, info.hbmColor)); 365return SafeNativeMethods.CopyImage(new HandleRef(this, Handle), NativeMethods.IMAGE_CURSOR, sz.Width, sz.Height, 0); 467SafeNativeMethods.DrawIcon(new HandleRef(graphics, dc), targetX, targetY, new HandleRef(this, handle)); 483SafeNativeMethods.DrawIcon(new HandleRef(graphics, dc), targetX, targetY, new HandleRef(this, handle)); 498SafeNativeMethods.IntersectClipRect(new HandleRef(this, Handle), targetX, targetY, targetX+clipWidth, targetY+clipHeight); 499SafeNativeMethods.DrawIconEx(new HandleRef(graphics, dc), targetX - imageX, targetY - imageY, 580handle = SafeNativeMethods.LoadCursor(NativeMethods.NullHandleRef, nResourceId); 593SafeNativeMethods.GetIconInfo(new HandleRef(this, iconHandle), info); 598SafeNativeMethods.IntDeleteObject(new HandleRef(null, info.hbmColor)); 607SafeNativeMethods.IntDeleteObject(new HandleRef(null, info.hbmMask)); 640handle = SafeNativeMethods.CopyImageAsCursor(new HandleRef(this, cursorHandle), NativeMethods.IMAGE_CURSOR,
winforms\Managed\System\WinForms\DataFormats.cs (2)
221int formatId = SafeNativeMethods.RegisterClipboardFormat(format); 265if (0 == SafeNativeMethods.GetClipboardFormatName(id, s, s.Capacity)) {
winforms\Managed\System\WinForms\DataGrid.cs (7)
2299SafeNativeMethods.ScrollWindow(new HandleRef(this, Handle), 5859IntPtr saveBrush = SafeNativeMethods.SelectObject(new HandleRef(this, dc), new HandleRef(null, halftone)); 5860SafeNativeMethods.PatBlt(new HandleRef(this, dc), r.X, r.Y, r.Width, r.Height, NativeMethods.PATINVERT); 5861SafeNativeMethods.SelectObject(new HandleRef(this, dc), new HandleRef(null, saveBrush)); 5862SafeNativeMethods.DeleteObject(new HandleRef(null, halftone)); 8629SafeNativeMethods.ScrollWindow(new HandleRef(this, Handle), 0, deltaY, ref scrollArea, ref scrollArea); 8883SafeNativeMethods.ScrollWindow(new HandleRef(this, Handle), 0, -parentRowsRect.Height, ref scrollRECT, ref scrollRECT);
winforms\Managed\System\WinForms\DataGridToolTip.cs (2)
41SafeNativeMethods.InitCommonControlsEx(icc); 50SafeNativeMethods.SetWindowPos(new HandleRef(tipWindow, tipWindow.Handle), NativeMethods.HWND_NOTOPMOST, 0, 0, 0, 0, NativeMethods.SWP_NOSIZE | NativeMethods.SWP_NOMOVE | NativeMethods.SWP_NOACTIVATE);
winforms\Managed\System\WinForms\DataGridViewCheckBoxCell.cs (1)
1441SafeNativeMethods.DrawFrameControl(new HandleRef(offscreen, dc), ref rcCheck,
winforms\Managed\System\WinForms\DataGridViewMethods.cs (13)
5769IntPtr saveBrush = SafeNativeMethods.SelectObject(new HandleRef(this, dc), new HandleRef(null, halftone)); 5771SafeNativeMethods.PatBlt(new HandleRef(this, dc), r.X, r.Y, r.Width, DATAGRIDVIEW_shadowEdgeThickness, NativeMethods.PATINVERT); 5772SafeNativeMethods.PatBlt(new HandleRef(this, dc), r.X, r.Y + r.Height - DATAGRIDVIEW_shadowEdgeThickness, r.Width, DATAGRIDVIEW_shadowEdgeThickness, NativeMethods.PATINVERT); 5773SafeNativeMethods.PatBlt(new HandleRef(this, dc), r.X, r.Y + DATAGRIDVIEW_shadowEdgeThickness, DATAGRIDVIEW_shadowEdgeThickness, r.Height - 2 * DATAGRIDVIEW_shadowEdgeThickness, NativeMethods.PATINVERT); 5774SafeNativeMethods.PatBlt(new HandleRef(this, dc), r.X + r.Width - DATAGRIDVIEW_shadowEdgeThickness, r.Y + DATAGRIDVIEW_shadowEdgeThickness, DATAGRIDVIEW_shadowEdgeThickness, r.Height - 2 * DATAGRIDVIEW_shadowEdgeThickness, NativeMethods.PATINVERT); 5776SafeNativeMethods.SelectObject(new HandleRef(this, dc), new HandleRef(null, saveBrush)); 5777SafeNativeMethods.DeleteObject(new HandleRef(null, halftone)); 5790IntPtr saveBrush = SafeNativeMethods.SelectObject(new HandleRef(this, dc), new HandleRef(null, halftone)); 5791SafeNativeMethods.PatBlt(new HandleRef(this, dc), r.X, r.Y, r.Width, r.Height, NativeMethods.PATINVERT); 5792SafeNativeMethods.SelectObject(new HandleRef(this, dc), new HandleRef(null, saveBrush)); 5793SafeNativeMethods.DeleteObject(new HandleRef(null, halftone)); 26360SafeNativeMethods.ScrollWindow(new HandleRef(this, this.Handle), 26471SafeNativeMethods.ScrollWindow(new HandleRef(this, this.Handle), 0, deltaY, ref scrollArea, ref scrollArea);
winforms\Managed\System\WinForms\DataObject.cs (8)
151IntPtr srcOld = SafeNativeMethods.SelectObject(new HandleRef(null, dcSrc), new HandleRef(bm, hBitmap)); 156IntPtr hBitmapNew = SafeNativeMethods.CreateCompatibleBitmap(new HandleRef(null, hDC), bm.Size.Width, bm.Size.Height); 160IntPtr destOld = SafeNativeMethods.SelectObject(new HandleRef(null, dcDest), new HandleRef(null, hBitmapNew)); 161SafeNativeMethods.BitBlt(new HandleRef(null, dcDest), 0, 0, bm.Size.Width, bm.Size.Height, new HandleRef(null, dcSrc), 0, 0, 0x00CC0020); 165SafeNativeMethods.SelectObject(new HandleRef(null, dcSrc), new HandleRef(null, srcOld)); 166SafeNativeMethods.SelectObject(new HandleRef(null, dcDest), new HandleRef(null, destOld)); 172SafeNativeMethods.DeleteObject(new HandleRef(bm, hBitmap)); 1644SafeNativeMethods.DeleteObject(new HandleRef(null, medium.unionmember));
winforms\Managed\System\WinForms\DateTimePicker.cs (3)
1131SafeNativeMethods.InitCommonControlsEx(icc); 1576SafeNativeMethods.InvalidateRect(new HandleRef(c, c.hwndFound), null, true); 1577SafeNativeMethods.UpdateWindow(new HandleRef(c, c.hwndFound));
winforms\Managed\System\WinForms\Design\ComponentEditorForm.cs (19)
687IntPtr hbitmapTemp = SafeNativeMethods.CreateBitmap(8, 8, 1, 1, patternBits); 692hbrushDither = SafeNativeMethods.CreatePatternBrush(new HandleRef(null, hbitmapTemp)); 697SafeNativeMethods.DeleteObject(new HandleRef(null, hbitmapTemp)); 712hfontOld = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(Parent, ((Control)Parent).FontHandle)); 717SafeNativeMethods.SetBkMode(new HandleRef(null, dc), NativeMethods.TRANSPARENT); 720SafeNativeMethods.SetBkColor(new HandleRef(null, dc), backColor); 732SafeNativeMethods.SetTextColor(new HandleRef(null, dc), textColor); 736SafeNativeMethods.ImageList_Draw(new HandleRef(imagelist, imagelist.Handle), imageIndex, new HandleRef(null, dc), 745savedColor = SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 756SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(SystemColors.ControlDark)); 766SafeNativeMethods.SetBkColor(new HandleRef(null, dc), savedColor); 770SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(null, hfontOld)); 828SafeNativeMethods.DeleteObject(new HandleRef(this, hbrushDither)); 834IntPtr hbrushOld = SafeNativeMethods.SelectObject(new HandleRef(null, dc), new HandleRef(this, hbrushDither)); 839oldTextColor = SafeNativeMethods.SetTextColor(new HandleRef(null, dc), ColorTranslator.ToWin32(SystemColors.ControlLightLight)); 840oldBackColor = SafeNativeMethods.SetBkColor(new HandleRef(null, dc), ColorTranslator.ToWin32(SystemColors.Control)); 842SafeNativeMethods.PatBlt(new HandleRef(null, dc), rc.left, rc.top, rc.right - rc.left, rc.bottom - rc.top, NativeMethods.PATCOPY); 843SafeNativeMethods.SetTextColor(new HandleRef(null, dc), oldTextColor); 844SafeNativeMethods.SetBkColor(new HandleRef(null, dc), oldBackColor);
winforms\Managed\System\WinForms\ErrorProvider.cs (9)
961SafeNativeMethods.InitCommonControlsEx(icc); 970SafeNativeMethods.SetWindowPos(new HandleRef(tipWindow, tipWindow.Handle), NativeMethods.HWND_TOP, 0, 0, 0, 0, NativeMethods.SWP_NOSIZE | NativeMethods.SWP_NOMOVE | NativeMethods.SWP_NOACTIVATE); 994SafeNativeMethods.SetWindowPos(new HandleRef(this, Handle), 1074SafeNativeMethods.DrawIconEx(new HandleRef(this, mirrordc.Hdc), bounds.X - windowBounds.X, bounds.Y - windowBounds.Y, new HandleRef(provider.Region, provider.Region.IconHandle), bounds.Width, bounds.Height, 0, NativeMethods.NullHandleRef, NativeMethods.DI_NORMAL); 1274SafeNativeMethods.DeleteObject(new HandleRef(null, windowRegionHandle)); 1278SafeNativeMethods.SetWindowPos(new HandleRef(this, Handle), NativeMethods.HWND_TOP, windowBounds.X, windowBounds.Y, 1280SafeNativeMethods.InvalidateRect(new HandleRef(this, Handle), null, false); 1710SafeNativeMethods.GetBitmapBits(new HandleRef(null, mask), bits.Length, bits); 1725SafeNativeMethods.DeleteObject(new HandleRef(null, mask));
winforms\Managed\System\WinForms\FileDialog.cs (1)
210int textLen = SafeNativeMethods.GetWindowTextLength(new HandleRef(this, dialogHWnd));
winforms\Managed\System\WinForms\FontDialog.cs (3)
502SafeNativeMethods.ShowWindow(new HandleRef(null, hWndCtl), NativeMethods.SW_HIDE); 504SafeNativeMethods.ShowWindow(new HandleRef(null, hWndCtl), NativeMethods.SW_HIDE); 610if (!SafeNativeMethods.ChooseFont(cf)) return false;
winforms\Managed\System\WinForms\Form.cs (19)
1778SafeNativeMethods.SetWindowPos(new HandleRef(this, Handle), NativeMethods.NullHandleRef, 2577SafeNativeMethods.SetWindowPos(new HandleRef(this, Handle), key, 0, 0, 0, 0, 2713SafeNativeMethods.ShowWindow(new HandleRef(this, Handle), NativeMethods.SW_SHOW); 2789SafeNativeMethods.ShowWindow(new HandleRef(this, hWnd), NativeMethods.SW_NORMAL); 2792SafeNativeMethods.ShowWindow(new HandleRef(this, hWnd), NativeMethods.SW_MAXIMIZE); 2795SafeNativeMethods.ShowWindow(new HandleRef(this, hWnd), NativeMethods.SW_MINIMIZE); 3433SafeNativeMethods.GetClientRect(new HandleRef(this, h), ref rc); 3457SafeNativeMethods.GetClientRect(new HandleRef(this, h), ref rc); 5117SafeNativeMethods.SetWindowPos(new HandleRef(this, HandleInternal), NativeMethods.NullHandleRef, e.SuggestedRectangle.X, e.SuggestedRectangle.Y, e.SuggestedRectangle.Width, e.SuggestedRectangle.Height, NativeMethods.SWP_NOZORDER | NativeMethods.SWP_NOACTIVATE); 5525SafeNativeMethods.EnumThreadWindowsCallback callback = null; 5530callback = new SafeNativeMethods.EnumThreadWindowsCallback(etwcb.Callback); 5531UnsafeNativeMethods.EnumThreadWindows(SafeNativeMethods.GetCurrentThreadId(), 6172SafeNativeMethods.ReleaseCapture(); 6233if (UnsafeNativeMethods.IsWindow(new HandleRef(null, hWndActive)) && SafeNativeMethods.IsWindowVisible(new HandleRef(null, hWndActive))) { 6236else if (UnsafeNativeMethods.IsWindow(new HandleRef(null, hWndOwner)) && SafeNativeMethods.IsWindowVisible(new HandleRef(null, hWndOwner))){ 6582SafeNativeMethods.DrawMenuBar(new HandleRef(this, Handle)); 6830SafeNativeMethods.RedrawWindow(new HandleRef(this, Handle), null, NativeMethods.NullHandleRef, NativeMethods.RDW_INVALIDATE | NativeMethods.RDW_FRAME); 7813SafeNativeMethods.InitCommonControlsEx(icc); 7879SafeNativeMethods.SetWindowPos(new HandleRef(window, window.Handle), NativeMethods.HWND_TOPMOST,
winforms\Managed\System\WinForms\GroupBox.cs (1)
771SafeNativeMethods.GetClientRect(new HandleRef(this, Handle), ref rect);
winforms\Managed\System\WinForms\Help.cs (8)
237SafeNativeMethods.HtmlHelp(handle, pathAndFileName, htmlCommand, stringHtmlParam); 240SafeNativeMethods.HtmlHelp(handle, pathAndFileName, htmlCommand, (int)htmlParam); 243SafeNativeMethods.HtmlHelp(handle, pathAndFileName, htmlCommand, (NativeMethods.HH_FTS_QUERY)htmlParam); 249SafeNativeMethods.HtmlHelp(NativeMethods.NullHandleRef, pathAndFileName, HH_DISPLAY_TOPIC, (string)null); 250SafeNativeMethods.HtmlHelp(handle, pathAndFileName, htmlCommand, (NativeMethods.HH_AKLINK)htmlParam); 254SafeNativeMethods.HtmlHelp(handle, pathAndFileName, htmlCommand, (string)param); 258SafeNativeMethods.HtmlHelp(handle, pathAndFileName, MapCommandToHTMLCommand(command, null, out htmlParam), 0); 261SafeNativeMethods.HtmlHelp(handle, pathAndFileName, HH_DISPLAY_TEXT_POPUP, (NativeMethods.HH_POPUP)param);
winforms\Managed\System\WinForms\HtmlDocument.cs (3)
561SafeNativeMethods.GetThreadLCID(), dispids); 576hr = scriptObject.Invoke(dispids[0], ref g, SafeNativeMethods.GetThreadLCID(), 832SafeNativeMethods.VariantClear(new HandleRef(null, (IntPtr)(a + VariantSize * i)));
winforms\Managed\System\WinForms\HtmlElement.cs (2)
610SafeNativeMethods.GetThreadLCID(), dispids); 626hr = scriptObject.Invoke(dispids[0], ref g, SafeNativeMethods.GetThreadLCID(),
winforms\Managed\System\WinForms\ImageList.cs (20)
312this.nativeImageList = new NativeImageList(SafeNativeMethods.ImageList_Duplicate(new HandleRef(himl, himl.Handle))); 314if(SafeNativeMethods.ImageList_GetIconSize(new HandleRef(this, this.nativeImageList.Handle), out x, out y)) { 319if(SafeNativeMethods.ImageList_GetImageInfo(new HandleRef(this, this.nativeImageList.Handle), 0, imageInfo)) { 483int index = SafeNativeMethods.ImageList_ReplaceIcon(new HandleRef(this, Handle), -1, new HandleRef(icon, icon.Handle)); 499int index = SafeNativeMethods.ImageList_Add(new HandleRef(this, Handle), new HandleRef(null, hBitmap), new HandleRef(null, hMask)); 500SafeNativeMethods.DeleteObject(new HandleRef(null, hBitmap)); 501SafeNativeMethods.DeleteObject(new HandleRef(null, hMask)); 543SafeNativeMethods.InitCommonControls(); 544nativeImageList = new NativeImageList(SafeNativeMethods.ImageList_Create(imageSize.Width, imageSize.Height, flags, INITIAL_CAPACITY, GROWBY)); 551SafeNativeMethods.ImageList_SetBkColor(new HandleRef(this, Handle), NativeMethods.CLR_NONE); 630SafeNativeMethods.ImageList_DrawEx(new HandleRef(this, Handle), index, new HandleRef(g, dc), x, y, 708if(SafeNativeMethods.ImageList_GetImageInfo(new HandleRef(this, this.Handle), index, imageInfo)) { 751SafeNativeMethods.ImageList_DrawEx(new HandleRef(this, Handle), index, new HandleRef(graphics, dc), 0, 0, 949SafeNativeMethods.ImageList_Destroy(new HandleRef(null, himl)); 1073return SafeNativeMethods.ImageList_GetImageCount(new HandleRef(owner, owner.Handle)); 1171bool ok = SafeNativeMethods.ImageList_Replace(new HandleRef(owner, owner.Handle), index, new HandleRef(null, hBitmap), new HandleRef(null, hMask)); 1172SafeNativeMethods.DeleteObject(new HandleRef(null, hBitmap)); 1173SafeNativeMethods.DeleteObject(new HandleRef(null, hMask)); 1424SafeNativeMethods.ImageList_Remove(new HandleRef(owner, owner.Handle), -1); 1580bool ok = SafeNativeMethods.ImageList_Remove(new HandleRef(owner, owner.Handle), index);
winforms\Managed\System\WinForms\ImageListStreamer.cs (4)
70SafeNativeMethods.InitCommonControls(); 72SafeNativeMethods.ImageList_Read(new UnsafeNativeMethods.ComStreamFromDataStream(ms))); 241int hResult = SafeNativeMethods.ImageList_WriteEx(new HandleRef(this, imagelistHandle), NativeMethods.ILP_DOWNLEVEL, new UnsafeNativeMethods.ComStreamFromDataStream(stream)); 248return SafeNativeMethods.ImageList_Write(new HandleRef(this, imagelistHandle), new UnsafeNativeMethods.ComStreamFromDataStream(stream));
winforms\Managed\System\WinForms\InputLanguage.cs (4)
67return new InputLanguage(SafeNativeMethods.GetKeyboardLayout(0)); 77IntPtr handleOld = SafeNativeMethods.ActivateKeyboardLayout(new HandleRef(value, value.handle), 0); 118int size = SafeNativeMethods.GetKeyboardLayoutList(0, null); 121SafeNativeMethods.GetKeyboardLayoutList(size, handles);
winforms\Managed\System\WinForms\ListBox.cs (1)
2349SafeNativeMethods.SelectPalette(new HandleRef(null, dc), new HandleRef(null, oldPal), 0);
winforms\Managed\System\WinForms\ListView.cs (8)
2458SafeNativeMethods.InitCommonControlsEx(icc); 2518SafeNativeMethods.SelectObject(new HandleRef(nmcd->nmcd, nmcd->nmcd.hdc), new HandleRef(odCacheFontHandleWrapper, odCacheFontHandleWrapper.Handle)); 2842SafeNativeMethods.SelectObject(new HandleRef(nmcd->nmcd, nmcd->nmcd.hdc), new HandleRef(null, odCacheFontHandle)); 2852SafeNativeMethods.SelectObject(new HandleRef(nmcd->nmcd, nmcd->nmcd.hdc), new HandleRef(odCacheFontHandleWrapper, odCacheFontHandleWrapper.Handle)); 3588SafeNativeMethods.InvalidateRect(new HandleRef(this, hwndHdr), null, true); 4600SafeNativeMethods.SetWindowPos(new HandleRef(this, hdrHWND), 5478Color foreColor = ColorTranslator.FromWin32(SafeNativeMethods.GetTextColor(new HandleRef(this, nmcd->hdc))); 5479Color backColor = ColorTranslator.FromWin32(SafeNativeMethods.GetBkColor(new HandleRef(this, nmcd->hdc)));
winforms\Managed\System\WinForms\ListViewInsertionMark.cs (3)
78color = SafeNativeMethods.ColorFromCOLORREF((int)listView.SendMessage(NativeMethods.LVM_GETINSERTMARKCOLOR, 0, 0)); 87listView.SendMessage(NativeMethods.LVM_SETINSERTMARKCOLOR, 0, SafeNativeMethods.ColorToCOLORREF(color)); 140listView.SendMessage(NativeMethods.LVM_SETINSERTMARKCOLOR, 0, SafeNativeMethods.ColorToCOLORREF(color));
winforms\Managed\System\WinForms\MaskedTextBox.cs (1)
2007SafeNativeMethods.RedrawWindow(new HandleRef(this, this.Handle), null, NativeMethods.NullHandleRef, NativeMethods.RDW_INVALIDATE | NativeMethods.RDW_FRAME);
winforms\Managed\System\WinForms\MDIClient.cs (5)
298rgn1 = SafeNativeMethods.CreateRectRgn(0, 0, bounds.Width, bounds.Height); 300rgn2 = SafeNativeMethods.CreateRectRgn(-rect.left, -rect.top, 306if (SafeNativeMethods.CombineRgn(new HandleRef(null, rgn1), new HandleRef(null, rgn1), new HandleRef(null, rgn2), NativeMethods.RGN_DIFF) == 0) 319SafeNativeMethods.DeleteObject(new HandleRef(null, rgn2)); 325SafeNativeMethods.DeleteObject(new HandleRef(null, rgn1));
winforms\Managed\System\WinForms\MenuItem.cs (2)
1478SafeNativeMethods.DrawMenuBar(new HandleRef(f, f.Handle)); 1506SafeNativeMethods.SelectPalette(new HandleRef(null, dis.hDC), new HandleRef(null, oldPal), 0);
winforms\Managed\System\WinForms\MessageBox.cs (1)
484result = Win32ToDialogResult(SafeNativeMethods.MessageBox(new HandleRef(owner, handle), text, caption, style));
winforms\Managed\System\WinForms\MonthCalendar.cs (1)
1370SafeNativeMethods.InitCommonControlsEx(icc);
winforms\Managed\System\WinForms\NativeMethods.cs (3)
2195wmMouseEnterMessage = SafeNativeMethods.RegisterWindowMessage("WinFormsMouseEnter"); 2205wmUnSubclass = SafeNativeMethods.RegisterWindowMessage("WinFormsUnSubclass"); 2732hicon = SafeNativeMethods.CopyImage(new HandleRef(icon, icon.Handle), NativeMethods.IMAGE_ICON, icon.Size.Width, icon.Size.Height, 0);
winforms\Managed\System\WinForms\NativeWindow.cs (2)
176int id = SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(null, handle), out lpdwProcessId); 182SafeNativeMethods.GetExitCodeThread(new HandleRef(null, threadHandle), out exitCode);
winforms\Managed\System\WinForms\NotifyIcon.cs (2)
47private static int WM_TASKBARCREATED = SafeNativeMethods.RegisterWindowMessage("TaskbarCreated"); 734SafeNativeMethods.TrackPopupMenuEx(new HandleRef(contextMenu, contextMenu.Handle),
winforms\Managed\System\WinForms\NumericUpDown.cs (1)
550SafeNativeMethods.MessageBeep(0);
winforms\Managed\System\WinForms\OpenFileDialog.cs (1)
204int errorCode = SafeNativeMethods.CommDlgExtendedError();
winforms\Managed\System\WinForms\OSFeature.cs (1)
78SafeNativeMethods.IsAppThemed();
winforms\Managed\System\WinForms\PaintEvent.cs (1)
170SafeNativeMethods.SelectPalette(new HandleRef(this, dc), new HandleRef(this, oldPal), 0);
winforms\Managed\System\WinForms\Printing\PrintPreviewControl.cs (2)
369if (SafeNativeMethods.GetScrollInfo(new HandleRef(this, m.HWnd), direction, si)) 750SafeNativeMethods.ScrollWindow(new HandleRef(this, Handle),
winforms\Managed\System\WinForms\ProgressBar.cs (1)
745SafeNativeMethods.InitCommonControlsEx(icc);
winforms\Managed\System\WinForms\PropertyGridInternal\GridEntry.cs (8)
2208oldTextColor = SafeNativeMethods.SetTextColor(new HandleRef(g, hdc), SafeNativeMethods.RGBToCOLORREF(textColor.ToArgb())); 2209oldBkColor = SafeNativeMethods.SetBkColor(new HandleRef(g, hdc), SafeNativeMethods.RGBToCOLORREF(bkColor.ToArgb())); 2210hfont = SafeNativeMethods.SelectObject(new HandleRef(g, hdc), new HandleRef(null, hfont)); 2234SafeNativeMethods.SetTextColor(new HandleRef(g, hdc), oldTextColor); 2235SafeNativeMethods.SetBkColor(new HandleRef(g, hdc), oldBkColor); 2236hfont = SafeNativeMethods.SelectObject(new HandleRef(g, hdc), new HandleRef(null, hfont));
winforms\Managed\System\WinForms\PropertyGridInternal\GridToolTip.cs (2)
110SafeNativeMethods.InitCommonControlsEx(icc); 204SafeNativeMethods.SetWindowPos(new HandleRef(this, Handle), NativeMethods.HWND_TOPMOST,
winforms\Managed\System\WinForms\PropertyGridInternal\PropertyGridView.cs (12)
1663SafeNativeMethods.SetWindowPos(new HandleRef(this.dropDownHolder, this.dropDownHolder.Handle), NativeMethods.NullHandleRef, loc.X, loc.Y, size.Width, size.Height, flags); 1706SafeNativeMethods.ShowWindow(new HandleRef(dropDownHolder, dropDownHolder.Handle), NativeMethods.SW_SHOWNA); 1737SafeNativeMethods.ShowWindow(new HandleRef(dropDownHolder, dropDownHolder.Handle), NativeMethods.SW_SHOWNA); 3659SafeNativeMethods.ExternalDeleteObject(new HandleRef(this, baseHfont)); 3663SafeNativeMethods.ExternalDeleteObject(new HandleRef(this, boldHfont)); 3876hFont = SafeNativeMethods.SelectObject(new HandleRef(DropDownListBox, hdc), new HandleRef(Font, hFont)); 3890SafeNativeMethods.GetTextMetrics(new HandleRef(DropDownListBox, hdc), ref tm); 3895hFont = SafeNativeMethods.SelectObject(new HandleRef(DropDownListBox, hdc), new HandleRef(Font, hFont)); 3898SafeNativeMethods.DeleteObject(new HandleRef(Font, hFont)); 7149SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(control, control.Handle), out thisProcessID); 7159SafeNativeMethods.GetCurrentThreadId()); 7239SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(null, hWndAtPoint), out pid);
winforms\Managed\System\WinForms\RichTextBox.cs (4)
526if (SafeNativeMethods.GetWindowTextLength(new HandleRef(this, Handle)) > 0) { 2113int textLen = SafeNativeMethods.GetWindowTextLength(new HandleRef(this, Handle)); 3533SafeNativeMethods.MessageBeep(0); 3622int textLength = SafeNativeMethods.GetWindowTextLength(new HandleRef(this, Handle));
winforms\Managed\System\WinForms\SafeNativeMethods.cs (3)
171public static extern SafeNativeMethods.IFontDisp OleCreateIFontDispIndirect(NativeMethods.FONTDESC fd, ref Guid iid); 368int retVal = SafeNativeMethods.GetTextMetricsA(hDC, ref lptmA); 396return SafeNativeMethods.GetTextMetricsW(hDC, ref lptm);
winforms\Managed\System\WinForms\SaveFileDialog.cs (1)
208int errorCode = SafeNativeMethods.CommDlgExtendedError();
winforms\Managed\System\WinForms\Screen.cs (6)
91SafeNativeMethods.GetMonitorInfo(new HandleRef(null, monitor), info); 124SafeNativeMethods.EnumDisplayMonitors(NativeMethods.NullHandleRef, null, proc, IntPtr.Zero); 248SafeNativeMethods.GetMonitorInfo(new HandleRef(null, hmonitor), info); 310return new Screen(SafeNativeMethods.MonitorFromPoint(pt, MONITOR_DEFAULTTONEAREST)); 329return new Screen(SafeNativeMethods.MonitorFromRect(ref rc, MONITOR_DEFAULTTONEAREST)); 364return new Screen(SafeNativeMethods.MonitorFromWindow(new HandleRef(null, hwnd), MONITOR_DEFAULTTONEAREST));
winforms\Managed\System\WinForms\ScrollableControl.cs (2)
878SafeNativeMethods.ScrollWindowEx(new HandleRef(this, Handle), xDelta, yDelta, 991SafeNativeMethods.GetScrollInfo(new HandleRef(this, Handle), fnBar, si);
winforms\Managed\System\WinForms\ScrollBar.cs (1)
895SafeNativeMethods.GetScrollInfo(new HandleRef(this, Handle), NativeMethods.SB_CTL, si);
winforms\Managed\System\WinForms\SendKeys.cs (2)
188int oemVal = SafeNativeMethods.OemKeyScan((short)(0xFF & (int)character)); 1095eventmsg.time = SafeNativeMethods.GetTickCount();
winforms\Managed\System\WinForms\SplitContainer.cs (4)
1638IntPtr saveBrush = SafeNativeMethods.SelectObject(new HandleRef(this, dc), new HandleRef(null, halftone)); 1639SafeNativeMethods.PatBlt(new HandleRef(this, dc), r.X, r.Y, r.Width, r.Height, NativeMethods.PATINVERT); 1640SafeNativeMethods.SelectObject(new HandleRef(this, dc), new HandleRef(null, saveBrush)); 1641SafeNativeMethods.DeleteObject(new HandleRef(null, halftone));
winforms\Managed\System\WinForms\Splitter.cs (4)
775IntPtr saveBrush = SafeNativeMethods.SelectObject(new HandleRef(ParentInternal, dc), new HandleRef(null, halftone)); 776SafeNativeMethods.PatBlt(new HandleRef(ParentInternal, dc), r.X, r.Y, r.Width, r.Height, NativeMethods.PATINVERT); 777SafeNativeMethods.SelectObject(new HandleRef(ParentInternal, dc), new HandleRef(null, saveBrush)); 778SafeNativeMethods.DeleteObject(new HandleRef(null, halftone));
winforms\Managed\System\WinForms\StatusBar.cs (3)
639SafeNativeMethods.InitCommonControlsEx(icc); 1681SafeNativeMethods.InitCommonControlsEx(icc); 1815SafeNativeMethods.SetWindowPos(new HandleRef(this, Handle), NativeMethods.HWND_TOPMOST,
winforms\Managed\System\WinForms\StringSorter.cs (3)
119this.lcid = culture == null? SafeNativeMethods.GetThreadLocale(): culture.LCID; 141return Compare(SafeNativeMethods.GetThreadLocale(), s1, s2, 0); 150return Compare(SafeNativeMethods.GetThreadLocale(), s1, s2, options);
winforms\Managed\System\WinForms\SystemInformation.cs (6)
134int message = SafeNativeMethods.RegisterWindowMessage(NativeMethods.MSH_SCROLL_LINES); 634return SafeNativeMethods.GetDoubleClickTime(); 1683return unchecked((int)SafeNativeMethods.GetCaretBlinkTime()); 1797SafeNativeMethods.EnumDisplaySettings(null, -1 /*ENUM_CURRENT_SETTINGS*/, ref dm); 1970IntPtr hDsk = SafeNativeMethods.OpenInputDesktop(0, false, NativeMethods.DESKTOP_SWITCHDESKTOP); 1978SafeNativeMethods.CloseDesktop(hDsk);
winforms\Managed\System\WinForms\TabControl.cs (4)
102private readonly int tabBaseReLayoutMessage = SafeNativeMethods.RegisterWindowMessage(Application.WindowMessagesVersion + "_TabBaseReLayout"); 1108SafeNativeMethods.InitCommonControlsEx(icc); 1362SafeNativeMethods.SetWindowPos(new HandleRef(this, tooltipHwnd), 2061SafeNativeMethods.SelectPalette(new HandleRef(null, dis.hDC), new HandleRef(null, oldPal), 0);
winforms\Managed\System\WinForms\TextBox.cs (3)
608SafeNativeMethods.RedrawWindow(new HandleRef(this, this.Handle), null, NativeMethods.NullHandleRef, NativeMethods.RDW_INVALIDATE | NativeMethods.RDW_FRAME); 813int ret = SafeNativeMethods.SHAutoComplete(new HandleRef(this, Handle) , (int)AutoCompleteSource | mode); 835SafeNativeMethods.SHAutoComplete(new HandleRef(this, Handle) , mode);
winforms\Managed\System\WinForms\TextBoxBase.cs (1)
1258return SafeNativeMethods.GetWindowTextLength(new HandleRef(this, Handle));
winforms\Managed\System\WinForms\Timer.cs (4)
347int hwndThread = SafeNativeMethods.GetWindowThreadProcessId(new HandleRef(this, hWnd), out pid); 348int currentThread = SafeNativeMethods.GetCurrentThreadId(); 367_timerID = (int) SafeNativeMethods.SetTimer(new HandleRef(this, Handle), TimerID++, interval, IntPtr.Zero); 409SafeNativeMethods.KillTimer(new HandleRef(this, hWnd), _timerID);
winforms\Managed\System\WinForms\ToolBar.cs (3)
1055SafeNativeMethods.InitCommonControlsEx(icc); 1563SafeNativeMethods.TrackPopupMenuEx( 1753SafeNativeMethods.SetWindowPos(new HandleRef(null, note.hwndFrom), NativeMethods.NullHandleRef, leftTop.x, leftTop.y, 0, 0, NativeMethods.SWP_NOSIZE | NativeMethods.SWP_NOZORDER | NativeMethods.SWP_NOACTIVATE);
winforms\Managed\System\WinForms\ToolStrip.cs (7)
2848SafeNativeMethods.BitBlt(new HandleRef(this, desthDC), bounds.X, bounds.Y, bounds.Width, bounds.Height, 3728SafeNativeMethods.BitBlt(itemHDC, 0, 0, item.Size.Width, item.Size.Height, toolStripHDC, item.Bounds.X, item.Bounds.Y, NativeMethods.SRCCOPY); 3736SafeNativeMethods.BitBlt(toolStripHDC, item.Bounds.X, item.Bounds.Y, item.Size.Width, item.Size.Height, itemHDC, 0, 0, NativeMethods.SRCCOPY); 5236cachedItemBitmap = new HandleRef(this, SafeNativeMethods.CreateCompatibleBitmap(toolStripHDC, bitmapSize.Width, bitmapSize.Height)); 5237IntPtr oldBitmap = SafeNativeMethods.SelectObject(cachedItemHDC,cachedItemBitmap); 5242SafeNativeMethods.ExternalDeleteObject(new HandleRef(null, oldBitmap)); 5260SafeNativeMethods.DeleteObject(cachedItemBitmap);
winforms\Managed\System\WinForms\ToolStripDropDown.cs (4)
1103SafeNativeMethods.SetWindowPos(new HandleRef(this, Handle), topMostFlag, 0, 0, 0, 0, 1841else if (IsHandleCreated && SafeNativeMethods.IsWindowEnabled(new HandleRef(this, Handle))) { 1842SafeNativeMethods.SetWindowPos(new HandleRef(this, Handle), NativeMethods.HWND_TOP, 0, 0, 0, 0, 2234SafeNativeMethods.RedrawWindow(activeHwndHandleRef, null, NativeMethods.NullHandleRef, NativeMethods.RDW_FRAME | NativeMethods.RDW_INVALIDATE);
winforms\Managed\System\WinForms\ToolStripItem.cs (1)
2601SafeNativeMethods.DoDragDrop(dataObject, dropSource, (int)allowedEffects, finalEffect);
winforms\Managed\System\WinForms\ToolStripManager.cs (3)
927SafeNativeMethods.ShowCaret(NativeMethods.NullHandleRef); 1174SafeNativeMethods.HideCaret(NativeMethods.NullHandleRef); 1415SafeNativeMethods.GetCurrentThreadId());
winforms\Managed\System\WinForms\ToolStripPanel.cs (1)
861SafeNativeMethods.UpdateWindow(new HandleRef(null, msg.hwnd));
winforms\Managed\System\WinForms\ToolStripTextBox.cs (8)
727hTotalRegion = new HandleRef(this, SafeNativeMethods.CreateRectRgn(0, 0, this.Width, this.Height)); 728hClientRegion = new HandleRef(this, SafeNativeMethods.CreateRectRgn(absoluteClientRectangle.left, absoluteClientRectangle.top, absoluteClientRectangle.right, absoluteClientRectangle.bottom)); 729hNonClientRegion = new HandleRef(this, SafeNativeMethods.CreateRectRgn(0,0,0,0)); 731SafeNativeMethods.CombineRgn(hNonClientRegion, hTotalRegion, hClientRegion, NativeMethods.RGN_XOR); 735SafeNativeMethods.RedrawWindow(new HandleRef(this, Handle), 745SafeNativeMethods.DeleteObject(hNonClientRegion); 751SafeNativeMethods.DeleteObject(hClientRegion); 756SafeNativeMethods.DeleteObject(hTotalRegion);
winforms\Managed\System\WinForms\ToolTip.cs (5)
884SafeNativeMethods.InitCommonControlsEx(icc); 2173SafeNativeMethods.SetWindowPos(new HandleRef(this, this.Handle), 2344SafeNativeMethods.SetWindowPos(new HandleRef(this, this.Handle), 2353SafeNativeMethods.SetWindowPos(new HandleRef(this, this.Handle), 2372SafeNativeMethods.ShowWindow(new HandleRef(this, Handle), NativeMethods.SW_HIDE);
winforms\Managed\System\WinForms\TrackBar.cs (1)
861SafeNativeMethods.InitCommonControlsEx(icc);
winforms\Managed\System\WinForms\TreeNode.cs (1)
1731SafeNativeMethods.InvalidateRect(new HandleRef(tv, tv.Handle), null, false);
winforms\Managed\System\WinForms\TreeView.cs (10)
1660SafeNativeMethods.InitCommonControlsEx(icc); 2045SafeNativeMethods.SetWindowPos(new HandleRef(this, this.Handle), NativeMethods.NullHandleRef, this.Left, this.Top, Int32.MaxValue, this.Height, flags); 2051SafeNativeMethods.SetWindowPos(new HandleRef(this, this.Handle), NativeMethods.NullHandleRef, this.Left, this.Top, oldSize, this.Height, flags); 2098SafeNativeMethods.ImageList_Destroy_Native(new HandleRef(this, handleOld)); 2109SafeNativeMethods.ImageList_Destroy_Native(new HandleRef(this, handle)); 2581SafeNativeMethods.InvalidateRect(new HandleRef(this, Handle), ref rc, true); 2793SafeNativeMethods.SelectObject(new HandleRef(nmcd.nmcd, nmcd.nmcd.hdc), new HandleRef(renderinfo, renderinfo.FontHandle)); 2921SafeNativeMethods.SetWindowPos(new HandleRef(this, tooltipHandle), 3048SendMessage(NativeMethods.WM_CONTEXTMENU, Handle, SafeNativeMethods.GetMessagePos()); 3099SafeNativeMethods.TrackPopupMenuEx(new HandleRef(contextMenu, contextMenu.Handle),
winforms\Managed\System\WinForms\UserControl.cs (1)
296if (hwnd == hwndFocus || SafeNativeMethods.IsChild(new HandleRef(this, hwnd), new HandleRef(null, hwndFocus)))
winforms\Managed\System\WinForms\VisualStyles\VisualStyleInformation.cs (13)
63return (SafeNativeMethods.IsAppThemed()); 71SafeNativeMethods.GetCurrentThemeName(filename, filename.Capacity, null, 0, null, 0); 87SafeNativeMethods.GetCurrentThemeName(null, 0, colorScheme, colorScheme.Capacity, null, 0); 103SafeNativeMethods.GetCurrentThemeName(null, 0, null, 0, size, size.Capacity); 119SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.DisplayName, name, name.Capacity); 135SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Company, company, company.Capacity); 151SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Author, author, author.Capacity); 167SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Copyright, copyright, copyright.Capacity); 185SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Url, url, url.Capacity); 201SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Version, version, version.Capacity); 217SafeNativeMethods.GetThemeDocumentationProperty(ThemeFilename, VisualStyleDocProperty.Description, description, description.Capacity); 239return (SafeNativeMethods.GetThemeSysBool(new HandleRef(null, visualStyleRenderer.Handle), VisualStyleSystemProperty.SupportsFlatMenus)); 262SafeNativeMethods.GetThemeSysInt(new HandleRef(null, visualStyleRenderer.Handle), VisualStyleSystemProperty.MinimumColorDepth, ref mcDepth);
winforms\Managed\System\WinForms\VisualStyles\VisualStyleRenderer.cs (33)
129returnVal = SafeNativeMethods.IsThemePartDefined(new HandleRef(null, hTheme), part, 0); 137returnVal = SafeNativeMethods.IsThemePartDefined(new HandleRef(null, tHandle.NativeHandle), part, 0); 291lastHResult = SafeNativeMethods.DrawThemeBackground(new HandleRef(this, hTheme.NativeHandle), hdc, part, state, new NativeMethods.COMRECT(bounds), null); 295lastHResult = SafeNativeMethods.DrawThemeBackground(new HandleRef(this, Handle), hdc, part, state, new NativeMethods.COMRECT(bounds), null); 325lastHResult = SafeNativeMethods.DrawThemeBackground(new HandleRef(this, hTheme.NativeHandle), hdc, part, state, new NativeMethods.COMRECT(bounds), new NativeMethods.COMRECT(clipRectangle)); 329lastHResult = SafeNativeMethods.DrawThemeBackground(new HandleRef(this, Handle), hdc, part, state, new NativeMethods.COMRECT(bounds), new NativeMethods.COMRECT(clipRectangle)); 361lastHResult = SafeNativeMethods.DrawThemeEdge( new HandleRef( this, Handle ), hdc, part, state, new NativeMethods.COMRECT( bounds ), (int) style, (int) edges | (int) effects | EdgeAdjust, rect ); 452lastHResult = SafeNativeMethods.DrawThemeParentBackground( new HandleRef( this, childControl.Handle ), hdc, new NativeMethods.COMRECT( bounds ) ); 497lastHResult = SafeNativeMethods.DrawThemeText( new HandleRef( this, Handle ), hdc, part, state, textToDraw, textToDraw.Length, (int) flags, disableFlag, new NativeMethods.COMRECT( bounds ) ); 520lastHResult = SafeNativeMethods.GetThemeBackgroundContentRect( new HandleRef( this, Handle ), hdc, part, state, new NativeMethods.COMRECT( bounds ), rect ); 544lastHResult = SafeNativeMethods.GetThemeBackgroundExtent( new HandleRef( this, Handle ), hdc, part, state, new NativeMethods.COMRECT( contentBounds ), rect ); 572lastHResult = SafeNativeMethods.GetThemeBackgroundRegion( new HandleRef( this, Handle ), hdc, part, state, new NativeMethods.COMRECT( bounds ), ref hRegion ); 585 SafeNativeMethods.ExternalDeleteObject(new HandleRef(null, hRegion)); 602lastHResult = SafeNativeMethods.GetThemeBool(new HandleRef(this, Handle), part, state, (int)prop, ref val); 620lastHResult = SafeNativeMethods.GetThemeColor(new HandleRef(this, Handle), part, state, (int)prop, ref color); 638lastHResult = SafeNativeMethods.GetThemeEnumValue(new HandleRef(this, Handle), part, state, (int)prop, ref val); 656lastHResult = SafeNativeMethods.GetThemeFilename(new HandleRef(this, Handle), part, state, (int)prop, filename, filename.Capacity); 684lastHResult = SafeNativeMethods.GetThemeFont( new HandleRef( this, Handle ), hdc, part, state, (int) prop, logfont ); 727lastHResult = SafeNativeMethods.GetThemeInt(new HandleRef(this, Handle), part, state, (int)prop, ref val); 757lastHResult = SafeNativeMethods.GetThemePartSize(new HandleRef(this, hTheme.NativeHandle), hdc, part, state, null, type, size); 761lastHResult = SafeNativeMethods.GetThemePartSize( new HandleRef(this, Handle), hdc, part, state, null, type, size); 789lastHResult = SafeNativeMethods.GetThemePartSize( new HandleRef( this, Handle ), hdc, part, state, new NativeMethods.COMRECT( bounds ), type, size ); 809lastHResult = SafeNativeMethods.GetThemePosition(new HandleRef(this, Handle), part, state, (int)prop, point); 834lastHResult = SafeNativeMethods.GetThemeMargins( new HandleRef( this, Handle ), hdc, part, state, (int) prop, ref margins ); 855lastHResult = SafeNativeMethods.GetThemeString(new HandleRef(this, Handle), part, state, (int)prop, aString, aString.Capacity); 878lastHResult = SafeNativeMethods.GetThemeTextExtent( new HandleRef( this, Handle ), hdc, part, state, textToDraw, textToDraw.Length, (int) flags, null, rect ); 903lastHResult = SafeNativeMethods.GetThemeTextExtent( new HandleRef( this, Handle ), hdc, part, state, textToDraw, textToDraw.Length, (int) flags, new NativeMethods.COMRECT( bounds ), rect ); 924lastHResult = SafeNativeMethods.GetThemeTextMetrics( new HandleRef( this, Handle ), hdc, part, state, ref tm ); 948lastHResult = SafeNativeMethods.HitTestThemeBackground( new HandleRef( this, Handle ), hdc, part, state, (int) options, new NativeMethods.COMRECT( backgroundRectangle ), NativeMethods.NullHandleRef, point, ref htCode ); 991lastHResult = SafeNativeMethods.HitTestThemeBackground( new HandleRef( this, Handle ), hdc, part, state, (int) options, new NativeMethods.COMRECT( backgroundRectangle ), new HandleRef( this, hRgn ), point, ref htCode ); 1004return (SafeNativeMethods.IsThemeBackgroundPartiallyTransparent(new HandleRef(this, Handle), part, state)); 1138hTheme = SafeNativeMethods.OpenThemeData(hWndRef, className); 1171SafeNativeMethods.CloseThemeData(new HandleRef(null, _hTheme));
winforms\Managed\System\WinForms\WebBrowser.cs (1)
1203&& SafeNativeMethods.IsChild(new HandleRef(this, this.Handle), new HandleRef(null, hwndFocus));
winforms\Managed\System\WinForms\WebBrowserBase.cs (2)
396msg.time = SafeNativeMethods.GetTickCount(); 401if (SafeNativeMethods.IsAccelerator(new HandleRef(ctlInfo, ctlInfo.hAccel), ctlInfo.cAccel, ref msg, null)) {
winforms\Managed\System\WinForms\WebBrowserHelper.cs (1)
96internal static readonly int REGMSG_MSG = SafeNativeMethods.RegisterWindowMessage(Application.WindowMessagesVersion + "_subclassCheck");
winforms\Managed\System\WinForms\WinFormsUtils.cs (12)
55int lastXY = SafeNativeMethods.GetMessagePos(); 626success = SafeNativeMethods.GetViewportOrgEx(hDC, viewportOrg); 630HandleRef hClippingRegion = new HandleRef(null, SafeNativeMethods.CreateRectRgn(viewportOrg.x + bounds.Left, viewportOrg.y + bounds.Top, viewportOrg.x + bounds.Right, viewportOrg.y + bounds.Bottom)); 636hOriginalClippingRegion = new HandleRef(this, SafeNativeMethods.CreateRectRgn(0, 0, 0, 0)); 640int result = SafeNativeMethods.GetClipRgn(hDC, hOriginalClippingRegion); 645success = SafeNativeMethods.SetViewportOrgEx(hDC, viewportOrg.x + bounds.Left, viewportOrg.y + bounds.Top, lastViewPort); 652originalRegionType = (NativeMethods.RegionFlags)SafeNativeMethods.GetRgnBox(hOriginalClippingRegion, ref originalClipRect); 661NativeMethods.RegionFlags combineResult = (NativeMethods.RegionFlags)SafeNativeMethods.CombineRgn(hClippingRegion, hClippingRegion, hOriginalClippingRegion, NativeMethods.RGN_AND); 671SafeNativeMethods.DeleteObject(hOriginalClippingRegion); 677NativeMethods.RegionFlags selectResult = (NativeMethods.RegionFlags)SafeNativeMethods.SelectClipRgn(hDC, hClippingRegion); 697success = SafeNativeMethods.DeleteObject(hClippingRegion); 701success = SafeNativeMethods.DeleteObject(hOriginalClippingRegion);