By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,795 Members | 1,660 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,795 IT Pros & Developers. It's quick & easy.

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

P: n/a
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.
Dec 15 '07 #1
Share this Question
Share on Google+
2 Replies


P: n/a
"kimiraikkonen" <ki*************@gmail.comschrieb:
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'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Dec 16 '07 #2

P: n/a
On Dec 16, 4:09 am, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrote:
"kimiraikkonen" <kimiraikkone...@gmail.comschrieb:
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'.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
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!
Dec 16 '07 #3

This discussion thread is closed

Replies have been disabled for this discussion.