그것 오랜만,하지만 난 당신이 위치에 마우스 커서를 이동할 수 있습니다 생각 :
Cursor.Position = Drawing.Point(x, y)
당신은 확실히 화면을 캡처 할 수 있습니다 (당신이 스크린 샷을 의미 가정). 이것은 복사/붙여 넣기 엉망 약간이지만 :
public class ScreenCapture : IDisposable
{
private string filePath = "";
private Attachment attachment;
private Bitmap bitmap = new Bitmap(1, 1);
private MemoryStream imageStream = new MemoryStream();
public ScreenCapture() { }
void IDisposable.Dispose()
{
Dispose();
}
public void Dispose()
{
if (bitmap != null)
bitmap.Dispose();
if (imageStream != null)
imageStream.Close();
}
# region Property Methods
public string FilePath
{
get { return filePath; }
}
# endregion // Property Methods
# region Private Methods
/// <summary>
/// Capture the specified region into a bitmap object.
/// </summary>
/// <param name="sourcePoint">The point at the upper-left corner of the source rectangle.</param>
/// <param name="destinationPoint">The point at the upper-left corner of the destination rectangle.</param>
/// <param name="selectionRectangle">The size of the area to be transferred.</param>
private void CaptureRegionToBitmap(Point sourcePoint, Point destinationPoint, Rectangle selectionRectangle)
{
if (bitmap != null)
bitmap.Dispose();
bitmap = new Bitmap(selectionRectangle.Width, selectionRectangle.Height);
using (Graphics g = Graphics.FromImage(bitmap))
g.CopyFromScreen(sourcePoint, destinationPoint, selectionRectangle.Size);
}
# endregion // Private Methods
# region Public Methods
/// <summary>
/// Create an attachment to append to an email message.
/// </summary>
/// <returns>Returns an email attachment.</returns>
public Attachment GenerateAttachment()
{
return GenerateAttachment("");
}
/// <summary>
/// Create an attachment from the generated bitmap to append to an email message.
/// </summary>
/// <param name="imageName">Provide a name for the attachment.</param>
/// <returns>Returns email attachment.</returns>
public Attachment GenerateAttachment(string imageName)
{
if (attachment != null)
attachment.Dispose();
if (imageName == null || imageName.Trim() == "")
imageName = Core.LoginUserName.ToLower() + "_image.png";
bitmap.Save(imageStream, ImageFormat.Png);
imageStream.Position = 0;
attachment = new Attachment(imageStream, imageName, "image/png");
return attachment;
}
/// <summary>
/// Capture the entire screen to a Bitmap object stored in memory.
/// </summary>
public void CaptureFullScreen()
{
CaptureRegionToBitmap(new Point(0, 0), new Point(0, 0), SystemInformation.VirtualScreen);
}
/// <summary>
/// Save the generated bitmap to a physical file on disk.
/// </summary>
/// <param name="filePath"></param>
/// <returns>Returns True if save was successful; otherwise False.</returns>
public bool SaveToDisk(string filePath)
{
bool saveSuccessful = false;
try
{
bitmap.Save(filePath, ImageFormat.Png);
this.filePath = filePath;
saveSuccessful = true;
}
catch { }
return saveSuccessful;
}
# endregion // Public Methods
}
나는이 도구의 이름을 잊지하지만 Microsoft는 Windows 응용 프로그램과 상호 작용하는 UI 테스트/자동화 도구를 가지고 있으며, 그들이 탭 (장애인/장애인 사용자를위한) Windows 접근성을 프로그래밍 방식으로 모든 것과 상호 작용할 수 있습니다.
이
도 관심의 대상이 될 수 있습니다 : 제가 알기로
UI Automation Fundamentals (MSDN)