corrado33 Posted January 16, 2015 Posted January 16, 2015 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.)
AZJIO Posted January 16, 2015 Posted January 16, 2015 I used it in the ">My_Notepad" $hMenuFile = _GUICtrlMenu_GetMenu($hGui) $aRect = _GUICtrlMenu_GetMenuBarInfo($hGui, 0, 1) $iHeightMenu = $aRect[3] - $aRect[1] My other projects or all
Solution DutchCoder Posted January 16, 2015 Solution Posted January 16, 2015 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)
corrado33 Posted January 16, 2015 Author Posted January 16, 2015 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.
AZJIO Posted January 17, 2015 Posted January 17, 2015 Try a function >_GetChildCoor to calculate the size of the child window. _WinAPI_GetSystemMetrics(4) - Title bar size My other projects or all
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now