コード例 #1
0
 private SelectableTreeNodeData SelectFromPoint(int lastX, int lastY)
 {
     if (selAccObjs.Checked)
     {
         SystemAccessibleObject sao = SystemAccessibleObject.FromPoint(lastX, lastY);
         return(new AccessibilityData(this, sao));
     }
     else
     {
         SystemWindow sw = SystemWindow.FromPointEx(lastX, lastY, selToplevel.Checked, false);
         if (!heuristicSearch.Checked && !selToplevel.Checked)
         {
             sw = SystemWindow.FromPoint(lastX, lastY);
         }
         if (sw != highlightedWindow)
         {
             if (highlightedWindow != null)
             {
                 highlightedWindow.Refresh();
                 highlightedWindow = null;
             }
             if (sw.HWnd != this.Handle && !sw.IsDescendantOf(new SystemWindow(this.Handle)))
             {
                 sw.Highlight();
                 highlightedWindow = sw;
             }
         }
         return(new WindowData(this, sw));
     }
 }
コード例 #2
0
ファイル: SelectorForm.cs プロジェクト: zouhao485/mwinapi
 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;
 }
コード例 #3
0
 private void button7_Click(object sender, EventArgs e)
 {
     wnd.Highlight(Color.Red);
 }