How to get an active window's size (width and height)

  • Thread starter Thread starter kimiraikkonen
  • Start date Start date
K

kimiraikkonen

Hi,
I need to show an active window's (form) size(width and height in
pixels) in message box, however there are some low-level api calls in
user32.dll but i don't know which function returns the correct
information.

What's the correct user32.dll api function (GetWindowPlacement?) and
syntax?

I supposed there would be a class in .NET 2.0 instead of struggling
Windows API.

Thanks.
 
kimiraikkonen said:
I need to show an active window's (form) size(width and height in
pixels) in message box, however there are some low-level api calls in
user32.dll but i don't know which function returns the correct
information.

If you are referring to the application's active window, take a look at
'Form.ActiveForm'.
 
If you are referring to the application's active window, take a look at
'Form.ActiveForm'.

Hi Herfried,
Thanks but my aim is to display an other active window's(not my
project's window) size. (there's some classes under me.activeWindow).

For example when my project is minimized as a notification icon, with
a keystroke(eg: ctrl) i should get the name of current active window's
size(eg: Internet Explorer's window size, explorer's window size). I
tried something but when i minimize my project as a notification
window, keystrokes(keydown event) doesn't run.

How can i do this?

Thanks!
 
Back
Top