• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Windows.SystemWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中ManagedWinapi.Windows.SystemWindow的典型用法代码示例。如果您正苦于以下问题:C# SystemWindow类的具体用法?C# SystemWindow怎么用?C# SystemWindow使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



SystemWindow类属于ManagedWinapi.Windows命名空间,在下文中一共展示了SystemWindow类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
            }
        }
开发者ID:YashMaster,项目名称:GestureSign,代码行数:31,代码来源:ApplicationBase.cs


示例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;
 }
开发者ID:YashMaster,项目名称:GestureSign,代码行数:7,代码来源:PointInfo.cs


示例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();
        }
开发者ID:floatas,项目名称:highsign,代码行数:25,代码来源:ApplicationBase.cs


示例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);
     }
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:9,代码来源:WindowClassGuesser.cs


示例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();
        }
开发者ID:toddmitchell,项目名称:RedSnapper,代码行数:12,代码来源:Snapper.cs


示例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);
     }
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:14,代码来源:MainForm.cs


示例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);
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:15,代码来源:WindowExecutableGuesser.cs


示例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;
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:18,代码来源:SelectorForm.cs


示例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);
     }
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:19,代码来源:WindowClassGuesser.cs


示例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;
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:41,代码来源:WindowInformation.cs


示例11: ClickButton

 private void ClickButton(SystemWindow systemWindow)
 {
     POINT pt = winMessenger.GetWindowCenter(systemWindow);
     winMessenger.MouseMove(pt.X, pt.Y);
     Thread.Sleep(100);
     winMessenger.Click();
 }
开发者ID:kingofcrabs,项目名称:LuminexDriver,代码行数:7,代码来源:WindowOp.cs


示例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);
 }
开发者ID:toddmitchell,项目名称:RedSnapper,代码行数:9,代码来源:SystemWindow.cs


示例13: getArea

 private static int getArea(SystemWindow sw)
 {
     RECT rr = sw.Rectangle;
         return rr.Height * rr.Width;
 }
开发者ID:toddmitchell,项目名称:RedSnapper,代码行数:5,代码来源:SystemWindow.cs


示例14: WindowDeviceContext

 internal WindowDeviceContext(SystemWindow sw, IntPtr hDC)
 {
     this.sw = sw;
         this.hDC = hDC;
 }
开发者ID:toddmitchell,项目名称:RedSnapper,代码行数:5,代码来源:SystemWindow.cs


示例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}"));
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:10,代码来源:SystemAccessibleObject.cs


示例16: FromWindow

 public static SystemAccessibleObject FromWindow(SystemWindow window, AccessibleObjectID objectID)
 {
     IAccessible iacc = (IAccessible)AccessibleObjectFromWindow(window == null ? IntPtr.Zero : window.HWnd, (uint)objectID, new Guid("{618736E0-3C3D-11CF-810C-00AA00389B71}"));
     return new SystemAccessibleObject(iacc, 0);
 }
开发者ID:hoangduit,项目名称:mwinapi,代码行数:5,代码来源:SystemAccessibleObject.cs


