Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7879789
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T03:59:02+00:00 2026-06-03T03:59:02+00:00

I have a C#.NET app where I am able to find a AutomationElement at

  • 0

I have a C#.NET app where I am able to find a AutomationElement at a particular point using FromPoint function.

Now I want to manipulate that AutomationElement so that I can move it to a different location, resize it etc.

For moving and resizing , I thought that I can use SetWindowPos Window API function but that requires the handle(an IntPtr) of the target window. Using the AutomationElement’s “Current” property, i can read the NativeWindowHandle(an int) of it.
Since Control is also a window, I passed this int value as window handle to the SetWindowPost function hoping that it would do my job.

But the code is not working.

Kindly suggest me a way to do this.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T03:59:03+00:00Added an answer on June 3, 2026 at 3:59 am

    What’s the type of element you want to move – a top-level window, or an item within a window? Also, is this a type of item that a user could move around using mouse or keyboard? UIAutomation is only supposed to allow you to manipulate the UI consistent with what a regular user could do – you can’t use it to move the controls around on a dialog, for example.

    The official way to move things in UIAutomation is to see if the element supports the Transform Pattern, and then use the Move or Resize methods to move it appropriately. I think this is mostly implemented only on top-level windows, not sure about how widely it is implemented on other controls – you can use UISpy/Inspect to check your target UI.

    If the element is a HWND, you could also get the NativeWindowHandle property – which is the underlying HWND, but you’ll need to convert it to IntPtr first – and then use it in Win32 APIs. This only works for actual HWND items, though, not for say items in a listview.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ASP.NET app that sits on our intranet, using the WindowsIdentity to
I have a .NET client app that intermittently loses connection to a UNC share
I have an asp.net app that uses System.IO.Path.GetTempFileName() for temporary files. In the production
I have a .Net (C#) app that uses Sql Express. Development is finished, and
I have an ASP.NET MVC app and I want to add to each page
I have a multi threaded .NET app that uses async I/O and AsyncCallbacks to
I have a web app, that also has an iPhone and Android app using
I have a WinForms .NET app that, according to the Vista Task Manager with
I have a .Net Compact app running on Windows Mobile, and I want to
We have an application that is written in .NET 3.5. This app works on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.