Microsoft MVP성태의 닷넷 이야기
.NET : 56. The managed way to retrieve text under the cursor (mouse pointer) [링크 복사], [링크+제목 복사]
조회: 8750
글쓴 사람
정성태 (techsharer at outlook.com)
홈페이지
첨부 파일
 
(연관된 글이 1개 있습니다.)
The managed way to retrieve text under the cursor (mouse pointer)
; http://blogs.msdn.com/b/oldnewthing/archive/2013/04/08/10409196.aspx


///////////////////////////////////////////////////////////////
using System;
using System.Windows;
using System.Windows.Forms;
using System.Windows.Automation;

class Program
{
 static Point MousePos {
  get { var pos = Control.MousePosition;
        return new Point(pos.X, pos.Y); }
 }

 public static void Main()
 {
  for (;;) {
   AutomationElement e = AutomationElement.FromPoint(MousePos);
   if (e != null) {
    foreach (var prop in e.GetSupportedProperties()) {
     object o = e.GetCurrentPropertyValue(prop);
     if (o != null) {
      var s = o.ToString();
      if (s != "") {
       var id = o as AutomationIdentifier;
       if (id != null) s = id.ProgrammaticName;
       Console.WriteLine("{0}: {1}", Automation.PropertyName(prop), s);
      }
     }
    }
    foreach (var pattern in e.GetSupportedPatterns()) {
     Console.WriteLine("Pattern: {0}", Automation.PatternName(pattern));
    }
    Console.WriteLine();
   }
   System.Threading.Thread.Sleep(1000);
  }
 }
}

[연관 글]






[최초 등록일: ]
[최종 수정일: 6/26/2013]

Creative Commons License
이 저작물은 크리에이티브 커먼즈 코리아 저작자표시-비영리-동일조건변경허락 2.0 대한민국 라이센스에 따라 이용하실 수 있습니다.

비밀번호

댓글 작성자
 




1  2  3  4  [5]  6  7  8 
NoWriterDateCnt.TitleFile(s)
95정성태2/23/20074970.NET : 20. .Net Zip Library/Utility updates and fixes
94정성태2/23/20074758COM : 2. VC++ - OneNote Addin 제작
93정성태2/3/20075592공통 코딩 규약 : 2. 프로퍼티와 공용 필드에 대한 선택 [1]
92정성태2/1/20074744공통 코딩 규약 : 1. HMACSHA512 / HMACSHA384 클래스 사용시 주의사항
91정성태1/27/20075025.NET : 19. HTML InnerText 구하기
90정성태1/27/20076669Vista : 3. 현재 사용자가 관리자 그룹에 속해 있는지 결정하는 코드
89정성태1/24/20074197.NET : 18. ASP.NET - AspNetHostingPermissionLevel 알아내기
88정성태1/22/20074471.NET : 17. 지역화된 폰트명 구하기
87정성태1/21/20075817.NET : 16. 클립보드 - HTML 텍스트 복사/붙여넣기
86정성태1/21/20074721.NET : 15. BinaryFormatter 에서의 진행 상태바 구현
85정성태1/20/20075661COM : 1. IE 7의 다중 탭을 이용한 네비게이션 [1]
84정성태1/19/20074563.NET : 14. 웹 서비스를 이용한 머신 간의 클립보드 공유
83정성태1/12/20074499.NET : 13. SafeHandles 를 적용한 GetProcAddress 래퍼
82정성태1/12/20074203.NET : 12. Cardspace 를 위한 ASP.NET 서버 컨트롤파일 다운로드1
81정성태1/12/20074527.NET : 11. 파일 확장자에 따른 아이콘 그려주는 HttpHandler [2]파일 다운로드1
80정성태1/10/20075246SQL : 1. SQL 2005 - 대소문자 구분없이 검색하도록 구현 [1]
79정성태1/10/20074143.NET : 10. Config 설정을 .NET Class 로 매핑
78정성태1/3/20074604.NET : 9. 텍스트 꾸미는 코드
77정성태12/13/20064799.NET : 8. C# - VARIANT 관련 마샬링 코드
76정성태12/6/20065373.NET : 7. 휴대 장치 열람하는 코드
75정성태12/6/20064477.NET : 6. 웹 서비스 메서드에 대해 완료 제한 시간 설정하는 방법
74정성태11/6/20064539.NET : 5. How to Decrypt an ASP.NET Encrypted Data
73정성태11/2/20065419.NET : 4. 콘솔 프로그램 실행시간 측정
72정성태11/1/20064681.NET : 3. System Monitoring 예제
70정성태11/1/20064235.NET : 2. System.Net.NetworkInformation.Ping 클래스 사용 예제
69정성태10/27/20064542.NET : 1. Typed DataSet 에서의 ExcludeSchema 사용
1  2  3  4  [5]  6  7  8