本文整理汇总了C#中ManagedWinapi.Windows.SystemWindow类的典型用法代码示例。如果您正苦于以下问题:C# SystemWindow类的具体用法?C# SystemWindow怎么用?C# SystemWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
SystemWindow类属于ManagedWinapi.Windows命名空间,在下文中一共展示了SystemWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsSystemWindowMatch
public bool IsSystemWindowMatch(SystemWindow Window)
{
string compareMatchString = MatchString ?? String.Empty;
string windowMatchString = String.Empty;
try
{
switch (MatchUsing)
{
case MatchUsing.WindowClass:
windowMatchString = Window.ClassName;
break;
case MatchUsing.WindowTitle:
windowMatchString = Window.Title;
break;
case MatchUsing.ExecutableFilename:
windowMatchString = Window.Process.MainModule.ModuleName;
break;
case MatchUsing.All:
return true;
}
return IsRegEx ? Regex.IsMatch(windowMatchString, compareMatchString, RegexOptions.Singleline | RegexOptions.IgnoreCase) : String.Equals(windowMatchString.Trim(), compareMatchString.Trim(), StringComparison.CurrentCultureIgnoreCase);
}
catch
{
return false;
}
}
示例2: PointInfo
public PointInfo(List<Point> touchLocation, List<List<Point>> points)
{
_touchLocation = touchLocation;
_window = SystemWindow.FromPointEx(_touchLocation[0].X, _touchLocation[0].Y, true, false);
_windowHandle = _window == null ? IntPtr.Zero : _window.HWnd;
Points = points;
}
示例3: IsSystemWindowMatch
public bool IsSystemWindowMatch(SystemWindow Window)
{
string compareMatchString = MatchString ?? String.Empty;
string windowMatchString = String.Empty;
switch (MatchUsing)
{
case MatchUsing.WindowClass:
windowMatchString = Window.ClassName;
break;
case MatchUsing.WindowTitle:
windowMatchString = Window.Title;
break;
case MatchUsing.ExecutableFilename:
windowMatchString = Window.Process.MainModule.FileName;
break;
case MatchUsing.All:
return true;
}
return IsRegEx ? Regex.IsMatch(windowMatchString, compareMatchString, RegexOptions.Singleline | RegexOptions.IgnoreCase) : windowMatchString.Trim().ToLower() == compareMatchString.Trim().ToLower();
}
示例4: parseChildren
private void parseChildren(List<string> toFill, SystemWindow window)
{
foreach (SystemWindow child in window.AllChildWindows)
{
string clazz = child.ClassName;
if (!toFill.Contains(clazz)) toFill.Add(clazz);
parseChildren(toFill, child);
}
}
示例5: timer_Tick
void timer_Tick(object sender, EventArgs e)
{
if (IntPtr.Zero != windowToSnap)
{
SystemWindow win = new SystemWindow(windowToSnap);
win.Location = zone.Location;
win.Size = zone.Size;
windowToSnap = IntPtr.Zero;
}
timer.Stop();
}
示例6: appendContent
private void appendContent(StringBuilder sb, SystemWindow sw, WindowContent c)
{
if (c == null) {
sb.AppendLine("<Unknown Type>");
return;
}
sb.AppendLine(c.ShortDescription);
sb.AppendLine("Class Name: " + sw.ClassName);
String ldesc = c.LongDescription.Replace("\n", "\r\n").Replace("\r\r\n", "\r\n");
if (ldesc != null && c.ShortDescription != ldesc) {
sb.AppendLine("------------------------------------------------------------");
sb.AppendLine(ldesc);
}
}
示例7: guess
public void guess(IGuesserListener listener, SystemWindow window)
{
string file;
try
{
file = window.Process.MainModule.FileName;
}
catch (Win32Exception)
{
listener.guessInfo(2, "*** File access denied");
return;
}
listener.guessInfo(2, "*** Detected File: " + file);
ctrl.guessFile(listener, file);
}
示例8: Highlight
private void Highlight(SystemWindow sw, SystemAccessibleObject acc)
{
if (sw == null) return;
if (acc != null && acc != highlightedObject)
{
if (highlightedWindow != null)
highlightedWindow.Refresh();
acc.Highlight();
}
else if (sw != highlightedWindow)
{
if (highlightedWindow != null)
highlightedWindow.Refresh();
sw.Highlight();
}
highlightedObject = acc;
highlightedWindow = sw;
}
示例9: guess
public void guess(IGuesserListener listener, SystemWindow window)
{
string mainclass = window.ClassName;
List<string> childClasses = new List<string>();
childClasses.Add(mainclass);
parseChildren(childClasses, window);
childClasses.Sort();
listener.guessInfo(1, "** Main class: " + mainclass);
foreach (string c in childClasses)
{
listener.guessInfo(2, "*** Child class:" + c);
}
IList<string> results = sp.parse(mainclass, childClasses.ToArray());
foreach (string r in results)
{
listener.guessInfo(0, "Wndclass suggests: " + r);
listener.guessAttribute("WNDCLASS", r);
}
}
示例10: getWindowProperties
private string getWindowProperties(SystemWindow sw)
{
string content;
if (includeContents.Checked)
{
try
{
WindowContent cc = sw.Content;
if (cc == null)
{
content = "Unknown";
}
else
{
content = "\"" + cc.ShortDescription + "\"\r\n" +
cc.LongDescription.Replace("\n", "\r\n").Replace("\r\r\n", "\r\n");
}
}
catch (Exception ex)
{
content = "\"Exception\"\r\n" + ex.ToString();
}
}
else
{
content = "(Enable in Options tab if desired)";
}
return " Handle:\t\t0x" + sw.HWnd.ToString("x8") + " (" + sw.HWnd + ")\r\n" +
" DialogID:\t0x" + sw.DialogID.ToString("x8") + " (" + sw.DialogID + ")\r\n" +
" Position:\t\t(" + sw.Position.Left + ", " + sw.Position.Top + "), " + sw.Position.Width + "x" + sw.Position.Height + "\r\n" +
" Parent:\t\t" + (sw.Parent == null ? "None" : (sw.ParentSymmetric == null ? "Asymmetric" : "Symmetric") + " 0x" + sw.Parent.HWnd.ToString("x8")) + "\r\n" +
" Appearance:\t" + (sw.Enabled ? "Enabled " : "Disabled ") + (sw.Visible ? "Visible" : "Invisible") + "\r\n" +
" Changable:\t" + (sw.Movable ? "Movable " : "NotMovable ") + (sw.Resizable ? "Resizable" : "FixedSize") + "\r\n" +
" WindowState:\t" +
(sw.TopMost ? "TopMost " : "") + sw.WindowState.ToString() + "\r\n" +
" Process:\t\t" + sw.Process.ProcessName + " (0x" + sw.Process.Id.ToString("x8") + "), " +
"\r\n" +
" ClassName:\t\"" + sw.ClassName + "\"\r\n" +
" Title:\t\t\"" + sw.Title + "\"\r\n\r\n" +
"Content:\t" + content;
}
示例11: ClickButton
private void ClickButton(SystemWindow systemWindow)
{
POINT pt = winMessenger.GetWindowCenter(systemWindow);
winMessenger.MouseMove(pt.X, pt.Y);
Thread.Sleep(100);
winMessenger.Click();
}
示例12: IsDescendantOf
/// <summary>
/// Check whether this window is a descendant of <c>ancestor</c>
/// </summary>
/// <param name="ancestor">The suspected ancestor</param>
/// <returns>If this is really an ancestor</returns>
public bool IsDescendantOf(SystemWindow ancestor)
{
return IsChild(ancestor._hwnd, _hwnd);
}
示例13: getArea
private static int getArea(SystemWindow sw)
{
RECT rr = sw.Rectangle;
return rr.Height * rr.Width;
}
示例14: WindowDeviceContext
internal WindowDeviceContext(SystemWindow sw, IntPtr hDC)
{
this.sw = sw;
this.hDC = hDC;
}
示例15: COMObjectFromWindow
/// <summary>
/// Gets the automation object for a given window.
/// This is a COM object implementing the IDispatch interface, commonly
/// available from Microsoft Office windows.
/// </summary>
/// <param name="window">The window</param>
public static object COMObjectFromWindow(SystemWindow window)
{
return AccessibleObjectFromWindow(window == null ? IntPtr.Zero : window.HWnd, OBJID_NATIVEOM, new Guid("{00020400-0000-0000-C000-000000000046}"));
}