Toasts – Diff between revs 1 and 41

Subversion Repositories:
Rev:
Show entire fileIgnore whitespace
Rev 1 Rev 41
Line 1... Line 1...
1 using System; 1 using System;
2 using System.Runtime.InteropServices; 2 using System.Runtime.InteropServices;
3   3  
4 namespace Toasts 4 namespace Toasts
5 { 5 {
6 internal static class NativeMethods 6 internal static class NativeMethods
7 { 7 {
8 #region Private Methods 8 #region Private Methods
9   9  
10 /// <summary> 10 /// <summary>
11 /// Gets the handle of the window that currently has focus. 11 /// Gets the handle of the window that currently has focus.
12 /// </summary> 12 /// </summary>
13 /// <returns> 13 /// <returns>
14 /// The handle of the window that currently has focus. 14 /// The handle of the window that currently has focus.
15 /// </returns> 15 /// </returns>
16 [DllImport("user32")] 16 [DllImport("user32")]
17 internal static extern IntPtr GetForegroundWindow(); 17 internal static extern IntPtr GetForegroundWindow();
18   18  
19 /// <summary> 19 /// <summary>
20 /// Activates the specified window. 20 /// Activates the specified window.
21 /// </summary> 21 /// </summary>
22 /// <param name="hWnd"> 22 /// <param name="hWnd">
23 /// The handle of the window to be focused. 23 /// The handle of the window to be focused.
24 /// </param> 24 /// </param>
25 /// <returns> 25 /// <returns>
26 /// True if the window was focused; False otherwise. 26 /// True if the window was focused; False otherwise.
27 /// </returns> 27 /// </returns>
28 [DllImport("user32")] 28 [DllImport("user32")]
29 internal static extern bool SetForegroundWindow(IntPtr hWnd); 29 internal static extern bool SetForegroundWindow(IntPtr hWnd);
30   30  
31 /// <summary> 31 /// <summary>
32 /// Windows API function to animate a window. 32 /// Windows API function to animate a window.
33 /// </summary> 33 /// </summary>
34 [DllImport("user32")] 34 [DllImport("user32")]
35 internal static extern bool AnimateWindow(IntPtr hWnd, int dwTime, int dwFlags); 35 internal static extern bool AnimateWindow(IntPtr hWnd, int dwTime, int dwFlags);
36   36  
37 [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")] 37 [DllImport("Gdi32.dll", EntryPoint = "CreateRoundRectRgn")]
38 internal static extern IntPtr CreateRoundRectRgn 38 internal static extern IntPtr CreateRoundRectRgn
39 ( 39 (
40 int nLeftRect, // x-coordinate of upper-left corner 40 int nLeftRect, // x-coordinate of upper-left corner
41 int nTopRect, // y-coordinate of upper-left corner 41 int nTopRect, // y-coordinate of upper-left corner
42 int nRightRect, // x-coordinate of lower-right corner 42 int nRightRect, // x-coordinate of lower-right corner
43 int nBottomRect, // y-coordinate of lower-right corner 43 int nBottomRect, // y-coordinate of lower-right corner
44 int nWidthEllipse, // width of ellipse 44 int nWidthEllipse, // width of ellipse
45 int nHeightEllipse // height of ellipse 45 int nHeightEllipse // height of ellipse
46 ); 46 );
47   47  
48 #endregion 48 #endregion
49 } 49 }
50 } 50 }
51   51