@@ -59,6 +59,17 @@ public static class NativeMethods
59
59
[ DllImport ( "user32.dll" , CharSet = CharSet . Unicode ) ]
60
60
public static extern IntPtr FindWindowEx ( IntPtr parentHandle , IntPtr childAfter , string lclassName , string windowTitle ) ;
61
61
62
+ /// <summary>
63
+ /// Forces the specified region to repaint.
64
+ /// </summary>
65
+ /// <param name="hWnd">The window to redraw</param>
66
+ /// <param name="lprcUpdate">The update region. Ignored if hrgnUpdate is not null.</param>
67
+ /// <param name="hrgnUpdate">Handle to an update region. Defaults to the entire window if null and lprcUpdate is null</param>
68
+ /// <param name="flags">Redraw flags.</param>
69
+ /// <returns></returns>
70
+ [ DllImport ( "user32.dll" ) ]
71
+ public static extern bool RedrawWindow ( IntPtr hWnd , IntPtr lprcUpdate , IntPtr hrgnUpdate , RedrawWindowFlags flags ) ;
72
+
62
73
/// <summary> Gets window caption text by handle. </summary>
63
74
///
64
75
/// <param name="windowHandle"> Handle of the window to be activated. </param>
@@ -101,4 +112,58 @@ public static void EnumChildWindows(IntPtr parentWindowHandle, EnumChildWindowsD
101
112
}
102
113
}
103
114
}
115
+
116
+ [ Flags ]
117
+ public enum RedrawWindowFlags : uint
118
+ {
119
+ /// <summary>
120
+ /// Invalidates the rectangle or region that you specify in lprcUpdate or hrgnUpdate.
121
+ /// You can set only one of these parameters to a non-NULL value. If both are NULL, RDW_INVALIDATE invalidates the entire window.
122
+ /// </summary>
123
+ Invalidate = 0x1 ,
124
+
125
+ /// <summary>Causes the OS to post a WM_PAINT message to the window regardless of whether a portion of the window is invalid.</summary>
126
+ InternalPaint = 0x2 ,
127
+
128
+ /// <summary>
129
+ /// Causes the window to receive a WM_ERASEBKGND message when the window is repainted.
130
+ /// Specify this value in combination with the RDW_INVALIDATE value; otherwise, RDW_ERASE has no effect.
131
+ /// </summary>
132
+ Erase = 0x4 ,
133
+
134
+ /// <summary>
135
+ /// Validates the rectangle or region that you specify in lprcUpdate or hrgnUpdate.
136
+ /// You can set only one of these parameters to a non-NULL value. If both are NULL, RDW_VALIDATE validates the entire window.
137
+ /// This value does not affect internal WM_PAINT messages.
138
+ /// </summary>
139
+ Validate = 0x8 ,
140
+
141
+ NoInternalPaint = 0x10 ,
142
+
143
+ /// <summary>Suppresses any pending WM_ERASEBKGND messages.</summary>
144
+ NoErase = 0x20 ,
145
+
146
+ /// <summary>Excludes child windows, if any, from the repainting operation.</summary>
147
+ NoChildren = 0x40 ,
148
+
149
+ /// <summary>Includes child windows, if any, in the repainting operation.</summary>
150
+ AllChildren = 0x80 ,
151
+
152
+ /// <summary>
153
+ /// Causes the affected windows, which you specify by setting the RDW_ALLCHILDREN and RDW_NOCHILDREN values, to receive
154
+ /// WM_ERASEBKGND and WM_PAINT messages before the RedrawWindow returns, if necessary.
155
+ /// </summary>
156
+ UpdateNow = 0x100 ,
157
+
158
+ /// <summary>
159
+ /// Causes the affected windows, which you specify by setting the RDW_ALLCHILDREN and RDW_NOCHILDREN values, to receive WM_ERASEBKGND
160
+ /// messages before RedrawWindow returns, if necessary.
161
+ /// The affected windows receive WM_PAINT messages at the ordinary time.
162
+ /// </summary>
163
+ EraseNow = 0x200 ,
164
+
165
+ Frame = 0x400 ,
166
+
167
+ NoFrame = 0x800
168
+ }
104
169
}
0 commit comments