示例17: MouseHook

        public static void MouseHook(LowLevelMessage evt, ref bool handled)
        {
            LowLevelMouseMessage mevt = evt as LowLevelMouseMessage;
            if (mevt != null)
            {
                MouseButtons moveMouseState = OptionsManager.MoveOptions.mouseButton;
                MouseButtons resizeMouseState = OptionsManager.ResizeOptions.mouseButton;

                switch ((MouseState)mevt.Message)
                {
                    case MouseState.WM_LBUTTONDOWN:
                    case MouseState.WM_RBUTTONDOWN:
                    case MouseState.WM_MBUTTONDOWN:
                        // Get the window to move or resize
                        _currentWindow = GetTopLevel(SystemWindow.FromPoint(mevt.Point.X, mevt.Point.Y));

                        if (TestMoveKeyModifier() && TestMoveMouseState(mevt))
                        {
                            // Now we are moving...
                            _isMoving = true;

                            //... from here to somewhere.
                            _previousPoint = mevt.Point;

                            // Set cursor
                            SystemCursor.SetSystemCursor(Cursors.SizeAll);

                            // Prevent event to be forwarded
                            handled = true;
                        }
                        // Check that:
                        // - we are allowed to resize
                        // - we are not moving
                        // - keys and mouse buttons respect the options
                        else if (_currentWindow.Resizable && !_isMoving && TestResizeKeyModifier() && TestResizeMouseState(mevt))
                        {
                            // Now we are resizing...
                            _isResizing = true;

                            //... from this point/quarter.
                            _previousPoint = mevt.Point;
                            _clickedQuarter = GetQuarterFromPoint(_currentWindow, mevt.Point);

                            // Set cursor
                            if ((_clickedQuarter == WindowsQuarter.DIR_NW) || (_clickedQuarter == WindowsQuarter.DIR_SE))
                                SystemCursor.SetSystemCursor(Cursors.SizeNWSE);
                            else if ((_clickedQuarter == WindowsQuarter.DIR_NE) || (_clickedQuarter == WindowsQuarter.DIR_SW))
                                SystemCursor.SetSystemCursor(Cursors.SizeNESW);

                            // Prevent event to be forwarded
                            handled = true;
                        }
                        break;

                    case MouseState.WM_MOUSEMOVE:
                        if (_isMoving)
                        {
                            int dx = mevt.Point.X - _previousPoint.X;
                            int dy = mevt.Point.Y - _previousPoint.Y;

                            // Only move not left/right snaped window
                            if (!_leftSnapedWindows.ContainsKey(_currentWindow) && !_rightSnapedWindows.ContainsKey(_currentWindow))
                                MoveWindow(_currentWindow, dx, dy);

                            _previousPoint = mevt.Point;

                            // Snap/Unsnap
                            SnapTo(_currentWindow, mevt.Point);
                        }
                        else if (_isResizing)
                        {
                            int dx = mevt.Point.X - _previousPoint.X;
                            int dy = mevt.Point.Y - _previousPoint.Y;

                            // Resize current window
                            ResizeWindow(_currentWindow, dx, dy);

                            _previousPoint = mevt.Point;
                        }
                        break;

                    case MouseState.WM_LBUTTONUP:
                    case MouseState.WM_RBUTTONUP:
                    case MouseState.WM_MBUTTONUP:
                        if (TestMoveMouseState(mevt))
                        {
                            if (_isMoving)
                            {
                                // Prevent event to be forwarded
                                handled = true;

                                // Restore cursor
                                SystemCursor.RestoreSystemCursor();
                            }
                            _isMoving = false;
                        }
                        else if (TestResizeMouseState(mevt))
                        {
                            if (_isResizing)
                            {
//.........这里部分代码省略.........
开发者ID:elcado,项目名称:WinMoreNSnap,代码行数:101,代码来源:Hook.cs


示例18: WinEventProc

        private void WinEventProc(IntPtr hWinEventHook, uint eventType, IntPtr hwnd, int idObject, int idChild, uint dwEventThread, uint dwmsEventTime)
        {
            if (State != CaptureState.Ready || Mode != CaptureMode.Normal || hwnd.Equals(IntPtr.Zero) ||
                Application.OpenForms.Count != 0 && hwnd.Equals(Application.OpenForms[0].Handle))
                return;
            var systemWindow = new SystemWindow(hwnd);
            var userApp = ApplicationManager.Instance.GetApplicationFromWindow(systemWindow, true);
            bool flag = userApp != null &&
                        (userApp.Any(app => app is UserApplication && ((UserApplication)app).InterceptTouchInput));

            _inputTargetWindow.InterceptTouchInput(flag);
        }
开发者ID:YashMaster,项目名称:GestureSign,代码行数:12,代码来源:TouchCapture.cs


示例19: AnimateCursorOnWindow

        private static void AnimateCursorOnWindow(SystemWindow window, Point point)
        {
            new Thread(new ThreadStart(delegate
                                           {
                                               // Create a device context that cover the whole display (all monitors)
                                               IntPtr hDC = CreateDC("DISPLAY", "", "", IntPtr.Zero);

                                               // Get a graphics
                                               using (Graphics g = Graphics.FromHdc(hDC))
                                               {
                                                   const int radius = 30;

                                                   g.SmoothingMode = SmoothingMode.AntiAlias;
                                                   g.CompositingMode = CompositingMode.SourceOver;
                                                   g.Clip = new Region(new Rectangle(point.X - (radius + 10) / 2, point.Y - (radius + 10) / 2,
                                                                                     radius + 10, radius + 10));

                                                   // Draw a growing circle upon the cursor
                                                   Brush trans = Brushes.Transparent;
                                                   Pen penGr = new Pen(Color.LightGray, 1);
                                                   Pen penDG = new Pen(Color.DimGray, 1);
                                                   Pen penLG = new Pen(Color.LightGray, 1);

                                                   for (int j = 0; j < 2; j++)
                                                   {
                                                       for (int i = 0; i < radius; i+=2)
                                                       {
                                                           Rectangle ellRect = new Rectangle(point.X - i / 2, point.Y - i / 2, i, i);

                                                           g.FillEllipse(trans, ellRect);
                                                           ellRect.Inflate(1, 1);
                                                           g.DrawEllipse(penGr, ellRect);
                                                           ellRect.Inflate(1, 1);
                                                           g.DrawEllipse(penDG, ellRect);
                                                           ellRect.Inflate(1, 1);
                                                           g.DrawEllipse(penLG, ellRect);

                                                           //g.Clear(Color.Transparent);

                                                           window.Refresh();
                                                       }

                                                       window.Refresh();
                                                   }
                                               }

                                               // Delete the device context
                                               DeleteDC(hDC);
                                           }
                           )).Start();
        }
开发者ID:elcado,项目名称:WinMoreNSnap,代码行数:51,代码来源:Hook.cs


示例20: Equals

 ///
 public bool Equals(SystemWindow sw)
 {
     if ((object)sw == null)
         {
             return false;
         }
         return _hwnd == sw._hwnd;
 }
开发者ID:toddmitchell,项目名称:RedSnapper,代码行数:9,代码来源:SystemWindow.cs



注:本文中的ManagedWinapi.Windows.SystemWindow类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Sessions.Session类代码示例发布时间:2022-05-26
下一篇:
C# NPP.NppiSize类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap