예제 #1
0
 /// <summary>
 /// Retrieves information about this window
 /// </summary>
 protected WinApi.WINDOWINFO GetWindowInfo()
 {
     WinApi.WINDOWINFO info = new WinApi.WINDOWINFO();
     info.cbSize = (uint)Marshal.SizeOf(info);
     WinApi.GetWindowInfo(Handle, ref info);
     return(info);
 }
예제 #2
0
 private WinApi.RECT GetClientBounds()
 {
     WinApi.WINDOWINFO info = new WinApi.WINDOWINFO();
     info.cbSize = (uint)System.Runtime.InteropServices.Marshal.SizeOf(info);
     WinApi.GetWindowInfo(Client.Tibia.MainWindowHandle, ref info);
     return(info.rcClient);
 }
예제 #3
0
        public void GetWindowHandler(int x, int y)
        {
            IntPtr hWnd = WinApi.WindowFromPoint(new WinApi.POINT(x, x));;

            if (hWnd != null)
            {
                //WinApi.SetActiveWindow(hWnd);
                //WinApi.SetForegroundWindow(hWnd);
                WinApi.SetWindowText(hWnd, hWnd.ToInt32().ToString());
                WinApi.WINDOWINFO info = new WinApi.WINDOWINFO();
                WinApi.GetWindowInfo(hWnd, ref info);
                Console.WriteLine(hWnd.ToInt32().ToString());
            }
        }