ValeryVal Posted August 18, 2011 Posted August 18, 2011 There is script: expandcollapse popup#include <GuiConstants.au3> #include <WindowsConstants.au3> #include <EditConstants.au3> ; Gui variables Global $hWndValid, $hWndInValid Global $WinW = 500, $WinH = 400 Global $Title = "Test of GUICreate" ; Create GUI window $hWndValid = GUICreate($Title, $WinW, $WinH, 0, 0, $WS_OVERLAPPEDWINDOW) ;get GUI sizes $Pos = WinGetPos($Title, "") $Label0 = GuiCtrlCreateLabel(" Gui was created by GuiCreate:", 80, 20, $WinW - 80, 20) $Label1 = GuiCtrlCreateLabel(" $WinW = " & $WinW & " $WinH = " & $WinH, 80, 50, $WinW - 80, 20) $Label2 = GuiCtrlCreateLabel(" However it returns by WinGetPos", 80, 80, $WinW - 80, 20) $Label3 = GuiCtrlCreateLabel(" $Pos[2] = " & $Pos[2] & " $Pos[3] = " & $Pos[3], 80, 110, $WinW - 80, 20) ;resize GUI WinMove ($Title, "", 0, 0, $WinW, $WinH) ;get GUI sizes once more $Pos = WinGetPos($Title, "") $Label0 = GuiCtrlCreateLabel(" Now Gui was resized by WinMove:", 80, 150, $WinW - 80, 20) $Label1 = GuiCtrlCreateLabel(" $WinW = " & $WinW & " $WinH = " & $WinH, 80, 180, $WinW - 80, 20) $Label2 = GuiCtrlCreateLabel(" and it returns by WinGetPos", 80, 210, $WinW - 80, 20) $Label3 = GuiCtrlCreateLabel(" $Pos[2] = " & $Pos[2] & " $Pos[3] = " & $Pos[3], 80, 240, $WinW - 80, 20) GUISetState() GUISetState() While 1 $Msg = GUIGetMsg(1) Switch $Msg[0] Case $GUI_EVENT_CLOSE Exit Case else EndSwitch WEnd The size of GUI moved is different than after GuiCreate. Why? This is GUI shot. The point of world view
Moderators Melba23 Posted August 18, 2011 Moderators Posted August 18, 2011 ValeryVal,GUICreate sets the size of the client area of the GUI - the useful area less the borders and title bar. The Win* functions affect the whole GUI not just the client area. Here is your script slightly modified to explain what is happening - look in the SciTE console for the data: expandcollapse popup#include <GuiConstants.au3> #include <WindowsConstants.au3> ; Gui variables Global $hWndValid, $hWndInValid Global $WinW = 500, $WinH = 400 Global $Title = "Test of GUICreate" ; Create GUI window $hWndValid = GUICreate($Title, $WinW, $WinH) ;get GUI sizes $Pos = WinGetPos($Title, "") $Client = WinGetClientSize($Title, "") ConsoleWrite("Gui was created by GuiCreate:" & @CRLF & _ "$WinW = " & $WinW & " $WinH = " & $WinH & @CRLF & _ "However it returns by WinGetPos:" & @CRLF & _ "$Pos[2] = " & $Pos[2] & " $Pos[3] = " & $Pos[3] & @CRLF & _ "But the client size is still:" & @CRLF & _ "$Client[1] = " & $Client[0] & " $Client[1] = " & $Client[1] & @CRLF & @CRLF) ;resize GUI WinMove($Title, "", 0, 0, $WinW, $WinH) ;get GUI sizes once more $Pos = WinGetPos($Title, "") $Client = WinGetClientSize($Title, "") ConsoleWrite("Now Gui was resized by WinMove:" & @CRLF & _ "$WinW = " & $WinW & " $WinH = " & $WinH & @CRLF & _ "And it returns by WinGetPos:" & @CRLF & _ "$Pos[2] = " & $Pos[2] & " $Pos[3] = " & $Pos[3] & @CRLF & _ "But the client size is now only:" & @CRLF & _ "$Client[1] = " & $Client[0] & " $Client[1] = " & $Client[1] & @CRLF & @CRLF) GUISetState() While 1 $Msg = GUIGetMsg(1) Switch $Msg[0] Case $GUI_EVENT_CLOSE Exit Case Else EndSwitch WEndAll clear? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area
ValeryVal Posted August 19, 2011 Author Posted August 19, 2011 All clear? Yes. It's clear. It's dark with AutoIt Help having the following (GuiCreate description): width [optional] The width of the window. height [optional] The height of the window. Thank you for respond The point of world view
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