Sign in to follow this  
Followers 0
corrado33

GUI_Create somewhat weird operation? (Wrong size window.)

5 posts in this topic

Hi all,

I'm writing a small script that identifies a certain area on my screen. For testing purposes, I've copied a window creating script from the web which works great, and is pretty simple. It simply draws a window over the area I've identified.

I use this line to create the window I'm talking about.

$hWnd = GUICreate("box", $diffX, $diffY,$negX,$y)

However, the box is always "taller" than I expected, even though diffY is calculated correctly. I suspect that when the window is created the "height" parameter doesn't take into account the menu bar. Is that correct? Anyone know the exact height in pixels of the menu bar in XP? (Sure sure I'll go google it.)

Share this post


Link to post
Share on other sites



By default a window is created with the "Client Area" of the dimensions mentioned.

So Windows will have the default borders and title bar "around" this area, according to the Theme chosen in Windows.

For this you need a GUI Control Style of 128 (Hex 80)

It will not allow you to create a window with all possibilities of normal application windows, but will do the trick.

$hWnd = GUICreate("box", $diffX, $diffY, $negX, $y, 0x00080080)

Share this post


Link to post
Share on other sites

By default a window is created with the "Client Area" of the dimensions mentioned.

So Windows will have the default borders and title bar "around" this area, according to the Theme chosen in Windows.

For this you need a GUI Control Style of 128 (Hex 80)

It will not allow you to create a window with all possibilities of normal application windows, but will do the trick.

$hWnd = GUICreate("box", $diffX, $diffY, $negX, $y, 0x00080080)

 

This is exactly what I ended up doing, but since it's only for debugging, I didn't look into it any further. 

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  
Followers 0