Get the position of a window

This function utilizes platform invoke (pinvoke) to provide the X,Y coordinates of a window on the screen as well as its size in height and width.More information about this function can be found in the following Hey, Scripting Guy! article: TBDRemember to dot source this script

13,480 times
Add to favorites
E-mail Twitter Digg Facebook
Sign in to ask a question

  • Same but without parameters(?)
    3 Posts | Last post May 19, 2018
    • What should I change on the original script file for beeing able to execute it without parameters?
    • The following *should* work (return info for all windowed processes).
          Param (
    • Another useful improvement:
                      $Object = [pscustomobject]@{
                          ProcessName = $_.ProcessName
                          Size = $Size
                          TopLeft = $TopLeft
                          BottomRight = $BottomRight
  • Multiple windows beeing runed by the same process
    1 Posts | Last post May 11, 2018
    • The other question I have been able (bit sketchy) to solve it, but now I'm running into another problem. When I test the scirpt with windows calculator or powershell evrything is running great, but when I input a process name with multiple windows it doesn't work. What would be the apropiate changes to be able to retrive the position of all opened windows?
      NOTE: I've never programmed a powershell script, have that in mind.