Jump to content
Sign in to follow this  
Matg40

Windows borderwidth

Recommended Posts

Matg40

Hi!

I tried to work with relative coords, but I can´t get the borderwidth of the window.

I read a value from registry (-15), but the resulting coords aren´t correct.

I took x + x(window) + x(control) + (-borderwidth) ; '-' because it´s a negative value => big errors

Then I took x + x(window) + x(control) + (-borderwidth/2) ; '-' because it´s a negative value => little errors, but not correct...

Is there another way to read the borderwidth?

Made I an error?

Best regards,

Matg40

Share this post


Link to post
Share on other sites
PaulIA

Hi!

I tried to work with relative coords, but I can´t get the borderwidth of the window.

I read a value from registry (-15), but the resulting coords aren´t correct.

I took x + x(window) + x(control) + (-borderwidth) ; '-' because it´s a negative value => big errors

Then I took x + x(window) + x(control) + (-borderwidth/2) ; '-' because it´s a negative value => little errors, but not correct...

Is there another way to read the borderwidth?

Made I an error?

Best regards,

Matg40

AFAIK, the correct way to get the border width of a window is with the GetSystemMetrics API call. Using Auto3Lib, it would look like this:

#include <A3LWinAPI.au3>

_Lib_ConsoleWrite("Window border width: " & _API_GetSystemMetrics($SM_CXBORDER))

You can used GetSystemMetrics to find out a host of other things too. Check out this MSDN link for more information. All fo the SM_ constants are defined in Auto3Lib if you want to play around with them.


Auto3Lib: A library of over 1200 functions for AutoIt

Share this post


Link to post
Share on other sites
Matg40

Hi!

Thanks for the answer !!! There´re some very interesting system information functions, too... :shocked:

Best regards,

Matg40

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×