@@ -55,7 +55,8 @@ namespace System.Windows.Forms {
5555 using System . Diagnostics . CodeAnalysis ;
5656 using System . Globalization ;
5757 using System . Runtime . Versioning ;
58-
58+ using static System . Windows . Forms . NativeMethods ;
59+
5960 /// <include file='doc\NativeMethods.uex' path='docs/doc[@for="NativeMethods"]/*' />
6061 internal static class NativeMethods {
6162
@@ -975,6 +976,12 @@ public const int
975976
976977 public const int LOCALE_IMEASURE = 0x0000000D ; // 0 = metric, 1 = US
977978
979+ public const int TVM_SETEXTENDEDSTYLE = TV_FIRST + 44 ;
980+ public const int TVM_GETEXTENDEDSTYLE = TV_FIRST + 45 ;
981+
982+ public const int TVS_EX_FADEINOUTEXPANDOS = 0x0040 ;
983+ public const int TVS_EX_DOUBLEBUFFER = 0x0004 ;
984+
978985 public static readonly int LOCALE_USER_DEFAULT = MAKELCID ( LANG_USER_DEFAULT ) ;
979986 public static readonly int LANG_USER_DEFAULT = MAKELANGID ( LANG_NEUTRAL , SUBLANG_DEFAULT ) ;
980987
@@ -4793,7 +4800,8 @@ public class NMHEADER {
47934800 public int iButton = 0 ;
47944801 public IntPtr pItem = IntPtr . Zero ; // HDITEM*
47954802 }
4796-
4803+
4804+ [ SuppressMessage ( "Microsoft.Design" , "CA1049:TypesThatOwnNativeResourcesShouldBeDisposable" ) ]
47974805 [ StructLayout ( LayoutKind . Sequential ) ]
47984806 public class MOUSEHOOKSTRUCT {
47994807 // pt was a by-value POINT structure
@@ -6009,6 +6017,70 @@ public UiaRect(System.Drawing.Rectangle r) {
60096017 // This value requires KB2533623 to be installed.
60106018 // Windows Server 2003 and Windows XP: This value is not supported.
60116019 internal const int LOAD_LIBRARY_SEARCH_SYSTEM32 = 0x00000800 ;
6020+
6021+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6022+ [ ResourceExposure ( ResourceScope . None ) ]
6023+ public static extern int MapWindowPoints ( IntPtr hWndFrom , IntPtr hWndTo , [ In , Out ] ref RECT rect , int cPoints ) ;
6024+
6025+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6026+ [ ResourceExposure ( ResourceScope . None ) ]
6027+ public static extern int MapWindowPoints ( IntPtr hWndFrom , IntPtr hWndTo , [ In , Out ] POINT pt , int cPoints ) ;
6028+
6029+
6030+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6031+ [ ResourceExposure ( ResourceScope . None ) ]
6032+ public static extern IntPtr WindowFromPoint ( int x , int y ) ;
6033+ [ DllImport ( ExternDll . User32 , CharSet = CharSet . Auto ) ]
6034+ [ ResourceExposure ( ResourceScope . None ) ]
6035+ public static extern IntPtr SendMessage ( IntPtr hWnd , int msg , IntPtr wParam , IntPtr lParam ) ;
6036+ [ DllImport ( ExternDll . User32 , CharSet = CharSet . Auto ) ]
6037+ [ ResourceExposure ( ResourceScope . None ) ]
6038+ public static extern IntPtr SendMessage ( IntPtr hWnd , int msg , int wParam , int lParam ) ;
6039+ [ DllImport ( ExternDll . User32 , CharSet = CharSet . Auto ) ]
6040+ [ ResourceExposure ( ResourceScope . None ) ]
6041+ public static extern IntPtr SendMessage ( IntPtr hWnd , int msg , int wParam , string lParam ) ;
6042+ [ DllImport ( ExternDll . User32 , CharSet = CharSet . Auto ) ]
6043+ [ ResourceExposure ( ResourceScope . None ) ]
6044+ public extern static IntPtr SendMessage ( IntPtr hWnd , int Msg , int wParam , [ In , Out ] TV_HITTESTINFO lParam ) ;
6045+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6046+ [ ResourceExposure ( ResourceScope . None ) ]
6047+ public static extern short GetKeyState ( int keyCode ) ;
6048+ [ DllImport ( ExternDll . Gdi32 , ExactSpelling = true , EntryPoint = "DeleteObject" , CharSet = CharSet . Auto ) ]
6049+ [ ResourceExposure ( ResourceScope . None ) ]
6050+ private static extern bool IntDeleteObject ( IntPtr hObject ) ;
6051+ public static bool DeleteObject ( IntPtr hObject )
6052+ {
6053+ System . Internal . HandleCollector . Remove ( hObject , CommonHandles . GDI ) ;
6054+ return IntDeleteObject ( hObject ) ;
6055+ }
6056+
6057+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6058+ [ ResourceExposure ( ResourceScope . None ) ]
6059+ public static extern bool GetUpdateRect ( IntPtr hwnd , [ In , Out ] ref RECT rc , bool fErase ) ;
6060+
6061+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6062+ [ ResourceExposure ( ResourceScope . None ) ]
6063+ public static extern bool GetUpdateRgn ( IntPtr hwnd , IntPtr hrgn , bool fErase ) ;
6064+
6065+ [ DllImport ( ExternDll . Gdi32 , ExactSpelling = true , EntryPoint = "CreateRectRgn" , CharSet = CharSet . Auto ) ]
6066+ [ ResourceExposure ( ResourceScope . Process ) ]
6067+ private static extern IntPtr IntCreateRectRgn ( int x1 , int y1 , int x2 , int y2 ) ;
6068+ public static IntPtr CreateRectRgn ( int x1 , int y1 , int x2 , int y2 )
6069+ {
6070+ return System . Internal . HandleCollector . Add ( IntCreateRectRgn ( x1 , y1 , x2 , y2 ) , CommonHandles . GDI ) ;
6071+ }
6072+
6073+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6074+ [ ResourceExposure ( ResourceScope . None ) ]
6075+ public static extern IntPtr GetCursor ( ) ;
6076+
6077+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6078+ [ ResourceExposure ( ResourceScope . None ) ]
6079+ public static extern bool GetCursorPos ( [ In , Out ] POINT pt ) ;
6080+
6081+ [ DllImport ( ExternDll . User32 , ExactSpelling = true , CharSet = CharSet . Auto ) ]
6082+ [ ResourceExposure ( ResourceScope . None ) ]
6083+ public static extern IntPtr SetParent ( IntPtr hWnd , IntPtr hWndParent ) ;
60126084 }
60136085}
60146086
0 commit comments