Qwerty212 Posted September 14, 2010 Share Posted September 14, 2010 Hello from a non english autoit learner.I'm trying to make a gui with a webcam using some of the examples that there are on the forum, but there's no way to make the size of this gui as big as the avaible area of the desktop without overlaping the toolbar (please, see image attached:)I know that depending on the computer that the program will run everyone will have a different toolbar size, so I'don't know how to manage to know how many pixels I've to take from the @Desktopheight to tell it later to the webcam.Can you please help me on that?Thanks in advance Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 14, 2010 Moderators Share Posted September 14, 2010 adolfito121, Take a look at this topic where I show how to get the size of the taskbar - it should help you work out the screen size you need. 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 Link to comment Share on other sites More sharing options...
Qwerty212 Posted September 15, 2010 Author Share Posted September 15, 2010 (edited) That's it! Now if I run your code like that: If $aTaskBar_Pos[1] > 0 Then ; Taskbar at BOTTOM If $aTaskBar_Pos[1] > @DesktopHeight - $aTaskBar_Pos[3] Then Return "Bottom Hidden" Else Return $aTaskBar_Pos[3] EndIf In the bottom of scite I've get a "66" (and If I change my taskbar to a normal size then I get a 34, so I guess that 66 are the pixel that taskbar sizes...) ... but how can I pass this 66 to another part of the gui?? (something like: $gui4 = GUICreate("", @DesktopWidth, @DesktopHeight - $aTaskBar_Pos, 0, 0) stills giving me a fullscreen gui Edited September 15, 2010 by adolfito121 Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 15, 2010 Moderators Share Posted September 15, 2010 adolfito121,The function returns an array - the clues are the $a... prefix and the fact that you need to use the element address format $aTaskBar_Pos[3] when you return a value. So try using: $gui4 = GUICreate("", @DesktopWidth, @DesktopHeight - $aTaskBar_Pos[3], 0, 0)If you are not sure about using arrays, could I recommend the Wiki Arrays tutorial? 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 Link to comment Share on other sites More sharing options...
Qwerty212 Posted September 15, 2010 Author Share Posted September 15, 2010 If you are not sure about using arrays, could I recommend the Wiki Arrays tutorial? M23Definitely this wiki is for me. Thank yoy very much again Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted September 15, 2010 Moderators Share Posted September 15, 2010 adolfito121, Glad I could help. 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 Link to comment Share on other sites More sharing options...
Bowmore Posted September 15, 2010 Share Posted September 15, 2010 (edited) Here is a little script with 3 functions to demonstrate how to get information about the working area of the desktop. That is the area of the desktop not covered by the taskbar or any docked windows. It will give the correct result no matter which edge of the screen the taskbar is docked. expandcollapse popup#Include <WinAPI.au3> Local $Rect[4] $Rect = _GetworkingAreaRect() MsgBox(0,"Desktop Working Area", "Width = " & _GetworkingAreaWidth() & @CRLF & "Height = " & _GetworkingAreaHeight() & @CRLF & "TopLeft = " & $Rect[0] & "," & $Rect[1] & @CRLF & "BottomRight = " & $Rect[2] & "," & $Rect[3] ) Func _GetworkingAreaWidth() Local $aRect[4] Local $iWidth = 0 $aRect = _GetworkingAreaRect() If Not @error Then $iWidth = $aRect[2] - $aRect[0] Return $iWidth Else Return SetError(1,0,0) EndIf EndFunc Func _GetworkingAreaHeight() Local $aRect[4] Local $iWidth = 0 $aRect = _GetworkingAreaRect() If Not @error Then $iWidth = $aRect[3] - $aRect[1] Return $iWidth Else Return SetError(1,0,0) EndIf EndFunc Func _GetworkingAreaRect() Local $aRect[4] Const $SPI_GETWORKAREA = 0x0030 Local $rect = DllStructCreate("int;int;int;int") Local $iResult = 0 $iResult = _WinAPI_SystemParametersInfo($SPI_GETWORKAREA, 0 , DllStructGetPtr($rect)) If $iResult Then $aRect[0] = DllStructGetData($rect,1) $aRect[1] = DllStructGetData($rect,2) $aRect[2] = DllStructGetData($rect,3) $aRect[3] = DllStructGetData($rect,4) Return $aRect Else Return SetError(1,0,0) EndIf EndFunc Edited September 15, 2010 by Bowmore RAMzor 1 "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the universe trying to build bigger and better idiots. So far, the universe is winning."- Rick Cook 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