water Posted September 3, 2008 Share Posted September 3, 2008 The following GUI should have a size of 327x94 pixel but AutoIt Window Info shows it as 333x119. Is there a grid that Windows (XP SP2 in my case) adjusts GUIs to? #Region ### START Koda GUI section ### Form= $Form1 = GUICreate("Form1", 327, 94, 193, 125) $Input1 = GUICtrlCreateInput("", 176, 24, 121, 21) $Button1 = GUICtrlCreateButton("Button1", 64, 24, 75, 25, 0) $Button2 = GUICtrlCreateButton("Button2", 80, 136, 75, 25, 0) $Button3 = GUICtrlCreateButton("Button3", 200, 136, 75, 25, 0) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### Thanks in advance Thomas My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
Polyphem Posted September 3, 2008 Share Posted September 3, 2008 No magic there... 327, 94 is the inner size of the gui... 333x119 the outer size... This post will be edited again by Polyphem: Tomorrow, 11:55 AM Link to comment Share on other sites More sharing options...
water Posted September 3, 2008 Author Share Posted September 3, 2008 (edited) Hi Polyphem, thanks for your fast reply! Is there a topic/URL you could recommend to start reading on how this type of size calculation is done by Windows? The bottom part of another GUI gets "out of alignment" when maximized (see attachement). Thanks Edited September 3, 2008 by water My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
AdmiralAlkex Posted September 3, 2008 Share Posted September 3, 2008 There is no calculation done by Windows, the parameters you set in GuiCreate() is the client area, not the window area. That thing that gets "out of alignment", is it perhaps a List or ListView? Try adding the style $LBS_NOINTEGRALHEIGHT to force it to be exactly the size specified. (normally List and Listview adapt their height to "fully" show items) .Some of my scripts: ShiftER, Codec-Control, Resolution switcher for HTC ShiftSome of my UDFs: SDL UDF, SetDefaultDllDirectories, Converting GDI+ Bitmap/Image to SDL Surface Link to comment Share on other sites More sharing options...
martin Posted September 3, 2008 Share Posted September 3, 2008 (edited) If you wanted to create a window the size w x h then you could do this $w = 600 $h = 400 $titleht = DllCall("user32.dll",'int',"GetSystemMetrics",'int',4);$SM_CYCAPTION) $framewid = DllCall("user32.dll",'int',"GetSystemMetrics",'int',7);$SM_CYFIXEDFRAME) GUICreate("ex",$w - 2 *$framewid[0] ,$h - 2*$framewid[0] - $titleht[0]) GUISetState() $ws = wingetpos("ex") ConsoleWrite($ws[2] & ', ' & $ws[3] & @CRLF) Edited September 3, 2008 by martin Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script. Link to comment Share on other sites More sharing options...
water Posted September 7, 2008 Author Share Posted September 7, 2008 Hi AdmiralAlkex, you're right - its a List. After adding $LBS_NOINTEGRALHEIGHT everything works fine. Thanks a lot Thomas My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
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