-1

How can I get the size and the position of a Window in C#? I read about the GetWindowRect function, but I do not understand how to use it. Can anyone please give me a example on how to use it? (I'd like to get the position of notepad++)

Hadi Mohammadi
  • 314
  • 2
  • 5
  • 20
darude_cod3r
  • 91
  • 3
  • 11

2 Answers2

0

Form.Location.X and Form.Location.Y will give you the X and Y coordinates of the top left corner.

For your own Form application is the code this.

Kevin Sch
  • 31
  • 1
  • 6
0

for your own program,
you can use these options,
"Size",
"Location",
otherwise you need to use "Screen" to get monitor size and get other app window size you want

Salmani
  • 41
  • 1
  • 1
  • 7