C# Spy++

C# 2014. 11. 6. 15:00

Visual Studio에 있는 spy 프로그램에서 window 정보들을 볼 수 있는데 그걸 간단히 따라 해본 프로그램.

spy++에 비하면 마니 허접하지만 win api를 쓰면 쉽게 구현할 수 있다.

테스트용 윈폼.zip


        
        [DllImport("user32.dll")]
        private static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam);
        [DllImport("user32.dll")]
        [return: MarshalAs(UnmanagedType.Bool)]
        static extern bool EnumChildWindows(IntPtr hwndParent, EnumWindowsProc lpEnumFunc, IntPtr lParam);
       
        ...
        ...
        ...

        EnumWindows(delegate(IntPtr wnd, IntPtr param)
        {
                //Todo
               EnumChildWindows(wnd, delegate(IntPtr handle, IntPtr lparam)
               {
                   //Todo    
                   return true;
               }, IntPtr.Zero);
               
               return true;
        }, IntPtr.Zero);

EnumWindows와 EnumcHildWindows를 사용하면 된다


'C#' 카테고리의 다른 글

C# 커서 바꾸기  (0) 2014.11.12
[C#] TextBox에 숫자만 입력받기  (0) 2014.11.10
C# 폼 FullScreen 전체화면으로 만들기  (0) 2014.11.05
C# 투명한 폼 만들기  (2) 2014.11.04
C# 폼 이동 코드  (0) 2014.11.04
Posted by outshine90
,