@@ -58,7 +58,7 @@ static class NativeMethods
5858 public static extern int GetMenuItemCount ( IntPtr hMenu ) ;
5959
6060 [ DllImport ( "user32.dll" ) ]
61- public static extern UInt32 GetMenuState ( IntPtr hMenu , int uIdItem , int uFlags ) ;
61+ public static extern uint GetMenuState ( IntPtr hMenu , int uIdItem , int uFlags ) ;
6262
6363 [ DllImport ( "User32.dll" ) ]
6464 public static extern bool SetMenuItemInfo ( IntPtr hMenu , int uIdItem , bool fByPosition , ref MenuItemInfo lpmii ) ;
@@ -70,10 +70,10 @@ static class NativeMethods
7070 public static extern int GetAsyncKeyState ( int key ) ;
7171
7272 [ DllImport ( "user32.dll" ) ]
73- public static extern bool SetLayeredWindowAttributes ( IntPtr hwnd , UInt32 crKey , Byte bAlpha , UInt32 dwFlags ) ;
73+ public static extern bool SetLayeredWindowAttributes ( IntPtr hwnd , uint crKey , Byte bAlpha , uint dwFlags ) ;
7474
7575 [ DllImport ( "user32.dll" ) ]
76- public static extern bool GetLayeredWindowAttributes ( IntPtr hwnd , out UInt32 crKey , out Byte bAlpha , out UInt32 dwFlags ) ;
76+ public static extern bool GetLayeredWindowAttributes ( IntPtr hwnd , out uint crKey , out Byte bAlpha , out uint dwFlags ) ;
7777
7878 [ DllImport ( "user32.dll" ) ]
7979 public static extern int SetWindowLong ( IntPtr handle , int nIndex , int dwNewLong ) ;
@@ -101,7 +101,7 @@ static class NativeMethods
101101
102102 [ DllImport ( "user32.dll" ) ]
103103 [ return : MarshalAs ( UnmanagedType . Bool ) ]
104- public static extern bool SetWindowPos ( IntPtr handle , IntPtr hWndInsertAfter , int x , int y , int cx , int cy , UInt32 uFlags ) ;
104+ public static extern bool SetWindowPos ( IntPtr handle , IntPtr hWndInsertAfter , int x , int y , int cx , int cy , uint uFlags ) ;
105105
106106 [ DllImport ( "user32.dll" ) ]
107107 [ return : MarshalAs ( UnmanagedType . Bool ) ]
@@ -122,16 +122,16 @@ static class NativeMethods
122122 public static extern bool ChangeWindowMessageFilter ( int msg , int flag ) ;
123123
124124 [ DllImport ( "user32.dll" ) ]
125- public static extern IntPtr SendMessage ( IntPtr hWnd , int msg , UInt32 wParam , UInt32 lParam ) ;
125+ public static extern IntPtr SendMessage ( IntPtr hWnd , int msg , uint wParam , uint lParam ) ;
126126
127127 [ DllImport ( "user32.dll" ) ]
128- public static extern IntPtr PostMessage ( IntPtr hWnd , int msg , UInt32 wParam , UInt32 lParam ) ;
128+ public static extern IntPtr PostMessage ( IntPtr hWnd , int msg , uint wParam , uint lParam ) ;
129129
130130 [ DllImport ( "user32.dll" ) ]
131131 public static extern IntPtr PostMessage ( IntPtr hWnd , int msg , UInt64 wParam , UInt64 lParam ) ;
132132
133133 [ DllImport ( "user32.dll" ) ]
134- public static extern int SendMessageTimeout ( IntPtr handle , int uMsg , UInt32 wParam , UInt32 lParam , SendMessageTimeoutFlags fuFlags , int uTimeout , out UInt32 lpdwResult ) ;
134+ public static extern int SendMessageTimeout ( IntPtr handle , int uMsg , uint wParam , uint lParam , SendMessageTimeoutFlags fuFlags , int uTimeout , out uint lpdwResult ) ;
135135
136136 [ DllImport ( "user32.dll" ) ]
137137 public static extern IntPtr LoadIcon ( IntPtr hInstance , string lpIconName ) ;
@@ -154,19 +154,19 @@ static class NativeMethods
154154 public static extern bool CloseHandle ( IntPtr hObject ) ;
155155
156156 [ DllImport ( "user32.dll" , SetLastError = true ) ]
157- public static extern UInt32 GetWindowThreadProcessId ( IntPtr hWnd , out int lpdwProcessId ) ;
157+ public static extern uint GetWindowThreadProcessId ( IntPtr hWnd , out int lpdwProcessId ) ;
158158
159159 [ DllImport ( "user32.dll" , SetLastError = true ) ]
160- public static extern UInt32 GetWindowThreadProcessId ( IntPtr hWnd , IntPtr processId ) ;
160+ public static extern uint GetWindowThreadProcessId ( IntPtr hWnd , IntPtr processId ) ;
161161
162162 [ DllImport ( "kernel32.dll" ) ]
163- public static extern UInt32 GetCurrentThreadId ( ) ;
163+ public static extern uint GetCurrentThreadId ( ) ;
164164
165165 [ DllImport ( "user32.dll" ) ]
166166 public static extern IntPtr GetForegroundWindow ( ) ;
167167
168168 [ DllImport ( "user32.dll" ) ]
169- public static extern bool AttachThreadInput ( UInt32 idAttach , UInt32 idAttachTo , bool fAttach ) ;
169+ public static extern bool AttachThreadInput ( uint idAttach , uint idAttachTo , bool fAttach ) ;
170170
171171 [ DllImport ( "user32.dll" ) ]
172172 public static extern bool BringWindowToTop ( IntPtr hWnd ) ;
@@ -176,14 +176,32 @@ static class NativeMethods
176176 public static extern bool IsWow64Process ( IntPtr hProcess , out bool wow64Process ) ;
177177
178178 [ DllImport ( "user32.dll" , EntryPoint = "GetClassLong" ) ]
179- public static extern UInt32 GetClassLongPtr32 ( IntPtr hWnd , int nIndex ) ;
179+ public static extern uint GetClassLongPtr32 ( IntPtr hWnd , int nIndex ) ;
180180
181181 [ DllImport ( "user32.dll" , EntryPoint = "GetClassLongPtr" ) ]
182182 public static extern IntPtr GetClassLongPtr64 ( IntPtr hWnd , int nIndex ) ;
183183
184184 [ DllImport ( "user32.dll" ) ]
185185 public static extern IntPtr GetThreadDesktop ( int threadId ) ;
186186
187+ [ DllImport ( "kernel32.dll" , SetLastError = true ) ]
188+ public static extern bool AttachConsole ( int processID ) ;
189+
190+ [ DllImport ( "kernel32.dll" , SetLastError = true ) ]
191+ public static extern uint GetConsoleOutputCP ( ) ;
192+
193+ [ DllImport ( "kernel32.dll" ) ]
194+ public static extern bool FreeConsole ( ) ;
195+
196+ [ DllImport ( "kernel32.dll" , SetLastError = true , CharSet = CharSet . Unicode ) ]
197+ public static extern bool ReadConsoleOutputCharacter ( IntPtr hConsoleOutput , [ Out ] char [ ] lpCharacter , uint nLength , Coord dwReadCoord , out uint lpNumberOfCharsRead ) ;
198+
199+ [ DllImport ( "kernel32.dll" , SetLastError = true ) ]
200+ public static extern bool GetConsoleScreenBufferInfo ( IntPtr hConsoleOutput , out ConsoleScreenBufferInfo lpConsoleScreenBufferInfo ) ;
201+
202+ [ DllImport ( "kernel32.dll" , SetLastError = true ) ]
203+ public static extern IntPtr GetStdHandle ( int nStdHandle ) ;
204+
187205 public static IntPtr GetClassLongPtr ( IntPtr hWnd , int nIndex )
188206 {
189207 return IntPtr . Size > 4 ? GetClassLongPtr64 ( hWnd , nIndex ) : new IntPtr ( GetClassLongPtr32 ( hWnd , nIndex ) ) ;
0 commit comments