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++)
Asked
Active
Viewed 920 times
-1

Hadi Mohammadi
- 314
- 2
- 5
- 20

darude_cod3r
- 91
- 3
- 11
-
http://stackoverflow.com/a/9669149/2300466 – Ahmad Ibrahim Jun 13 '15 at 09:30
2 Answers
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